Agma Animation Macro

Press a single key to animate your cell.

// ==UserScript==
// @name         Agma Animation Macro
// @namespace    agma-animation-macro
// @version      2.0.1
// @description  Press a single key to animate your cell.
// @author       Nuke
// @license      MIT
// @match        *://agma.io/*
// @grant        none
// ==/UserScript==

var ur=Object.create;var ue=Object.defineProperty;var cr=Object.getOwnPropertyDescriptor;var lr=Object.getOwnPropertyNames;var fr=Object.getPrototypeOf,dr=Object.prototype.hasOwnProperty;var tt=t=>ue(t,"__esModule",{value:!0});var m=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rt=(t,e)=>{for(var r in e)ue(t,r,{get:e[r],enumerable:!0})},it=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of lr(e))!dr.call(t,n)&&(r||n!=="default")&&ue(t,n,{get:()=>e[n],enumerable:!(i=cr(e,n))||i.enumerable});return t},T=(t,e)=>it(tt(ue(t!=null?ur(fr(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),hr=(t=>(e,r)=>t&&t.get(e)||(r=it(tt({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var ce=b(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.ChatContext=G.createChatContext=void 0;function mr(t){return new nt(t)}G.createChatContext=mr;var nt=function(){function t(e){this._chatElement=document.querySelector(e)}return t.prototype.value=function(e){if(typeof e=="undefined")return this._chatElement.value;this._chatElement.value=e},t.prototype.clear=function(){this.value("")},t.prototype.focus=function(){this._chatElement.focus()},t}();G.ChatContext=nt});var st=b(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.DEFAULT_COMMAND=K.DEFAULT_OPTIONS=void 0;K.DEFAULT_OPTIONS={prefix:"/"};K.DEFAULT_COMMAND={clearChat:!0}});var ot=b(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.debug=P.error=P.warn=P.log=void 0;function _r(t){console.log("[io-scripts (LOG)]: ".concat(t))}P.log=_r;function pr(t){console.warn("[io-scripts (WARN)]: ".concat(t))}P.warn=pr;function br(t){console.error("[io-scripts (ERROR)]: ".concat(t))}P.error=br;function yr(t){console.log("[io-scripts (DEBUG)]: ".concat(t))}P.debug=yr});var at=b((ci,Sr)=>{Sr.exports={name:"io-scripts",private:!1,version:"2.3.14",description:"io-scripts is an easy-to-use library to create scripts for any kind of .io game.",bin:"./dist/src/bin/io-scripts.js",main:"dist/src/index.js",types:"dist/src/index.d.ts",scripts:{build:"rm -rf ./dist && tsc"},author:"CodingWithNuke",license:"MIT",keywords:["io-scripts",".io","scripts","userscripts","userscript","agar.io","agma.io"],dependencies:{commander:"^8.3.0",esbuild:"^0.14.8",fs:"^0.0.1-security",kolorist:"^1.5.1",path:"^0.12.7","prepend-file":"^2.0.0"},devDependencies:{"@types/node":"^16.11.10",typescript:"^4.5.2"}}});var Re=b(p=>{"use strict";var B=p&&p.__assign||function(){return B=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},B.apply(this,arguments)},Cr=p&&p.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),gr=p&&p.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Or=p&&p.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Cr(e,t,r);return gr(e,t),e},vr=p&&p.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function f(_){try{c(i.next(_))}catch(C){o(C)}}function h(_){try{c(i.throw(_))}catch(C){o(C)}}function c(_){_.done?s(_.value):n(_.value).then(f,h)}c((i=i.apply(t,e||[])).next())})},Er=p&&p.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(c){return function(_){return h([c,_])}}function h(c){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(_){c=[6,_],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},te=p&&p.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(f){o={error:f}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},le=p&&p.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(p,"__esModule",{value:!0});p.Script=p.createScript=void 0;var Mr=ce(),ut=st(),F=Or(ot()),wr=at();function Ar(t){return new ct(t)}p.createScript=Ar;var ct=function(){function t(e){this._initialized=!1,this._commands=new Map,this._plugins=new Set,this._ioScriptsVersion=wr.version,this.options=B(B({},ut.DEFAULT_OPTIONS),e),this._init(),this.options.exposeToWindowObject&&(window.$script?F.error('Unable to expose script to "window.$script". "window.$script" is already in use by another script.'):window.$script=this)}return t.prototype.command=function(e,r){if(r){var i=this._commands.get(e)||le([],te(this._commands.values()),!1).find(function(o){var f;return(f=o.aliases)===null||f===void 0?void 0:f.includes(e)});if(i){this.options.silent||F.warn('Command with name or alias "'.concat(e,'" has already been registered.'));return}var n=r.aliases&&Array.isArray(r.aliases)&&le([],te(this._commands.values()),!1).find(function(o){var f;return o.aliases&&Array.isArray(o.aliases)&&!!((f=o.aliases)===null||f===void 0?void 0:f.filter(function(h){var c;return(c=r.aliases)===null||c===void 0?void 0:c.indexOf(h)}))});if(n){this.options.silent||F.warn('Command with name "'.concat(e,'" has a duplicate alias conflict with another command.'));return}return this._commands.set(e,B(B(B({},ut.DEFAULT_COMMAND),r),{name:e})),this}var s=this._commands.get(e)||le([],te(this._commands.values()),!1).find(function(o){return o.aliases&&typeof o.aliases=="string"?o.aliases===e:Array.isArray(o.aliases)&&o.aliases.includes(e)});if(s)return s;if(!this.options.silent){F.warn('Command "'.concat(e,'" not found.'));return}},t.prototype.use=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return this._plugins.has(e)?!this.options.silent&&F.warn("Plugin has already been applied."):e&&typeof e=="function"?(this._plugins.add(e),e.apply(void 0,le([this],te(r),!1))):this.options.silent||F.error("A plugin must be a function."),this},t.prototype._init=function(){var e=this;if(!this._initialized){var r=this.options,i=r.chatElementSelector,n=r.prefix;if(!(!i||!n)){var s=document.querySelector(i);if(!s){F.error('Given chatElementSelector "'.concat(i,'" not found as an element.'));return}s.addEventListener("keydown",function(o){return vr(e,void 0,void 0,function(){var f,h,c,_,C,H;return Er(this,function(V){switch(V.label){case 0:return o.code!=="Enter"?[3,2]:(f=s.value,f.startsWith(n)?(h=te(f.trim().slice(n.length).split(/ +/g)),c=h[0],_=h.slice(1),C=this.command(c.toLowerCase()),C?C.disabled?[2]:(H=(0,Mr.createChatContext)(i),C.clearChat&&H.clear(),[4,C.run(this,H,_)]):[3,2]):[2]);case 1:V.sent(),C.focusChatAfterRun&&H.focus(),V.label=2;case 2:return[2]}})})}),this._initialized=!0}}},t}();p.Script=ct});var lt=b(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.defineCommand=void 0;function xr(t){return t}fe.defineCommand=xr});var ft=b(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.definePlugin=void 0;function Tr(t){return t}de.definePlugin=Tr});var dt=b(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.Script=void 0;var Pr=Re();Object.defineProperty(he,"Script",{enumerable:!0,get:function(){return Pr.Script}})});var mt=b(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0})});var pt=b(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0})});var bt=b(M=>{"use strict";var Dr=M&&M.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),He=M&&M.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dr(e,t,r)};Object.defineProperty(M,"__esModule",{value:!0});M.ChatContext=void 0;var jr=ce();Object.defineProperty(M,"ChatContext",{enumerable:!0,get:function(){return jr.ChatContext}});He(dt(),M);He(mt(),M);He(pt(),M)});var $=b(O=>{"use strict";var Rr=O&&O.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),Hr=O&&O.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rr(e,t,r)};Object.defineProperty(O,"__esModule",{value:!0});O.definePlugin=O.defineCommand=O.createScript=O.createChatContext=void 0;var Ir=ce();Object.defineProperty(O,"createChatContext",{enumerable:!0,get:function(){return Ir.createChatContext}});var Lr=Re();Object.defineProperty(O,"createScript",{enumerable:!0,get:function(){return Lr.createScript}});var Ur=lt();Object.defineProperty(O,"defineCommand",{enumerable:!0,get:function(){return Ur.defineCommand}});var Nr=ft();Object.defineProperty(O,"definePlugin",{enumerable:!0,get:function(){return Nr.definePlugin}});Hr(bt(),O)});var St=b(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0})});var Ct=b(k=>{"use strict";var Br=k&&k.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),Fr=k&&k.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Br(e,t,r)};Object.defineProperty(k,"__esModule",{value:!0});Fr(St(),k)});var Ie=b(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.Colors=q.DEFAULT_OPTIONS=void 0;q.DEFAULT_OPTIONS={textColor:"#ffffff",visibilityTime:5e3};var kr;(function(t){t.WHITE="#FFFFFF",t.SILVER="#C0C0C0",t.GRAY="#808080",t.GREY="#808080",t.BLACK="#000000",t.RED="#FF0000",t.MAROON="#800000",t.YELLOW="#FFF000",t.OLIVE="#808000",t.LIME="#00FF00",t.GREEN="#008000",t.AQUA="#00FFFF",t.TEAL="#008080",t.BLUE="#0000FF",t.NAVY="#000080",t.FUCHSIA="#FF00FF",t.PURPLE="#800080"})(kr=q.Colors||(q.Colors={}))});var gt=b(Y=>{"use strict";var me=Y&&Y.__assign||function(){return me=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},me.apply(this,arguments)};Object.defineProperty(Y,"__esModule",{value:!0});Y.useAlert=void 0;var qr=Ie();function Wr(t,e){e=me(me({},qr.DEFAULT_OPTIONS),e);var r=document.querySelector(e.alertElementSelector),i=e.textColor,n=e.visibilityTime;i&&(r.style.color=i),r.style.fontSize="24px",r.textContent=t,r.style.display="block",setTimeout(function(){r.style.display="none"},n)}Y.useAlert=Wr});var _e=b(w=>{"use strict";var Vr=w&&w.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),Gr=w&&w.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vr(e,t,r)};Object.defineProperty(w,"__esModule",{value:!0});w.Colors=w.useAlert=void 0;Gr(Ct(),w);var Kr=gt();Object.defineProperty(w,"useAlert",{enumerable:!0,get:function(){return Kr.useAlert}});var $r=Ie();Object.defineProperty(w,"Colors",{enumerable:!0,get:function(){return $r.Colors}})});var z,re,Le,pe=m(()=>{z=".",re=Symbol("target"),Le=Symbol("unsubscribe")});function ie(t){return t instanceof Date||t instanceof Set||t instanceof Map||t instanceof WeakSet||t instanceof WeakMap||ArrayBuffer.isView(t)}function Ot(t){return(typeof t=="object"?t===null:typeof t!="function")||t instanceof RegExp}var Ue=m(()=>{});var E,be=m(()=>{E=Array.isArray});function W(t){return typeof t=="symbol"}var ye=m(()=>{});var Yr,v,Se=m(()=>{pe();be();ye();Yr={after:(t,e)=>E(t)?t.slice(e.length):e===""?t:t.slice(e.length+1),concat:(t,e)=>E(t)?(t=[...t],e&&t.push(e),t):e&&e.toString!==void 0?(t!==""&&(t+=z),W(e)?t+e.toString():t+e):t,initial:t=>{if(E(t))return t.slice(0,-1);if(t==="")return t;let e=t.lastIndexOf(z);return e===-1?"":t.slice(0,e)},last:t=>{if(E(t))return t[t.length-1]||"";if(t==="")return t;let e=t.lastIndexOf(z);return e===-1?t:t.slice(e+1)},walk:(t,e)=>{if(E(t))for(let r of t)e(r);else if(t!==""){let r=0,i=t.indexOf(z);if(i===-1)e(t);else for(;r<t.length;)i===-1&&(i=t.length),e(t.slice(r,i)),r=i+1,i=t.indexOf(z,r)}},get(t,e){return this.walk(e,r=>{t&&(t=t[r])}),t}},v=Yr});function Ne(t){return typeof t=="object"&&typeof t.next=="function"}var vt=m(()=>{});function Be(t,e,r,i,n){let s=t.next;if(e.name==="entries")t.next=function(){let o=s.call(this);return o.done===!1&&(o.value[0]=n(o.value[0],e,o.value[0],i),o.value[1]=n(o.value[1],e,o.value[0],i)),o};else if(e.name==="values"){let o=r[re].keys();t.next=function(){let f=s.call(this);return f.done===!1&&(f.value=n(f.value,e,o.next().value,i)),f}}else t.next=function(){let o=s.call(this);return o.done===!1&&(o.value=n(o.value,e,o.value,i)),o};return t}var Et=m(()=>{pe()});function Ce(t,e,r){return t.isUnsubscribed||e.ignoreSymbols&&W(r)||e.ignoreUnderscores&&r.charAt(0)==="_"||"ignoreKeys"in e&&e.ignoreKeys.includes(r)}var Mt=m(()=>{ye()});var ge,wt=m(()=>{Se();ge=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let r=this._getDescriptorCache(),i=r.get(e);return i===void 0&&(i={},r.set(e,i)),i}_getOwnPropertyDescriptor(e,r){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,r);let i=this._getProperties(e),n=i[r];return n===void 0&&(n=Reflect.getOwnPropertyDescriptor(e,r),i[r]=n),n}getProxy(e,r,i,n){if(this.isUnsubscribed)return e;let s=e[n],o=s||e;this._pathCache.set(o,r);let f=this._proxyCache.get(o);return f===void 0&&(f=s===void 0?new Proxy(e,i):e,this._proxyCache.set(o,f)),f}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,r){return!Object.is(e,v.get(r,this.getPath(e)))}defineProperty(e,r,i){return Reflect.defineProperty(e,r,i)?(this.isUnsubscribed||(this._getProperties(e)[r]=i),!0):!1}setProperty(e,r,i,n,s){if(!this._equals(s,i)||!(r in e)){let o=this._getOwnPropertyDescriptor(e,r);return o!==void 0&&"set"in o?Reflect.set(e,r,i,n):Reflect.set(e,r,i)}return!0}deleteProperty(e,r,i){if(Reflect.deleteProperty(e,r)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(e);n&&(delete n[r],this._pathCache.delete(i))}return!0}return!1}isSameDescriptor(e,r,i){let n=this._getOwnPropertyDescriptor(r,i);return e!==void 0&&n!==void 0&&Object.is(e.value,n.value)&&(e.writable||!1)===(n.writable||!1)&&(e.enumerable||!1)===(n.enumerable||!1)&&(e.configurable||!1)===(n.configurable||!1)&&e.get===n.get&&e.set===n.set}isGetInvariant(e,r){let i=this._getOwnPropertyDescriptor(e,r);return i!==void 0&&i.configurable!==!0&&i.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}}});function J(t){return toString.call(t)==="[object Object]"}var Fe=m(()=>{});function Q(){return!0}var At=m(()=>{});function I(t,e){return t.length!==e.length||t.some((r,i)=>e[i]!==r)}var xt=m(()=>{});var Oe,ke=m(()=>{Oe=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])});var zr,qe,Tt,We=m(()=>{At();xt();ke();zr=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),qe={push:Q,pop:Q,shift:Q,unshift:Q,copyWithin:I,reverse:I,sort:I,splice:I,flat:I,fill:I},Tt=new Set([...Oe,...zr,...Object.keys(qe)])});function X(t,e){if(t.size!==e.size)return!0;for(let r of t)if(!e.has(r))return!0;return!1}var Pt=m(()=>{});var Ve,Ge,Ke,Dt,ve=m(()=>{Pt();Ve=["keys","values","entries"],Ge=new Set(["has","toString"]),Ke={add:X,clear:X,delete:X,forEach:X},Dt=new Set([...Ge,...Object.keys(Ke),...Ve])});function Z(t,e){if(t.size!==e.size)return!0;let r;for(let[i,n]of t)if(r=e.get(i),r!==n||r===void 0&&!e.has(i))return!0;return!1}var jt=m(()=>{});var Jr,$e,Rt,Ye=m(()=>{jt();ve();Jr=new Set([...Ge,"get"]),$e={set:Z,clear:Z,delete:Z,forEach:Z},Rt=new Set([...Jr,...Object.keys($e),...Ve])});var y,L=m(()=>{Se();be();Fe();We();ve();Ye();ke();y=class{constructor(e,r,i,n){this._path=r,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=r===void 0?e:this._shallowClone(e)}static isHandledMethod(e){return Oe.has(e)}_shallowClone(e){let r=e;if(J(e))r={...e};else if(E(e))r=[...e];else if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set([...e].map(i=>this._shallowClone(i)));else if(e instanceof Map){r=new Map;for(let[i,n]of e.entries())r.set(i,this._shallowClone(n))}return this._clonedCache.add(r),r}preferredThisArg(e,r,i,n){return e?(E(n)?this._onIsChanged=qe[r]:n instanceof Set?this._onIsChanged=Ke[r]:n instanceof Map&&(this._onIsChanged=$e[r]),n):i}update(e,r,i){let n=v.after(e,this._path);if(r!=="length"){let s=this.clone;v.walk(n,o=>{s&&s[o]&&(this._clonedCache.has(s[o])||(s[o]=this._shallowClone(s[o])),s=s[o])}),this._hasOnValidate&&this._changes.push({path:n,property:r,previous:i}),s&&s[r]&&(s[r]=i)}this._isChanged=!0}undo(e){let r;for(let i=this._changes.length-1;i!==-1;i--)r=this._changes[i],v.get(e,r.path)[r.property]=r.previous}isChanged(e){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,e)}}});var ne,Ht=m(()=>{We();L();ne=class extends y{static isHandledMethod(e){return Tt.has(e)}}});var Ee,It=m(()=>{L();Ee=class extends y{undo(e){e.setTime(this.clone.getTime())}isChanged(e,r){return!r(this.clone.valueOf(),e.valueOf())}}});var se,Lt=m(()=>{ve();L();se=class extends y{static isHandledMethod(e){return Dt.has(e)}undo(e){for(let r of this.clone)e.add(r);for(let r of e)this.clone.has(r)||e.delete(r)}}});var oe,Ut=m(()=>{Ye();L();oe=class extends y{static isHandledMethod(e){return Rt.has(e)}undo(e){for(let[r,i]of this.clone.entries())e.set(r,i);for(let r of e.keys())this.clone.has(r)||e.delete(r)}}});var Me,Nt=m(()=>{L();Me=class extends y{constructor(e,r,i,n){super(void 0,r,i,n);this._arg1=i[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}}});var we,Bt=m(()=>{L();we=class extends y{constructor(e,r,i,n){super(void 0,r,i,n);this._weakKey=i[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let r=e.has(this._weakKey);this._weakHas&&!r?e.set(this._weakKey,this._weakValue):!this._weakHas&&r?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}}});var D,Ft=m(()=>{be();Ue();Fe();L();Ht();It();Lt();Ut();Nt();Bt();D=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return J(e)||E(e)||ie(e)}static isHandledMethod(e,r){return J(e)?y.isHandledMethod(r):E(e)?ne.isHandledMethod(r):e instanceof Set?se.isHandledMethod(r):e instanceof Map?oe.isHandledMethod(r):ie(e)}get isCloning(){return this._stack.length>0}start(e,r,i){let n=y;E(e)?n=ne:e instanceof Date?n=Ee:e instanceof Set?n=se:e instanceof Map?n=oe:e instanceof WeakSet?n=Me:e instanceof WeakMap&&(n=we),this._stack.push(new n(e,r,i,this._hasOnValidate))}update(e,r,i){this._stack[this._stack.length-1].update(e,r,i)}preferredThisArg(e,r,i){let{name:n}=e,s=D.isHandledMethod(i,n);return this._stack[this._stack.length-1].preferredThisArg(s,n,r,i)}isChanged(e,r,i){return this._stack[this._stack.length-1].isChanged(e,r,i)}undo(e){this._previousClone!==void 0&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}}});var kt={};rt(kt,{default:()=>Xr});var Qr,ze,Xr,qt=m(()=>{pe();Ue();Se();ye();vt();Et();Mt();wt();Ft();Qr={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},ze=(t,e,r={})=>{r={...Qr,...r};let i=Symbol("ProxyTarget"),{equals:n,isShallow:s,ignoreDetached:o,details:f}=r,h=new ge(n),c=typeof r.onValidate=="function",_=new D(c),C=(a,u,l,d,g)=>!c||_.isCloning||r.onValidate(v.concat(h.getPath(a),u),l,d,g)===!0,H=(a,u,l,d)=>{!Ce(h,r,u)&&!(o&&h.isDetached(a,t))&&V(h.getPath(a),u,l,d)},V=(a,u,l,d,g)=>{_.isCloning?_.update(a,u,d):e(v.concat(a,u),l,d,g)},Je=a=>a&&(a[i]||a),Qe=(a,u,l,d)=>Ot(a)||l==="constructor"||s&&!D.isHandledMethod(u,l)||Ce(h,r,l)||h.isGetInvariant(u,l)||o&&h.isDetached(u,t)?a:(d===void 0&&(d=h.getPath(u)),h.getProxy(a,v.concat(d,l),De,i)),De={get(a,u,l){if(W(u)){if(u===i||u===re)return a;if(u===Le&&!h.isUnsubscribed&&h.getPath(a).length===0)return h.unsubscribe(),a}let d=ie(a)?Reflect.get(a,u):Reflect.get(a,u,l);return Qe(d,a,u)},set(a,u,l,d){l=Je(l);let g=a[i]||a,N=g[u];if(n(N,l)&&u in a)return!0;let x=C(a,u,l,N);return x&&h.setProperty(g,u,l,d,N)?(H(a,u,a[u],N),!0):!x},defineProperty(a,u,l){if(!h.isSameDescriptor(l,a,u)){let d=a[u];C(a,u,l.value,d)&&h.defineProperty(a,u,l,d)&&H(a,u,l.value,d)}return!0},deleteProperty(a,u){if(!Reflect.has(a,u))return!0;let l=Reflect.get(a,u),d=C(a,u,void 0,l);return d&&h.deleteProperty(a,u,l)?(H(a,u,void 0,l),!0):!d},apply(a,u,l){let d=u[i]||u;if(h.isUnsubscribed)return Reflect.apply(a,d,l);if((f===!1||f!==!0&&!f.includes(a.name))&&D.isHandledType(d)){let g=v.initial(h.getPath(a)),N=D.isHandledMethod(d,a.name);_.start(d,g,l);let x=Reflect.apply(a,_.preferredThisArg(a,u,d),N?l.map(ae=>Je(ae)):l),ar=_.isChanged(d,n),Xe=_.stop();if(D.isHandledType(x)&&N&&(u instanceof Map&&a.name==="get"&&(g=v.concat(g,l[0])),x=h.getProxy(x,g,De)),ar){let ae={name:a.name,args:l,result:x},Ze=_.isCloning?v.initial(g):g,et=_.isCloning?v.last(g):"";C(v.get(t,Ze),et,d,Xe,ae)?V(Ze,et,d,Xe,ae):_.undo(d)}return(u instanceof Map||u instanceof Set)&&Ne(x)?Be(x,a,u,g,Qe):x}return Reflect.apply(a,u,l)}},je=h.getProxy(t,r.pathAsArray?[]:"",De);return e=e.bind(je),c&&(r.onValidate=r.onValidate.bind(je)),je};ze.target=t=>t&&t[re]||t;ze.unsubscribe=t=>t[Le]||t;Xr=ze});var Vt=b(U=>{"use strict";var Zr=U&&U.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(U,"__esModule",{value:!0});U.Store=U.createStore=void 0;var ei=Zr((qt(),hr(kt)));function ti(t,e){return new Wt(t,e)}U.createStore=ti;var Wt=function(){function t(e,r){this._name=e;var i=this,n=JSON.parse(localStorage.getItem(this._name));this.state=(0,ei.default)(n||r,function(){localStorage.setItem(i._name,JSON.stringify(this))})}return t}();U.Store=Wt});var Gt=b(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.createStore=void 0;var ri=Vt();Object.defineProperty(Ae,"createStore",{enumerable:!0,get:function(){return ri.createStore}})});var tr=b(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.isWriting=void 0;function ni(){var t,e;return((t=document.activeElement)===null||t===void 0?void 0:t.tagName.toLowerCase())==="input"||((e=document.activeElement)===null||e===void 0?void 0:e.tagName.toLowerCase())==="textarea"}Te.isWriting=ni});var sr=T($());var xe={};rt(xe,{reset:()=>Xt,set:()=>Jt,show:()=>er});var zt=T($()),S=T(_e());var $t=T(Gt());var Kt="agma-animation-macro";var A=(0,$t.createStore)(Kt,{slots:[null,null,null]});function ee(t){return!isNaN(typeof t=="string"?parseFloat(t):t)&&isFinite(typeof t=="string"?parseFloat(t):t)}var Yt=["spin","flip","shake","jump","wacky","hearts"];var Jt=(0,zt.defineCommand)({name:"set",run:(t,e,[r,i])=>{if(!r){(0,S.useAlert)("A slot number must be provided.",{alertElementSelector:"#curser",textColor:S.Colors.RED});return}if(!i){(0,S.useAlert)("A animation must be provided.",{alertElementSelector:"#curser",textColor:S.Colors.RED});return}if(!ee(r)&&r!=="*"&&r.toLowerCase()!=="all"){(0,S.useAlert)('Slot number must be a valid number, "*" or "all".',{alertElementSelector:"#curser",textColor:S.Colors.RED});return}if(!Yt.includes(i.toLocaleLowerCase())){(0,S.useAlert)(`"${i}" is not a valid animation name.`,{alertElementSelector:"#curser",textColor:S.Colors.RED});return}if(r==="*"||r.toLowerCase()==="all"){A.state.slots.forEach((n,s,o)=>{o[s]=i}),(0,S.useAlert)(`All slots have been set to "${i}"`,{alertElementSelector:"#curser",textColor:S.Colors.LIME});return}if(r<1||r>3){(0,S.useAlert)("Slot number must be between 1 and 3.",{alertElementSelector:"#curser",textColor:S.Colors.RED});return}A.state.slots[r-1]=i,(0,S.useAlert)(`Slot "#${r}" is set to "${i}".`,{alertElementSelector:"#curser",textColor:S.Colors.LIME})}});var Qt=T($()),j=T(_e());var Xt=(0,Qt.defineCommand)({name:"reset",run:(t,e,[r])=>{if(!r){A.state.slots=[null,null,null],(0,j.useAlert)("All slots have been reset.",{alertElementSelector:"#curser",textColor:j.Colors.LIME});return}if(!ee(r)){(0,j.useAlert)("Slot number must be a valid number.",{alertElementSelector:"#curser",textColor:j.Colors.RED});return}if(r<1||r>3){(0,j.useAlert)("Slot number must be between 1 and 3.",{alertElementSelector:"#curser",textColor:j.Colors.RED});return}A.state.slots[r-1]=null,(0,j.useAlert)(`Slot "#${r}" has been reset.`,{alertElementSelector:"#curser",textColor:j.Colors.LIME})}});var Zt=T($()),R=T(_e());var er=(0,Zt.defineCommand)({name:"show",run:(t,e,[r])=>{if(!r){(0,R.useAlert)(`Current slots are "${A.state.slots.map(i=>i||"unset").join(", ")}"`,{alertElementSelector:"#curser",textColor:R.Colors.WHITE});return}if(!ee(r)){(0,R.useAlert)("Slot number must be a valid number.",{alertElementSelector:"#curser",textColor:R.Colors.RED});return}if(r<1||r>3){(0,R.useAlert)("Slot number must be between 1 and 3.",{alertElementSelector:"#curser",textColor:R.Colors.RED});return}(0,R.useAlert)(`Slot "#${r}" is set to "${A.state.slots[r-1]}".`,{alertElementSelector:"#curser",textColor:R.Colors.WHITE})}});var Pe=T($()),rr=T(tr());var ir=(0,Pe.definePlugin)((t,e)=>{document.addEventListener("keydown",r=>{if(!(0,rr.isWriting)()&&r.keyCode===192){r.preventDefault();let i=(0,Pe.createChatContext)(t.options.chatElementSelector);i.value(A.state.slots.filter(n=>n).join(" ")),i._chatElement.focus()}})});var nr=[[ir,{}]];var or=(0,sr.createScript)({chatElementSelector:"#chtbox",silent:!0,prefix:"/aam "});for(let t in xe){let e=xe[t];or.command(e.name,e)}for(let[t,e]of nr)or.use(t,e);