reacthub-pixitweenjs 0.2.38 → 0.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.es.js +17144 -11584
  2. package/dist/index.umd.js +215 -218
  3. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -1,72 +1,97 @@
1
- (function(Ae,X){typeof exports=="object"&&typeof module<"u"?X(exports,require("react"),require("@pixi/react"),require("gsap"),require("pixi.js"),require("reacthub-react-bindings"),require("@pixi/sound")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","gsap","pixi.js","reacthub-react-bindings","@pixi/sound"],X):X((Ae=typeof globalThis<"u"?globalThis:Ae||self)["reacthub-pixitweenjs"]={},Ae.React,Ae.PIXIReact,Ae.gsap,Ae.PIXI,Ae.reacthubReactBindings,Ae.PIXI.sound)})(this,function(Ae,X,le,ct,ic,oc,sc){"use strict";function xs(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Q=xs(X),Qe=xs(ic);var Bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ac(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Es={exports:{}},pn={},lc=X,uc=Symbol.for("react.element"),cc=Symbol.for("react.fragment"),hc=Object.prototype.hasOwnProperty,fc=lc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dc={key:!0,ref:!0,__self:!0,__source:!0};function ws(t,e,r){var n,i={},o=null,s=null;for(n in r!==void 0&&(o=""+r),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref),e)hc.call(e,n)&&!dc.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:uc,type:t,key:o,ref:s,props:i,_owner:fc.current}}pn.Fragment=cc,pn.jsx=ws,pn.jsxs=ws,Es.exports=pn;var ie=Es.exports,Dt=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(Dt||{}),Ts=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(Ts||{}),Ni=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(Ni||{}),ee=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(ee||{}),Nt=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(Nt||{}),W=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(W||{}),ir=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(ir||{}),fe=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(fe||{}),ki=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(ki||{}),bt=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(bt||{}),Ur=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(Ur||{}),Ut=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(Ut||{}),kt=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(kt||{}),qt=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(qt||{}),Ci=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(Ci||{}),We=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(We||{}),Ce=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(Ce||{}),Ne=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(Ne||{}),ht=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(ht||{});const pc={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},ue={ADAPTER:pc,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Ri=/iPhone/i,As=/iPod/i,Os=/iPad/i,Ss=/\biOS-universal(?:.+)Mac\b/i,Ii=/\bAndroid(?:.+)Mobile\b/i,Ns=/Android/i,or=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,yn=/Silk/i,_t=/Windows Phone/i,ks=/\bWindows(?:.+)ARM\b/i,Cs=/BlackBerry/i,Rs=/BB10/i,Is=/Opera Mini/i,Ps=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ms=/Mobile(?:.+)Firefox\b/i,Ls=function(t){return t!==void 0&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function js(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||typeof navigator>"u"?typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,n=r.split("[FBAN");n[1]!==void 0&&(r=n[0]),(n=r.split("Twitter"))[1]!==void 0&&(r=n[0]);var i=function(s){return function(u){return u.test(s)}}(r),o={apple:{phone:i(Ri)&&!i(_t),ipod:i(As),tablet:!i(Ri)&&(i(Os)||Ls(e))&&!i(_t),universal:i(Ss),device:(i(Ri)||i(As)||i(Os)||i(Ss)||Ls(e))&&!i(_t)},amazon:{phone:i(or),tablet:!i(or)&&i(yn),device:i(or)||i(yn)},android:{phone:!i(_t)&&i(or)||!i(_t)&&i(Ii),tablet:!i(_t)&&!i(or)&&!i(Ii)&&(i(yn)||i(Ns)),device:!i(_t)&&(i(or)||i(yn)||i(Ii)||i(Ns))||i(/\bokhttp\b/i)},windows:{phone:i(_t),tablet:i(ks),device:i(_t)||i(ks)},other:{blackberry:i(Cs),blackberry10:i(Rs),opera:i(Is),firefox:i(Ms),chrome:i(Ps),device:i(Cs)||i(Rs)||i(Is)||i(Ms)||i(Ps)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}const sr=(js.default??js)(globalThis.navigator);ue.RETINA_PREFIX=/@([0-9\.]+)x/,ue.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Fs={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(p,d,y){this.fn=p,this.context=d,this.once=y||!1}function o(p,d,y,f,l){if(typeof y!="function")throw new TypeError("The listener must be a function");var c=new i(y,f||p,l),a=r?r+d:d;return p._events[a]?p._events[a].fn?p._events[a]=[p._events[a],c]:p._events[a].push(c):(p._events[a]=c,p._eventsCount++),p}function s(p,d){--p._eventsCount==0?p._events=new n:delete p._events[d]}function u(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),u.prototype.eventNames=function(){var p,d,y=[];if(this._eventsCount===0)return y;for(d in p=this._events)e.call(p,d)&&y.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(p)):y},u.prototype.listeners=function(p){var d=r?r+p:p,y=this._events[d];if(!y)return[];if(y.fn)return[y.fn];for(var f=0,l=y.length,c=new Array(l);f<l;f++)c[f]=y[f].fn;return c},u.prototype.listenerCount=function(p){var d=r?r+p:p,y=this._events[d];return y?y.fn?1:y.length:0},u.prototype.emit=function(p,d,y,f,l,c){var a=r?r+p:p;if(!this._events[a])return!1;var h,m,g=this._events[a],_=arguments.length;if(g.fn){switch(g.once&&this.removeListener(p,g.fn,void 0,!0),_){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,y),!0;case 4:return g.fn.call(g.context,d,y,f),!0;case 5:return g.fn.call(g.context,d,y,f,l),!0;case 6:return g.fn.call(g.context,d,y,f,l,c),!0}for(m=1,h=new Array(_-1);m<_;m++)h[m-1]=arguments[m];g.fn.apply(g.context,h)}else{var b,E=g.length;for(m=0;m<E;m++)switch(g[m].once&&this.removeListener(p,g[m].fn,void 0,!0),_){case 1:g[m].fn.call(g[m].context);break;case 2:g[m].fn.call(g[m].context,d);break;case 3:g[m].fn.call(g[m].context,d,y);break;case 4:g[m].fn.call(g[m].context,d,y,f);break;default:if(!h)for(b=1,h=new Array(_-1);b<_;b++)h[b-1]=arguments[b];g[m].fn.apply(g[m].context,h)}}return!0},u.prototype.on=function(p,d,y){return o(this,p,d,y,!1)},u.prototype.once=function(p,d,y){return o(this,p,d,y,!0)},u.prototype.removeListener=function(p,d,y,f){var l=r?r+p:p;if(!this._events[l])return this;if(!d)return s(this,l),this;var c=this._events[l];if(c.fn)c.fn!==d||f&&!c.once||y&&c.context!==y||s(this,l);else{for(var a=0,h=[],m=c.length;a<m;a++)(c[a].fn!==d||f&&!c[a].once||y&&c[a].context!==y)&&h.push(c[a]);h.length?this._events[l]=h.length===1?h[0]:h:s(this,l)}return this},u.prototype.removeAllListeners=function(p){var d;return p?(d=r?r+p:p,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,t.exports=u})(Fs);const mn=nr(Fs.exports);var Pi={exports:{}};function gn(t,e,r){r=r||2;var n,i,o,s,u,p,d,y=e&&e.length,f=y?e[0]*r:t.length,l=Bs(t,0,f,r,!0),c=[];if(!l||l.next===l.prev)return c;if(y&&(l=function(h,m,g,_){var b,E,x,v=[];for(b=0,E=m.length;b<E;b++)(x=Bs(h,m[b]*_,b<E-1?m[b+1]*_:h.length,_,!1))===x.next&&(x.steiner=!0),v.push(Ec(x));for(v.sort(bc),b=0;b<v.length;b++)g=_c(v[b],g);return g}(t,e,l,r)),t.length>80*r){n=o=t[0],i=s=t[1];for(var a=r;a<f;a+=r)(u=t[a])<n&&(n=u),(p=t[a+1])<i&&(i=p),u>o&&(o=u),p>s&&(s=p);d=(d=Math.max(o-n,s-i))!==0?32767/d:0}return qr(l,c,r,n,i,d,0),c}function Bs(t,e,r,n,i){var o,s;if(i===ji(t,e,r,n)>0)for(o=e;o<r;o+=n)s=qs(o,t[o],t[o+1],s);else for(o=r-n;o>=e;o-=n)s=qs(o,t[o],t[o+1],s);return s&&vn(s,s.next)&&(Hr(s),s=s.next),s}function Gt(t,e){if(!t)return t;e||(e=t);var r,n=t;do if(r=!1,n.steiner||!vn(n,n.next)&&Ee(n.prev,n,n.next)!==0)n=n.next;else{if(Hr(n),(n=e=n.prev)===n.next)break;r=!0}while(r||n!==e);return e}function qr(t,e,r,n,i,o,s){if(t){!s&&o&&function(y,f,l,c){var a=y;do a.z===0&&(a.z=Mi(a.x,a.y,f,l,c)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==y);a.prevZ.nextZ=null,a.prevZ=null,function(h){var m,g,_,b,E,x,v,T,O=1;do{for(g=h,h=null,E=null,x=0;g;){for(x++,_=g,v=0,m=0;m<O&&(v++,_=_.nextZ);m++);for(T=O;v>0||T>0&&_;)v!==0&&(T===0||!_||g.z<=_.z)?(b=g,g=g.nextZ,v--):(b=_,_=_.nextZ,T--),E?E.nextZ=b:h=b,b.prevZ=E,E=b;g=_}E.nextZ=null,O*=2}while(x>1)}(a)}(t,n,i,o);for(var u,p,d=t;t.prev!==t.next;)if(u=t.prev,p=t.next,o?mc(t,n,i,o):yc(t))e.push(u.i/r|0),e.push(t.i/r|0),e.push(p.i/r|0),Hr(t),t=p.next,d=p.next;else if((t=p)===d){s?s===1?qr(t=gc(Gt(t),e,r),e,r,n,i,o,2):s===2&&vc(t,e,r,n,i,o):qr(Gt(t),e,r,n,i,o,1);break}}}function yc(t){var e=t.prev,r=t,n=t.next;if(Ee(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,s=n.x,u=e.y,p=r.y,d=n.y,y=i<o?i<s?i:s:o<s?o:s,f=u<p?u<d?u:d:p<d?p:d,l=i>o?i>s?i:s:o>s?o:s,c=u>p?u>d?u:d:p>d?p:d,a=n.next;a!==e;){if(a.x>=y&&a.x<=l&&a.y>=f&&a.y<=c&&ar(i,u,o,p,s,d,a.x,a.y)&&Ee(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function mc(t,e,r,n){var i=t.prev,o=t,s=t.next;if(Ee(i,o,s)>=0)return!1;for(var u=i.x,p=o.x,d=s.x,y=i.y,f=o.y,l=s.y,c=u<p?u<d?u:d:p<d?p:d,a=y<f?y<l?y:l:f<l?f:l,h=u>p?u>d?u:d:p>d?p:d,m=y>f?y>l?y:l:f>l?f:l,g=Mi(c,a,e,r,n),_=Mi(h,m,e,r,n),b=t.prevZ,E=t.nextZ;b&&b.z>=g&&E&&E.z<=_;){if(b.x>=c&&b.x<=h&&b.y>=a&&b.y<=m&&b!==i&&b!==s&&ar(u,y,p,f,d,l,b.x,b.y)&&Ee(b.prev,b,b.next)>=0||(b=b.prevZ,E.x>=c&&E.x<=h&&E.y>=a&&E.y<=m&&E!==i&&E!==s&&ar(u,y,p,f,d,l,E.x,E.y)&&Ee(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;b&&b.z>=g;){if(b.x>=c&&b.x<=h&&b.y>=a&&b.y<=m&&b!==i&&b!==s&&ar(u,y,p,f,d,l,b.x,b.y)&&Ee(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=_;){if(E.x>=c&&E.x<=h&&E.y>=a&&E.y<=m&&E!==i&&E!==s&&ar(u,y,p,f,d,l,E.x,E.y)&&Ee(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function gc(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!vn(i,o)&&Ds(i,n,n.next,o)&&Gr(i,o)&&Gr(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),Hr(n),Hr(n.next),n=t=o),n=n.next}while(n!==t);return Gt(n)}function vc(t,e,r,n,i,o){var s=t;do{for(var u=s.next.next;u!==s.prev;){if(s.i!==u.i&&wc(s,u)){var p=Us(s,u);return s=Gt(s,s.next),p=Gt(p,p.next),qr(s,e,r,n,i,o,0),void qr(p,e,r,n,i,o,0)}u=u.next}s=s.next}while(s!==t)}function bc(t,e){return t.x-e.x}function _c(t,e){var r=function(i,o){var s,u=o,p=i.x,d=i.y,y=-1/0;do{if(d<=u.y&&d>=u.next.y&&u.next.y!==u.y){var f=u.x+(d-u.y)*(u.next.x-u.x)/(u.next.y-u.y);if(f<=p&&f>y&&(y=f,s=u.x<u.next.x?u:u.next,f===p))return s}u=u.next}while(u!==o);if(!s)return null;var l,c=s,a=s.x,h=s.y,m=1/0;u=s;do p>=u.x&&u.x>=a&&p!==u.x&&ar(d<h?p:y,d,a,h,d<h?y:p,d,u.x,u.y)&&(l=Math.abs(d-u.y)/(p-u.x),Gr(u,i)&&(l<m||l===m&&(u.x>s.x||u.x===s.x&&xc(s,u)))&&(s=u,m=l)),u=u.next;while(u!==c);return s}(t,e);if(!r)return e;var n=Us(r,t);return Gt(n,n.next),Gt(r,r.next)}function xc(t,e){return Ee(t.prev,t,e.prev)<0&&Ee(e.next,t,t.next)<0}function Mi(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ec(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ar(t,e,r,n,i,o,s,u){return(i-s)*(e-u)>=(t-s)*(o-u)&&(t-s)*(n-u)>=(r-s)*(e-u)&&(r-s)*(o-u)>=(i-s)*(n-u)}function wc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(r,n){var i=r;do{if(i.i!==r.i&&i.next.i!==r.i&&i.i!==n.i&&i.next.i!==n.i&&Ds(i,i.next,r,n))return!0;i=i.next}while(i!==r);return!1}(t,e)&&(Gr(t,e)&&Gr(e,t)&&function(r,n){var i=r,o=!1,s=(r.x+n.x)/2,u=(r.y+n.y)/2;do i.y>u!=i.next.y>u&&i.next.y!==i.y&&s<(i.next.x-i.x)*(u-i.y)/(i.next.y-i.y)+i.x&&(o=!o),i=i.next;while(i!==r);return o}(t,e)&&(Ee(t.prev,t,e.prev)||Ee(t,e.prev,e))||vn(t,e)&&Ee(t.prev,t,t.next)>0&&Ee(e.prev,e,e.next)>0)}function Ee(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function vn(t,e){return t.x===e.x&&t.y===e.y}function Ds(t,e,r,n){var i=_n(Ee(t,e,r)),o=_n(Ee(t,e,n)),s=_n(Ee(r,n,t)),u=_n(Ee(r,n,e));return i!==o&&s!==u||!(i!==0||!bn(t,r,e))||!(o!==0||!bn(t,n,e))||!(s!==0||!bn(r,t,n))||!(u!==0||!bn(r,e,n))}function bn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function _n(t){return t>0?1:t<0?-1:0}function Gr(t,e){return Ee(t.prev,t,t.next)<0?Ee(t,e,t.next)>=0&&Ee(t,t.prev,e)>=0:Ee(t,e,t.prev)<0||Ee(t,t.next,e)<0}function Us(t,e){var r=new Li(t.i,t.x,t.y),n=new Li(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function qs(t,e,r,n){var i=new Li(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Hr(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Li(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ji(t,e,r,n){for(var i=0,o=e,s=r-n;o<r;o+=n)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}Pi.exports=gn,Pi.exports.default=gn,gn.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,s=Math.abs(ji(t,0,o,r));if(i)for(var u=0,p=e.length;u<p;u++){var d=e[u]*r,y=u<p-1?e[u+1]*r:t.length;s-=Math.abs(ji(t,d,y,r))}var f=0;for(u=0;u<n.length;u+=3){var l=n[u]*r,c=n[u+1]*r,a=n[u+2]*r;f+=Math.abs((t[l]-t[a])*(t[c+1]-t[l+1])-(t[l]-t[c])*(t[a+1]-t[l+1]))}return s===0&&f===0?0:Math.abs((f-s)/s)},gn.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[i][o][s]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r};const Tc=nr(Pi.exports);var Fi={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */(function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,o=typeof Bt=="object"&&Bt;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var s,u,p=2147483647,d=36,y=1,f=26,l=38,c=700,a=72,h=128,m="-",g=/^xn--/,_=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=d-y,v=Math.floor,T=String.fromCharCode;function O(I){throw new RangeError(E[I])}function A(I,M){for(var L=I.length,j=[];L--;)j[L]=M(I[L]);return j}function N(I,M){var L=I.split("@"),j="";return L.length>1&&(j=L[0]+"@",I=L[1]),j+A((I=I.replace(b,".")).split("."),M).join(".")}function k(I){for(var M,L,j=[],q=0,G=I.length;q<G;)(M=I.charCodeAt(q++))>=55296&&M<=56319&&q<G?(64512&(L=I.charCodeAt(q++)))==56320?j.push(((1023&M)<<10)+(1023&L)+65536):(j.push(M),q--):j.push(M);return j}function w(I){return A(I,function(M){var L="";return M>65535&&(L+=T((M-=65536)>>>10&1023|55296),M=56320|1023&M),L+=T(M)}).join("")}function C(I,M){return I+22+75*(I<26)-((M!=0)<<5)}function P(I,M,L){var j=0;for(I=L?v(I/c):I>>1,I+=v(I/M);I>x*f>>1;j+=d)I=v(I/x);return v(j+(x+1)*I/(I+l))}function S(I){var M,L,j,q,G,z,K,F,D,B,U,H=[],V=I.length,$=0,Y=h,J=a;for((L=I.lastIndexOf(m))<0&&(L=0),j=0;j<L;++j)I.charCodeAt(j)>=128&&O("not-basic"),H.push(I.charCodeAt(j));for(q=L>0?L+1:0;q<V;){for(G=$,z=1,K=d;q>=V&&O("invalid-input"),((F=(U=I.charCodeAt(q++))-48<10?U-22:U-65<26?U-65:U-97<26?U-97:d)>=d||F>v((p-$)/z))&&O("overflow"),$+=F*z,!(F<(D=K<=J?y:K>=J+f?f:K-J));K+=d)z>v(p/(B=d-D))&&O("overflow"),z*=B;J=P($-G,M=H.length+1,G==0),v($/M)>p-Y&&O("overflow"),Y+=v($/M),$%=M,H.splice($++,0,Y)}return w(H)}function R(I){var M,L,j,q,G,z,K,F,D,B,U,H,V,$,Y,J=[];for(H=(I=k(I)).length,M=h,L=0,G=a,z=0;z<H;++z)(U=I[z])<128&&J.push(T(U));for(j=q=J.length,q&&J.push(m);j<H;){for(K=p,z=0;z<H;++z)(U=I[z])>=M&&U<K&&(K=U);for(K-M>v((p-L)/(V=j+1))&&O("overflow"),L+=(K-M)*V,M=K,z=0;z<H;++z)if((U=I[z])<M&&++L>p&&O("overflow"),U==M){for(F=L,D=d;!(F<(B=D<=G?y:D>=G+f?f:D-G));D+=d)Y=F-B,$=d-B,J.push(T(C(B+Y%$,0))),F=v(Y/$);J.push(T(C(F,0))),G=P(L,V,j==q),L=0,++j}++L,++M}return J.join("")}if(s={version:"1.4.1",ucs2:{decode:k,encode:w},decode:S,encode:R,toASCII:function(I){return N(I,function(M){return _.test(M)?"xn--"+R(M):M})},toUnicode:function(I){return N(I,function(M){return g.test(M)?S(M.slice(4).toLowerCase()):M})}},n&&i)if(t.exports==n)i.exports=s;else for(u in s)s.hasOwnProperty(u)&&(n[u]=s[u]);else r.punycode=s})(Bt)})(Fi,Fi.exports);var se,Ac=Fi.exports,Gs=typeof Symbol<"u"&&Symbol,Oc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;for(e in t[e]=42,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var n=Object.getOwnPropertySymbols(t);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},Hs={foo:{}},Sc=Object,Bi=Array.prototype.slice,Nc=Object.prototype.toString,kc=function(t){var e=this;if(typeof e!="function"||Nc.call(e)!=="[object Function]")throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,n=Bi.call(arguments,1),i=Math.max(0,e.length-n.length),o=[],s=0;s<i;s++)o.push("$"+s);if(r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof r){var p=e.apply(this,n.concat(Bi.call(arguments)));return Object(p)===p?p:this}return e.apply(t,n.concat(Bi.call(arguments)))}),e.prototype){var u=function(){};u.prototype=e.prototype,r.prototype=new u,u.prototype=null}return r},Di=Function.prototype.bind||kc,Cc=Di.call(Function.call,Object.prototype.hasOwnProperty),lr=SyntaxError,zs=Function,ur=TypeError,Ui=function(t){try{return zs('"use strict"; return ('+t+").constructor;")()}catch{}},Ht=Object.getOwnPropertyDescriptor;if(Ht)try{Ht({},"")}catch{Ht=null}var qi=function(){throw new ur},Rc=Ht?function(){try{return qi}catch{try{return Ht(arguments,"callee").get}catch{return qi}}}():qi,cr=typeof Gs=="function"&&typeof Symbol=="function"&&typeof Gs("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&Oc(),Ic={__proto__:Hs}.foo===Hs.foo&&!({__proto__:null}instanceof Sc),Re=Object.getPrototypeOf||(Ic?function(t){return t.__proto__}:null),hr={},Pc=typeof Uint8Array<"u"&&Re?Re(Uint8Array):se,zt={"%AggregateError%":typeof AggregateError>"u"?se:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?se:ArrayBuffer,"%ArrayIteratorPrototype%":cr&&Re?Re([][Symbol.iterator]()):se,"%AsyncFromSyncIteratorPrototype%":se,"%AsyncFunction%":hr,"%AsyncGenerator%":hr,"%AsyncGeneratorFunction%":hr,"%AsyncIteratorPrototype%":hr,"%Atomics%":typeof Atomics>"u"?se:Atomics,"%BigInt%":typeof BigInt>"u"?se:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?se:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?se:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?se:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?se:Float32Array,"%Float64Array%":typeof Float64Array>"u"?se:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?se:FinalizationRegistry,"%Function%":zs,"%GeneratorFunction%":hr,"%Int8Array%":typeof Int8Array>"u"?se:Int8Array,"%Int16Array%":typeof Int16Array>"u"?se:Int16Array,"%Int32Array%":typeof Int32Array>"u"?se:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cr&&Re?Re(Re([][Symbol.iterator]())):se,"%JSON%":typeof JSON=="object"?JSON:se,"%Map%":typeof Map>"u"?se:Map,"%MapIteratorPrototype%":typeof Map<"u"&&cr&&Re?Re(new Map()[Symbol.iterator]()):se,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?se:Promise,"%Proxy%":typeof Proxy>"u"?se:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?se:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?se:Set,"%SetIteratorPrototype%":typeof Set<"u"&&cr&&Re?Re(new Set()[Symbol.iterator]()):se,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?se:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cr&&Re?Re(""[Symbol.iterator]()):se,"%Symbol%":cr?Symbol:se,"%SyntaxError%":lr,"%ThrowTypeError%":Rc,"%TypedArray%":Pc,"%TypeError%":ur,"%Uint8Array%":typeof Uint8Array>"u"?se:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?se:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?se:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?se:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?se:WeakMap,"%WeakRef%":typeof WeakRef>"u"?se:WeakRef,"%WeakSet%":typeof WeakSet>"u"?se:WeakSet};if(Re)try{null.error}catch(t){var Mc=Re(Re(t));zt["%Error.prototype%"]=Mc}var Lc=function t(e){var r;if(e==="%AsyncFunction%")r=Ui("async function () {}");else if(e==="%GeneratorFunction%")r=Ui("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ui("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Re&&(r=Re(i.prototype))}return zt[e]=r,r},Vs={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},zr=Di,xn=Cc,jc=zr.call(Function.call,Array.prototype.concat),Fc=zr.call(Function.apply,Array.prototype.splice),Xs=zr.call(Function.call,String.prototype.replace),En=zr.call(Function.call,String.prototype.slice),Bc=zr.call(Function.call,RegExp.prototype.exec),Dc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Uc=/\\(\\)?/g,qc=function(t,e){var r,n=t;if(xn(Vs,n)&&(n="%"+(r=Vs[n])[0]+"%"),xn(zt,n)){var i=zt[n];if(i===hr&&(i=Lc(n)),i===void 0&&!e)throw new ur("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new lr("intrinsic "+t+" does not exist!")},Gi=function(t,e){if(typeof t!="string"||t.length===0)throw new ur("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new ur('"allowMissing" argument must be a boolean');if(Bc(/^%?[^%]*%?$/,t)===null)throw new lr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(h){var m=En(h,0,1),g=En(h,-1);if(m==="%"&&g!=="%")throw new lr("invalid intrinsic syntax, expected closing `%`");if(g==="%"&&m!=="%")throw new lr("invalid intrinsic syntax, expected opening `%`");var _=[];return Xs(h,Dc,function(b,E,x,v){_[_.length]=x?Xs(v,Uc,"$1"):E||b}),_}(t),n=r.length>0?r[0]:"",i=qc("%"+n+"%",e),o=i.name,s=i.value,u=!1,p=i.alias;p&&(n=p[0],Fc(r,jc([0,1],p)));for(var d=1,y=!0;d<r.length;d+=1){var f=r[d],l=En(f,0,1),c=En(f,-1);if((l==='"'||l==="'"||l==="`"||c==='"'||c==="'"||c==="`")&&l!==c)throw new lr("property names with quotes must have matching quotes");if(f!=="constructor"&&y||(u=!0),xn(zt,o="%"+(n+="."+f)+"%"))s=zt[o];else if(s!=null){if(!(f in s)){if(!e)throw new ur("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ht&&d+1>=r.length){var a=Ht(s,f);s=(y=!!a)&&"get"in a&&!("originalValue"in a.get)?a.get:s[f]}else y=xn(s,f),s=s[f];y&&!u&&(zt[o]=s)}}return s},$s={exports:{}};(function(t){var e=Di,r=Gi,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),p=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}t.exports=function(y){var f=o(e,i,arguments);return s&&u&&s(f,"length").configurable&&u(f,"length",{value:1+p(0,y.length-(arguments.length-1))}),f};var d=function(){return o(e,n,arguments)};u?u(t.exports,"apply",{value:d}):t.exports.apply=d})($s);var Ws=Gi,Ys=$s.exports,Gc=Ys(Ws("String.prototype.indexOf"));const Hc=ac(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Hi=typeof Map=="function"&&Map.prototype,zi=Object.getOwnPropertyDescriptor&&Hi?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wn=Hi&&zi&&typeof zi.get=="function"?zi.get:null,Ks=Hi&&Map.prototype.forEach,Vi=typeof Set=="function"&&Set.prototype,Xi=Object.getOwnPropertyDescriptor&&Vi?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Tn=Vi&&Xi&&typeof Xi.get=="function"?Xi.get:null,Zs=Vi&&Set.prototype.forEach,Vr=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap.prototype.has:null,Xr=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet.prototype.has:null,Qs=typeof WeakRef=="function"&&WeakRef.prototype?WeakRef.prototype.deref:null,zc=Boolean.prototype.valueOf,Vc=Object.prototype.toString,Xc=Function.prototype.toString,$c=String.prototype.match,$i=String.prototype.slice,Ct=String.prototype.replace,Wc=String.prototype.toUpperCase,Js=String.prototype.toLowerCase,ea=RegExp.prototype.test,ta=Array.prototype.concat,ft=Array.prototype.join,Yc=Array.prototype.slice,ra=Math.floor,Wi=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Yi=Object.getOwnPropertySymbols,Ki=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fr||"symbol")?Symbol.toStringTag:null,na=Object.prototype.propertyIsEnumerable,ia=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function oa(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||ea.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-ra(-t):ra(t);if(n!==t){var i=String(n),o=$i.call(e,i.length+1);return Ct.call(i,r,"$&_")+"."+Ct.call(Ct.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ct.call(e,r,"$&_")}var Zi=Hc,sa=Zi.custom,aa=ca(sa)?sa:null;function la(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Kc(t){return Ct.call(String(t),/"/g,"&quot;")}function Qi(t){return!(It(t)!=="[object Array]"||Fe&&typeof t=="object"&&Fe in t)}function ua(t){return!(It(t)!=="[object RegExp]"||Fe&&typeof t=="object"&&Fe in t)}function ca(t){if(fr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Ki)return!1;try{return Ki.call(t),!0}catch{}return!1}var Zc=Object.prototype.hasOwnProperty||function(t){return t in this};function Rt(t,e){return Zc.call(t,e)}function It(t){return Vc.call(t)}function ha(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function fa(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return fa($i.call(t,0,e.maxStringLength),e)+n}return la(Ct.call(Ct.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Qc),"single",e)}function Qc(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Wc.call(e.toString(16))}function $r(t){return"Object("+t+")"}function Ji(t){return t+" { ? }"}function da(t,e,r,n){return t+" ("+e+") {"+(n?eo(r,n):ft.call(r,", "))+"}"}function eo(t,e){if(t.length===0)return"";var r=`
2
- `+e.prev+e.base;return r+ft.call(t,","+r)+`
3
- `+e.prev}function An(t,e){var r=Qi(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Rt(t,i)?e(t[i],t):""}var o,s=typeof Yi=="function"?Yi(t):[];if(fr){o={};for(var u=0;u<s.length;u++)o["$"+s[u]]=s[u]}for(var p in t)Rt(t,p)&&(r&&String(Number(p))===p&&p<t.length||fr&&o["$"+p]instanceof Symbol||(ea.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof Yi=="function")for(var d=0;d<s.length;d++)na.call(t,s[d])&&n.push("["+e(s[d])+"]: "+e(t[s[d]],t));return n}var to=Gi,dr=function(t,e){var r=Ws(t,!!e);return typeof r=="function"&&Gc(t,".prototype.")>-1?Ys(r):r},Jc=function t(e,r,n,i){var o=r||{};if(Rt(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Rt(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!Rt(o,"customInspect")||o.customInspect;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Rt(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Rt(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=o.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return fa(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return u?oa(e,p):p}if(typeof e=="bigint"){var d=String(e)+"n";return u?oa(e,d):d}var y=o.depth===void 0?5:o.depth;if(n===void 0&&(n=0),n>=y&&y>0&&typeof e=="object")return Qi(e)?"[Array]":"[Object]";var f=function(w,C){var P;if(w.indent===" ")P=" ";else{if(!(typeof w.indent=="number"&&w.indent>0))return null;P=ft.call(Array(w.indent+1)," ")}return{base:P,prev:ft.call(Array(C+1),P)}}(o,n);if(i===void 0)i=[];else if(ha(i,e)>=0)return"[Circular]";function l(w,C,P){if(C&&(i=Yc.call(i)).push(C),P){var S={depth:o.depth};return Rt(o,"quoteStyle")&&(S.quoteStyle=o.quoteStyle),t(w,S,n+1,i)}return t(w,o,n+1,i)}if(typeof e=="function"&&!ua(e)){var c=function(w){if(w.name)return w.name;var C=$c.call(Xc.call(w),/^function\s*([\w$]+)/);return C?C[1]:null}(e),a=An(e,l);return"[Function"+(c?": "+c:" (anonymous)")+"]"+(a.length>0?" { "+ft.call(a,", ")+" }":"")}if(ca(e)){var h=fr?Ct.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ki.call(e);return typeof e!="object"||fr?h:$r(h)}if(function(w){return!w||typeof w!="object"?!1:typeof HTMLElement<"u"&&w instanceof HTMLElement?!0:typeof w.nodeName=="string"&&typeof w.getAttribute=="function"}(e)){for(var m="<"+Js.call(String(e.nodeName)),g=e.attributes||[],_=0;_<g.length;_++)m+=" "+g[_].name+"="+la(Kc(g[_].value),"double",o);return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+="</"+Js.call(String(e.nodeName))+">"}if(Qi(e)){if(e.length===0)return"[]";var b=An(e,l);return f&&!function(w){for(var C=0;C<w.length;C++)if(ha(w[C],`
4
- `)>=0)return!1;return!0}(b)?"["+eo(b,f)+"]":"[ "+ft.call(b,", ")+" ]"}if(function(w){return!(It(w)!=="[object Error]"||Fe&&typeof w=="object"&&Fe in w)}(e)){var E=An(e,l);return"cause"in Error.prototype||!("cause"in e)||na.call(e,"cause")?E.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ft.call(E,", ")+" }":"{ ["+String(e)+"] "+ft.call(ta.call("[cause]: "+l(e.cause),E),", ")+" }"}if(typeof e=="object"&&s){if(aa&&typeof e[aa]=="function"&&Zi)return Zi(e,{depth:y-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(w){if(!wn||!w||typeof w!="object")return!1;try{wn.call(w);try{Tn.call(w)}catch{return!0}return w instanceof Map}catch{}return!1}(e)){var x=[];return Ks&&Ks.call(e,function(w,C){x.push(l(C,e,!0)+" => "+l(w,e))}),da("Map",wn.call(e),x,f)}if(function(w){if(!Tn||!w||typeof w!="object")return!1;try{Tn.call(w);try{wn.call(w)}catch{return!0}return w instanceof Set}catch{}return!1}(e)){var v=[];return Zs&&Zs.call(e,function(w){v.push(l(w,e))}),da("Set",Tn.call(e),v,f)}if(function(w){if(!Vr||!w||typeof w!="object")return!1;try{Vr.call(w,Vr);try{Xr.call(w,Xr)}catch{return!0}return w instanceof WeakMap}catch{}return!1}(e))return Ji("WeakMap");if(function(w){if(!Xr||!w||typeof w!="object")return!1;try{Xr.call(w,Xr);try{Vr.call(w,Vr)}catch{return!0}return w instanceof WeakSet}catch{}return!1}(e))return Ji("WeakSet");if(function(w){if(!Qs||!w||typeof w!="object")return!1;try{return Qs.call(w),!0}catch{}return!1}(e))return Ji("WeakRef");if(function(w){return!(It(w)!=="[object Number]"||Fe&&typeof w=="object"&&Fe in w)}(e))return $r(l(Number(e)));if(function(w){if(!w||typeof w!="object"||!Wi)return!1;try{return Wi.call(w),!0}catch{}return!1}(e))return $r(l(Wi.call(e)));if(function(w){return!(It(w)!=="[object Boolean]"||Fe&&typeof w=="object"&&Fe in w)}(e))return $r(zc.call(e));if(function(w){return!(It(w)!=="[object String]"||Fe&&typeof w=="object"&&Fe in w)}(e))return $r(l(String(e)));if(!function(w){return!(It(w)!=="[object Date]"||Fe&&typeof w=="object"&&Fe in w)}(e)&&!ua(e)){var T=An(e,l),O=ia?ia(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",N=!O&&Fe&&Object(e)===e&&Fe in e?$i.call(It(e),8,-1):A?"Object":"",k=(O||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(N||A?"["+ft.call(ta.call([],N||[],A||[]),": ")+"] ":"");return T.length===0?k+"{}":f?k+"{"+eo(T,f)+"}":k+"{ "+ft.call(T,", ")+" }"}return String(e)},eh=to("%TypeError%"),On=to("%WeakMap%",!0),Sn=to("%Map%",!0),th=dr("WeakMap.prototype.get",!0),rh=dr("WeakMap.prototype.set",!0),nh=dr("WeakMap.prototype.has",!0),ih=dr("Map.prototype.get",!0),oh=dr("Map.prototype.set",!0),sh=dr("Map.prototype.has",!0),ro=function(t,e){for(var r,n=t;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},ah=String.prototype.replace,lh=/%20/g,pa="RFC3986",no={default:pa,formatters:{RFC1738:function(t){return ah.call(t,lh,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:pa},uh=no,io=Object.prototype.hasOwnProperty,Vt=Array.isArray,dt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ya=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)t[n]!==void 0&&(r[n]=t[n]);return r},ma={arrayToObject:ya,assign:function(t,e){return Object.keys(e).reduce(function(r,n){return r[n]=e[n],r},t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],o=i.obj[i.prop],s=Object.keys(o),u=0;u<s.length;++u){var p=s[u],d=o[p];typeof d=="object"&&d!==null&&r.indexOf(d)===-1&&(e.push({obj:o,prop:p}),r.push(d))}return function(y){for(;y.length>1;){var f=y.pop(),l=f.obj[f.prop];if(Vt(l)){for(var c=[],a=0;a<l.length;++a)l[a]!==void 0&&c.push(l[a]);f.obj[f.prop]=c}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},encode:function(t,e,r,n,i){if(t.length===0)return t;var o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var s="",u=0;u<o.length;++u){var p=o.charCodeAt(u);p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||i===uh.RFC1738&&(p===40||p===41)?s+=o.charAt(u):p<128?s+=dt[p]:p<2048?s+=dt[192|p>>6]+dt[128|63&p]:p<55296||p>=57344?s+=dt[224|p>>12]+dt[128|p>>6&63]+dt[128|63&p]:(u+=1,p=65536+((1023&p)<<10|1023&o.charCodeAt(u)),s+=dt[240|p>>18]+dt[128|p>>12&63]+dt[128|p>>6&63]+dt[128|63&p])}return s},isBuffer:function(t){return!(!t||typeof t!="object")&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},maybeMap:function(t,e){if(Vt(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(Vt(e))e.push(r);else{if(!e||typeof e!="object")return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!io.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return Vt(e)&&!Vt(r)&&(i=ya(e,n)),Vt(e)&&Vt(r)?(r.forEach(function(o,s){if(io.call(e,s)){var u=e[s];u&&typeof u=="object"&&o&&typeof o=="object"?e[s]=t(u,o,n):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var u=r[s];return io.call(o,s)?o[s]=t(o[s],u,n):o[s]=u,o},i)}},ga=function(){var t,e,r,n={assert:function(i){if(!n.has(i))throw new eh("Side channel does not contain "+Jc(i))},get:function(i){if(On&&i&&(typeof i=="object"||typeof i=="function")){if(t)return th(t,i)}else if(Sn){if(e)return ih(e,i)}else if(r)return function(o,s){var u=ro(o,s);return u&&u.value}(r,i)},has:function(i){if(On&&i&&(typeof i=="object"||typeof i=="function")){if(t)return nh(t,i)}else if(Sn){if(e)return sh(e,i)}else if(r)return function(o,s){return!!ro(o,s)}(r,i);return!1},set:function(i,o){On&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new On),rh(t,i,o)):Sn?(e||(e=new Sn),oh(e,i,o)):(r||(r={key:{},next:null}),function(s,u,p){var d=ro(s,u);d?d.value=p:s.next={key:u,next:s.next,value:p}}(r,i,o))}};return n},Nn=ma,Wr=no,ch=Object.prototype.hasOwnProperty,va={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},xt=Array.isArray,hh=Array.prototype.push,ba=function(t,e){hh.apply(t,xt(e)?e:[e])},fh=Date.prototype.toISOString,_a=Wr.default,Be={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Nn.encode,encodeValuesOnly:!1,format:_a,formatter:Wr.formatters[_a],indices:!1,serializeDate:function(t){return fh.call(t)},skipNulls:!1,strictNullHandling:!1},oo={},dh=function t(e,r,n,i,o,s,u,p,d,y,f,l,c,a,h,m){for(var g=e,_=m,b=0,E=!1;(_=_.get(oo))!==void 0&&!E;){var x=_.get(e);if(b+=1,x!==void 0){if(x===b)throw new RangeError("Cyclic object value");E=!0}_.get(oo)===void 0&&(b=0)}if(typeof p=="function"?g=p(r,g):g instanceof Date?g=f(g):n==="comma"&&xt(g)&&(g=Nn.maybeMap(g,function(S){return S instanceof Date?f(S):S})),g===null){if(o)return u&&!a?u(r,Be.encoder,h,"key",l):r;g=""}if(function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"}(g)||Nn.isBuffer(g))return u?[c(a?r:u(r,Be.encoder,h,"key",l))+"="+c(u(g,Be.encoder,h,"value",l))]:[c(r)+"="+c(String(g))];var v,T=[];if(g===void 0)return T;if(n==="comma"&&xt(g))a&&u&&(g=Nn.maybeMap(g,u)),v=[{value:g.length>0?g.join(",")||null:void 0}];else if(xt(p))v=p;else{var O=Object.keys(g);v=d?O.sort(d):O}for(var A=i&&xt(g)&&g.length===1?r+"[]":r,N=0;N<v.length;++N){var k=v[N],w=typeof k=="object"&&k.value!==void 0?k.value:g[k];if(!s||w!==null){var C=xt(g)?typeof n=="function"?n(A,k):A:A+(y?"."+k:"["+k+"]");m.set(e,b);var P=ga();P.set(oo,m),ba(T,t(w,C,n,i,o,s,n==="comma"&&a&&xt(g)?null:u,p,d,y,f,l,c,a,h,P))}}return T},pr=ma,so=Object.prototype.hasOwnProperty,ph=Array.isArray,Ie={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:pr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},yh=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},xa=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},mh=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),u=s?i.slice(0,s.index):i,p=[];if(u){if(!r.plainObjects&&so.call(Object.prototype,u)&&!r.allowPrototypes)return;p.push(u)}for(var d=0;r.depth>0&&(s=o.exec(i))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&so.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(s[1])}return s&&p.push("["+i.slice(s.index)+"]"),function(y,f,l,c){for(var a=c?f:xa(f,l),h=y.length-1;h>=0;--h){var m,g=y[h];if(g==="[]"&&l.parseArrays)m=[].concat(a);else{m=l.plainObjects?Object.create(null):{};var _=g.charAt(0)==="["&&g.charAt(g.length-1)==="]"?g.slice(1,-1):g,b=parseInt(_,10);l.parseArrays||_!==""?!isNaN(b)&&g!==_&&String(b)===_&&b>=0&&l.parseArrays&&b<=l.arrayLimit?(m=[])[b]=a:_!=="__proto__"&&(m[_]=a):m={0:a}}a=m}return a}(p,e,r,n)}},gh=function(t,e){var r,n=t,i=function(a){if(!a)return Be;if(a.encoder!==null&&a.encoder!==void 0&&typeof a.encoder!="function")throw new TypeError("Encoder has to be a function.");var h=a.charset||Be.charset;if(a.charset!==void 0&&a.charset!=="utf-8"&&a.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=Wr.default;if(a.format!==void 0){if(!ch.call(Wr.formatters,a.format))throw new TypeError("Unknown format option provided.");m=a.format}var g=Wr.formatters[m],_=Be.filter;return(typeof a.filter=="function"||xt(a.filter))&&(_=a.filter),{addQueryPrefix:typeof a.addQueryPrefix=="boolean"?a.addQueryPrefix:Be.addQueryPrefix,allowDots:a.allowDots===void 0?Be.allowDots:!!a.allowDots,charset:h,charsetSentinel:typeof a.charsetSentinel=="boolean"?a.charsetSentinel:Be.charsetSentinel,delimiter:a.delimiter===void 0?Be.delimiter:a.delimiter,encode:typeof a.encode=="boolean"?a.encode:Be.encode,encoder:typeof a.encoder=="function"?a.encoder:Be.encoder,encodeValuesOnly:typeof a.encodeValuesOnly=="boolean"?a.encodeValuesOnly:Be.encodeValuesOnly,filter:_,format:m,formatter:g,serializeDate:typeof a.serializeDate=="function"?a.serializeDate:Be.serializeDate,skipNulls:typeof a.skipNulls=="boolean"?a.skipNulls:Be.skipNulls,sort:typeof a.sort=="function"?a.sort:null,strictNullHandling:typeof a.strictNullHandling=="boolean"?a.strictNullHandling:Be.strictNullHandling}}(e);typeof i.filter=="function"?n=(0,i.filter)("",n):xt(i.filter)&&(r=i.filter);var o,s=[];if(typeof n!="object"||n===null)return"";o=e&&e.arrayFormat in va?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var u=va[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var p=u==="comma"&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var d=ga(),y=0;y<r.length;++y){var f=r[y];i.skipNulls&&n[f]===null||ba(s,dh(n[f],f,u,p,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,d))}var l=s.join(i.delimiter),c=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?c+="utf8=%26%2310003%3B&":c+="utf8=%E2%9C%93&"),l.length>0?c+l:""},vh=function(t,e){var r=function(d){if(!d)return Ie;if(d.decoder!==null&&d.decoder!==void 0&&typeof d.decoder!="function")throw new TypeError("Decoder has to be a function.");if(d.charset!==void 0&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=d.charset===void 0?Ie.charset:d.charset;return{allowDots:d.allowDots===void 0?Ie.allowDots:!!d.allowDots,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:Ie.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:Ie.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:Ie.arrayLimit,charset:y,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:Ie.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:Ie.comma,decoder:typeof d.decoder=="function"?d.decoder:Ie.decoder,delimiter:typeof d.delimiter=="string"||pr.isRegExp(d.delimiter)?d.delimiter:Ie.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:Ie.depth,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:Ie.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:Ie.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:Ie.plainObjects,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:Ie.strictNullHandling}}(e);if(t===""||t==null)return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?function(d,y){var f,l={__proto__:null},c=y.ignoreQueryPrefix?d.replace(/^\?/,""):d,a=y.parameterLimit===1/0?void 0:y.parameterLimit,h=c.split(y.delimiter,a),m=-1,g=y.charset;if(y.charsetSentinel)for(f=0;f<h.length;++f)h[f].indexOf("utf8=")===0&&(h[f]==="utf8=%E2%9C%93"?g="utf-8":h[f]==="utf8=%26%2310003%3B"&&(g="iso-8859-1"),m=f,f=h.length);for(f=0;f<h.length;++f)if(f!==m){var _,b,E=h[f],x=E.indexOf("]="),v=x===-1?E.indexOf("="):x+1;v===-1?(_=y.decoder(E,Ie.decoder,g,"key"),b=y.strictNullHandling?null:""):(_=y.decoder(E.slice(0,v),Ie.decoder,g,"key"),b=pr.maybeMap(xa(E.slice(v+1),y),function(T){return y.decoder(T,Ie.decoder,g,"value")})),b&&y.interpretNumericEntities&&g==="iso-8859-1"&&(b=yh(b)),E.indexOf("[]=")>-1&&(b=ph(b)?[b]:b),so.call(l,_)?l[_]=pr.combine(l[_],b):l[_]=b}return l}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var u=o[s],p=mh(u,n[u],r,typeof t=="string");i=pr.merge(i,p,r)}return r.allowSparse===!0?i:pr.compact(i)},bh={formats:no,parse:vh,stringify:gh},_h=Ac;function Je(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var xh=/^([a-z0-9.+-]+:)/i,Eh=/:[0-9]*$/,wh=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Th=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
5
- `," "]),ao=["'"].concat(Th),Ea=["%","/","?",";","#"].concat(ao),wa=["/","?","#"],Ta=/^[+a-z0-9A-Z_-]{0,63}$/,Ah=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Oh={javascript:!0,"javascript:":!0},lo={javascript:!0,"javascript:":!0},yr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},uo=bh;function kn(t,e,r){if(t&&typeof t=="object"&&t instanceof Je)return t;var n=new Je;return n.parse(t,e,r),n}Je.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n<t.indexOf("#")?"?":"#",o=t.split(i);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(i);if(s=s.trim(),!r&&t.split("#").length===1){var u=wh.exec(s);if(u)return this.path=s,this.href=s,this.pathname=u[1],u[2]?(this.search=u[2],this.query=e?uo.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var p=xh.exec(s);if(p){var d=(p=p[0]).toLowerCase();this.protocol=d,s=s.substr(p.length)}if(r||p||s.match(/^\/\/[^@/]+@[^@/]+/)){var y=s.substr(0,2)==="//";!y||p&&lo[p]||(s=s.substr(2),this.slashes=!0)}if(!lo[p]&&(y||p&&!yr[p])){for(var f,l,c=-1,a=0;a<wa.length;a++)(h=s.indexOf(wa[a]))!==-1&&(c===-1||h<c)&&(c=h);for((l=c===-1?s.lastIndexOf("@"):s.lastIndexOf("@",c))!==-1&&(f=s.slice(0,l),s=s.slice(l+1),this.auth=decodeURIComponent(f)),c=-1,a=0;a<Ea.length;a++){var h;(h=s.indexOf(Ea[a]))!==-1&&(c===-1||h<c)&&(c=h)}c===-1&&(c=s.length),this.host=s.slice(0,c),s=s.slice(c),this.parseHost(),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m)for(var g=this.hostname.split(/\./),_=(a=0,g.length);a<_;a++){var b=g[a];if(b&&!b.match(Ta)){for(var E="",x=0,v=b.length;x<v;x++)b.charCodeAt(x)>127?E+="x":E+=b[x];if(!E.match(Ta)){var T=g.slice(0,a),O=g.slice(a+1),A=b.match(Ah);A&&(T.push(A[1]),O.unshift(A[2])),O.length&&(s="/"+O.join(".")+s),this.hostname=T.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=_h.toASCII(this.hostname));var N=this.port?":"+this.port:"",k=this.hostname||"";this.host=k+N,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!Oh[d])for(a=0,_=ao.length;a<_;a++){var w=ao[a];if(s.indexOf(w)!==-1){var C=encodeURIComponent(w);C===w&&(C=escape(w)),s=s.split(w).join(C)}}var P=s.indexOf("#");P!==-1&&(this.hash=s.substr(P),s=s.slice(0,P));var S=s.indexOf("?");if(S!==-1?(this.search=s.substr(S),this.query=s.substr(S+1),e&&(this.query=uo.parse(this.query)),s=s.slice(0,S)):e&&(this.search="",this.query={}),s&&(this.pathname=s),yr[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){N=this.pathname||"";var R=this.search||"";this.path=N+R}return this.href=this.format(),this},Je.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=uo.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||yr[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),s&&s.charAt(0)!=="?"&&(s="?"+s),e+i+(r=r.replace(/[?#]/g,function(u){return encodeURIComponent(u)}))+(s=s.replace("#","%23"))+n},Je.prototype.resolve=function(t){return this.resolveObject(kn(t,!1,!0)).format()},Je.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new Je;e.parse(t,!1,!0),t=e}for(var r=new Je,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),u=0;u<s.length;u++){var p=s[u];p!=="protocol"&&(r[p]=t[p])}return yr[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!yr[t.protocol]){for(var d=Object.keys(t),y=0;y<d.length;y++){var f=d[y];r[f]=t[f]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||lo[t.protocol])r.pathname=t.pathname;else{for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),l[0]!==""&&l.unshift(""),l.length<2&&l.unshift(""),r.pathname=l.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var c=r.pathname||"",a=r.search||"";r.path=c+a}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var h=r.pathname&&r.pathname.charAt(0)==="/",m=t.host||t.pathname&&t.pathname.charAt(0)==="/",g=m||h||r.host&&t.pathname,_=g,b=r.pathname&&r.pathname.split("/")||[],E=(l=t.pathname&&t.pathname.split("/")||[],r.protocol&&!yr[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(b[0]===""?b[0]=r.host:b.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(l[0]===""?l[0]=t.host:l.unshift(t.host)),t.host=null),g=g&&(l[0]===""||b[0]==="")),m)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,b=l;else if(l.length)b||(b=[]),b.pop(),b=b.concat(l),r.search=t.search,r.query=t.query;else if(t.search!=null)return E&&(r.host=b.shift(),r.hostname=r.host,(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.hostname=A.shift(),r.host=r.hostname)),r.search=t.search,r.query=t.query,r.pathname===null&&r.search===null||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=b.slice(-1)[0],v=(r.host||t.host||b.length>1)&&(x==="."||x==="..")||x==="",T=0,O=b.length;O>=0;O--)(x=b[O])==="."?b.splice(O,1):x===".."?(b.splice(O,1),T++):T&&(b.splice(O,1),T--);if(!g&&!_)for(;T--;T)b.unshift("..");!g||b[0]===""||b[0]&&b[0].charAt(0)==="/"||b.unshift(""),v&&b.join("/").substr(-1)!=="/"&&b.push("");var A,N=b[0]===""||b[0]&&b[0].charAt(0)==="/";return E&&(r.hostname=N?"":b.length?b.shift():"",r.host=r.hostname,(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.hostname=A.shift(),r.host=r.hostname)),(g=g||r.host&&b.length)&&!N&&b.unshift(""),b.length>0?r.pathname=b.join("/"):(r.pathname=null,r.path=null),r.pathname===null&&r.search===null||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Je.prototype.parseHost=function(){var t=this.host,e=Eh.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var Sh=function(t){return typeof t=="string"&&(t=kn(t)),t instanceof Je?t.format():Je.prototype.format.call(t)};const Nh={parse:kn,format:Sh,resolve:function(t,e){return kn(t,!1,!0).resolve(e)}},Aa={};function ye(t,e,r=3){if(Aa[e])return;let n=new Error().stack;n===void 0?console.warn("PixiJS Deprecation Warning: ",`${e}
6
- Deprecated since v${t}`):(n=n.split(`
1
+ (function(Ct,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("react"),require("@pixi/react"),require("gsap"),require("pixi.js"),require("reacthub-react-bindings"),require("@pixi/sound")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","gsap","pixi.js","reacthub-react-bindings","@pixi/sound"],Q):(Ct=typeof globalThis<"u"?globalThis:Ct||self,Q(Ct["reacthub-pixitweenjs"]={},Ct.React,Ct.PIXIReact,Ct.gsap,Ct.PIXI,Ct.reacthubReactBindings,Ct.PIXI.sound))})(this,function(Ct,Q,yt,he,df,pf,vf){"use strict";function Ta(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const st=Ta(Q),te=Ta(df);var Ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yf(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var wa={exports:{}},pn={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var mf=Q,gf=Symbol.for("react.element"),bf=Symbol.for("react.fragment"),_f=Object.prototype.hasOwnProperty,xf=mf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ef={key:!0,ref:!0,__self:!0,__source:!0};function Aa(e,t,r){var n,i={},s=null,a=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)_f.call(t,n)&&!Ef.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:gf,type:e,key:s,ref:a,props:i,_owner:xf.current}}pn.Fragment=bf,pn.jsx=Aa,pn.jsxs=Aa,wa.exports=pn;var dt=wa.exports,$e=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))($e||{}),Sa=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(Sa||{}),Ii=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(Ii||{}),ot=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR",e))(ot||{}),Ce=(e=>(e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e))(Ce||{}),rt=(e=>(e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e))(rt||{}),sr=(e=>(e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e))(sr||{}),bt=(e=>(e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT",e))(bt||{}),Ri=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(Ri||{}),xe=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(xe||{}),Dr=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(Dr||{}),Ge=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(Ge||{}),Pe=(e=>(e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",e))(Pe||{}),qe=(e=>(e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT",e))(qe||{}),Ni=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(Ni||{}),Zt=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(Zt||{}),Ut=(e=>(e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE",e[e.COLOR=4]="COLOR",e))(Ut||{}),Bt=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(Bt||{}),de=(e=>(e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e))(de||{});const mt={ADAPTER:{createCanvas:(e,t)=>{const r=document.createElement("canvas");return r.width=e,r.height=t,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Ci=/iPhone/i,Oa=/iPod/i,Ia=/iPad/i,Ra=/\biOS-universal(?:.+)Mac\b/i,Pi=/\bAndroid(?:.+)Mobile\b/i,Na=/Android/i,ar=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,vn=/Silk/i,Ee=/Windows Phone/i,Ca=/\bWindows(?:.+)ARM\b/i,Pa=/BlackBerry/i,ka=/BB10/i,Ma=/Opera Mini/i,La=/\b(CriOS|Chrome)(?:.+)Mobile/i,Fa=/Mobile(?:.+)Firefox\b/i,Ba=function(e){return typeof e<"u"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream>"u"};function Tf(e){return function(t){return t.test(e)}}function Ua(e){var t={userAgent:"",platform:"",maxTouchPoints:0};!e&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e=="string"?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var r=t.userAgent,n=r.split("[FBAN");typeof n[1]<"u"&&(r=n[0]),n=r.split("Twitter"),typeof n[1]<"u"&&(r=n[0]);var i=Tf(r),s={apple:{phone:i(Ci)&&!i(Ee),ipod:i(Oa),tablet:!i(Ci)&&(i(Ia)||Ba(t))&&!i(Ee),universal:i(Ra),device:(i(Ci)||i(Oa)||i(Ia)||i(Ra)||Ba(t))&&!i(Ee)},amazon:{phone:i(ar),tablet:!i(ar)&&i(vn),device:i(ar)||i(vn)},android:{phone:!i(Ee)&&i(ar)||!i(Ee)&&i(Pi),tablet:!i(Ee)&&!i(ar)&&!i(Pi)&&(i(vn)||i(Na)),device:!i(Ee)&&(i(ar)||i(vn)||i(Pi)||i(Na))||i(/\bokhttp\b/i)},windows:{phone:i(Ee),tablet:i(Ca),device:i(Ee)||i(Ca)},other:{blackberry:i(Pa),blackberry10:i(ka),opera:i(Ma),firefox:i(Fa),chrome:i(La),device:i(Pa)||i(ka)||i(Ma)||i(Fa)||i(La)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const or=(Ua.default??Ua)(globalThis.navigator);mt.RETINA_PREFIX=/@([0-9\.]+)x/,mt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Da={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,f,c){this.fn=l,this.context=f,this.once=c||!1}function s(l,f,c,h,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,h||l,u),p=r?r+f:f;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function a(l,f){--l._eventsCount===0?l._events=new n:delete l._events[f]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var f=[],c,h;if(this._eventsCount===0)return f;for(h in c=this._events)t.call(c,h)&&f.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(c)):f},o.prototype.listeners=function(f){var c=r?r+f:f,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var u=0,d=h.length,p=new Array(d);u<d;u++)p[u]=h[u].fn;return p},o.prototype.listenerCount=function(f){var c=r?r+f:f,h=this._events[c];return h?h.fn?1:h.length:0},o.prototype.emit=function(f,c,h,u,d,p){var v=r?r+f:f;if(!this._events[v])return!1;var g=this._events[v],m=arguments.length,b,_;if(g.fn){switch(g.once&&this.removeListener(f,g.fn,void 0,!0),m){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,h),!0;case 4:return g.fn.call(g.context,c,h,u),!0;case 5:return g.fn.call(g.context,c,h,u,d),!0;case 6:return g.fn.call(g.context,c,h,u,d,p),!0}for(_=1,b=new Array(m-1);_<m;_++)b[_-1]=arguments[_];g.fn.apply(g.context,b)}else{var y=g.length,x;for(_=0;_<y;_++)switch(g[_].once&&this.removeListener(f,g[_].fn,void 0,!0),m){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,c);break;case 3:g[_].fn.call(g[_].context,c,h);break;case 4:g[_].fn.call(g[_].context,c,h,u);break;default:if(!b)for(x=1,b=new Array(m-1);x<m;x++)b[x-1]=arguments[x];g[_].fn.apply(g[_].context,b)}}return!0},o.prototype.on=function(f,c,h){return s(this,f,c,h,!1)},o.prototype.once=function(f,c,h){return s(this,f,c,h,!0)},o.prototype.removeListener=function(f,c,h,u){var d=r?r+f:f;if(!this._events[d])return this;if(!c)return a(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!u||p.once)&&(!h||p.context===h)&&a(this,d);else{for(var v=0,g=[],m=p.length;v<m;v++)(p[v].fn!==c||u&&!p[v].once||h&&p[v].context!==h)&&g.push(p[v]);g.length?this._events[d]=g.length===1?g[0]:g:a(this,d)}return this},o.prototype.removeAllListeners=function(f){var c;return f?(c=r?r+f:f,this._events[c]&&a(this,c)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(Da);var wf=Da.exports;const yn=ir(wf);var ki={exports:{}};ki.exports=mn,ki.exports.default=mn;function mn(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,s=ja(e,0,i,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,l,f,c,h,u,d;if(n&&(s=Rf(e,t,s,r)),e.length>80*r){o=f=e[0],l=c=e[1];for(var p=r;p<i;p+=r)h=e[p],u=e[p+1],h<o&&(o=h),u<l&&(l=u),h>f&&(f=h),u>c&&(c=u);d=Math.max(f-o,c-l),d=d!==0?32767/d:0}return jr(s,a,r,o,l,d,0),a}function ja(e,t,r,n,i){var s,a;if(i===Fi(e,t,r,n)>0)for(s=t;s<r;s+=n)a=qa(s,e[s],e[s+1],a);else for(s=r-n;s>=t;s-=n)a=qa(s,e[s],e[s+1],a);return a&&gn(a,a.next)&&(Gr(a),a=a.next),a}function He(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(gn(r,r.next)||Pt(r.prev,r,r.next)===0)){if(Gr(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function jr(e,t,r,n,i,s,a){if(e){!a&&s&&Mf(e,n,i,s);for(var o=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,s?Sf(e,n,i,s):Af(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),Gr(e),e=f.next,o=f.next;continue}if(e=f,e===o){a?a===1?(e=Of(He(e),t,r),jr(e,t,r,n,i,s,2)):a===2&&If(e,t,r,n,i,s):jr(He(e),t,r,n,i,s,1);break}}}}function Af(e){var t=e.prev,r=e,n=e.next;if(Pt(t,r,n)>=0)return!1;for(var i=t.x,s=r.x,a=n.x,o=t.y,l=r.y,f=n.y,c=i<s?i<a?i:a:s<a?s:a,h=o<l?o<f?o:f:l<f?l:f,u=i>s?i>a?i:a:s>a?s:a,d=o>l?o>f?o:f:l>f?l:f,p=n.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=h&&p.y<=d&&lr(i,o,s,l,a,f,p.x,p.y)&&Pt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Sf(e,t,r,n){var i=e.prev,s=e,a=e.next;if(Pt(i,s,a)>=0)return!1;for(var o=i.x,l=s.x,f=a.x,c=i.y,h=s.y,u=a.y,d=o<l?o<f?o:f:l<f?l:f,p=c<h?c<u?c:u:h<u?h:u,v=o>l?o>f?o:f:l>f?l:f,g=c>h?c>u?c:u:h>u?h:u,m=Mi(d,p,t,r,n),b=Mi(v,g,t,r,n),_=e.prevZ,y=e.nextZ;_&&_.z>=m&&y&&y.z<=b;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&lr(o,c,l,h,f,u,_.x,_.y)&&Pt(_.prev,_,_.next)>=0||(_=_.prevZ,y.x>=d&&y.x<=v&&y.y>=p&&y.y<=g&&y!==i&&y!==a&&lr(o,c,l,h,f,u,y.x,y.y)&&Pt(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&lr(o,c,l,h,f,u,_.x,_.y)&&Pt(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=b;){if(y.x>=d&&y.x<=v&&y.y>=p&&y.y<=g&&y!==i&&y!==a&&lr(o,c,l,h,f,u,y.x,y.y)&&Pt(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function Of(e,t,r){var n=e;do{var i=n.prev,s=n.next.next;!gn(i,s)&&$a(i,n,n.next,s)&&$r(i,s)&&$r(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),Gr(n),Gr(n.next),n=e=s),n=n.next}while(n!==e);return He(n)}function If(e,t,r,n,i,s){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&Bf(a,o)){var l=Ga(a,o);a=He(a,a.next),l=He(l,l.next),jr(a,t,r,n,i,s,0),jr(l,t,r,n,i,s,0);return}o=o.next}a=a.next}while(a!==e)}function Rf(e,t,r,n){var i=[],s,a,o,l,f;for(s=0,a=t.length;s<a;s++)o=t[s]*n,l=s<a-1?t[s+1]*n:e.length,f=ja(e,o,l,n,!1),f===f.next&&(f.steiner=!0),i.push(Ff(f));for(i.sort(Nf),s=0;s<i.length;s++)r=Cf(i[s],r);return r}function Nf(e,t){return e.x-t.x}function Cf(e,t){var r=Pf(e,t);if(!r)return t;var n=Ga(r,e);return He(n,n.next),He(r,r.next)}function Pf(e,t){var r=t,n=e.x,i=e.y,s=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=n&&o>s&&(s=o,a=r.x<r.next.x?r:r.next,o===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,h=1/0,u;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&lr(i<c?n:s,i,f,c,i<c?s:n,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(n-r.x),$r(r,e)&&(u<h||u===h&&(r.x>a.x||r.x===a.x&&kf(a,r)))&&(a=r,h=u)),r=r.next;while(r!==l);return a}function kf(e,t){return Pt(e.prev,e,t.prev)<0&&Pt(t.next,e,e.next)<0}function Mf(e,t,r,n){var i=e;do i.z===0&&(i.z=Mi(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Lf(i)}function Lf(e){var t,r,n,i,s,a,o,l,f=1;do{for(r=e,e=null,s=null,a=0;r;){for(a++,n=r,o=0,t=0;t<f&&(o++,n=n.nextZ,!!n);t++);for(l=f;o>0||l>0&&n;)o!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,o--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;r=n}s.nextZ=null,f*=2}while(a>1);return e}function Mi(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Ff(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function lr(e,t,r,n,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(n-o)>=(r-a)*(t-o)&&(r-a)*(s-o)>=(i-a)*(n-o)}function Bf(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Uf(e,t)&&($r(e,t)&&$r(t,e)&&Df(e,t)&&(Pt(e.prev,e,t.prev)||Pt(e,t.prev,t))||gn(e,t)&&Pt(e.prev,e,e.next)>0&&Pt(t.prev,t,t.next)>0)}function Pt(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function gn(e,t){return e.x===t.x&&e.y===t.y}function $a(e,t,r,n){var i=_n(Pt(e,t,r)),s=_n(Pt(e,t,n)),a=_n(Pt(r,n,e)),o=_n(Pt(r,n,t));return!!(i!==s&&a!==o||i===0&&bn(e,r,t)||s===0&&bn(e,n,t)||a===0&&bn(r,e,n)||o===0&&bn(r,t,n))}function bn(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function _n(e){return e>0?1:e<0?-1:0}function Uf(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&$a(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function $r(e,t){return Pt(e.prev,e,e.next)<0?Pt(e,t,e.next)>=0&&Pt(e,e.prev,t)>=0:Pt(e,t,e.prev)<0||Pt(e,e.next,t)<0}function Df(e,t){var r=e,n=!1,i=(e.x+t.x)/2,s=(e.y+t.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Ga(e,t){var r=new Li(e.i,e.x,e.y),n=new Li(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function qa(e,t,r,n){var i=new Li(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Gr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Li(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}mn.deviation=function(e,t,r,n){var i=t&&t.length,s=i?t[0]*r:e.length,a=Math.abs(Fi(e,0,s,r));if(i)for(var o=0,l=t.length;o<l;o++){var f=t[o]*r,c=o<l-1?t[o+1]*r:e.length;a-=Math.abs(Fi(e,f,c,r))}var h=0;for(o=0;o<n.length;o+=3){var u=n[o]*r,d=n[o+1]*r,p=n[o+2]*r;h+=Math.abs((e[u]-e[p])*(e[d+1]-e[u+1])-(e[u]-e[d])*(e[p+1]-e[u+1]))}return a===0&&h===0?0:Math.abs((h-a)/a)};function Fi(e,t,r,n){for(var i=0,s=t,a=r-n;s<r;s+=n)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}mn.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var s=0;s<e[i].length;s++)for(var a=0;a<t;a++)r.vertices.push(e[i][s][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r};var jf=ki.exports;const $f=ir(jf);var xn={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */xn.exports,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof Ne=="object"&&Ne;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,l=36,f=1,c=26,h=38,u=700,d=72,p=128,v="-",g=/^xn--/,m=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=l-f,x=Math.floor,O=String.fromCharCode,T;function E(k){throw new RangeError(_[k])}function N(k,R){for(var P=k.length,L=[];P--;)L[P]=R(k[P]);return L}function A(k,R){var P=k.split("@"),L="";P.length>1&&(L=P[0]+"@",k=P[1]),k=k.replace(b,".");var $=k.split("."),G=N($,R).join(".");return L+G}function w(k){for(var R=[],P=0,L=k.length,$,G;P<L;)$=k.charCodeAt(P++),$>=55296&&$<=56319&&P<L?(G=k.charCodeAt(P++),(G&64512)==56320?R.push((($&1023)<<10)+(G&1023)+65536):(R.push($),P--)):R.push($);return R}function S(k){return N(k,function(R){var P="";return R>65535&&(R-=65536,P+=O(R>>>10&1023|55296),R=56320|R&1023),P+=O(R),P}).join("")}function I(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function C(k,R){return k+22+75*(k<26)-((R!=0)<<5)}function F(k,R,P){var L=0;for(k=P?x(k/u):k>>1,k+=x(k/R);k>y*c>>1;L+=l)k=x(k/y);return x(L+(y+1)*k/(k+h))}function D(k){var R=[],P=k.length,L,$=0,G=p,M=d,B,q,H,z,Y,J,et,at,lt;for(B=k.lastIndexOf(v),B<0&&(B=0),q=0;q<B;++q)k.charCodeAt(q)>=128&&E("not-basic"),R.push(k.charCodeAt(q));for(H=B>0?B+1:0;H<P;){for(z=$,Y=1,J=l;H>=P&&E("invalid-input"),et=I(k.charCodeAt(H++)),(et>=l||et>x((o-$)/Y))&&E("overflow"),$+=et*Y,at=J<=M?f:J>=M+c?c:J-M,!(et<at);J+=l)lt=l-at,Y>x(o/lt)&&E("overflow"),Y*=lt;L=R.length+1,M=F($-z,L,z==0),x($/L)>o-G&&E("overflow"),G+=x($/L),$%=L,R.splice($++,0,G)}return S(R)}function U(k){var R,P,L,$,G,M,B,q,H,z,Y,J=[],et,at,lt,Nt;for(k=w(k),et=k.length,R=p,P=0,G=d,M=0;M<et;++M)Y=k[M],Y<128&&J.push(O(Y));for(L=$=J.length,$&&J.push(v);L<et;){for(B=o,M=0;M<et;++M)Y=k[M],Y>=R&&Y<B&&(B=Y);for(at=L+1,B-R>x((o-P)/at)&&E("overflow"),P+=(B-R)*at,R=B,M=0;M<et;++M)if(Y=k[M],Y<R&&++P>o&&E("overflow"),Y==R){for(q=P,H=l;z=H<=G?f:H>=G+c?c:H-G,!(q<z);H+=l)Nt=q-z,lt=l-z,J.push(O(C(z+Nt%lt,0))),q=x(Nt/lt);J.push(O(C(q,0))),G=F(P,at,L==$),P=0,++L}++P,++R}return J.join("")}function X(k){return A(k,function(R){return g.test(R)?D(R.slice(4).toLowerCase()):R})}function j(k){return A(k,function(R){return m.test(R)?"xn--"+U(R):R})}if(a={version:"1.4.1",ucs2:{decode:w,encode:S},decode:D,encode:U,toASCII:j,toUnicode:X},n&&i)if(e.exports==n)i.exports=a;else for(T in a)a.hasOwnProperty(T)&&(n[T]=a[T]);else r.punycode=a})(Ne)}(xn,xn.exports);var Gf=xn.exports,qf=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0},Ha=typeof Symbol<"u"&&Symbol,Hf=qf,Vf=function(){return typeof Ha!="function"||typeof Symbol!="function"||typeof Ha("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Hf()},Va={foo:{}},zf=Object,Xf=function(){return{__proto__:Va}.foo===Va.foo&&!({__proto__:null}instanceof zf)},Wf="Function.prototype.bind called on incompatible ",Bi=Array.prototype.slice,Yf=Object.prototype.toString,Kf="[object Function]",Zf=function(t){var r=this;if(typeof r!="function"||Yf.call(r)!==Kf)throw new TypeError(Wf+r);for(var n=Bi.call(arguments,1),i,s=function(){if(this instanceof i){var c=r.apply(this,n.concat(Bi.call(arguments)));return Object(c)===c?c:this}else return r.apply(t,n.concat(Bi.call(arguments)))},a=Math.max(0,r.length-n.length),o=[],l=0;l<a;l++)o.push("$"+l);if(i=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var f=function(){};f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i},Qf=Zf,Ui=Function.prototype.bind||Qf,Jf=Ui,tc=Jf.call(Function.call,Object.prototype.hasOwnProperty),pt,ur=SyntaxError,za=Function,fr=TypeError,Di=function(e){try{return za('"use strict"; return ('+e+").constructor;")()}catch{}},Ve=Object.getOwnPropertyDescriptor;if(Ve)try{Ve({},"")}catch{Ve=null}var ji=function(){throw new fr},ec=Ve?function(){try{return arguments.callee,ji}catch{try{return Ve(arguments,"callee").get}catch{return ji}}}():ji,cr=Vf(),rc=Xf(),Dt=Object.getPrototypeOf||(rc?function(e){return e.__proto__}:null),hr={},nc=typeof Uint8Array>"u"||!Dt?pt:Dt(Uint8Array),ze={"%AggregateError%":typeof AggregateError>"u"?pt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pt:ArrayBuffer,"%ArrayIteratorPrototype%":cr&&Dt?Dt([][Symbol.iterator]()):pt,"%AsyncFromSyncIteratorPrototype%":pt,"%AsyncFunction%":hr,"%AsyncGenerator%":hr,"%AsyncGeneratorFunction%":hr,"%AsyncIteratorPrototype%":hr,"%Atomics%":typeof Atomics>"u"?pt:Atomics,"%BigInt%":typeof BigInt>"u"?pt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?pt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pt:FinalizationRegistry,"%Function%":za,"%GeneratorFunction%":hr,"%Int8Array%":typeof Int8Array>"u"?pt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cr&&Dt?Dt(Dt([][Symbol.iterator]())):pt,"%JSON%":typeof JSON=="object"?JSON:pt,"%Map%":typeof Map>"u"?pt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cr||!Dt?pt:Dt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pt:Promise,"%Proxy%":typeof Proxy>"u"?pt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?pt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cr||!Dt?pt:Dt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cr&&Dt?Dt(""[Symbol.iterator]()):pt,"%Symbol%":cr?Symbol:pt,"%SyntaxError%":ur,"%ThrowTypeError%":ec,"%TypedArray%":nc,"%TypeError%":fr,"%Uint8Array%":typeof Uint8Array>"u"?pt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?pt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pt:WeakSet};if(Dt)try{null.error}catch(e){var ic=Dt(Dt(e));ze["%Error.prototype%"]=ic}var sc=function e(t){var r;if(t==="%AsyncFunction%")r=Di("async function () {}");else if(t==="%GeneratorFunction%")r=Di("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Di("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Dt&&(r=Dt(i.prototype))}return ze[t]=r,r},Xa={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},qr=Ui,En=tc,ac=qr.call(Function.call,Array.prototype.concat),oc=qr.call(Function.apply,Array.prototype.splice),Wa=qr.call(Function.call,String.prototype.replace),Tn=qr.call(Function.call,String.prototype.slice),lc=qr.call(Function.call,RegExp.prototype.exec),uc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fc=/\\(\\)?/g,cc=function(t){var r=Tn(t,0,1),n=Tn(t,-1);if(r==="%"&&n!=="%")throw new ur("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ur("invalid intrinsic syntax, expected opening `%`");var i=[];return Wa(t,uc,function(s,a,o,l){i[i.length]=o?Wa(l,fc,"$1"):a||s}),i},hc=function(t,r){var n=t,i;if(En(Xa,n)&&(i=Xa[n],n="%"+i[0]+"%"),En(ze,n)){var s=ze[n];if(s===hr&&(s=sc(n)),typeof s>"u"&&!r)throw new fr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new ur("intrinsic "+t+" does not exist!")},$i=function(t,r){if(typeof t!="string"||t.length===0)throw new fr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new fr('"allowMissing" argument must be a boolean');if(lc(/^%?[^%]*%?$/,t)===null)throw new ur("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cc(t),i=n.length>0?n[0]:"",s=hc("%"+i+"%",r),a=s.name,o=s.value,l=!1,f=s.alias;f&&(i=f[0],oc(n,ac([0,1],f)));for(var c=1,h=!0;c<n.length;c+=1){var u=n[c],d=Tn(u,0,1),p=Tn(u,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new ur("property names with quotes must have matching quotes");if((u==="constructor"||!h)&&(l=!0),i+="."+u,a="%"+i+"%",En(ze,a))o=ze[a];else if(o!=null){if(!(u in o)){if(!r)throw new fr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ve&&c+1>=n.length){var v=Ve(o,u);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[u]}else h=En(o,u),o=o[u];h&&!l&&(ze[a]=o)}}return o},Ya={exports:{}};(function(e){var t=Ui,r=$i,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||t.call(i,n),a=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}e.exports=function(h){var u=s(t,i,arguments);if(a&&o){var d=a(u,"length");d.configurable&&o(u,"length",{value:1+l(0,h.length-(arguments.length-1))})}return u};var f=function(){return s(t,n,arguments)};o?o(e.exports,"apply",{value:f}):e.exports.apply=f})(Ya);var dc=Ya.exports,Ka=$i,Za=dc,pc=Za(Ka("String.prototype.indexOf")),vc=function(t,r){var n=Ka(t,!!r);return typeof n=="function"&&pc(t,".prototype.")>-1?Za(n):n};const yc=yf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Gi=typeof Map=="function"&&Map.prototype,qi=Object.getOwnPropertyDescriptor&&Gi?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wn=Gi&&qi&&typeof qi.get=="function"?qi.get:null,Qa=Gi&&Map.prototype.forEach,Hi=typeof Set=="function"&&Set.prototype,Vi=Object.getOwnPropertyDescriptor&&Hi?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,An=Hi&&Vi&&typeof Vi.get=="function"?Vi.get:null,Ja=Hi&&Set.prototype.forEach,mc=typeof WeakMap=="function"&&WeakMap.prototype,Hr=mc?WeakMap.prototype.has:null,gc=typeof WeakSet=="function"&&WeakSet.prototype,Vr=gc?WeakSet.prototype.has:null,bc=typeof WeakRef=="function"&&WeakRef.prototype,to=bc?WeakRef.prototype.deref:null,_c=Boolean.prototype.valueOf,xc=Object.prototype.toString,Ec=Function.prototype.toString,Tc=String.prototype.match,zi=String.prototype.slice,ke=String.prototype.replace,wc=String.prototype.toUpperCase,eo=String.prototype.toLowerCase,ro=RegExp.prototype.test,no=Array.prototype.concat,pe=Array.prototype.join,Ac=Array.prototype.slice,io=Math.floor,Xi=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Wi=Object.getOwnPropertySymbols,Yi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,dr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ht=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===dr||"symbol")?Symbol.toStringTag:null,so=Object.prototype.propertyIsEnumerable,ao=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function oo(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||ro.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-io(-e):io(e);if(n!==e){var i=String(n),s=zi.call(t,i.length+1);return ke.call(i,r,"$&_")+"."+ke.call(ke.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ke.call(t,r,"$&_")}var Ki=yc,lo=Ki.custom,uo=ho(lo)?lo:null,Sc=function e(t,r,n,i){var s=r||{};if(Me(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Me(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Me(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Me(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Me(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return vo(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return o?oo(t,l):l}if(typeof t=="bigint"){var f=String(t)+"n";return o?oo(t,f):f}var c=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof t=="object")return Zi(t)?"[Array]":"[Object]";var h=Hc(s,n);if(typeof i>"u")i=[];else if(po(i,t)>=0)return"[Circular]";function u(I,C,F){if(C&&(i=Ac.call(i),i.push(C)),F){var D={depth:s.depth};return Me(s,"quoteStyle")&&(D.quoteStyle=s.quoteStyle),e(I,D,n+1,i)}return e(I,s,n+1,i)}if(typeof t=="function"&&!co(t)){var d=Lc(t),p=Sn(t,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+pe.call(p,", ")+" }":"")}if(ho(t)){var v=dr?ke.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Yi.call(t);return typeof t=="object"&&!dr?zr(v):v}if($c(t)){for(var g="<"+eo.call(String(t.nodeName)),m=t.attributes||[],b=0;b<m.length;b++)g+=" "+m[b].name+"="+fo(Oc(m[b].value),"double",s);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+eo.call(String(t.nodeName))+">",g}if(Zi(t)){if(t.length===0)return"[]";var _=Sn(t,u);return h&&!qc(_)?"["+Ji(_,h)+"]":"[ "+pe.call(_,", ")+" ]"}if(Rc(t)){var y=Sn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!so.call(t,"cause")?"{ ["+String(t)+"] "+pe.call(no.call("[cause]: "+u(t.cause),y),", ")+" }":y.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+pe.call(y,", ")+" }"}if(typeof t=="object"&&a){if(uo&&typeof t[uo]=="function"&&Ki)return Ki(t,{depth:c-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Fc(t)){var x=[];return Qa&&Qa.call(t,function(I,C){x.push(u(C,t,!0)+" => "+u(I,t))}),yo("Map",wn.call(t),x,h)}if(Dc(t)){var O=[];return Ja&&Ja.call(t,function(I){O.push(u(I,t))}),yo("Set",An.call(t),O,h)}if(Bc(t))return Qi("WeakMap");if(jc(t))return Qi("WeakSet");if(Uc(t))return Qi("WeakRef");if(Cc(t))return zr(u(Number(t)));if(kc(t))return zr(u(Xi.call(t)));if(Pc(t))return zr(_c.call(t));if(Nc(t))return zr(u(String(t)));if(!Ic(t)&&!co(t)){var T=Sn(t,u),E=ao?ao(t)===Object.prototype:t instanceof Object||t.constructor===Object,N=t instanceof Object?"":"null prototype",A=!E&&Ht&&Object(t)===t&&Ht in t?zi.call(Le(t),8,-1):N?"Object":"",w=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",S=w+(A||N?"["+pe.call(no.call([],A||[],N||[]),": ")+"] ":"");return T.length===0?S+"{}":h?S+"{"+Ji(T,h)+"}":S+"{ "+pe.call(T,", ")+" }"}return String(t)};function fo(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function Oc(e){return ke.call(String(e),/"/g,"&quot;")}function Zi(e){return Le(e)==="[object Array]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function Ic(e){return Le(e)==="[object Date]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function co(e){return Le(e)==="[object RegExp]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function Rc(e){return Le(e)==="[object Error]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function Nc(e){return Le(e)==="[object String]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function Cc(e){return Le(e)==="[object Number]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function Pc(e){return Le(e)==="[object Boolean]"&&(!Ht||!(typeof e=="object"&&Ht in e))}function ho(e){if(dr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Yi)return!1;try{return Yi.call(e),!0}catch{}return!1}function kc(e){if(!e||typeof e!="object"||!Xi)return!1;try{return Xi.call(e),!0}catch{}return!1}var Mc=Object.prototype.hasOwnProperty||function(e){return e in this};function Me(e,t){return Mc.call(e,t)}function Le(e){return xc.call(e)}function Lc(e){if(e.name)return e.name;var t=Tc.call(Ec.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function po(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Fc(e){if(!wn||!e||typeof e!="object")return!1;try{wn.call(e);try{An.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Bc(e){if(!Hr||!e||typeof e!="object")return!1;try{Hr.call(e,Hr);try{Vr.call(e,Vr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Uc(e){if(!to||!e||typeof e!="object")return!1;try{return to.call(e),!0}catch{}return!1}function Dc(e){if(!An||!e||typeof e!="object")return!1;try{An.call(e);try{wn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function jc(e){if(!Vr||!e||typeof e!="object")return!1;try{Vr.call(e,Vr);try{Hr.call(e,Hr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function $c(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function vo(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return vo(zi.call(e,0,t.maxStringLength),t)+n}var i=ke.call(ke.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Gc);return fo(i,"single",t)}function Gc(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+wc.call(t.toString(16))}function zr(e){return"Object("+e+")"}function Qi(e){return e+" { ? }"}function yo(e,t,r,n){var i=n?Ji(r,n):pe.call(r,", ");return e+" ("+t+") {"+i+"}"}function qc(e){for(var t=0;t<e.length;t++)if(po(e[t],`
10
+ `)>=0)return!1;return!0}function Hc(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=pe.call(Array(e.indent+1)," ");else return null;return{base:r,prev:pe.call(Array(t+1),r)}}function Ji(e,t){if(e.length===0)return"";var r=`
11
+ `+t.prev+t.base;return r+pe.call(e,","+r)+`
12
+ `+t.prev}function Sn(e,t){var r=Zi(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Me(e,i)?t(e[i],e):""}var s=typeof Wi=="function"?Wi(e):[],a;if(dr){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var l in e)Me(e,l)&&(r&&String(Number(l))===l&&l<e.length||dr&&a["$"+l]instanceof Symbol||(ro.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof Wi=="function")for(var f=0;f<s.length;f++)so.call(e,s[f])&&n.push("["+t(s[f])+"]: "+t(e[s[f]],e));return n}var ts=$i,pr=vc,Vc=Sc,zc=ts("%TypeError%"),On=ts("%WeakMap%",!0),In=ts("%Map%",!0),Xc=pr("WeakMap.prototype.get",!0),Wc=pr("WeakMap.prototype.set",!0),Yc=pr("WeakMap.prototype.has",!0),Kc=pr("Map.prototype.get",!0),Zc=pr("Map.prototype.set",!0),Qc=pr("Map.prototype.has",!0),es=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},Jc=function(e,t){var r=es(e,t);return r&&r.value},th=function(e,t,r){var n=es(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},eh=function(e,t){return!!es(e,t)},rh=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new zc("Side channel does not contain "+Vc(s))},get:function(s){if(On&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Xc(t,s)}else if(In){if(r)return Kc(r,s)}else if(n)return Jc(n,s)},has:function(s){if(On&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Yc(t,s)}else if(In){if(r)return Qc(r,s)}else if(n)return eh(n,s);return!1},set:function(s,a){On&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new On),Wc(t,s,a)):In?(r||(r=new In),Zc(r,s,a)):(n||(n={key:{},next:null}),th(n,s,a))}};return i},nh=String.prototype.replace,ih=/%20/g,rs={RFC1738:"RFC1738",RFC3986:"RFC3986"},ns={default:rs.RFC3986,formatters:{RFC1738:function(e){return nh.call(e,ih,"+")},RFC3986:function(e){return String(e)}},RFC1738:rs.RFC1738,RFC3986:rs.RFC3986},sh=ns,is=Object.prototype.hasOwnProperty,Xe=Array.isArray,ve=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),ah=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Xe(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},mo=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},oh=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(Xe(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!is.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return Xe(t)&&!Xe(r)&&(i=mo(t,n)),Xe(t)&&Xe(r)?(r.forEach(function(s,a){if(is.call(t,a)){var o=t[a];o&&typeof o=="object"&&s&&typeof s=="object"?t[a]=e(o,s,n):t.push(s)}else t[a]=s}),t):Object.keys(r).reduce(function(s,a){var o=r[a];return is.call(s,a)?s[a]=e(s[a],o,n):s[a]=o,s},i)},lh=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},uh=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},fh=function(t,r,n,i,s){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var o="",l=0;l<a.length;++l){var f=a.charCodeAt(l);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===sh.RFC1738&&(f===40||f===41)){o+=a.charAt(l);continue}if(f<128){o=o+ve[f];continue}if(f<2048){o=o+(ve[192|f>>6]+ve[128|f&63]);continue}if(f<55296||f>=57344){o=o+(ve[224|f>>12]+ve[128|f>>6&63]+ve[128|f&63]);continue}l+=1,f=65536+((f&1023)<<10|a.charCodeAt(l)&1023),o+=ve[240|f>>18]+ve[128|f>>12&63]+ve[128|f>>6&63]+ve[128|f&63]}return o},ch=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],a=s.obj[s.prop],o=Object.keys(a),l=0;l<o.length;++l){var f=o[l],c=a[f];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:a,prop:f}),n.push(c))}return ah(r),t},hh=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},dh=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},ph=function(t,r){return[].concat(t,r)},vh=function(t,r){if(Xe(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},go={arrayToObject:mo,assign:lh,combine:ph,compact:ch,decode:uh,encode:fh,isBuffer:dh,isRegExp:hh,maybeMap:vh,merge:oh},bo=rh,Rn=go,Xr=ns,yh=Object.prototype.hasOwnProperty,_o={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Te=Array.isArray,mh=Array.prototype.push,xo=function(e,t){mh.apply(e,Te(t)?t:[t])},gh=Date.prototype.toISOString,Eo=Xr.default,Vt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Rn.encode,encodeValuesOnly:!1,format:Eo,formatter:Xr.formatters[Eo],indices:!1,serializeDate:function(t){return gh.call(t)},skipNulls:!1,strictNullHandling:!1},bh=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},ss={},_h=function e(t,r,n,i,s,a,o,l,f,c,h,u,d,p,v,g){for(var m=t,b=g,_=0,y=!1;(b=b.get(ss))!==void 0&&!y;){var x=b.get(t);if(_+=1,typeof x<"u"){if(x===_)throw new RangeError("Cyclic object value");y=!0}typeof b.get(ss)>"u"&&(_=0)}if(typeof l=="function"?m=l(r,m):m instanceof Date?m=h(m):n==="comma"&&Te(m)&&(m=Rn.maybeMap(m,function(D){return D instanceof Date?h(D):D})),m===null){if(s)return o&&!p?o(r,Vt.encoder,v,"key",u):r;m=""}if(bh(m)||Rn.isBuffer(m)){if(o){var O=p?r:o(r,Vt.encoder,v,"key",u);return[d(O)+"="+d(o(m,Vt.encoder,v,"value",u))]}return[d(r)+"="+d(String(m))]}var T=[];if(typeof m>"u")return T;var E;if(n==="comma"&&Te(m))p&&o&&(m=Rn.maybeMap(m,o)),E=[{value:m.length>0?m.join(",")||null:void 0}];else if(Te(l))E=l;else{var N=Object.keys(m);E=f?N.sort(f):N}for(var A=i&&Te(m)&&m.length===1?r+"[]":r,w=0;w<E.length;++w){var S=E[w],I=typeof S=="object"&&typeof S.value<"u"?S.value:m[S];if(!(a&&I===null)){var C=Te(m)?typeof n=="function"?n(A,S):A:A+(c?"."+S:"["+S+"]");g.set(t,_);var F=bo();F.set(ss,g),xo(T,e(I,C,n,i,s,a,n==="comma"&&p&&Te(m)?null:o,l,f,c,h,u,d,p,v,F))}}return T},xh=function(t){if(!t)return Vt;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Vt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Xr.default;if(typeof t.format<"u"){if(!yh.call(Xr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=Xr.formatters[n],s=Vt.filter;return(typeof t.filter=="function"||Te(t.filter))&&(s=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Vt.addQueryPrefix,allowDots:typeof t.allowDots>"u"?Vt.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Vt.charsetSentinel,delimiter:typeof t.delimiter>"u"?Vt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Vt.encode,encoder:typeof t.encoder=="function"?t.encoder:Vt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Vt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Vt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Vt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Vt.strictNullHandling}},Eh=function(e,t){var r=e,n=xh(t),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Te(n.filter)&&(s=n.filter,i=s);var a=[];if(typeof r!="object"||r===null)return"";var o;t&&t.arrayFormat in _o?o=t.arrayFormat:t&&"indices"in t?o=t.indices?"indices":"repeat":o="indices";var l=_o[o];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=l==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=bo(),h=0;h<i.length;++h){var u=i[h];n.skipNulls&&r[u]===null||xo(a,_h(r[u],u,l,f,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var d=a.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},vr=go,as=Object.prototype.hasOwnProperty,Th=Array.isArray,jt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:vr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},wh=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},To=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Ah="utf8=%26%2310003%3B",Sh="utf8=%E2%9C%93",Oh=function(t,r){var n={__proto__:null},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,s=r.parameterLimit===1/0?void 0:r.parameterLimit,a=i.split(r.delimiter,s),o=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<a.length;++l)a[l].indexOf("utf8=")===0&&(a[l]===Sh?f="utf-8":a[l]===Ah&&(f="iso-8859-1"),o=l,l=a.length);for(l=0;l<a.length;++l)if(l!==o){var c=a[l],h=c.indexOf("]="),u=h===-1?c.indexOf("="):h+1,d,p;u===-1?(d=r.decoder(c,jt.decoder,f,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(c.slice(0,u),jt.decoder,f,"key"),p=vr.maybeMap(To(c.slice(u+1),r),function(v){return r.decoder(v,jt.decoder,f,"value")})),p&&r.interpretNumericEntities&&f==="iso-8859-1"&&(p=wh(p)),c.indexOf("[]=")>-1&&(p=Th(p)?[p]:p),as.call(n,d)?n[d]=vr.combine(n[d],p):n[d]=p}return n},Ih=function(e,t,r,n){for(var i=n?t:To(t,r),s=e.length-1;s>=0;--s){var a,o=e[s];if(o==="[]"&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var l=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,f=parseInt(l,10);!r.parseArrays&&l===""?a={0:i}:!isNaN(f)&&o!==l&&String(f)===l&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(a=[],a[f]=i):l!=="__proto__"&&(a[l]=i)}i=a}return i},Rh=function(t,r,n,i){if(t){var s=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,l=n.depth>0&&a.exec(s),f=l?s.slice(0,l.index):s,c=[];if(f){if(!n.plainObjects&&as.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var h=0;n.depth>0&&(l=o.exec(s))!==null&&h<n.depth;){if(h+=1,!n.plainObjects&&as.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),Ih(c,r,n,i)}},Nh=function(t){if(!t)return jt;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?jt.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?jt.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:jt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:jt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:jt.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:jt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:jt.comma,decoder:typeof t.decoder=="function"?t.decoder:jt.decoder,delimiter:typeof t.delimiter=="string"||vr.isRegExp(t.delimiter)?t.delimiter:jt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:jt.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:jt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:jt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:jt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:jt.strictNullHandling}},Ch=function(e,t){var r=Nh(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?Oh(e,r):e,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),a=0;a<s.length;++a){var o=s[a],l=Rh(o,n[o],r,typeof e=="string");i=vr.merge(i,l,r)}return r.allowSparse===!0?i:vr.compact(i)},Ph=Eh,kh=Ch,Mh=ns,Lh={formats:Mh,parse:kh,stringify:Ph},Fh=Gf;function ee(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Bh=/^([a-z0-9.+-]+:)/i,Uh=/:[0-9]*$/,Dh=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,jh=["<",">",'"',"`"," ","\r",`
13
+ `," "],$h=["{","}","|","\\","^","`"].concat(jh),os=["'"].concat($h),wo=["%","/","?",";","#"].concat(os),Ao=["/","?","#"],Gh=255,So=/^[+a-z0-9A-Z_-]{0,63}$/,qh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Hh={javascript:!0,"javascript:":!0},ls={javascript:!0,"javascript:":!0},yr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},us=Lh;function Nn(e,t,r){if(e&&typeof e=="object"&&e instanceof ee)return e;var n=new ee;return n.parse(e,t,r),n}ee.prototype.parse=function(e,t,r){if(typeof e!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=n!==-1&&n<e.indexOf("#")?"?":"#",s=e.split(i),a=/\\/g;s[0]=s[0].replace(a,"/"),e=s.join(i);var o=e;if(o=o.trim(),!r&&e.split("#").length===1){var l=Dh.exec(o);if(l)return this.path=o,this.href=o,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=us.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var f=Bh.exec(o);if(f){f=f[0];var c=f.toLowerCase();this.protocol=c,o=o.substr(f.length)}if(r||f||o.match(/^\/\/[^@/]+@[^@/]+/)){var h=o.substr(0,2)==="//";h&&!(f&&ls[f])&&(o=o.substr(2),this.slashes=!0)}if(!ls[f]&&(h||f&&!yr[f])){for(var u=-1,d=0;d<Ao.length;d++){var p=o.indexOf(Ao[d]);p!==-1&&(u===-1||p<u)&&(u=p)}var v,g;u===-1?g=o.lastIndexOf("@"):g=o.lastIndexOf("@",u),g!==-1&&(v=o.slice(0,g),o=o.slice(g+1),this.auth=decodeURIComponent(v)),u=-1;for(var d=0;d<wo.length;d++){var p=o.indexOf(wo[d]);p!==-1&&(u===-1||p<u)&&(u=p)}u===-1&&(u=o.length),this.host=o.slice(0,u),o=o.slice(u),this.parseHost(),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m)for(var b=this.hostname.split(/\./),d=0,_=b.length;d<_;d++){var y=b[d];if(y&&!y.match(So)){for(var x="",O=0,T=y.length;O<T;O++)y.charCodeAt(O)>127?x+="x":x+=y[O];if(!x.match(So)){var E=b.slice(0,d),N=b.slice(d+1),A=y.match(qh);A&&(E.push(A[1]),N.unshift(A[2])),N.length&&(o="/"+N.join(".")+o),this.hostname=E.join(".");break}}}this.hostname.length>Gh?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=Fh.toASCII(this.hostname));var w=this.port?":"+this.port:"",S=this.hostname||"";this.host=S+w,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!Hh[c])for(var d=0,_=os.length;d<_;d++){var I=os[d];if(o.indexOf(I)!==-1){var C=encodeURIComponent(I);C===I&&(C=escape(I)),o=o.split(I).join(C)}}var F=o.indexOf("#");F!==-1&&(this.hash=o.substr(F),o=o.slice(0,F));var D=o.indexOf("?");if(D!==-1?(this.search=o.substr(D),this.query=o.substr(D+1),t&&(this.query=us.parse(this.query)),o=o.slice(0,D)):t&&(this.search="",this.query={}),o&&(this.pathname=o),yr[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var w=this.pathname||"",U=this.search||"";this.path=w+U}return this.href=this.format(),this};function Vh(e){return typeof e=="string"&&(e=Nn(e)),e instanceof ee?e.format():ee.prototype.format.call(e)}ee.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=us.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||yr[t])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),t+i+r+a+n};function zh(e,t){return Nn(e,!1,!0).resolve(t)}ee.prototype.resolve=function(e){return this.resolveObject(Nn(e,!1,!0)).format()},ee.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new ee;t.parse(e,!1,!0),e=t}for(var r=new ee,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,e.href==="")return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),o=0;o<a.length;o++){var l=a[o];l!=="protocol"&&(r[l]=e[l])}return yr[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!yr[e.protocol]){for(var f=Object.keys(e),c=0;c<f.length;c++){var h=f[c];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!ls[e.protocol]){for(var _=(e.pathname||"").split("/");_.length&&!(e.host=_.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),_[0]!==""&&_.unshift(""),_.length<2&&_.unshift(""),r.pathname=_.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var u=r.pathname||"",d=r.search||"";r.path=u+d}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var p=r.pathname&&r.pathname.charAt(0)==="/",v=e.host||e.pathname&&e.pathname.charAt(0)==="/",g=v||p||r.host&&e.pathname,m=g,b=r.pathname&&r.pathname.split("/")||[],_=e.pathname&&e.pathname.split("/")||[],y=r.protocol&&!yr[r.protocol];if(y&&(r.hostname="",r.port=null,r.host&&(b[0]===""?b[0]=r.host:b.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(_[0]===""?_[0]=e.host:_.unshift(e.host)),e.host=null),g=g&&(_[0]===""||b[0]==="")),v)r.host=e.host||e.host===""?e.host:r.host,r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname,r.search=e.search,r.query=e.query,b=_;else if(_.length)b||(b=[]),b.pop(),b=b.concat(_),r.search=e.search,r.query=e.query;else if(e.search!=null){if(y){r.host=b.shift(),r.hostname=r.host;var x=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;x&&(r.auth=x.shift(),r.hostname=x.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=b.slice(-1)[0],T=(r.host||e.host||b.length>1)&&(O==="."||O==="..")||O==="",E=0,N=b.length;N>=0;N--)O=b[N],O==="."?b.splice(N,1):O===".."?(b.splice(N,1),E++):E&&(b.splice(N,1),E--);if(!g&&!m)for(;E--;E)b.unshift("..");g&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),T&&b.join("/").substr(-1)!=="/"&&b.push("");var A=b[0]===""||b[0]&&b[0].charAt(0)==="/";if(y){r.hostname=A?"":b.length?b.shift():"",r.host=r.hostname;var x=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;x&&(r.auth=x.shift(),r.hostname=x.shift(),r.host=r.hostname)}return g=g||r.host&&b.length,g&&!A&&b.unshift(""),b.length>0?r.pathname=b.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},ee.prototype.parseHost=function(){var e=this.host,t=Uh.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Xh=Nn,Wh=zh,Yh=Vh;const Kh={parse:Xh,format:Yh,resolve:Wh},Oo={};function Tt(e,t,r=3){if(Oo[t])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
14
+ Deprecated since v${e}`):(n=n.split(`
7
15
  `).splice(r).join(`
8
- `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
9
- Deprecated since v${t}`),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
10
- Deprecated since v${t}`),console.warn(n))),Aa[e]=!0}let co;var kh={grad:.9,turn:360,rad:360/(2*Math.PI)},Et=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Pe=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},Ye=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},Oa=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},Sa=function(t){return{r:Ye(t.r,0,255),g:Ye(t.g,0,255),b:Ye(t.b,0,255),a:Ye(t.a)}},ho=function(t){return{r:Pe(t.r),g:Pe(t.g),b:Pe(t.b),a:Pe(t.a,3)}},Ch=/^#([0-9a-f]{3,8})$/i,Cn=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Na=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,o=Math.max(e,r,n),s=o-Math.min(e,r,n),u=s?o===e?(r-n)/s:o===r?2+(n-e)/s:4+(e-r)/s:0;return{h:60*(u<0?u+6:u),s:o?s/o*100:0,v:o/255*100,a:i}},ka=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var o=Math.floor(e),s=n*(1-r),u=n*(1-(e-o)*r),p=n*(1-(1-e+o)*r),d=o%6;return{r:255*[n,u,s,s,p,n][d],g:255*[p,n,n,u,s,s][d],b:255*[s,s,p,n,n,u][d],a:i}},Ca=function(t){return{h:Oa(t.h),s:Ye(t.s,0,100),l:Ye(t.l,0,100),a:Ye(t.a)}},Ra=function(t){return{h:Pe(t.h),s:Pe(t.s),l:Pe(t.l),a:Pe(t.a,3)}},Ia=function(t){return ka((r=(e=t).s,{h:e.h,s:(r*=((n=e.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:e.a}));var e,r,n},Yr=function(t){return{h:(e=Na(t)).h,s:(i=(200-(r=e.s))*(n=e.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,n,i},Rh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ih=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ph=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fo={string:[[function(t){var e=Ch.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Pe(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Pe(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=Ph.exec(t)||Mh.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:Sa({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=Rh.exec(t)||Ih.exec(t);if(!e)return null;var r,n,i=Ca({h:(r=e[1],n=e[2],n===void 0&&(n="deg"),Number(r)*(kh[n]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Ia(i)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,n=t.b,i=t.a,o=i===void 0?1:i;return Et(e)&&Et(r)&&Et(n)?Sa({r:Number(e),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,n=t.l,i=t.a,o=i===void 0?1:i;if(!Et(e)||!Et(r)||!Et(n))return null;var s=Ca({h:Number(e),s:Number(r),l:Number(n),a:Number(o)});return Ia(s)},"hsl"],[function(t){var e=t.h,r=t.s,n=t.v,i=t.a,o=i===void 0?1:i;if(!Et(e)||!Et(r)||!Et(n))return null;var s=function(u){return{h:Oa(u.h),s:Ye(u.s,0,100),v:Ye(u.v,0,100),a:Ye(u.a)}}({h:Number(e),s:Number(r),v:Number(n),a:Number(o)});return ka(s)},"hsv"]]},Pa=function(t,e){for(var r=0;r<e.length;r++){var n=e[r][0](t);if(n)return[n,e[r][1]]}return[null,void 0]},po=function(t,e){var r=Yr(t);return{h:r.h,s:Ye(r.s+100*e,0,100),l:r.l,a:r.a}},yo=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},Ma=function(t,e){var r=Yr(t);return{h:r.h,s:r.s,l:Ye(r.l+100*e,0,100),a:r.a}},mo=function(){function t(e){this.parsed=function(r){return typeof r=="string"?Pa(r.trim(),fo.string):typeof r=="object"&&r!==null?Pa(r,fo.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return Pe(yo(this.rgba),2)},t.prototype.isDark=function(){return yo(this.rgba)<.5},t.prototype.isLight=function(){return yo(this.rgba)>=.5},t.prototype.toHex=function(){return r=(e=ho(this.rgba)).r,n=e.g,i=e.b,s=(o=e.a)<1?Cn(Pe(255*o)):"","#"+Cn(r)+Cn(n)+Cn(i)+s;var e,r,n,i,o,s},t.prototype.toRgb=function(){return ho(this.rgba)},t.prototype.toRgbString=function(){return r=(e=ho(this.rgba)).r,n=e.g,i=e.b,(o=e.a)<1?"rgba("+r+", "+n+", "+i+", "+o+")":"rgb("+r+", "+n+", "+i+")";var e,r,n,i,o},t.prototype.toHsl=function(){return Ra(Yr(this.rgba))},t.prototype.toHslString=function(){return r=(e=Ra(Yr(this.rgba))).h,n=e.s,i=e.l,(o=e.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+o+")":"hsl("+r+", "+n+"%, "+i+"%)";var e,r,n,i,o},t.prototype.toHsv=function(){return e=Na(this.rgba),{h:Pe(e.h),s:Pe(e.s),v:Pe(e.v),a:Pe(e.a,3)};var e},t.prototype.invert=function(){return pt({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),pt(po(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),pt(po(this.rgba,-e))},t.prototype.grayscale=function(){return pt(po(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),pt(Ma(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),pt(Ma(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?pt({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):Pe(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=Yr(this.rgba);return typeof e=="number"?pt({h:e,s:r.s,l:r.l,a:r.a}):Pe(r.h)},t.prototype.isEqual=function(e){return this.toHex()===pt(e).toHex()},t}(),pt=function(t){return t instanceof mo?t:new mo(t)},La=[];(function(t){t.forEach(function(e){La.indexOf(e)<0&&(e(mo,fo),La.push(e))})})([function(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in r)n[r[i]]=i;var o={};t.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var u,p,d=n[this.toHex()];if(d)return d;if(s!=null&&s.closest){var y=this.toRgb(),f=1/0,l="black";if(!o.length)for(var c in r)o[c]=new t(r[c]).toRgb();for(var a in r){var h=(u=y,p=o[a],Math.pow(u.r-p.r,2)+Math.pow(u.g-p.g,2)+Math.pow(u.b-p.b,2));h<f&&(f=h,l=a)}return l}},e.string.push([function(s){var u=s.toLowerCase(),p=u==="transparent"?"#0000":r[u];return p?new t(p).toRgb():null},"name"])}]);const mr=class{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof mr)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set PIXI.Color#value to null");this._value!==null&&this.isSourceEqual(this._value,t)||(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if(r==="number"||r==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every((n,i)=>n===e[i]);if(t!==null&&e!==null){const n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every(o=>t[o]===e[o])}return t===e}toRgba(){const[t,e,r,n]=this._components;return{r:t,g:e,b:r,a:n}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,n]=this._components;return(t=t??[])[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*n),t}toRgbArray(t){t=t??[];const[e,r,n]=this._components;return t[0]=e,t[1]=r,t[2]=n,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(t){const[e,r,n,i]=mr.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=n,this._components[3]*=i,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t){if(t===1)return(255*t<<24)+this._int;if(t===0)return 0;let e=this._int>>16&255,r=this._int>>8&255,n=255&this._int;return e=e*t+.5|0,r=r*t+.5|0,n=n*t+.5|0,(255*t<<24)+(e<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,n]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(n*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,n,i]=this._components;return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}normalize(t){let e;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215)e=[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255,1];else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4){t=this._clamp(t);const[r,n,i,o=1]=t;e=[r,n,i,o]}else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4){t=this._clamp(t,0,255);const[r,n,i,o=255]=t;e=[r/255,n/255,i/255,o/255]}else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const n=mr.HEX_PATTERN.exec(t);n&&(t=`#${n[2]}`)}const r=pt(t);if(r.isValid()){const{r:n,g:i,b:o,a:s}=r.rgba;e=[n/255,i/255,o/255,s]}}if(!e)throw new Error(`Unable to convert color ${t}`);this._components.set(e),this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((n,i)=>{t[i]=Math.min(Math.max(n,e),r)}),t)}};let qe=mr;qe.shared=new mr,qe.temp=new mr,qe.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;const Lh=function(){const t=[],e=[];for(let n=0;n<32;n++)t[n]=n,e[n]=n;t[ee.NORMAL_NPM]=ee.NORMAL,t[ee.ADD_NPM]=ee.ADD,t[ee.SCREEN_NPM]=ee.SCREEN,e[ee.NORMAL]=ee.NORMAL_NPM,e[ee.ADD]=ee.ADD_NPM,e[ee.SCREEN]=ee.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}();function ja(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function Rn(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Fa(t){return!(t&t-1||!t)}function Ba(t){let e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,r=((t>>>=r)>15?1:0)<<2,e|=r,r=((t>>>=r)>3?1:0)<<1,e|=r,e|(t>>>=r)>>1}function In(t,e,r){const n=t.length;let i;if(e>=n||r===0)return;const o=n-(r=e+r>n?n-e:r);for(i=e;i<o;++i)t[i]=t[i+r];t.length=o}let jh=0;function Kr(){return++jh}const Da={},yt=Object.create(null),Pt=Object.create(null);let Pn;function Fh(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location,Pn||(Pn=document.createElement("a")),Pn.href=t;const r=Nh.parse(Pn.href),n=!r.port&&e.port===""||r.port===e.port;return r.hostname===e.hostname&&n&&r.protocol===e.protocol?"":"anonymous"}function Ua(t,e=1){var n;const r=(n=ue.RETINA_PREFIX)==null?void 0:n.exec(t);return r?parseFloat(r[1]):e}var ae=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(ae||{});const go=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t!="object")throw new Error("Invalid extension type");return typeof(t={...t}).type=="string"&&(t.type=[t.type]),t},qa=(t,e)=>go(t).priority??e,me={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(go).forEach(e=>{e.type.forEach(r=>{var n,i;return(i=(n=this._removeHandlers)[r])==null?void 0:i.call(n,e)})}),this},add(...t){return t.map(go).forEach(e=>{e.type.forEach(r=>{const n=this._addHandlers,i=this._queue;n[r]?n[r](e):(i[r]=i[r]||[],i[r].push(e))})}),this},handle(t,e,r){const n=this._addHandlers,i=this._removeHandlers;if(n[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);n[t]=e,i[t]=r;const o=this._queue;return o[t]&&(o[t].forEach(s=>e(s)),delete o[t]),this},handleByMap(t,e){return this.handle(t,r=>{e[r.name]=r.ref},r=>{delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,n=>{e.includes(n.ref)||(e.push(n.ref),e.sort((i,o)=>qa(o,r)-qa(i,r)))},n=>{const i=e.indexOf(n.ref);i!==-1&&e.splice(i,1)})}};class Bh{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const Dh=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
11
- `);function Uh(t){let e="";for(let r=0;r<t;++r)r>0&&(e+=`
12
- else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}let Mn=class tc{constructor(){this.data=0,this.blendMode=ee.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(e){!!(1&this.data)!==e&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(e){!!(2&this.data)!==e&&(this.data^=2)}get culling(){return!!(4&this.data)}set culling(e){!!(4&this.data)!==e&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(e){!!(8&this.data)!==e&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(e){!!(32&this.data)!==e&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(e){!!(16&this.data)!==e&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==ee.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new tc;return e.depthTest=!1,e.blend=!0,e}};const vo=[];function Ga(t,e){if(!t)return null;let r="";if(typeof t=="string"){const n=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);n&&(r=n[1].toLowerCase())}for(let n=vo.length-1;n>=0;--n){const i=vo[n];if(i.test&&i.test(t,r))return new i(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class et{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,n,i,o,s,u,p){if(arguments.length>8)throw new Error("max arguments reached");const{name:d,items:y}=this;this._aliasCount++;for(let f=0,l=y.length;f<l;f++)y[f][d](e,r,n,i,o,s,u,p);return y===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(et.prototype,{dispatch:{value:et.prototype.emit},run:{value:et.prototype.emit}});class Zr{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new et("setRealSize"),this.onUpdate=new et("update"),this.onError=new et("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){e===this._width&&r===this._height||(this._width=e,this._height=r,this.onResize.emit(e,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,r,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,r){return!1}}class bo extends Zr{constructor(e,r){const{width:n,height:i}=r||{};if(!n||!i)throw new Error("BufferResource width or height invalid");super(n,i),this.data=e}upload(e,r,n){const i=e.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===kt.UNPACK);const o=r.realWidth,s=r.realHeight;return n.width===o&&n.height===s?i.texSubImage2D(r.target,0,0,0,o,s,r.format,n.type,this.data):(n.width=o,n.height=s,i.texImage2D(r.target,0,n.internalFormat,o,s,0,r.format,n.type,this.data)),!0}dispose(){this.data=null}static test(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array}}const qh={scaleMode:bt.NEAREST,format:W.RGBA,alphaMode:kt.NPM},gr=class extends mn{constructor(t=null,e=null){super(),e=Object.assign({},gr.defaultOptions,e);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:o,width:s,height:u,wrapMode:p,format:d,type:y,target:f,resolution:l,resourceOptions:c}=e;!t||t instanceof Zr||((t=Ga(t,c)).internal=!0),this.resolution=l||ue.RESOLUTION,this.width=Math.round((s||0)*this.resolution)/this.resolution,this.height=Math.round((u||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=i,this._wrapMode=p,this._scaleMode=o,this.format=d,this.type=y,this.target=f,this.alphaMode=r,this.uid=Kr(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&u>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let r;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Fa(this.realWidth)&&Fa(this.realHeight)}setResolution(t){const e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Pt[this.cacheId],delete yt[this.cacheId],this.cacheId=null),this.dispose(),gr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,r=ue.STRICT_TEXTURE_CACHE){const n=typeof t=="string";let i=null;if(n)i=t;else{if(!t._pixiId){const s=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${s}_${Kr()}`}i=t._pixiId}let o=Pt[i];if(n&&r&&!o)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return o||(o=new gr(t,e),o.cacheId=i,gr.addToCache(o,i)),o}static fromBuffer(t,e,r,n){t=t||new Float32Array(e*r*4);const i=new bo(t,{width:e,height:r}),o=t instanceof Float32Array?fe.FLOAT:fe.UNSIGNED_BYTE;return new gr(i,Object.assign({},qh,n||{width:e,height:r,type:o}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Pt[e]&&Pt[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Pt[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Pt[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Pt[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Pt[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};let de=gr;de.defaultOptions={mipmap:Ut.POW2,anisotropicLevel:0,scaleMode:bt.LINEAR,wrapMode:Ur.CLAMP,alphaMode:kt.UNPACK,target:ir.TEXTURE_2D,format:W.RGBA,type:fe.UNSIGNED_BYTE},de._globalBatch=0;class _o{constructor(){this.texArray=null,this.blend=0,this.type=Nt.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Gh=0,He=class rc{constructor(e,r=!0,n=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=Gh++,this.disposeRunner=new et("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?ht.ELEMENT_ARRAY_BUFFER:ht.ARRAY_BUFFER}get index(){return this.type===ht.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new rc(e)}};class Ln{constructor(e,r=0,n=!1,i=fe.FLOAT,o,s,u,p=1){this.buffer=e,this.size=r,this.normalized=n,this.type=i,this.stride=o,this.start=s,this.instance=u,this.divisor=p}destroy(){this.buffer=null}static from(e,r,n,i,o){return new Ln(e,r,n,i,o)}}const Hh={Float32Array,Uint32Array,Int32Array,Uint8Array},Ha={5126:4,5123:2,5121:1};let zh=0;const Vh={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class vr{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=zh++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new et("disposeGeometry"),this.refCount=0}addAttribute(e,r,n=0,i=!1,o,s,u,p=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof He||(r instanceof Array&&(r=new Float32Array(r)),r=new He(r));const d=e.split("|");if(d.length>1){for(let f=0;f<d.length;f++)this.addAttribute(d[f],r,n,i,o);return this}let y=this.buffers.indexOf(r);return y===-1&&(this.buffers.push(r),y=this.buffers.length-1),this.attributes[e]=new Ln(y,n,i,o,s,u,p),this.instanced=this.instanced||p,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof He||(e instanceof Array&&(e=new Uint16Array(e)),e=new He(e)),e.type=ht.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],n=new He;let i;for(i in this.attributes){const o=this.attributes[i],s=this.buffers[o.buffer];e.push(s.data),r.push(o.size*Ha[o.type]/4),o.buffer=0}for(n.data=function(o,s){let u=0,p=0;const d={};for(let c=0;c<o.length;c++)p+=s[c],u+=o[c].length;const y=new ArrayBuffer(4*u);let f=null,l=0;for(let c=0;c<o.length;c++){const a=s[c],h=o[c],m=ja(h);d[m]||(d[m]=new Hh[m](y)),f=d[m];for(let g=0;g<h.length;g++)f[(g/a|0)*p+l+g%a]=h[g];l+=a}return new Float32Array(y)}(e,r),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new vr;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new He(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];e.attributes[r]=new Ln(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=ht.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new vr,n=[],i=[],o=[];let s;for(let u=0;u<e.length;u++){s=e[u];for(let p=0;p<s.buffers.length;p++)i[p]=i[p]||0,i[p]+=s.buffers[p].data.length,o[p]=0}for(let u=0;u<s.buffers.length;u++)n[u]=new Vh[ja(s.buffers[u].data)](i[u]),r.buffers[u]=new He(n[u]);for(let u=0;u<e.length;u++){s=e[u];for(let p=0;p<s.buffers.length;p++)n[p].set(s.buffers[p].data,o[p]),o[p]+=s.buffers[p].data.length}if(r.attributes=s.attributes,s.indexBuffer){r.indexBuffer=r.buffers[s.buffers.indexOf(s.indexBuffer)],r.indexBuffer.type=ht.ELEMENT_ARRAY_BUFFER;let u=0,p=0,d=0,y=0;for(let f=0;f<s.buffers.length;f++)if(s.buffers[f]!==s.indexBuffer){y=f;break}for(const f in s.attributes){const l=s.attributes[f];(0|l.buffer)===y&&(p+=l.size*Ha[l.type]/4)}for(let f=0;f<e.length;f++){const l=e[f].indexBuffer.data;for(let c=0;c<l.length;c++)r.indexBuffer.data[c+d]+=u;u+=e[f].buffers[y].data.length/p,d+=l.length}}return r}}class za extends vr{constructor(e=!1){super(),this._buffer=new He(null,e,!1),this._indexBuffer=new He(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,fe.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,fe.FLOAT).addAttribute("aColor",this._buffer,4,!0,fe.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,fe.FLOAT).addIndex(this._indexBuffer)}}const jn=2*Math.PI,Xh=180/Math.PI,$h=Math.PI/180;var je=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(je||{});class Me{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new Me(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,r=e){return this.x=e,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const Fn=[new Me,new Me,new Me,new Me];class ge{constructor(e=0,r=0,n=0,i=0){this.x=Number(e),this.y=Number(r),this.width=Number(n),this.height=Number(i),this.type=je.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new ge(0,0,0,0)}clone(){return new ge(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return!(this.width<=0||this.height<=0)&&e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const O=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=O)return!1;const A=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>A}const n=this.left,i=this.right,o=this.top,s=this.bottom;if(i<=n||s<=o)return!1;const u=Fn[0].set(e.left,e.top),p=Fn[1].set(e.left,e.bottom),d=Fn[2].set(e.right,e.top),y=Fn[3].set(e.right,e.bottom);if(d.x<=u.x||p.y<=u.y)return!1;const f=Math.sign(r.a*r.d-r.b*r.c);if(f===0||(r.apply(u,u),r.apply(p,p),r.apply(d,d),r.apply(y,y),Math.max(u.x,p.x,d.x,y.x)<=n||Math.min(u.x,p.x,d.x,y.x)>=i||Math.max(u.y,p.y,d.y,y.y)<=o||Math.min(u.y,p.y,d.y,y.y)>=s))return!1;const l=f*(p.y-u.y),c=f*(u.x-p.x),a=l*n+c*o,h=l*i+c*o,m=l*n+c*s,g=l*i+c*s;if(Math.max(a,h,m,g)<=l*u.x+c*u.y||Math.min(a,h,m,g)>=l*y.x+c*y.y)return!1;const _=f*(u.y-d.y),b=f*(d.x-u.x),E=_*n+b*o,x=_*i+b*o,v=_*n+b*s,T=_*i+b*s;return!(Math.max(E,x,v,T)<=_*u.x+b*u.y||Math.min(E,x,v,T)>=_*y.x+b*y.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=2*e,this.height+=2*r,this}fit(e){const r=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,r=.001){const n=Math.ceil((this.x+this.width-r)*e)/e,i=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=n-this.x,this.height=i-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=n-r,this.y=i,this.height=o-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class xo{constructor(e=0,r=0,n=0){this.x=e,this.y=r,this.radius=n,this.type=je.CIRC}clone(){return new xo(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const n=this.radius*this.radius;let i=this.x-e,o=this.y-r;return i*=i,o*=o,i+o<=n}getBounds(){return new ge(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Qr{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const n=[];for(let i=0,o=r.length;i<o;i++)n.push(r[i].x,r[i].y);r=n}this.points=r,this.type=je.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new Qr(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let n=!1;const i=this.points.length/2;for(let o=0,s=i-1;o<i;s=o++){const u=this.points[2*o],p=this.points[2*o+1],d=this.points[2*s],y=this.points[2*s+1];p>r!=y>r&&e<(r-p)/(y-p)*(d-u)+u&&(n=!n)}return n}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((e,r)=>`${e}, ${r}`,"")}]`}}class Eo{constructor(e=0,r=0,n=0,i=0,o=20){this.x=e,this.y=r,this.width=n,this.height=i,this.radius=o,this.type=je.RREC}clone(){return new Eo(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+n&&r<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let i=e-(this.x+n),o=r-(this.y+n);const s=n*n;if(i*i+o*o<=s||(i=e-(this.x+this.width-n),i*i+o*o<=s)||(o=r-(this.y+this.height-n),i*i+o*o<=s)||(i=e-(this.x+n),i*i+o*o<=s))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let De=class Si{constructor(e=1,r=0,n=0,i=1,o=0,s=0){this.array=null,this.a=e,this.b=r,this.c=n,this.d=i,this.tx=o,this.ty=s}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,r,n,i,o,s){return this.a=e,this.b=r,this.c=n,this.d=i,this.tx=o,this.ty=s,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const n=r||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,r){r=r||new Me;const n=e.x,i=e.y;return r.x=this.a*n+this.c*i+this.tx,r.y=this.b*n+this.d*i+this.ty,r}applyInverse(e,r){r=r||new Me;const n=1/(this.a*this.d+this.c*-this.b),i=e.x,o=e.y;return r.x=this.d*n*i+-this.c*n*o+(this.ty*this.c-this.tx*this.d)*n,r.y=this.a*n*o+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),n=Math.sin(e),i=this.a,o=this.c,s=this.tx;return this.a=i*r-this.b*n,this.b=i*n+this.b*r,this.c=o*r-this.d*n,this.d=o*n+this.d*r,this.tx=s*r-this.ty*n,this.ty=s*n+this.ty*r,this}append(e){const r=this.a,n=this.b,i=this.c,o=this.d;return this.a=e.a*r+e.b*i,this.b=e.a*n+e.b*o,this.c=e.c*r+e.d*i,this.d=e.c*n+e.d*o,this.tx=e.tx*r+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*o+this.ty,this}setTransform(e,r,n,i,o,s,u,p,d){return this.a=Math.cos(u+d)*o,this.b=Math.sin(u+d)*o,this.c=-Math.sin(u-p)*s,this.d=Math.cos(u-p)*s,this.tx=e-(n*this.a+i*this.c),this.ty=r-(n*this.b+i*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,n=this.b,i=this.c,o=this.d,s=e.pivot,u=-Math.atan2(-i,o),p=Math.atan2(n,r),d=Math.abs(u+p);return d<1e-5||Math.abs(jn-d)<1e-5?(e.rotation=p,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=u,e.skew.y=p),e.scale.x=Math.sqrt(r*r+n*n),e.scale.y=Math.sqrt(i*i+o*o),e.position.x=this.tx+(s.x*r+s.y*i),e.position.y=this.ty+(s.x*n+s.y*o),e}invert(){const e=this.a,r=this.b,n=this.c,i=this.d,o=this.tx,s=e*i-r*n;return this.a=i/s,this.b=-r/s,this.c=-n/s,this.d=e/s,this.tx=(n*this.ty-i*o)/s,this.ty=-(e*this.ty-r*o)/s,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Si;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new Si}static get TEMP_MATRIX(){return new Si}};const Xt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],$t=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Wt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Yt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],wo=[],Va=[],Bn=Math.sign;(function(){for(let t=0;t<16;t++){const e=[];wo.push(e);for(let r=0;r<16;r++){const n=Bn(Xt[t]*Xt[r]+Wt[t]*$t[r]),i=Bn($t[t]*Xt[r]+Yt[t]*$t[r]),o=Bn(Xt[t]*Wt[r]+Wt[t]*Yt[r]),s=Bn($t[t]*Wt[r]+Yt[t]*Yt[r]);for(let u=0;u<16;u++)if(Xt[u]===n&&$t[u]===i&&Wt[u]===o&&Yt[u]===s){e.push(u);break}}}for(let t=0;t<16;t++){const e=new De;e.set(Xt[t],$t[t],Wt[t],Yt[t],0,0),Va.push(e)}})();const we={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Xt[t],uY:t=>$t[t],vX:t=>Wt[t],vY:t=>Yt[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>wo[t][e],sub:(t,e)=>wo[t][we.inv(e)],rotate180:t=>4^t,isVertical:t=>(3&t)==2,byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?we.S:we.N:2*Math.abs(e)<=Math.abs(t)?t>0?we.E:we.W:e>0?t>0?we.SE:we.SW:t>0?we.NE:we.NW,matrixAppendRotationInv:(t,e,r=0,n=0)=>{const i=Va[we.inv(e)];i.tx=r,i.ty=n,t.append(i)}};class br{constructor(e,r,n=0,i=0){this._x=n,this._y=i,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new br(e,r,this._x,this._y)}set(e=0,r=e){return this._x===e&&this._y===r||(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}const Xa=class{constructor(){this.worldTransform=new De,this.localTransform=new De,this.position=new br(this.onChange,this,0,0),this.scale=new br(this.onChange,this,1,1),this.pivot=new br(this.onChange,this,0,0),this.skew=new br(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,n=this.worldTransform;n.a=e.a*r.a+e.b*r.c,n.b=e.a*r.b+e.b*r.d,n.c=e.c*r.a+e.d*r.c,n.d=e.c*r.b+e.d*r.d,n.tx=e.tx*r.a+e.ty*r.c+r.tx,n.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let To=Xa;To.IDENTITY=new Xa;function $a(t,e,r){const n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),n}function Ao(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function Wa(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Ao(2*e);case"bvec3":return Ao(3*e);case"bvec4":return Ao(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const _r=[{test:t=>t.type==="float"&&t.size===1&&!t.isArray,code:t=>`
13
- if(uv["${t}"] !== ud["${t}"].value)
16
+ `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
17
+ Deprecated since v${e}`),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t}
18
+ Deprecated since v${e}`),console.warn(n))),Oo[t]=!0}let fs;function Zh(){return typeof fs>"u"&&(fs=function(){var r;const t={stencil:!0,failIfMajorPerformanceCaveat:mt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!mt.ADAPTER.getWebGLRenderingContext())return!1;const n=mt.ADAPTER.createCanvas();let i=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);const s=!!((r=i==null?void 0:i.getContextAttributes())!=null&&r.stencil);if(i){const a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,s}catch{return!1}}()),fs}var Qh={grad:.9,turn:360,rad:360/(2*Math.PI)},we=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},$t=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},Qt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},Io=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ro=function(e){return{r:Qt(e.r,0,255),g:Qt(e.g,0,255),b:Qt(e.b,0,255),a:Qt(e.a)}},cs=function(e){return{r:$t(e.r),g:$t(e.g),b:$t(e.b),a:$t(e.a,3)}},Jh=/^#([0-9a-f]{3,8})$/i,Cn=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},No=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=Math.max(t,r,n),a=s-Math.min(t,r,n),o=a?s===t?(r-n)/a:s===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(o<0?o+6:o),s:s?a/s*100:0,v:s/255*100,a:i}},Co=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),a=n*(1-r),o=n*(1-(t-s)*r),l=n*(1-(1-t+s)*r),f=s%6;return{r:255*[n,o,a,a,l,n][f],g:255*[l,n,n,o,a,a][f],b:255*[a,a,l,n,n,o][f],a:i}},Po=function(e){return{h:Io(e.h),s:Qt(e.s,0,100),l:Qt(e.l,0,100),a:Qt(e.a)}},ko=function(e){return{h:$t(e.h),s:$t(e.s),l:$t(e.l),a:$t(e.a,3)}},Mo=function(e){return Co((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},Wr=function(e){return{h:(t=No(e)).h,s:(i=(200-(r=t.s))*(n=t.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,r,n,i},td=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ed=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hs={string:[[function(e){var t=Jh.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?$t(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?$t(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=rd.exec(e)||nd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ro({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=td.exec(e)||ed.exec(e);if(!t)return null;var r,n,i=Po({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Qh[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Mo(i)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=i===void 0?1:i;return we(t)&&we(r)&&we(n)?Ro({r:Number(t),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,i=e.a,s=i===void 0?1:i;if(!we(t)||!we(r)||!we(n))return null;var a=Po({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return Mo(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,s=i===void 0?1:i;if(!we(t)||!we(r)||!we(n))return null;var a=function(o){return{h:Io(o.h),s:Qt(o.s,0,100),v:Qt(o.v,0,100),a:Qt(o.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return Co(a)},"hsv"]]},Lo=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},id=function(e){return typeof e=="string"?Lo(e.trim(),hs.string):typeof e=="object"&&e!==null?Lo(e,hs.object):[null,void 0]},ds=function(e,t){var r=Wr(e);return{h:r.h,s:Qt(r.s+100*t,0,100),l:r.l,a:r.a}},ps=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Fo=function(e,t){var r=Wr(e);return{h:r.h,s:r.s,l:Qt(r.l+100*t,0,100),a:r.a}},vs=function(){function e(t){this.parsed=id(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return $t(ps(this.rgba),2)},e.prototype.isDark=function(){return ps(this.rgba)<.5},e.prototype.isLight=function(){return ps(this.rgba)>=.5},e.prototype.toHex=function(){return t=cs(this.rgba),r=t.r,n=t.g,i=t.b,a=(s=t.a)<1?Cn($t(255*s)):"","#"+Cn(r)+Cn(n)+Cn(i)+a;var t,r,n,i,s,a},e.prototype.toRgb=function(){return cs(this.rgba)},e.prototype.toRgbString=function(){return t=cs(this.rgba),r=t.r,n=t.g,i=t.b,(s=t.a)<1?"rgba("+r+", "+n+", "+i+", "+s+")":"rgb("+r+", "+n+", "+i+")";var t,r,n,i,s},e.prototype.toHsl=function(){return ko(Wr(this.rgba))},e.prototype.toHslString=function(){return t=ko(Wr(this.rgba)),r=t.h,n=t.s,i=t.l,(s=t.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+s+")":"hsl("+r+", "+n+"%, "+i+"%)";var t,r,n,i,s},e.prototype.toHsv=function(){return t=No(this.rgba),{h:$t(t.h),s:$t(t.s),v:$t(t.v),a:$t(t.a,3)};var t},e.prototype.invert=function(){return ye({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),ye(ds(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),ye(ds(this.rgba,-t))},e.prototype.grayscale=function(){return ye(ds(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),ye(Fo(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),ye(Fo(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?ye({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):$t(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=Wr(this.rgba);return typeof t=="number"?ye({h:t,s:r.s,l:r.l,a:r.a}):$t(r.h)},e.prototype.isEqual=function(t){return this.toHex()===ye(t).toHex()},e}(),ye=function(e){return e instanceof vs?e:new vs(e)},Bo=[],sd=function(e){e.forEach(function(t){Bo.indexOf(t)<0&&(t(vs,hs),Bo.push(t))})};function ad(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var i in r)n[r[i]]=i;var s={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,l,f=n[this.toHex()];if(f)return f;if(a!=null&&a.closest){var c=this.toRgb(),h=1/0,u="black";if(!s.length)for(var d in r)s[d]=new e(r[d]).toRgb();for(var p in r){var v=(o=c,l=s[p],Math.pow(o.r-l.r,2)+Math.pow(o.g-l.g,2)+Math.pow(o.b-l.b,2));v<h&&(h=v,u=p)}return u}},t.string.push([function(a){var o=a.toLowerCase(),l=o==="transparent"?"#0000":r[o];return l?new e(l).toRgb():null},"name"])}sd([ad]);const mr=class{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof mr)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}isSourceEqual(e,t){const r=typeof e;if(r!==typeof t)return!1;if(r==="number"||r==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?!1:e.every((i,s)=>i===t[s]);if(e!==null&&t!==null){const i=Object.keys(e),s=Object.keys(t);return i.length!==s.length?!1:i.every(a=>e[a]===t[a])}return e===t}toRgba(){const[e,t,r,n]=this._components;return{r:e,g:t,b:r,a:n}}toRgb(){const[e,t,r]=this._components;return{r:e,g:t,b:r}}toRgbaString(){const[e,t,r]=this.toUint8RgbArray();return`rgba(${e},${t},${r},${this.alpha})`}toUint8RgbArray(e){const[t,r,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(r*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,r,n]=this._components;return e[0]=t,e[1]=r,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,r,n,i]=mr.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=r,this._components[2]*=n,this._components[3]*=i,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e){if(e===1)return(e*255<<24)+this._int;if(e===0)return 0;let t=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return t=t*e+.5|0,r=r*e+.5|0,n=n*e+.5|0,(e*255<<24)+(t<<16)+(r<<8)+n}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,r,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(r*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,r,n,i]=this._components;return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}normalize(e){let t;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const r=e;t=[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255,1]}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4){e=this._clamp(e);const[r,n,i,s=1]=e;t=[r,n,i,s]}else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4){e=this._clamp(e,0,255);const[r,n,i,s=255]=e;t=[r/255,n/255,i/255,s/255]}else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const n=mr.HEX_PATTERN.exec(e);n&&(e=`#${n[2]}`)}const r=ye(e);if(r.isValid()){const{r:n,g:i,b:s,a}=r.rgba;t=[n/255,i/255,s/255,a]}}if(t)this._components.set(t),this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,r]=this._components;this._int=(e*255<<16)+(t*255<<8)+(r*255|0)}_clamp(e,t=0,r=1){return typeof e=="number"?Math.min(Math.max(e,t),r):(e.forEach((n,i)=>{e[i]=Math.min(Math.max(n,t),r)}),e)}};let Xt=mr;Xt.shared=new mr,Xt.temp=new mr,Xt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function od(){const e=[],t=[];for(let n=0;n<32;n++)e[n]=n,t[n]=n;e[ot.NORMAL_NPM]=ot.NORMAL,e[ot.ADD_NPM]=ot.ADD,e[ot.SCREEN_NPM]=ot.SCREEN,t[ot.NORMAL]=ot.NORMAL_NPM,t[ot.ADD]=ot.ADD_NPM,t[ot.SCREEN]=ot.SCREEN_NPM;const r=[];return r.push(t),r.push(e),r}const ld=od();function Uo(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?"Float32Array":e instanceof Uint32Array?"Uint32Array":"Int32Array";if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return"Uint16Array"}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return"Uint8Array";return null}function Pn(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function Do(e){return!(e&e-1)&&!!e}function jo(e){let t=(e>65535?1:0)<<4;e>>>=t;let r=(e>255?1:0)<<3;return e>>>=r,t|=r,r=(e>15?1:0)<<2,e>>>=r,t|=r,r=(e>3?1:0)<<1,e>>>=r,t|=r,t|e>>1}function kn(e,t,r){const n=e.length;let i;if(t>=n||r===0)return;r=t+r>n?n-t:r;const s=n-r;for(i=t;i<s;++i)e[i]=e[i+r];e.length=s}let ud=0;function Yr(){return++ud}const $o={},me=Object.create(null),Fe=Object.create(null);let Mn;function fd(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,Mn||(Mn=document.createElement("a")),Mn.href=e;const r=Kh.parse(Mn.href),n=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!n||r.protocol!==t.protocol?"anonymous":""}function Go(e,t=1){var n;const r=(n=mt.RETINA_PREFIX)==null?void 0:n.exec(e);return r?parseFloat(r[1]):t}var vt=(e=>(e.Renderer="renderer",e.Application="application",e.RendererSystem="renderer-webgl-system",e.RendererPlugin="renderer-webgl-plugin",e.CanvasRendererSystem="renderer-canvas-system",e.CanvasRendererPlugin="renderer-canvas-plugin",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e))(vt||{});const ys=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={...typeof e.extension!="object"?{type:e.extension}:e.extension,ref:e}}if(typeof e=="object")e={...e};else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},qo=(e,t)=>ys(e).priority??t,wt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(ys).forEach(t=>{t.type.forEach(r=>{var n,i;return(i=(n=this._removeHandlers)[r])==null?void 0:i.call(n,t)})}),this},add(...e){return e.map(ys).forEach(t=>{t.type.forEach(r=>{const n=this._addHandlers,i=this._queue;n[r]?n[r](t):(i[r]=i[r]||[],i[r].push(t))})}),this},handle(e,t,r){const n=this._addHandlers,i=this._removeHandlers;if(n[e]||i[e])throw new Error(`Extension type ${e} already has a handler`);n[e]=t,i[e]=r;const s=this._queue;return s[e]&&(s[e].forEach(a=>t(a)),delete s[e]),this},handleByMap(e,t){return this.handle(e,r=>{t[r.name]=r.ref},r=>{delete t[r.name]})},handleByList(e,t,r=-1){return this.handle(e,n=>{t.includes(n.ref)||(t.push(n.ref),t.sort((i,s)=>qo(s,r)-qo(i,r)))},n=>{const i=t.indexOf(n.ref);i!==-1&&t.splice(i,1)})}};class cd{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const hd=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
19
+ `);function dd(e){let t="";for(let r=0;r<e;++r)r>0&&(t+=`
20
+ else `),r<e-1&&(t+=`if(test == ${r}.0){}`);return t}function pd(e,t){if(e===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=t.createShader(t.FRAGMENT_SHADER);for(;;){const n=hd.replace(/%forloop%/gi,dd(e));if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))e=e/2|0;else break}return e}const ms=0,gs=1,bs=2,_s=3,xs=4,Es=5;let Ln=class ff{constructor(){this.data=0,this.blendMode=ot.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<ms)}set blend(t){!!(this.data&1<<ms)!==t&&(this.data^=1<<ms)}get offsets(){return!!(this.data&1<<gs)}set offsets(t){!!(this.data&1<<gs)!==t&&(this.data^=1<<gs)}get culling(){return!!(this.data&1<<bs)}set culling(t){!!(this.data&1<<bs)!==t&&(this.data^=1<<bs)}get depthTest(){return!!(this.data&1<<_s)}set depthTest(t){!!(this.data&1<<_s)!==t&&(this.data^=1<<_s)}get depthMask(){return!!(this.data&1<<Es)}set depthMask(t){!!(this.data&1<<Es)!==t&&(this.data^=1<<Es)}get clockwiseFrontFace(){return!!(this.data&1<<xs)}set clockwiseFrontFace(t){!!(this.data&1<<xs)!==t&&(this.data^=1<<xs)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==ot.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new ff;return t.depthTest=!1,t.blend=!0,t}};const Ts=[];function Ho(e,t){if(!e)return null;let r="";if(typeof e=="string"){const n=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);n&&(r=n[1].toLowerCase())}for(let n=Ts.length-1;n>=0;--n){const i=Ts[n];if(i.test&&i.test(e,r))return new i(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class re{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,r,n,i,s,a,o,l){if(arguments.length>8)throw new Error("max arguments reached");const{name:f,items:c}=this;this._aliasCount++;for(let h=0,u=c.length;h<u;h++)c[h][f](t,r,n,i,s,a,o,l);return c===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const r=this.items.indexOf(t);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(re.prototype,{dispatch:{value:re.prototype.emit},run:{value:re.prototype.emit}});class Kr{constructor(t=0,r=0){this._width=t,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new re("setRealSize"),this.onUpdate=new re("update"),this.onError=new re("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,r){(t!==this._width||r!==this._height)&&(this._width=t,this._height=r,this.onResize.emit(t,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,r,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,r){return!1}}class ws extends Kr{constructor(t,r){const{width:n,height:i}=r||{};if(!n||!i)throw new Error("BufferResource width or height invalid");super(n,i),this.data=t}upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Pe.UNPACK);const s=r.realWidth,a=r.realHeight;return n.width===s&&n.height===a?i.texSubImage2D(r.target,0,0,0,s,a,r.format,n.type,this.data):(n.width=s,n.height=a,i.texImage2D(r.target,0,n.internalFormat,s,a,0,r.format,n.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const vd={scaleMode:xe.NEAREST,format:rt.RGBA,alphaMode:Pe.NPM},gr=class extends yn{constructor(e=null,t=null){super(),t=Object.assign({},gr.defaultOptions,t);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:s,width:a,height:o,wrapMode:l,format:f,type:c,target:h,resolution:u,resourceOptions:d}=t;e&&!(e instanceof Kr)&&(e=Ho(e,d),e.internal=!0),this.resolution=u||mt.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((o||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=i,this._wrapMode=l,this._scaleMode=s,this.format=f,this.type=c,this.target=h,this.alphaMode=r,this.uid=Yr(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&o>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let r;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this}setSize(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)}setRealSize(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Do(this.realWidth)&&Do(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Fe[this.cacheId],delete me[this.cacheId],this.cacheId=null),this.dispose(),gr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,r=mt.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let i=null;if(n)i=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${Yr()}`}i=e._pixiId}let s=Fe[i];if(n&&r&&!s)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return s||(s=new gr(e,t),s.cacheId=i,gr.addToCache(s,i)),s}static fromBuffer(e,t,r,n){e=e||new Float32Array(t*r*4);const i=new ws(e,{width:t,height:r}),s=e instanceof Float32Array?bt.FLOAT:bt.UNSIGNED_BYTE;return new gr(i,Object.assign({},vd,n||{width:t,height:r,type:s}))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Fe[t]&&Fe[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Fe[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Fe[e];if(t){const r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete Fe[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)delete Fe[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}};let _t=gr;_t.defaultOptions={mipmap:Ge.POW2,anisotropicLevel:0,scaleMode:xe.LINEAR,wrapMode:Dr.CLAMP,alphaMode:Pe.UNPACK,target:sr.TEXTURE_2D,format:rt.RGBA,type:bt.UNSIGNED_BYTE},_t._globalBatch=0;class As{constructor(){this.texArray=null,this.blend=0,this.type=Ce.TRIANGLES,this.start=0,this.size=0,this.data=null}}let yd=0,Wt=class cf{constructor(t,r=!0,n=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=yd++,this.disposeRunner=new re("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?de.ELEMENT_ARRAY_BUFFER:de.ARRAY_BUFFER}get index(){return this.type===de.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new cf(t)}};class Fn{constructor(t,r=0,n=!1,i=bt.FLOAT,s,a,o,l=1){this.buffer=t,this.size=r,this.normalized=n,this.type=i,this.stride=s,this.start=a,this.instance=o,this.divisor=l}destroy(){this.buffer=null}static from(t,r,n,i,s){return new Fn(t,r,n,i,s)}}const md={Float32Array,Uint32Array,Int32Array,Uint8Array};function gd(e,t){let r=0,n=0;const i={};for(let l=0;l<e.length;l++)n+=t[l],r+=e[l].length;const s=new ArrayBuffer(r*4);let a=null,o=0;for(let l=0;l<e.length;l++){const f=t[l],c=e[l],h=Uo(c);i[h]||(i[h]=new md[h](s)),a=i[h];for(let u=0;u<c.length;u++){const d=(u/f|0)*n+o,p=u%f;a[d+p]=c[u]}o+=f}return new Float32Array(s)}const Vo={5126:4,5123:2,5121:1};let bd=0;const _d={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class br{constructor(t=[],r={}){this.buffers=t,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=bd++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new re("disposeGeometry"),this.refCount=0}addAttribute(t,r,n=0,i=!1,s,a,o,l=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Wt||(r instanceof Array&&(r=new Float32Array(r)),r=new Wt(r));const f=t.split("|");if(f.length>1){for(let h=0;h<f.length;h++)this.addAttribute(f[h],r,n,i,s);return this}let c=this.buffers.indexOf(r);return c===-1&&(this.buffers.push(r),c=this.buffers.length-1),this.attributes[t]=new Fn(c,n,i,s,a,o,l),this.instanced=this.instanced||l,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof Wt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Wt(t)),t.type=de.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const t=[],r=[],n=new Wt;let i;for(i in this.attributes){const s=this.attributes[i],a=this.buffers[s.buffer];t.push(a.data),r.push(s.size*Vo[s.type]/4),s.buffer=0}for(n.data=gd(t,r),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const r=this.attributes[t];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new br;for(let r=0;r<this.buffers.length;r++)t.buffers[r]=new Wt(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];t.attributes[r]=new Fn(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=de.ELEMENT_ARRAY_BUFFER),t}static merge(t){const r=new br,n=[],i=[],s=[];let a;for(let o=0;o<t.length;o++){a=t[o];for(let l=0;l<a.buffers.length;l++)i[l]=i[l]||0,i[l]+=a.buffers[l].data.length,s[l]=0}for(let o=0;o<a.buffers.length;o++)n[o]=new _d[Uo(a.buffers[o].data)](i[o]),r.buffers[o]=new Wt(n[o]);for(let o=0;o<t.length;o++){a=t[o];for(let l=0;l<a.buffers.length;l++)n[l].set(a.buffers[l].data,s[l]),s[l]+=a.buffers[l].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=de.ELEMENT_ARRAY_BUFFER;let o=0,l=0,f=0,c=0;for(let h=0;h<a.buffers.length;h++)if(a.buffers[h]!==a.indexBuffer){c=h;break}for(const h in a.attributes){const u=a.attributes[h];(u.buffer|0)===c&&(l+=u.size*Vo[u.type]/4)}for(let h=0;h<t.length;h++){const u=t[h].indexBuffer.data;for(let d=0;d<u.length;d++)r.indexBuffer.data[d+f]+=o;o+=t[h].buffers[c].data.length/l,f+=u.length}}return r}}class zo extends br{constructor(t=!1){super(),this._buffer=new Wt(null,t,!1),this._indexBuffer=new Wt(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,bt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,bt.FLOAT).addAttribute("aColor",this._buffer,4,!0,bt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,bt.FLOAT).addIndex(this._indexBuffer)}}const Bn=Math.PI*2,xd=180/Math.PI,Ed=Math.PI/180;var qt=(e=>(e[e.POLY=0]="POLY",e[e.RECT=1]="RECT",e[e.CIRC=2]="CIRC",e[e.ELIP=3]="ELIP",e[e.RREC=4]="RREC",e))(qt||{});class Gt{constructor(t=0,r=0){this.x=0,this.y=0,this.x=t,this.y=r}clone(){return new Gt(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,r=t){return this.x=t,this.y=r,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const Un=[new Gt,new Gt,new Gt,new Gt];class At{constructor(t=0,r=0,n=0,i=0){this.x=Number(t),this.y=Number(r),this.width=Number(n),this.height=Number(i),this.type=qt.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new At(0,0,0,0)}clone(){return new At(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,r){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(t,r){if(!r){const E=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=E)return!1;const A=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>A}const n=this.left,i=this.right,s=this.top,a=this.bottom;if(i<=n||a<=s)return!1;const o=Un[0].set(t.left,t.top),l=Un[1].set(t.left,t.bottom),f=Un[2].set(t.right,t.top),c=Un[3].set(t.right,t.bottom);if(f.x<=o.x||l.y<=o.y)return!1;const h=Math.sign(r.a*r.d-r.b*r.c);if(h===0||(r.apply(o,o),r.apply(l,l),r.apply(f,f),r.apply(c,c),Math.max(o.x,l.x,f.x,c.x)<=n||Math.min(o.x,l.x,f.x,c.x)>=i||Math.max(o.y,l.y,f.y,c.y)<=s||Math.min(o.y,l.y,f.y,c.y)>=a))return!1;const u=h*(l.y-o.y),d=h*(o.x-l.x),p=u*n+d*s,v=u*i+d*s,g=u*n+d*a,m=u*i+d*a;if(Math.max(p,v,g,m)<=u*o.x+d*o.y||Math.min(p,v,g,m)>=u*c.x+d*c.y)return!1;const b=h*(o.y-f.y),_=h*(f.x-o.x),y=b*n+_*s,x=b*i+_*s,O=b*n+_*a,T=b*i+_*a;return!(Math.max(y,x,O,T)<=b*o.x+_*o.y||Math.min(y,x,O,T)>=b*c.x+_*c.y)}pad(t=0,r=t){return this.x-=t,this.y-=r,this.width+=t*2,this.height+=r*2,this}fit(t){const r=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,r=.001){const n=Math.ceil((this.x+this.width-r)*t)/t,i=Math.ceil((this.y+this.height-r)*t)/t;return this.x=Math.floor((this.x+r)*t)/t,this.y=Math.floor((this.y+r)*t)/t,this.width=n-this.x,this.height=i-this.y,this}enlarge(t){const r=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class Ss{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.radius=n,this.type=qt.CIRC}clone(){return new Ss(this.x,this.y,this.radius)}contains(t,r){if(this.radius<=0)return!1;const n=this.radius*this.radius;let i=this.x-t,s=this.y-r;return i*=i,s*=s,i+s<=n}getBounds(){return new At(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}let Td=class hf{constructor(t=0,r=0,n=0,i=0){this.x=t,this.y=r,this.width=n,this.height=i,this.type=qt.ELIP}clone(){return new hf(this.x,this.y,this.width,this.height)}contains(t,r){if(this.width<=0||this.height<=0)return!1;let n=(t-this.x)/this.width,i=(r-this.y)/this.height;return n*=n,i*=i,n+i<=1}getBounds(){return new At(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};class Zr{constructor(...t){let r=Array.isArray(t[0])?t[0]:t;if(typeof r[0]!="number"){const n=[];for(let i=0,s=r.length;i<s;i++)n.push(r[i].x,r[i].y);r=n}this.points=r,this.type=qt.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),r=new Zr(t);return r.closeStroke=this.closeStroke,r}contains(t,r){let n=!1;const i=this.points.length/2;for(let s=0,a=i-1;s<i;a=s++){const o=this.points[s*2],l=this.points[s*2+1],f=this.points[a*2],c=this.points[a*2+1];l>r!=c>r&&t<(f-o)*((r-l)/(c-l))+o&&(n=!n)}return n}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,r)=>`${t}, ${r}`,"")}]`}}class Os{constructor(t=0,r=0,n=0,i=0,s=20){this.x=t,this.y=r,this.width=n,this.height=i,this.radius=s,this.type=qt.RREC}clone(){return new Os(this.x,this.y,this.width,this.height,this.radius)}contains(t,r){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+n&&r<=this.y+this.height-n||t>=this.x+n&&t<=this.x+this.width-n)return!0;let i=t-(this.x+n),s=r-(this.y+n);const a=n*n;if(i*i+s*s<=a||(i=t-(this.x+this.width-n),i*i+s*s<=a)||(s=r-(this.y+this.height-n),i*i+s*s<=a)||(i=t-(this.x+n),i*i+s*s<=a))return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}let zt=class Oi{constructor(t=1,r=0,n=0,i=1,s=0,a=0){this.array=null,this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=a}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,r,n,i,s,a){return this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=a,this}toArray(t,r){this.array||(this.array=new Float32Array(9));const n=r||this.array;return t?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(t,r){r=r||new Gt;const n=t.x,i=t.y;return r.x=this.a*n+this.c*i+this.tx,r.y=this.b*n+this.d*i+this.ty,r}applyInverse(t,r){r=r||new Gt;const n=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return r.x=this.d*n*i+-this.c*n*s+(this.ty*this.c-this.tx*this.d)*n,r.y=this.a*n*s+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,r}translate(t,r){return this.tx+=t,this.ty+=r,this}scale(t,r){return this.a*=t,this.d*=r,this.c*=t,this.b*=r,this.tx*=t,this.ty*=r,this}rotate(t){const r=Math.cos(t),n=Math.sin(t),i=this.a,s=this.c,a=this.tx;return this.a=i*r-this.b*n,this.b=i*n+this.b*r,this.c=s*r-this.d*n,this.d=s*n+this.d*r,this.tx=a*r-this.ty*n,this.ty=a*n+this.ty*r,this}append(t){const r=this.a,n=this.b,i=this.c,s=this.d;return this.a=t.a*r+t.b*i,this.b=t.a*n+t.b*s,this.c=t.c*r+t.d*i,this.d=t.c*n+t.d*s,this.tx=t.tx*r+t.ty*i+this.tx,this.ty=t.tx*n+t.ty*s+this.ty,this}setTransform(t,r,n,i,s,a,o,l,f){return this.a=Math.cos(o+f)*s,this.b=Math.sin(o+f)*s,this.c=-Math.sin(o-l)*a,this.d=Math.cos(o-l)*a,this.tx=t-(n*this.a+i*this.c),this.ty=r-(n*this.b+i*this.d),this}prepend(t){const r=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const n=this.a,i=this.c;this.a=n*t.a+this.b*t.c,this.b=n*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=r*t.a+this.ty*t.c+t.tx,this.ty=r*t.b+this.ty*t.d+t.ty,this}decompose(t){const r=this.a,n=this.b,i=this.c,s=this.d,a=t.pivot,o=-Math.atan2(-i,s),l=Math.atan2(n,r),f=Math.abs(o+l);return f<1e-5||Math.abs(Bn-f)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=l),t.scale.x=Math.sqrt(r*r+n*n),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(a.x*r+a.y*i),t.position.y=this.ty+(a.x*n+a.y*s),t}invert(){const t=this.a,r=this.b,n=this.c,i=this.d,s=this.tx,a=t*i-r*n;return this.a=i/a,this.b=-r/a,this.c=-n/a,this.d=t/a,this.tx=(n*this.ty-i*s)/a,this.ty=-(t*this.ty-r*s)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new Oi;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new Oi}static get TEMP_MATRIX(){return new Oi}};const We=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ye=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ke=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ze=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Is=[],Xo=[],Dn=Math.sign;function wd(){for(let e=0;e<16;e++){const t=[];Is.push(t);for(let r=0;r<16;r++){const n=Dn(We[e]*We[r]+Ke[e]*Ye[r]),i=Dn(Ye[e]*We[r]+Ze[e]*Ye[r]),s=Dn(We[e]*Ke[r]+Ke[e]*Ze[r]),a=Dn(Ye[e]*Ke[r]+Ze[e]*Ze[r]);for(let o=0;o<16;o++)if(We[o]===n&&Ye[o]===i&&Ke[o]===s&&Ze[o]===a){t.push(o);break}}}for(let e=0;e<16;e++){const t=new zt;t.set(We[e],Ye[e],Ke[e],Ze[e],0,0),Xo.push(t)}}wd();const kt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>We[e],uY:e=>Ye[e],vX:e=>Ke[e],vY:e=>Ze[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Is[e][t],sub:(e,t)=>Is[e][kt.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?kt.S:kt.N:Math.abs(t)*2<=Math.abs(e)?e>0?kt.E:kt.W:t>0?e>0?kt.SE:kt.SW:e>0?kt.NE:kt.NW,matrixAppendRotationInv:(e,t,r=0,n=0)=>{const i=Xo[kt.inv(t)];i.tx=r,i.ty=n,e.append(i)}};class _r{constructor(t,r,n=0,i=0){this._x=n,this._y=i,this.cb=t,this.scope=r}clone(t=this.cb,r=this.scope){return new _r(t,r,this._x,this._y)}set(t=0,r=t){return(this._x!==t||this._y!==r)&&(this._x=t,this._y=r,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const Wo=class{constructor(){this.worldTransform=new zt,this.localTransform=new zt,this.position=new _r(this.onChange,this,0,0),this.scale=new _r(this.onChange,this,1,1),this.pivot=new _r(this.onChange,this,0,0),this.skew=new _r(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}toString(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}updateLocalTransform(){const e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(e){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){const r=e.worldTransform,n=this.worldTransform;n.a=t.a*r.a+t.b*r.c,n.b=t.a*r.b+t.b*r.d,n.c=t.c*r.a+t.d*r.c,n.d=t.c*r.b+t.d*r.d,n.tx=t.tx*r.a+t.ty*r.c+r.tx,n.ty=t.tx*r.b+t.ty*r.d+r.ty,this._parentID=e._worldID,this._worldID++}}setFromMatrix(e){e.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())}};let Rs=Wo;Rs.IDENTITY=new Wo;var Ad=`varying vec2 vTextureCoord;
21
+
22
+ uniform sampler2D uSampler;
23
+
24
+ void main(void){
25
+ gl_FragColor *= texture2D(uSampler, vTextureCoord);
26
+ }`,Sd=`attribute vec2 aVertexPosition;
27
+ attribute vec2 aTextureCoord;
28
+
29
+ uniform mat3 projectionMatrix;
30
+
31
+ varying vec2 vTextureCoord;
32
+
33
+ void main(void){
34
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
35
+ vTextureCoord = aTextureCoord;
36
+ }
37
+ `;function Yo(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}function Ns(e){const t=new Array(e);for(let r=0;r<t.length;r++)t[r]=!1;return t}function Ko(e,t){switch(e){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"uvec2":return new Uint32Array(2*t);case"uvec3":return new Uint32Array(3*t);case"uvec4":return new Uint32Array(4*t);case"bool":return!1;case"bvec2":return Ns(2*t);case"bvec3":return Ns(3*t);case"bvec4":return Ns(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const xr=[{test:e=>e.type==="float"&&e.size===1&&!e.isArray,code:e=>`
38
+ if(uv["${e}"] !== ud["${e}"].value)
14
39
  {
15
- ud["${t}"].value = uv["${t}"]
16
- gl.uniform1f(ud["${t}"].location, uv["${t}"])
40
+ ud["${e}"].value = uv["${e}"]
41
+ gl.uniform1f(ud["${e}"].location, uv["${e}"])
17
42
  }
18
- `},{test:(t,e)=>!(t.type!=="sampler2D"&&t.type!=="samplerCube"&&t.type!=="sampler2DArray"||t.size!==1||t.isArray||e!=null&&e.castToBaseTexture===void 0),code:t=>`t = syncData.textureCount++;
43
+ `},{test:(e,t)=>(e.type==="sampler2D"||e.type==="samplerCube"||e.type==="sampler2DArray")&&e.size===1&&!e.isArray&&(t==null||t.castToBaseTexture!==void 0),code:e=>`t = syncData.textureCount++;
19
44
 
20
- renderer.texture.bind(uv["${t}"], t);
45
+ renderer.texture.bind(uv["${e}"], t);
21
46
 
22
- if(ud["${t}"].value !== t)
47
+ if(ud["${e}"].value !== t)
23
48
  {
24
- ud["${t}"].value = t;
25
- gl.uniform1i(ud["${t}"].location, t);
49
+ ud["${e}"].value = t;
50
+ gl.uniform1i(ud["${e}"].location, t);
26
51
  ; // eslint-disable-line max-len
27
- }`},{test:(t,e)=>t.type==="mat3"&&t.size===1&&!t.isArray&&e.a!==void 0,code:t=>`
28
- gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));
29
- `,codeUbo:t=>`
30
- var ${t}_matrix = uv.${t}.toArray(true);
31
-
32
- data[offset] = ${t}_matrix[0];
33
- data[offset+1] = ${t}_matrix[1];
34
- data[offset+2] = ${t}_matrix[2];
52
+ }`},{test:(e,t)=>e.type==="mat3"&&e.size===1&&!e.isArray&&t.a!==void 0,code:e=>`
53
+ gl.uniformMatrix3fv(ud["${e}"].location, false, uv["${e}"].toArray(true));
54
+ `,codeUbo:e=>`
55
+ var ${e}_matrix = uv.${e}.toArray(true);
56
+
57
+ data[offset] = ${e}_matrix[0];
58
+ data[offset+1] = ${e}_matrix[1];
59
+ data[offset+2] = ${e}_matrix[2];
35
60
 
36
- data[offset + 4] = ${t}_matrix[3];
37
- data[offset + 5] = ${t}_matrix[4];
38
- data[offset + 6] = ${t}_matrix[5];
61
+ data[offset + 4] = ${e}_matrix[3];
62
+ data[offset + 5] = ${e}_matrix[4];
63
+ data[offset + 6] = ${e}_matrix[5];
39
64
 
40
- data[offset + 8] = ${t}_matrix[6];
41
- data[offset + 9] = ${t}_matrix[7];
42
- data[offset + 10] = ${t}_matrix[8];
43
- `},{test:(t,e)=>t.type==="vec2"&&t.size===1&&!t.isArray&&e.x!==void 0,code:t=>`
44
- cv = ud["${t}"].value;
45
- v = uv["${t}"];
65
+ data[offset + 8] = ${e}_matrix[6];
66
+ data[offset + 9] = ${e}_matrix[7];
67
+ data[offset + 10] = ${e}_matrix[8];
68
+ `},{test:(e,t)=>e.type==="vec2"&&e.size===1&&!e.isArray&&t.x!==void 0,code:e=>`
69
+ cv = ud["${e}"].value;
70
+ v = uv["${e}"];
46
71
 
47
72
  if(cv[0] !== v.x || cv[1] !== v.y)
48
73
  {
49
74
  cv[0] = v.x;
50
75
  cv[1] = v.y;
51
- gl.uniform2f(ud["${t}"].location, v.x, v.y);
52
- }`,codeUbo:t=>`
53
- v = uv.${t};
76
+ gl.uniform2f(ud["${e}"].location, v.x, v.y);
77
+ }`,codeUbo:e=>`
78
+ v = uv.${e};
54
79
 
55
80
  data[offset] = v.x;
56
81
  data[offset+1] = v.y;
57
- `},{test:t=>t.type==="vec2"&&t.size===1&&!t.isArray,code:t=>`
58
- cv = ud["${t}"].value;
59
- v = uv["${t}"];
82
+ `},{test:e=>e.type==="vec2"&&e.size===1&&!e.isArray,code:e=>`
83
+ cv = ud["${e}"].value;
84
+ v = uv["${e}"];
60
85
 
61
86
  if(cv[0] !== v[0] || cv[1] !== v[1])
62
87
  {
63
88
  cv[0] = v[0];
64
89
  cv[1] = v[1];
65
- gl.uniform2f(ud["${t}"].location, v[0], v[1]);
90
+ gl.uniform2f(ud["${e}"].location, v[0], v[1]);
66
91
  }
67
- `},{test:(t,e)=>t.type==="vec4"&&t.size===1&&!t.isArray&&e.width!==void 0,code:t=>`
68
- cv = ud["${t}"].value;
69
- v = uv["${t}"];
92
+ `},{test:(e,t)=>e.type==="vec4"&&e.size===1&&!e.isArray&&t.width!==void 0,code:e=>`
93
+ cv = ud["${e}"].value;
94
+ v = uv["${e}"];
70
95
 
71
96
  if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
72
97
  {
@@ -74,17 +99,17 @@ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}let Mn=class tc{constructor(
74
99
  cv[1] = v.y;
75
100
  cv[2] = v.width;
76
101
  cv[3] = v.height;
77
- gl.uniform4f(ud["${t}"].location, v.x, v.y, v.width, v.height)
78
- }`,codeUbo:t=>`
79
- v = uv.${t};
102
+ gl.uniform4f(ud["${e}"].location, v.x, v.y, v.width, v.height)
103
+ }`,codeUbo:e=>`
104
+ v = uv.${e};
80
105
 
81
106
  data[offset] = v.x;
82
107
  data[offset+1] = v.y;
83
108
  data[offset+2] = v.width;
84
109
  data[offset+3] = v.height;
85
- `},{test:(t,e)=>t.type==="vec4"&&t.size===1&&!t.isArray&&e.red!==void 0,code:t=>`
86
- cv = ud["${t}"].value;
87
- v = uv["${t}"];
110
+ `},{test:(e,t)=>e.type==="vec4"&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>`
111
+ cv = ud["${e}"].value;
112
+ v = uv["${e}"];
88
113
 
89
114
  if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)
90
115
  {
@@ -92,17 +117,17 @@ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}let Mn=class tc{constructor(
92
117
  cv[1] = v.green;
93
118
  cv[2] = v.blue;
94
119
  cv[3] = v.alpha;
95
- gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)
96
- }`,codeUbo:t=>`
97
- v = uv.${t};
120
+ gl.uniform4f(ud["${e}"].location, v.red, v.green, v.blue, v.alpha)
121
+ }`,codeUbo:e=>`
122
+ v = uv.${e};
98
123
 
99
124
  data[offset] = v.red;
100
125
  data[offset+1] = v.green;
101
126
  data[offset+2] = v.blue;
102
127
  data[offset+3] = v.alpha;
103
- `},{test:(t,e)=>t.type==="vec3"&&t.size===1&&!t.isArray&&e.red!==void 0,code:t=>`
104
- cv = ud["${t}"].value;
105
- v = uv["${t}"];
128
+ `},{test:(e,t)=>e.type==="vec3"&&e.size===1&&!e.isArray&&t.red!==void 0,code:e=>`
129
+ cv = ud["${e}"].value;
130
+ v = uv["${e}"];
106
131
 
107
132
  if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)
108
133
  {
@@ -110,16 +135,16 @@ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}let Mn=class tc{constructor(
110
135
  cv[1] = v.green;
111
136
  cv[2] = v.blue;
112
137
 
113
- gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)
114
- }`,codeUbo:t=>`
115
- v = uv.${t};
138
+ gl.uniform3f(ud["${e}"].location, v.red, v.green, v.blue)
139
+ }`,codeUbo:e=>`
140
+ v = uv.${e};
116
141
 
117
142
  data[offset] = v.red;
118
143
  data[offset+1] = v.green;
119
144
  data[offset+2] = v.blue;
120
- `},{test:t=>t.type==="vec4"&&t.size===1&&!t.isArray,code:t=>`
121
- cv = ud["${t}"].value;
122
- v = uv["${t}"];
145
+ `},{test:e=>e.type==="vec4"&&e.size===1&&!e.isArray,code:e=>`
146
+ cv = ud["${e}"].value;
147
+ v = uv["${e}"];
123
148
 
124
149
  if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
125
150
  {
@@ -128,8 +153,8 @@ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}let Mn=class tc{constructor(
128
153
  cv[2] = v[2];
129
154
  cv[3] = v[3];
130
155
 
131
- gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])
132
- }`}],Wh={float:`
156
+ gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2], v[3])
157
+ }`}],Od={float:`
133
158
  if (cv !== v)
134
159
  {
135
160
  cu.value = v;
@@ -265,38 +290,46 @@ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}let Mn=class tc{constructor(
265
290
  cu.value = v;
266
291
 
267
292
  gl.uniform1i(location, v);
268
- }`},Yh={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"},Ya={};let Dn,xr=Ya;function Kh(){if(!Dn){Dn=We.MEDIUM;const t=function(){if(xr===Ya||xr!=null&&xr.isContextLost()){const e=ue.ADAPTER.createCanvas();let r;ue.PREFER_ENV>=Dt.WEBGL2&&(r=e.getContext("webgl2",{})),r||(r=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),r?r.getExtension("WEBGL_draw_buffers"):r=null),xr=r}return xr}();t&&t.getShaderPrecisionFormat&&(Dn=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?We.HIGH:We.MEDIUM)}return Dn}function Ka(t,e){const r=t.getShaderSource(e).split(`
269
- `).map((d,y)=>`${y}: ${d}`),n=t.getShaderInfoLog(e),i=n.split(`
270
- `),o={},s=i.map(d=>parseFloat(d.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(d=>!(!d||o[d])&&(o[d]=!0,!0)),u=[""];s.forEach(d=>{r[d-1]=`%c${r[d-1]}%c`,u.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const p=r.join(`
271
- `);u[0]=p,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn(...u),console.groupEnd()}const Zh={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Za(t){return Zh[t]}let Un=null;const Qa={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Ja(t,e){if(!Un){const r=Object.keys(Qa);Un={};for(let n=0;n<r.length;++n){const i=r[n];Un[t[i]]=Qa[i]}}return Un[e]}function el(t,e,r){if(t.substring(0,9)!=="precision"){let n=e;return e===We.HIGH&&r!==We.HIGH&&(n=We.MEDIUM),`precision ${n} float;
272
- ${t}`}return r!==We.HIGH&&t.substring(0,15)==="precision highp"?t.replace("precision highp","precision mediump"):t}let Jr,Qh=0;const qn={},Er=class{constructor(t,e,r="pixi-shader",n={}){this.extra={},this.id=Qh++,this.vertexSrc=t||Er.defaultVertexSrc,this.fragmentSrc=e||Er.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),qn[r]?(qn[r]++,r+=`-${qn[r]}`):qn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
293
+ }`},Id={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function Rd(e,t){var n;const r=[`
294
+ var v = null;
295
+ var cv = null;
296
+ var cu = null;
297
+ var t = 0;
298
+ var gl = renderer.gl;
299
+ `];for(const i in e.uniforms){const s=t[i];if(!s){(n=e.uniforms[i])!=null&&n.group&&(e.uniforms[i].ubo?r.push(`
300
+ renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');
301
+ `):r.push(`
302
+ renderer.shader.syncUniformGroup(uv.${i}, syncData);
303
+ `));continue}const a=e.uniforms[i];let o=!1;for(let l=0;l<xr.length;l++)if(xr[l].test(s,a)){r.push(xr[l].code(i,a)),o=!0;break}if(!o){const f=(s.size===1&&!s.isArray?Od:Id)[s.type].replace("location",`ud["${i}"].location`);r.push(`
304
+ cu = ud["${i}"];
305
+ cv = cu.value;
306
+ v = uv["${i}"];
307
+ ${f};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
308
+ `))}const Zo={};let Er=Zo;function Nd(){if(Er===Zo||Er!=null&&Er.isContextLost()){const e=mt.ADAPTER.createCanvas();let t;mt.PREFER_ENV>=$e.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Er=t}return Er}let jn;function Cd(){if(!jn){jn=Zt.MEDIUM;const e=Nd();e&&e.getShaderPrecisionFormat&&(jn=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Zt.HIGH:Zt.MEDIUM)}return jn}function Qo(e,t){const r=e.getShaderSource(t).split(`
309
+ `).map((f,c)=>`${c}: ${f}`),n=e.getShaderInfoLog(t),i=n.split(`
310
+ `),s={},a=i.map(f=>parseFloat(f.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(f=>f&&!s[f]?(s[f]=!0,!0):!1),o=[""];a.forEach(f=>{r[f-1]=`%c${r[f-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=r.join(`
311
+ `);o[0]=l,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function Pd(e,t,r,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||Qo(e,r),e.getShaderParameter(n,e.COMPILE_STATUS)||Qo(e,n),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const kd={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Jo(e){return kd[e]}let $n=null;const tl={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function el(e,t){if(!$n){const r=Object.keys(tl);$n={};for(let n=0;n<r.length;++n){const i=r[n];$n[e[i]]=tl[i]}}return $n[t]}function rl(e,t,r){if(e.substring(0,9)!=="precision"){let n=t;return t===Zt.HIGH&&r!==Zt.HIGH&&(n=Zt.MEDIUM),`precision ${n} float;
312
+ ${e}`}else if(r!==Zt.HIGH&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}let Qr;function Md(){if(typeof Qr=="boolean")return Qr;try{Qr=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Qr=!1}return Qr}let Ld=0;const Gn={},Tr=class{constructor(e,t,r="pixi-shader",n={}){this.extra={},this.id=Ld++,this.vertexSrc=e||Tr.defaultVertexSrc,this.fragmentSrc=t||Tr.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,this.vertexSrc.substring(0,8)!=="#version"&&(r=r.replace(/\s+/g,"-"),Gn[r]?(Gn[r]++,r+=`-${Gn[r]}`):Gn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
273
313
  ${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${r}
274
- ${this.fragmentSrc}`,this.vertexSrc=el(this.vertexSrc,Er.defaultVertexPrecision,We.HIGH),this.fragmentSrc=el(this.fragmentSrc,Er.defaultFragmentPrecision,Kh())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return`attribute vec2 aVertexPosition;
275
- attribute vec2 aTextureCoord;
276
-
277
- uniform mat3 projectionMatrix;
278
-
279
- varying vec2 vTextureCoord;
280
-
281
- void main(void){
282
- gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
283
- vTextureCoord = aTextureCoord;
284
- }
285
- `}static get defaultFragmentSrc(){return`varying vec2 vTextureCoord;
286
-
287
- uniform sampler2D uSampler;
288
-
289
- void main(void){
290
- gl_FragColor *= texture2D(uSampler, vTextureCoord);
291
- }`}static from(t,e,r){const n=t+e;let i=Da[n];return i||(Da[n]=i=new Er(t,e,r)),i}};let wt=Er;wt.defaultVertexPrecision=We.HIGH,wt.defaultFragmentPrecision=sr.apple.device?We.HIGH:We.MEDIUM;let Jh=0;class tt{constructor(e,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Jh++,this.static=!!r,this.ubo=!!n,e instanceof He?(this.buffer=e,this.buffer.type=ht.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new He(new Float32Array(1)),this.buffer.type=ht.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(e,r,n){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new tt(r,n)}static from(e,r,n){return new tt(e,r,n)}static uboFrom(e,r){return new tt(e,r??!0,!0)}}class en{constructor(e,r){this.uniformBindCount=0,this.program=e,this.uniformGroup=r?r instanceof tt?r:new tt(r):new tt({}),this.disposeRunner=new et("disposeShader")}checkUniformExists(e,r){if(r.uniforms[e])return!0;for(const n in r.uniforms){const i=r.uniforms[n];if(i.group&&this.checkUniformExists(e,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(e,r,n){const i=wt.from(e,r);return new en(i,n)}}class ef{constructor(e,r){if(this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(e){if(!this.programCache[e]){const n=new Int32Array(e);for(let o=0;o<e;o++)n[o]=o;this.defaultGroupCache[e]=tt.from({uSamplers:n},!0);let i=this.fragTemplate;i=i.replace(/%count%/gi,`${e}`),i=i.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new wt(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new De,default:this.defaultGroupCache[e]};return new en(this.programCache[e],r)}generateSampleSrc(e){let r="";r+=`
314
+ ${this.fragmentSrc}`,this.vertexSrc=rl(this.vertexSrc,Tr.defaultVertexPrecision,Zt.HIGH),this.fragmentSrc=rl(this.fragmentSrc,Tr.defaultFragmentPrecision,Cd())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return Sd}static get defaultFragmentSrc(){return Ad}static from(e,t,r){const n=e+t;let i=$o[n];return i||($o[n]=i=new Tr(e,t,r)),i}};let Ae=Tr;Ae.defaultVertexPrecision=Zt.HIGH,Ae.defaultFragmentPrecision=or.apple.device?Zt.HIGH:Zt.MEDIUM;let Fd=0;class ne{constructor(t,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Fd++,this.static=!!r,this.ubo=!!n,t instanceof Wt?(this.buffer=t,this.buffer.type=de.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Wt(new Float32Array(1)),this.buffer.type=de.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,r,n){if(!this.ubo)this.uniforms[t]=new ne(r,n);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(t,r,n){return new ne(t,r,n)}static uboFrom(t,r){return new ne(t,r??!0,!0)}}class Jr{constructor(t,r){this.uniformBindCount=0,this.program=t,r?r instanceof ne?this.uniformGroup=r:this.uniformGroup=new ne(r):this.uniformGroup=new ne({}),this.disposeRunner=new re("disposeShader")}checkUniformExists(t,r){if(r.uniforms[t])return!0;for(const n in r.uniforms){const i=r.uniforms[n];if(i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,r,n){const i=Ae.from(t,r);return new Jr(i,n)}}class Bd{constructor(t,r){if(this.vertexSrc=t,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const n=new Int32Array(t);for(let s=0;s<t;s++)n[s]=s;this.defaultGroupCache[t]=ne.from({uSamplers:n},!0);let i=this.fragTemplate;i=i.replace(/%count%/gi,`${t}`),i=i.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Ae(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new zt,default:this.defaultGroupCache[t]};return new Jr(this.programCache[t],r)}generateSampleSrc(t){let r="";r+=`
292
315
  `,r+=`
293
- `;for(let n=0;n<e;n++)n>0&&(r+=`
294
- else `),n<e-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
316
+ `;for(let n=0;n<t;n++)n>0&&(r+=`
317
+ else `),n<t-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
295
318
  {`,r+=`
296
319
  color = texture2D(uSamplers[${n}], vTextureCoord);`,r+=`
297
320
  }`;return r+=`
298
321
  `,r+=`
299
- `,r}}class Oo{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}}class tl{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}}const rt=class extends tl{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=za,this.vertexSize=6,this.state=Mn.for2d(),this.size=4*rt.defaultBatchSize,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??function(t){let e=!0;const r=ue.ADAPTER.getNavigator();if(sr.tablet||sr.phone){if(sr.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(e=!1)}if(sr.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(e=!1)}}return e?t:4}(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??!sr.apple.device,this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return ye("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return`precision highp float;
322
+ `,r}}class Cs{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}function Ud(){return!or.apple.device}function Dd(e){let t=!0;const r=mt.ADAPTER.getNavigator();if(or.tablet||or.phone){if(or.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(t=!1)}if(or.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(t=!1)}}return t?e:4}class nl{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var jd=`varying vec2 vTextureCoord;
323
+ varying vec4 vColor;
324
+ varying float vTextureId;
325
+ uniform sampler2D uSamplers[%count%];
326
+
327
+ void main(void){
328
+ vec4 color;
329
+ %forloop%
330
+ gl_FragColor = color * vColor;
331
+ }
332
+ `,$d=`precision highp float;
300
333
  attribute vec2 aVertexPosition;
301
334
  attribute vec2 aTextureCoord;
302
335
  attribute vec4 aColor;
@@ -317,17 +350,14 @@ void main(void){
317
350
  vTextureId = aTextureId;
318
351
  vColor = aColor * tint;
319
352
  }
320
- `}static get defaultFragmentTemplate(){return`varying vec2 vTextureCoord;
321
- varying vec4 vColor;
322
- varying float vTextureId;
323
- uniform sampler2D uSamplers[%count%];
353
+ `;const ie=class extends nl{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=zo,this.vertexSize=6,this.state=Ln.for2d(),this.size=ie.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??Dd(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??Ud(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return Tt("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return $d}static get defaultFragmentTemplate(){return jd}setShaderGenerator({vertex:e=ie.defaultVertexSrc,fragment:t=ie.defaultFragmentTemplate}={}){this.shaderGenerator=new Bd(e,t)}contextChange(){const e=this.renderer.gl;mt.PREFER_ENV===$e.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),ie.defaultMaxTextures),this.maxTextures=pd(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:t}=ie,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new As);for(;t.length<n;)t.push(new Cs);for(let i=0;i<this.maxTextures;i++)this._tempBoundTextures[i]=null}onPrerender(){this._flushId=0}render(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,r=ie._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++_t._globalBatch,o=0,l=r[0],f=0;n.copyBoundTextures(i,t);for(let c=0;c<this._bufferSize;++c){const h=e[c];e[c]=null,h._batchEnabled!==a&&(l.count>=t&&(n.boundArray(l,i,a,t),this.buildDrawCalls(l,f,c),f=c,l=r[++o],++a),h._batchEnabled=a,h.touched=s,l.elements[l.count++]=h)}l.count>0&&(n.boundArray(l,i,a,t),this.buildDrawCalls(l,f,this._bufferSize),++o,++a);for(let c=0;c<i.length;c++)i[c]=null;_t._globalBatch=a}buildDrawCalls(e,t,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:s,vertexSize:a}=this,o=ie._drawCallPool;let l=this._dcIndex,f=this._aIndex,c=this._iIndex,h=o[l];h.start=this._iIndex,h.texArray=e;for(let u=t;u<r;++u){const d=n[u],p=d._texture.baseTexture,v=ld[p.alphaMode?1:0][d.blendMode];n[u]=null,t<u&&h.blend!==v&&(h.size=c-h.start,t=u,h=o[++l],h.texArray=e,h.start=c),this.packInterleavedGeometry(d,i,s,f,c),f+=d.vertexData.length/2*a,c+=d.indices.length,h.blend=v}t<r&&(h.size=c-h.start,++l),this._dcIndex=l,this._aIndex=f,this._iIndex=c}bindAndClearTexArray(e){const t=this.renderer.texture;for(let r=0;r<e.count;r++)t.bind(e.elements[r],e.ids[r]),e.elements[r]=null;e.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:t,_indexBuffer:r}=this;ie.canUploadSameBuffer?(e[this._flushId]._buffer.update(t.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(t.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:t,state:r}=this.renderer,n=ie._drawCallPool;let i=null;for(let s=0;s<e;s++){const{texArray:a,type:o,size:l,start:f,blend:c}=n[s];i!==a&&(i=a,this.bindAndClearTexArray(a)),this.state.blendMode=c,r.set(this.state),t.drawElements(o,l,t.UNSIGNED_SHORT,f*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),ie.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(e){const t=Pn(Math.ceil(e/8)),r=jo(t),n=t*8;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._aBuffers[n];return i||(this._aBuffers[n]=i=new cd(n*this.vertexSize*4)),i}getIndexBuffer(e){const t=Pn(Math.ceil(e/12)),r=jo(t),n=t*12;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._iBuffers[r];return i||(this._iBuffers[r]=i=new Uint16Array(n)),i}packInterleavedGeometry(e,t,r,n,i){const{uint32View:s,float32View:a}=t,o=n/this.vertexSize,l=e.uvs,f=e.indices,c=e.vertexData,h=e._texture.baseTexture._batchLocation,u=Math.min(e.worldAlpha,1),d=Xt.shared.setValue(e._tintRGB).toPremultiplied(u);for(let p=0;p<c.length;p+=2)a[n++]=c[p],a[n++]=c[p+1],a[n++]=l[p],a[n++]=l[p+1],s[n++]=d,a[n++]=h;for(let p=0;p<f.length;p++)r[i++]=o+f[p]}};let se=ie;se.defaultBatchSize=4096,se.extension={name:"batch",type:vt.RendererPlugin},se._drawCallPool=[],se._textureArrayPool=[],wt.add(se);var Gd=`varying vec2 vTextureCoord;
354
+
355
+ uniform sampler2D uSampler;
324
356
 
325
357
  void main(void){
326
- vec4 color;
327
- %forloop%
328
- gl_FragColor = color * vColor;
358
+ gl_FragColor = texture2D(uSampler, vTextureCoord);
329
359
  }
330
- `}setShaderGenerator({vertex:t=rt.defaultVertexSrc,fragment:e=rt.defaultFragmentTemplate}={}){this.shaderGenerator=new ef(t,e)}contextChange(){const t=this.renderer.gl;ue.PREFER_ENV===Dt.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),rt.defaultMaxTextures),this.maxTextures=function(e,r){if(e===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=r.createShader(r.FRAGMENT_SHADER);for(;;){const i=Dh.replace(/%forloop%/gi,Uh(e));if(r.shaderSource(n,i),r.compileShader(n),r.getShaderParameter(n,r.COMPILE_STATUS))break;e=e/2|0}return e}(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:t,_textureArrayPool:e}=rt,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;t.length<r;)t.push(new _o);for(;e.length<n;)e.push(new Oo);for(let i=0;i<this.maxTextures;i++)this._tempBoundTextures[i]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,r=rt._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,o=this.renderer.textureGC.count;let s=++de._globalBatch,u=0,p=r[0],d=0;n.copyBoundTextures(i,e);for(let y=0;y<this._bufferSize;++y){const f=t[y];t[y]=null,f._batchEnabled!==s&&(p.count>=e&&(n.boundArray(p,i,s,e),this.buildDrawCalls(p,d,y),d=y,p=r[++u],++s),f._batchEnabled=s,f.touched=o,p.elements[p.count++]=f)}p.count>0&&(n.boundArray(p,i,s,e),this.buildDrawCalls(p,d,this._bufferSize),++u,++s);for(let y=0;y<i.length;y++)i[y]=null;de._globalBatch=s}buildDrawCalls(t,e,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:o,vertexSize:s}=this,u=rt._drawCallPool;let p=this._dcIndex,d=this._aIndex,y=this._iIndex,f=u[p];f.start=this._iIndex,f.texArray=t;for(let l=e;l<r;++l){const c=n[l],a=c._texture.baseTexture,h=Lh[a.alphaMode?1:0][c.blendMode];n[l]=null,e<l&&f.blend!==h&&(f.size=y-f.start,e=l,f=u[++p],f.texArray=t,f.start=y),this.packInterleavedGeometry(c,i,o,d,y),d+=c.vertexData.length/2*s,y+=c.indices.length,f.blend=h}e<r&&(f.size=y-f.start,++p),this._dcIndex=p,this._aIndex=d,this._iIndex=y}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:r}=this;rt.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:r}=this.renderer,n=rt._drawCallPool;let i=null;for(let o=0;o<t;o++){const{texArray:s,type:u,size:p,start:d,blend:y}=n[o];i!==s&&(i=s,this.bindAndClearTexArray(s)),this.state.blendMode=y,r.set(this.state),e.drawElements(u,p,e.UNSIGNED_SHORT,2*d)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),rt.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=Rn(Math.ceil(t/8)),r=Ba(e),n=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._aBuffers[n];return i||(this._aBuffers[n]=i=new Bh(n*this.vertexSize*4)),i}getIndexBuffer(t){const e=Rn(Math.ceil(t/12)),r=Ba(e),n=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let i=this._iBuffers[r];return i||(this._iBuffers[r]=i=new Uint16Array(n)),i}packInterleavedGeometry(t,e,r,n,i){const{uint32View:o,float32View:s}=e,u=n/this.vertexSize,p=t.uvs,d=t.indices,y=t.vertexData,f=t._texture.baseTexture._batchLocation,l=Math.min(t.worldAlpha,1),c=qe.shared.setValue(t._tintRGB).toPremultiplied(l);for(let a=0;a<y.length;a+=2)s[n++]=y[a],s[n++]=y[a+1],s[n++]=p[a],s[n++]=p[a+1],o[n++]=c,s[n++]=f;for(let a=0;a<d.length;a++)r[i++]=u+d[a]}};let nt=rt;nt.defaultBatchSize=4096,nt.extension={name:"batch",type:ae.RendererPlugin},nt._drawCallPool=[],nt._textureArrayPool=[],me.add(nt);const tn=class extends en{constructor(t,e,r){super(wt.from(t||tn.defaultVertexSrc,e||tn.defaultFragmentSrc),r),this.padding=0,this.resolution=tn.defaultResolution,this.multisample=tn.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Mn}apply(t,e,r,n,i){t.applyFilter(this,e,r,n)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return`attribute vec2 aVertexPosition;
360
+ `,qd=`attribute vec2 aVertexPosition;
331
361
 
332
362
  uniform mat3 projectionMatrix;
333
363
 
@@ -353,30 +383,7 @@ void main(void)
353
383
  gl_Position = filterVertexPosition();
354
384
  vTextureCoord = filterTextureCoord();
355
385
  }
356
- `}static get defaultFragmentSrc(){return`varying vec2 vTextureCoord;
357
-
358
- uniform sampler2D uSampler;
359
-
360
- void main(void){
361
- gl_FragColor = texture2D(uSampler, vTextureCoord);
362
- }
363
- `}};let Tt=tn;Tt.defaultResolution=1,Tt.defaultMultisample=Ne.NONE;class Gn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new qe(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=e,o=n??r;o!==void 0&&(this.color=o),this.alpha=i}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}Gn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Gn.extension={type:[ae.RendererSystem,ae.CanvasRendererSystem],name:"background"},me.add(Gn);class rl{constructor(e){this.renderer=e,this.emptyRenderer=new tl(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:n}=this.renderer.texture;for(let i=r-1;i>=0;--i)e[i]=n[i]||null,e[i]&&(e[i]._batchLocation=i)}boundArray(e,r,n,i){const{elements:o,ids:s,count:u}=e;let p=0;for(let d=0;d<u;d++){const y=o[d],f=y._batchLocation;if(f>=0&&f<i&&r[f]===y)s[d]=f;else for(;p<i;){const l=r[p];if(!l||l._batchEnabled!==n||l._batchLocation!==p){s[d]=p,y._batchLocation=p,r[p]=y;break}p++}}}destroy(){this.renderer=null}}rl.extension={type:ae.RendererSystem,name:"batch"},me.add(rl);let nl=0;class Hn{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=nl++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,n=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:n,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=nl++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let n;if(ue.PREFER_ENV>=Dt.WEBGL2&&(n=e.getContext("webgl2",r)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Hn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Hn.extension={type:ae.RendererSystem,name:"context"},me.add(Hn);class tf extends bo{upload(e,r,n){const i=e.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===kt.UNPACK);const o=r.realWidth,s=r.realHeight;return n.width===o&&n.height===s?i.texSubImage2D(r.target,0,0,0,o,s,r.format,n.type,this.data):(n.width=o,n.height=s,i.texImage2D(r.target,0,n.internalFormat,o,s,0,r.format,n.type,this.data)),!0}}class So{constructor(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new et("disposeFramebuffer"),this.multisample=Ne.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new de(null,{scaleMode:bt.NEAREST,resolution:1,mipmap:Ut.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new de(new tf(null,{width:this.width,height:this.height}),{scaleMode:bt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ut.OFF,format:W.DEPTH_COMPONENT,type:fe.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,r){if(e=Math.round(e),r=Math.round(r),e!==this.width||r!==this.height){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){const i=this.colorTextures[n],o=i.resolution;i.setSize(e/o,r/o)}if(this.depthTexture){const n=this.depthTexture.resolution;this.depthTexture.setSize(e/n,r/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class il extends de{constructor(e={}){typeof e=="number"&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),e.width=e.width||100,e.height=e.height||100,e.multisample??(e.multisample=Ne.NONE),super(null,e),this.mipmap=Ut.OFF,this.valid=!0,this._clear=new qe([0,0,0,0]),this.framebuffer=new So(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Mt extends Zr{constructor(e){const r=e;super(r.naturalWidth||r.videoWidth||r.width,r.naturalHeight||r.videoHeight||r.height),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,n){n!==void 0||r.startsWith("data:")?n!==!1&&(e.crossOrigin=typeof n=="string"?n:"anonymous"):e.crossOrigin=Fh(r)}upload(e,r,n,i){const o=e.gl,s=r.realWidth,u=r.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||i.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1&&i.buffered.length===0)return!1;return o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===kt.UNPACK),this.noSubImage||r.target!==o.TEXTURE_2D||n.width!==s||n.height!==u?(n.width=s,n.height=u,o.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)):o.texSubImage2D(o.TEXTURE_2D,0,0,0,r.format,n.type,i),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class ol extends Mt{constructor(e,r){if(r=r||{},typeof e=="string"){const n=new Image;Mt.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??ue.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load||(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,n)=>{const i=this.source;this.url=i.src;const o=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.resize(i.width,i.height),this._load=null,this.createBitmap?r(this.process()):r(this))};i.complete&&i.src?o():(i.onload=o,i.onerror=s=>{n(s),this.onError.emit(s)})})),this._load}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,n=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:n?"cors":"no-cors"}).then(i=>i.blob()).then(i=>r(i,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===kt.UNPACK?"premultiply":"none"})).then(i=>this.destroyed?Promise.reject():(this.bitmap=i,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,n){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,n,this.bitmap),!this.preserveBitmap){let i=!0;const o=r._glTextures;for(const s in o){const u=o[s];if(u!==n&&u.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class sl{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,r,n){const i=r.width,o=r.height;if(n){const s=e.width/2/i,u=e.height/2/o,p=e.x/i+s,d=e.y/o+u;n=we.add(n,we.NW),this.x0=p+s*we.uX(n),this.y0=d+u*we.uY(n),n=we.add(n,2),this.x1=p+s*we.uX(n),this.y1=d+u*we.uY(n),n=we.add(n,2),this.x2=p+s*we.uX(n),this.y2=d+u*we.uY(n),n=we.add(n,2),this.x3=p+s*we.uX(n),this.y3=d+u*we.uY(n)}else this.x0=e.x/i,this.y0=e.y/o,this.x1=(e.x+e.width)/i,this.y1=e.y/o,this.x2=(e.x+e.width)/i,this.y2=(e.y+e.height)/o,this.x3=e.x/i,this.y3=(e.y+e.height)/o;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const al=new sl;function zn(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class pe extends mn{constructor(e,r,n,i,o,s,u){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new ge(0,0,1,1)),e instanceof pe&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=i,this.valid=!1,this._uvs=al,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(o||0),o===!0)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=s?new Me(s.x,s.y):new Me(0,0),this.defaultBorders=u,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&yt[r.url]&&pe.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,pe.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),n=new pe(this.baseTexture,!this.noFrame&&e,r,(i=this.trim)==null?void 0:i.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(n._frame=e),n}updateUvs(){this._uvs===al&&(this._uvs=new sl),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},n=ue.STRICT_TEXTURE_CACHE){const i=typeof e=="string";let o=null;if(i)o=e;else if(e instanceof de){if(!e.cacheId){const u=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${u}-${Kr()}`,de.addToCache(e,e.cacheId)}o=e.cacheId}else{if(!e._pixiId){const u=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${u}_${Kr()}`}o=e._pixiId}let s=yt[o];if(i&&n&&!s)throw new Error(`The cacheId "${o}" does not exist in TextureCache.`);return s||e instanceof de?!s&&e instanceof de&&(s=new pe(e),pe.addToCache(s,o)):(r.resolution||(r.resolution=Ua(e)),s=new pe(new de(e,r)),s.baseTexture.cacheId=o,de.addToCache(s.baseTexture,o),pe.addToCache(s,o)),s}static fromURL(e,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=pe.from(e,Object.assign({resourceOptions:n},r),!1),o=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):o.load().then(()=>Promise.resolve(i))}static fromBuffer(e,r,n,i){return new pe(de.fromBuffer(e,r,n,i))}static fromLoader(e,r,n,i){const o=new de(e,Object.assign({scaleMode:de.defaultOptions.scaleMode,resolution:Ua(r)},i)),{resource:s}=o;s instanceof ol&&(s.url=r);const u=new pe(o);return n||(n=r),de.addToCache(u.baseTexture,n),pe.addToCache(u,n),n!==r&&(de.addToCache(u.baseTexture,r),pe.addToCache(u,r)),u.baseTexture.valid?Promise.resolve(u):new Promise(p=>{u.baseTexture.once("loaded",()=>p(u))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),yt[r]&&yt[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),yt[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=yt[e];if(r){const n=r.textureCacheIds.indexOf(e);return n>-1&&r.textureCacheIds.splice(n,1),delete yt[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)yt[e.textureCacheIds[r]]===e&&delete yt[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:n,width:i,height:o}=e,s=r+i>this.baseTexture.width,u=n+o>this.baseTexture.height;if(s||u){const p=s&&u?"and":"or",d=`X: ${r} + ${i} = ${r+i} > ${this.baseTexture.width}`,y=`Y: ${n} + ${o} = ${n+o} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${d} ${p} ${y}`)}this.valid=i&&o&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return pe._EMPTY||(pe._EMPTY=new pe(new de),zn(pe._EMPTY),zn(pe._EMPTY.baseTexture)),pe._EMPTY}static get WHITE(){if(!pe._WHITE){const e=ue.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),pe._WHITE=new pe(de.from(e)),zn(pe._WHITE),zn(pe._WHITE.baseTexture)}return pe._WHITE}}class Vn extends pe{constructor(e,r){super(e,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r,n=!0){const i=this.baseTexture.resolution,o=Math.round(e*i)/i,s=Math.round(r*i)/i;this.valid=o>0&&s>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=s,n&&this.baseTexture.resize(o,s),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new Vn(new il(e))}}class ll{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,n=Ne.NONE){const i=new il(Object.assign({width:e,height:r,resolution:1,multisample:n},this.textureOptions));return new Vn(i)}getOptimalTexture(e,r,n=1,i=Ne.NONE){let o;e=Math.ceil(e*n-1e-6),r=Math.ceil(r*n-1e-6),this.enableFullScreen&&e===this._pixelsWidth&&r===this._pixelsHeight?o=i>1?-i:-1:(o=((65535&(e=Rn(e)))<<16|65535&(r=Rn(r)))>>>0,i>1&&(o+=4294967296*i)),this.texturePool[o]||(this.texturePool[o]=[]);let s=this.texturePool[o].pop();return s||(s=this.createTexture(e,r,i)),s.filterPoolKey=o,s.setResolution(n),s}getFilterTexture(e,r,n){const i=this.getOptimalTexture(e.width,e.height,r||e.resolution,n||Ne.NONE);return i.filterFrame=e.filterFrame,i}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1)for(const r in this.texturePool){const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}}setScreenSize(e){if(e.width!==this._pixelsWidth||e.height!==this._pixelsHeight){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}ll.SCREEN_KEY=-1;class rf extends vr{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class nf extends vr{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new He(this.vertices),this.uvBuffer=new He(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let n=0,i=0;return this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+r.width/e.width,this.uvs[3]=i,this.uvs[4]=n+r.width/e.width,this.uvs[5]=i+r.height/e.height,this.uvs[6]=n,this.uvs[7]=i+r.height/e.height,n=r.x,i=r.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+r.width,this.vertices[3]=i,this.vertices[4]=n+r.width,this.vertices[5]=i+r.height,this.vertices[6]=n,this.vertices[7]=i+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class of{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ne.NONE,this.sourceFrame=new ge,this.destinationFrame=new ge,this.bindingSourceFrame=new ge,this.bindingDestinationFrame=new ge,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Xn=[new Me,new Me,new Me,new Me],No=new De;class ul{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new ll,this.statePool=[],this.quad=new rf,this.quadUv=new nf,this.tempRect=new ge,this.activeState={},this.globalUniforms=new tt({outputFrame:new ge,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const n=this.renderer,i=this.defaultFilterStack,o=this.statePool.pop()||new of,s=this.renderer.renderTexture;let u=r[0].resolution,p=r[0].multisample,d=r[0].padding,y=r[0].autoFit,f=r[0].legacy??!0;for(let a=1;a<r.length;a++){const h=r[a];u=Math.min(u,h.resolution),p=Math.min(p,h.multisample),d=this.useMaxPadding?Math.max(d,h.padding):d+h.padding,y=y&&h.autoFit,f=f||(h.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=s.current),i.push(o),o.resolution=u,o.multisample=p,o.legacy=f,o.target=e,o.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),o.sourceFrame.pad(d);const l=this.tempRect.copyFrom(s.sourceFrame);n.projection.transform&&this.transformAABB(No.copyFrom(n.projection.transform).invert(),l),y?(o.sourceFrame.fit(l),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(l)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,s.current?s.current.resolution:n.resolution,s.sourceFrame,s.destinationFrame,n.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,u,p),o.filters=r,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;const c=this.tempRect;c.x=0,c.y=0,c.width=o.sourceFrame.width,c.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(s.sourceFrame),o.bindingDestinationFrame.copyFrom(s.destinationFrame),o.transform=n.projection.transform,n.projection.transform=null,s.bind(o.renderTexture,o.sourceFrame,c),n.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),n=r.filters;this.activeState=r;const i=this.globalUniforms.uniforms;i.outputFrame=r.sourceFrame,i.resolution=r.resolution;const o=i.inputSize,s=i.inputPixel,u=i.inputClamp;if(o[0]=r.destinationFrame.width,o[1]=r.destinationFrame.height,o[2]=1/o[0],o[3]=1/o[1],s[0]=Math.round(o[0]*r.resolution),s[1]=Math.round(o[1]*r.resolution),s[2]=1/s[0],s[3]=1/s[1],u[0]=.5*s[2],u[1]=.5*s[3],u[2]=r.sourceFrame.width*o[2]-.5*s[2],u[3]=r.sourceFrame.height*o[3]-.5*s[3],r.legacy){const d=i.filterArea;d[0]=r.destinationFrame.width,d[1]=r.destinationFrame.height,d[2]=r.sourceFrame.x,d[3]=r.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const p=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,r.renderTexture,p.renderTexture,qt.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let d=r.renderTexture,y=this.getOptimalFilterTexture(d.width,d.height,r.resolution);y.filterFrame=d.filterFrame;let f=0;for(f=0;f<n.length-1;++f){f===1&&r.multisample>1&&(y=this.getOptimalFilterTexture(d.width,d.height,r.resolution),y.filterFrame=d.filterFrame),n[f].apply(this,d,y,qt.CLEAR,r);const l=d;d=y,y=l}n[f].apply(this,d,p.renderTexture,qt.BLEND,r),f>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(d),this.returnFilterTexture(y)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=qt.CLEAR){const{renderTexture:n,state:i}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,n.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const o=1&i.stateId||this.forceClear;(r===qt.CLEAR||r===qt.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,n,i){const o=this.renderer;o.state.set(e.state),this.bindAndClear(n,i),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(Nt.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(Nt.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:o}=r._texture,s=e.set(i.width,0,0,i.height,n.x,n.y),u=r.worldTransform.copyTo(De.TEMP_MATRIX);return u.invert(),s.prepend(u),s.scale(1/o.width,1/o.height),s.translate(r.anchor.x,r.anchor.y),s}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,n=1,i=Ne.NONE){return this.texturePool.getOptimalTexture(e,r,n,i)}getFilterTexture(e,r,n){if(typeof e=="number"){const o=e;e=r,r=o}e=e||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,n||Ne.NONE);return i.filterFrame=e.filterFrame,i}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const n=Xn[0],i=Xn[1],o=Xn[2],s=Xn[3];n.set(r.left,r.top),i.set(r.left,r.bottom),o.set(r.right,r.top),s.set(r.right,r.bottom),e.apply(n,n),e.apply(i,i),e.apply(o,o),e.apply(s,s);const u=Math.min(n.x,i.x,o.x,s.x),p=Math.min(n.y,i.y,o.y,s.y),d=Math.max(n.x,i.x,o.x,s.x),y=Math.max(n.y,i.y,o.y,s.y);r.x=u,r.y=p,r.width=d-u,r.height=y-p}roundFrame(e,r,n,i,o){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(o){const{a:s,b:u,c:p,d}=o;if((Math.abs(u)>1e-4||Math.abs(p)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(d)>1e-4))return}(o=o?No.copyFrom(o):No.identity()).translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(o,e),e.ceil(r),this.transformAABB(o.invert(),e)}}}ul.extension={type:ae.RendererSystem,name:"filter"},me.add(ul);class sf{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ne.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const af=new ge;class cl{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new So(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ge,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;ue.PREFER_ENV===Dt.WEBGL_LEGACY&&(r=null,n=null),r?e.drawBuffers=i=>r.drawBuffersWEBGL(i):(this.hasMRT=!1,e.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,n=0){const{gl:i}=this;if(e){const o=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,o.framebuffer)),o.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,o.mipLevel=n),o.dirtyId!==e.dirtyId&&(o.dirtyId=e.dirtyId,o.dirtyFormat!==e.dirtyFormat?(o.dirtyFormat=e.dirtyFormat,o.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):o.dirtySize!==e.dirtySize&&(o.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let s=0;s<e.colorTextures.length;s++){const u=e.colorTextures[s];this.renderer.texture.unbind(u.parentTextureArray||u)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const s=r.width>>n,u=r.height>>n,p=s/r.width;this.setViewport(r.x*p,r.y*p,s,u)}else{const s=e.width>>n,u=e.height>>n;this.setViewport(0,0,s,u)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,n,i){const o=this.viewport;e=Math.round(e),r=Math.round(r),n=Math.round(n),i=Math.round(i),o.width===n&&o.height===i&&o.x===e&&o.y===r||(o.x=e,o.y=r,o.width=n,o.height=i,this.gl.viewport(e,r,n,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,r,n,i,o=Ni.COLOR|Ni.DEPTH){const{gl:s}=this;s.clearColor(e,r,n,i),s.clear(o)}initFramebuffer(e){const{gl:r}=this,n=new sf(r.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n}resizeFramebuffer(e){const{gl:r}=this,n=e.glFramebuffers[this.CONTEXT_UID];n.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height));const i=e.colorTextures;let o=i.length;r.drawBuffers||(o=Math.min(o,1));for(let s=0;s<o;s++){const u=i[s],p=u.parentTextureArray||u;this.renderer.texture.bind(p,0),s===0&&n.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,p._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:n}=this,i=e.glFramebuffers[this.CONTEXT_UID],o=e.colorTextures;let s=o.length;n.drawBuffers||(s=Math.min(s,1)),i.multisample>1&&this.canMultisampleFramebuffer(e)?i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer():i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const u=[];for(let p=0;p<s;p++){const d=o[p],y=d.parentTextureArray||d;this.renderer.texture.bind(y,0),p===0&&i.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,y._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+p,d.target,y._glTextures[this.CONTEXT_UID].texture,r),u.push(n.COLOR_ATTACHMENT0+p))}if(u.length>1&&n.drawBuffers(u),e.depthTexture&&this.writeDepthTexture){const p=e.depthTexture;this.renderer.texture.bind(p,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,p._glTextures[this.CONTEXT_UID].texture,r)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil))}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let n=Ne.NONE;if(e<=1||r===null)return n;for(let i=0;i<r.length;i++)if(r[i]<=e){n=r[i];break}return n===1&&(n=Ne.NONE),n}blit(e,r,n){const{current:i,renderer:o,gl:s,CONTEXT_UID:u}=this;if(o.context.webGLVersion!==2||!i)return;const p=i.glFramebuffers[u];if(!p)return;if(!e){if(!p.msaaBuffer)return;const y=i.colorTextures[0];if(!y)return;p.blitFramebuffer||(p.blitFramebuffer=new So(i.width,i.height),p.blitFramebuffer.addColorTexture(0,y)),(e=p.blitFramebuffer).colorTextures[0]!==y&&(e.colorTextures[0]=y,e.dirtyId++,e.dirtyFormat++),e.width===i.width&&e.height===i.height||(e.width=i.width,e.height=i.height,e.dirtyId++,e.dirtySize++)}r||((r=af).width=i.width,r.height=i.height),n||(n=r);const d=r.width===n.width&&r.height===n.height;this.bind(e),s.bindFramebuffer(s.READ_FRAMEBUFFER,p.framebuffer),s.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,s.COLOR_BUFFER_BIT,d?s.NEAREST:s.LINEAR)}disposeFramebuffer(e,r){const n=e.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!n)return;delete e.glFramebuffers[this.CONTEXT_UID];const o=this.managedFramebuffers.indexOf(e);o>=0&&this.managedFramebuffers.splice(o,1),e.disposeRunner.remove(this),r||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<r.length;n++)this.disposeFramebuffer(r[n],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;e.stencil=!0;const n=e.width,i=e.height,o=this.gl,s=o.createRenderbuffer();o.bindRenderbuffer(o.RENDERBUFFER,s),r.msaaBuffer?o.renderbufferStorageMultisample(o.RENDERBUFFER,r.multisample,o.DEPTH24_STENCIL8,n,i):o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,n,i),r.stencil=s,o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,s)}reset(){this.current=this.unknownFramebuffer,this.viewport=new ge}destroy(){this.renderer=null}}cl.extension={type:ae.RendererSystem,name:"framebuffer"},me.add(cl);const ko={5126:4,5123:2,5121:1};class hl{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let n=this.renderer.context.extensions.vertexArrayObject;ue.PREFER_ENV===Dt.WEBGL_LEGACY&&(n=null),n?(e.createVertexArray=()=>n.createVertexArrayOES(),e.bindVertexArray=i=>n.bindVertexArrayOES(i),e.deleteVertexArray=i=>n.deleteVertexArrayOES(i)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const n=e.getExtension("ANGLE_instanced_arrays");n?(e.vertexAttribDivisor=(i,o)=>n.vertexAttribDivisorANGLE(i,o),e.drawElementsInstanced=(i,o,s,u,p)=>n.drawElementsInstancedANGLE(i,o,s,u,p),e.drawArraysInstanced=(i,o,s,u)=>n.drawArraysInstancedANGLE(i,o,s,u)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:n}=this;let i=e.glVertexArrayObjects[this.CONTEXT_UID],o=!1;i||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=i={},o=!0);const s=i[r.program.id]||this.initGeometryVao(e,r,o);this._activeGeometry=e,this._activeVao!==s&&(this._activeVao=s,this.hasVao?n.bindVertexArray(s):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let n=0;n<e.buffers.length;n++){const i=e.buffers[n];r.update(i)}}checkCompatibility(e,r){const n=e.attributes,i=r.attributeData;for(const o in i)if(!n[o])throw new Error(`shader and geometry incompatible, geometry missing the "${o}" attribute`)}getSignature(e,r){const n=e.attributes,i=r.attributeData,o=["g",e.id];for(const s in n)i[s]&&o.push(s,i[s].location);return o.join("-")}initGeometryVao(e,r,n=!0){const i=this.gl,o=this.CONTEXT_UID,s=this.renderer.buffer,u=r.program;u.glPrograms[o]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,u);const p=this.getSignature(e,u),d=e.glVertexArrayObjects[this.CONTEXT_UID];let y=d[p];if(y)return d[u.id]=y,y;const f=e.buffers,l=e.attributes,c={},a={};for(const h in f)c[h]=0,a[h]=0;for(const h in l)!l[h].size&&u.attributeData[h]?l[h].size=u.attributeData[h].size:l[h].size||console.warn(`PIXI Geometry attribute '${h}' size cannot be determined (likely the bound shader does not have the attribute)`),c[l[h].buffer]+=l[h].size*ko[l[h].type];for(const h in l){const m=l[h],g=m.size;m.stride===void 0&&(c[m.buffer]===g*ko[m.type]?m.stride=0:m.stride=c[m.buffer]),m.start===void 0&&(m.start=a[m.buffer],a[m.buffer]+=g*ko[m.type])}y=i.createVertexArray(),i.bindVertexArray(y);for(let h=0;h<f.length;h++){const m=f[h];s.bind(m),n&&m._glBuffers[o].refCount++}return this.activateVao(e,u),d[u.id]=y,d[p]=y,i.bindVertexArray(null),s.unbind(ht.ARRAY_BUFFER),y}disposeGeometry(e,r){var u;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const n=e.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,o=e.buffers,s=(u=this.renderer)==null?void 0:u.buffer;if(e.disposeRunner.remove(this),n){if(s)for(let p=0;p<o.length;p++){const d=o[p]._glBuffers[this.CONTEXT_UID];d&&(d.refCount--,d.refCount!==0||r||s.dispose(o[p],r))}if(!r){for(const p in n)if(p[0]==="g"){const d=n[p];this._activeVao===d&&this.unbind(),i.deleteVertexArray(d)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let n=0;n<r.length;n++)this.disposeGeometry(this.managedGeometries[r[n]],e)}activateVao(e,r){const n=this.gl,i=this.CONTEXT_UID,o=this.renderer.buffer,s=e.buffers,u=e.attributes;e.indexBuffer&&o.bind(e.indexBuffer);let p=null;for(const d in u){const y=u[d],f=s[y.buffer],l=f._glBuffers[i];if(r.attributeData[d]){p!==l&&(o.bind(f),p=l);const c=r.attributeData[d].location;if(n.enableVertexAttribArray(c),n.vertexAttribPointer(c,y.size,y.type||n.FLOAT,y.normalized,y.stride,y.start),y.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");n.vertexAttribDivisor(c,y.divisor)}}}}draw(e,r,n,i){const{gl:o}=this,s=this._activeGeometry;if(s.indexBuffer){const u=s.indexBuffer.data.BYTES_PER_ELEMENT,p=u===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;u===2||u===4&&this.canUseUInt32ElementIndex?s.instanced?o.drawElementsInstanced(e,r||s.indexBuffer.data.length,p,(n||0)*u,i||1):o.drawElements(e,r||s.indexBuffer.data.length,p,(n||0)*u):console.warn("unsupported index buffer type: uint32")}else s.instanced?o.drawArraysInstanced(e,n,r||s.getSize(),i||1):o.drawArrays(e,n,r||s.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}hl.extension={type:ae.RendererSystem,name:"geometry"},me.add(hl);const fl=new De;class lf{constructor(e,r){this._texture=e,this.mapCoord=new De,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=r===void 0?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const n=this.mapCoord;for(let i=0;i<e.length;i+=2){const o=e[i],s=e[i+1];r[i]=o*n.a+s*n.c+n.tx,r[i+1]=o*n.b+s*n.d+n.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const n=r._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=r.orig,o=r.trim;o&&(fl.set(i.width/o.width,0,0,i.height/o.height,-o.x/o.width,-o.y/o.height),this.mapCoord.append(fl));const s=r.baseTexture,u=this.uClampFrame,p=this.clampMargin/s.resolution,d=this.clampOffset;return u[0]=(r._frame.x+p+d)/s.width,u[1]=(r._frame.y+p+d)/s.height,u[2]=(r._frame.x+r._frame.width-p+d)/s.width,u[3]=(r._frame.y+r._frame.height-p+d)/s.height,this.uClampOffset[0]=d/s.realWidth,this.uClampOffset[1]=d/s.realHeight,this.isSimple=r._frame.width===s.width&&r._frame.height===s.height&&r.rotate===0,!0}}class uf extends Tt{constructor(e,r,n){let i=null;typeof e!="string"&&r===void 0&&n===void 0&&(i=e,e=void 0,r=void 0,n=void 0),super(e||`attribute vec2 aVertexPosition;
364
- attribute vec2 aTextureCoord;
365
-
366
- uniform mat3 projectionMatrix;
367
- uniform mat3 otherMatrix;
368
-
369
- varying vec2 vMaskCoord;
370
- varying vec2 vTextureCoord;
371
-
372
- void main(void)
373
- {
374
- gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
375
-
376
- vTextureCoord = aTextureCoord;
377
- vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
378
- }
379
- `,r||`varying vec2 vMaskCoord;
386
+ `;const tn=class extends Jr{constructor(e,t,r){const n=Ae.from(e||tn.defaultVertexSrc,t||tn.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=tn.defaultResolution,this.multisample=tn.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Ln}apply(e,t,r,n,i){e.applyFilter(this,t,r,n)}get blendMode(){return this.state.blendMode}set blendMode(e){this.state.blendMode=e}get resolution(){return this._resolution}set resolution(e){this._resolution=e}static get defaultVertexSrc(){return qd}static get defaultFragmentSrc(){return Gd}};let Se=tn;Se.defaultResolution=1,Se.defaultMultisample=Bt.NONE;class qn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Xt(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=t,s=n??r;s!==void 0&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}qn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},qn.extension={type:[vt.RendererSystem,vt.CanvasRendererSystem],name:"background"},wt.add(qn);class il{constructor(t){this.renderer=t,this.emptyRenderer=new nl(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,r){const{boundTextures:n}=this.renderer.texture;for(let i=r-1;i>=0;--i)t[i]=n[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,r,n,i){const{elements:s,ids:a,count:o}=t;let l=0;for(let f=0;f<o;f++){const c=s[f],h=c._batchLocation;if(h>=0&&h<i&&r[h]===c){a[f]=h;continue}for(;l<i;){const u=r[l];if(u&&u._batchEnabled===n&&u._batchLocation===l){l++;continue}a[f]=l,c._batchLocation=l,r[l]=c;break}}}destroy(){this.renderer=null}}il.extension={type:vt.RendererSystem,name:"batch"},wt.add(il);let sl=0;class Hn{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=sl++}init(t){if(t.context)this.initFromContext(t.context);else{const r=this.renderer.background.alpha<1,n=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:n,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=sl++,this.renderer.runners.contextChange.emit(t);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const r=this.createContext(this.renderer.view,t);this.initFromContext(r)}createContext(t,r){let n;if(mt.PREFER_ENV>=$e.WEBGL2&&(n=t.getContext("webgl2",r)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=t.getContext("webgl",r)||t.getContext("experimental-webgl",r),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,r={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const r=t.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=n||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Hn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Hn.extension={type:vt.RendererSystem,name:"context"},wt.add(Hn);class Hd extends ws{upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Pe.UNPACK);const s=r.realWidth,a=r.realHeight;return n.width===s&&n.height===a?i.texSubImage2D(r.target,0,0,0,s,a,r.format,n.type,this.data):(n.width=s,n.height=a,i.texImage2D(r.target,0,n.internalFormat,s,a,0,r.format,n.type,this.data)),!0}}class Ps{constructor(t,r){this.width=Math.round(t||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new re("disposeFramebuffer"),this.multisample=Bt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,r){return this.colorTextures[t]=r||new _t(null,{scaleMode:xe.NEAREST,resolution:1,mipmap:Ge.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new _t(new Hd(null,{width:this.width,height:this.height}),{scaleMode:xe.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ge.OFF,format:rt.DEPTH_COMPONENT,type:bt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,r){if(t=Math.round(t),r=Math.round(r),!(t===this.width&&r===this.height)){this.width=t,this.height=r,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){const i=this.colorTextures[n],s=i.resolution;i.setSize(t/s,r/s)}if(this.depthTexture){const n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,r/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class al extends _t{constructor(t={}){if(typeof t=="number"){const r=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];t={width:r,height:n,scaleMode:i,resolution:s}}t.width=t.width||100,t.height=t.height||100,t.multisample??(t.multisample=Bt.NONE),super(null,t),this.mipmap=Ge.OFF,this.valid=!0,this._clear=new Xt([0,0,0,0]),this.framebuffer=new Ps(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}resize(t,r){this.framebuffer.resize(t*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Be extends Kr{constructor(t){const r=t,n=r.naturalWidth||r.videoWidth||r.width,i=r.naturalHeight||r.videoHeight||r.height;super(n,i),this.source=t,this.noSubImage=!1}static crossOrigin(t,r,n){n===void 0&&!r.startsWith("data:")?t.crossOrigin=fd(r):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")}upload(t,r,n,i){const s=t.gl,a=r.realWidth,o=r.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||i.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1&&i.buffered.length===0)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Pe.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&n.width===a&&n.height===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,n.type,i):(n.width=a,n.height=o,s.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)),!0}update(){if(this.destroyed)return;const t=this.source,r=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class ol extends Be{constructor(t,r){if(r=r||{},typeof t=="string"){const n=new Image;Be.crossOrigin(n,t,r.crossorigin),n.src=t,t=n}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??mt.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(t){return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise((r,n)=>{const i=this.source;this.url=i.src;const s=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.resize(i.width,i.height),this._load=null,this.createBitmap?r(this.process()):r(this))};i.complete&&i.src?s():(i.onload=s,i.onerror=a=>{n(a),this.onError.emit(a)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,n=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:n?"cors":"no-cors"}).then(i=>i.blob()).then(i=>r(i,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Pe.UNPACK?"premultiply":"none"})).then(i=>this.destroyed?Promise.reject():(this.bitmap=i,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,r,n){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,r,n,this.bitmap),!this.preserveBitmap){let i=!0;const s=r._glTextures;for(const a in s){const o=s[a];if(o!==n&&o.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class ll{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,r,n){const i=r.width,s=r.height;if(n){const a=t.width/2/i,o=t.height/2/s,l=t.x/i+a,f=t.y/s+o;n=kt.add(n,kt.NW),this.x0=l+a*kt.uX(n),this.y0=f+o*kt.uY(n),n=kt.add(n,2),this.x1=l+a*kt.uX(n),this.y1=f+o*kt.uY(n),n=kt.add(n,2),this.x2=l+a*kt.uX(n),this.y2=f+o*kt.uY(n),n=kt.add(n,2),this.x3=l+a*kt.uX(n),this.y3=f+o*kt.uY(n)}else this.x0=t.x/i,this.y0=t.y/s,this.x1=(t.x+t.width)/i,this.y1=t.y/s,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/s,this.x3=t.x/i,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}toString(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}}const ul=new ll;function Vn(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class xt extends yn{constructor(t,r,n,i,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new At(0,0,1,1)),t instanceof xt&&(t=t.baseTexture),this.baseTexture=t,this._frame=r,this.trim=i,this.valid=!1,this._uvs=ul,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new Gt(a.x,a.y):new Gt(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=r:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:r}=this.baseTexture;r!=null&&r.url&&me[r.url]&&xt.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,xt.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),n=new xt(this.baseTexture,!this.noFrame&&t,r,(i=this.trim)==null?void 0:i.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(n._frame=t),n}updateUvs(){this._uvs===ul&&(this._uvs=new ll),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,r={},n=mt.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let s=null;if(i)s=t;else if(t instanceof _t){if(!t.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Yr()}`,_t.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Yr()}`}s=t._pixiId}let a=me[s];if(i&&n&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(t instanceof _t)?(r.resolution||(r.resolution=Go(t)),a=new xt(new _t(t,r)),a.baseTexture.cacheId=s,_t.addToCache(a.baseTexture,s),xt.addToCache(a,s)):!a&&t instanceof _t&&(a=new xt(t),xt.addToCache(a,s)),a}static fromURL(t,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=xt.from(t,Object.assign({resourceOptions:n},r),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then(()=>Promise.resolve(i))}static fromBuffer(t,r,n,i){return new xt(_t.fromBuffer(t,r,n,i))}static fromLoader(t,r,n,i){const s=new _t(t,Object.assign({scaleMode:_t.defaultOptions.scaleMode,resolution:Go(r)},i)),{resource:a}=s;a instanceof ol&&(a.url=r);const o=new xt(s);return n||(n=r),_t.addToCache(o.baseTexture,n),xt.addToCache(o,n),n!==r&&(_t.addToCache(o.baseTexture,r),xt.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(l=>{o.baseTexture.once("loaded",()=>l(o))})}static addToCache(t,r){r&&(t.textureCacheIds.includes(r)||t.textureCacheIds.push(r),me[r]&&me[r]!==t&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),me[r]=t)}static removeFromCache(t){if(typeof t=="string"){const r=me[t];if(r){const n=r.textureCacheIds.indexOf(t);return n>-1&&r.textureCacheIds.splice(n,1),delete me[t],r}}else if(t!=null&&t.textureCacheIds){for(let r=0;r<t.textureCacheIds.length;++r)me[t.textureCacheIds[r]]===t&&delete me[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:r,y:n,width:i,height:s}=t,a=r+i>this.baseTexture.width,o=n+s>this.baseTexture.height;if(a||o){const l=a&&o?"and":"or",f=`X: ${r} + ${i} = ${r+i} > ${this.baseTexture.width}`,c=`Y: ${n} + ${s} = ${n+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${f} ${l} ${c}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return xt._EMPTY||(xt._EMPTY=new xt(new _t),Vn(xt._EMPTY),Vn(xt._EMPTY.baseTexture)),xt._EMPTY}static get WHITE(){if(!xt._WHITE){const t=mt.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),xt._WHITE=new xt(_t.from(t)),Vn(xt._WHITE),Vn(xt._WHITE.baseTexture)}return xt._WHITE}}class zn extends xt{constructor(t,r){super(t,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,r,n=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,a=Math.round(r*i)/i;this.valid=s>0&&a>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(s,a),this.updateUvs()}setResolution(t){const{baseTexture:r}=this;r.resolution!==t&&(r.setResolution(t),this.resize(r.width,r.height,!1))}static create(t){return new zn(new al(t))}}class fl{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,r,n=Bt.NONE){const i=new al(Object.assign({width:t,height:r,resolution:1,multisample:n},this.textureOptions));return new zn(i)}getOptimalTexture(t,r,n=1,i=Bt.NONE){let s;t=Math.ceil(t*n-1e-6),r=Math.ceil(r*n-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||r!==this._pixelsHeight?(t=Pn(t),r=Pn(r),s=((t&65535)<<16|r&65535)>>>0,i>1&&(s+=i*4294967296)):s=i>1?-i:-1,this.texturePool[s]||(this.texturePool[s]=[]);let a=this.texturePool[s].pop();return a||(a=this.createTexture(t,r,i)),a.filterPoolKey=s,a.setResolution(n),a}getFilterTexture(t,r,n){const i=this.getOptimalTexture(t.width,t.height,r||t.resolution,n||Bt.NONE);return i.filterFrame=t.filterFrame,i}returnTexture(t){const r=t.filterPoolKey;t.filterFrame=null,this.texturePool[r].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const r in this.texturePool){const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}}setScreenSize(t){if(!(t.width===this._pixelsWidth&&t.height===this._pixelsHeight)){this.enableFullScreen=t.width>0&&t.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}fl.SCREEN_KEY=-1;class Vd extends br{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class zd extends br{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Wt(this.vertices),this.uvBuffer=new Wt(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,r){let n=0,i=0;return this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+r.width/t.width,this.uvs[3]=i,this.uvs[4]=n+r.width/t.width,this.uvs[5]=i+r.height/t.height,this.uvs[6]=n,this.uvs[7]=i+r.height/t.height,n=r.x,i=r.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+r.width,this.vertices[3]=i,this.vertices[4]=n+r.width,this.vertices[5]=i+r.height,this.vertices[6]=n,this.vertices[7]=i+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class Xd{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Bt.NONE,this.sourceFrame=new At,this.destinationFrame=new At,this.bindingSourceFrame=new At,this.bindingDestinationFrame=new At,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Xn=[new Gt,new Gt,new Gt,new Gt],ks=new zt;class cl{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new fl,this.statePool=[],this.quad=new Vd,this.quadUv=new zd,this.tempRect=new At,this.activeState={},this.globalUniforms=new ne({outputFrame:new At,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,r){const n=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new Xd,a=this.renderer.renderTexture;let o=r[0].resolution,l=r[0].multisample,f=r[0].padding,c=r[0].autoFit,h=r[0].legacy??!0;for(let p=1;p<r.length;p++){const v=r[p];o=Math.min(o,v.resolution),l=Math.min(l,v.multisample),f=this.useMaxPadding?Math.max(f,v.padding):f+v.padding,c=c&&v.autoFit,h=h||(v.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),i.push(s),s.resolution=o,s.multisample=l,s.legacy=h,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(f);const u=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(ks.copyFrom(n.projection.transform).invert(),u),c?(s.sourceFrame.fit(u),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(u)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,o,l),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const d=this.tempRect;d.x=0,d.y=0,d.width=s.sourceFrame.width,d.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,d),n.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,r=t.pop(),n=r.filters;this.activeState=r;const i=this.globalUniforms.uniforms;i.outputFrame=r.sourceFrame,i.resolution=r.resolution;const s=i.inputSize,a=i.inputPixel,o=i.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*r.resolution),a[1]=Math.round(s[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*s[2]-.5*a[2],o[3]=r.sourceFrame.height*s[3]-.5*a[3],r.legacy){const f=i.filterArea;f[0]=r.destinationFrame.width,f[1]=r.destinationFrame.height,f[2]=r.sourceFrame.x,f[3]=r.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const l=t[t.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,r.renderTexture,l.renderTexture,qe.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let f=r.renderTexture,c=this.getOptimalFilterTexture(f.width,f.height,r.resolution);c.filterFrame=f.filterFrame;let h=0;for(h=0;h<n.length-1;++h){h===1&&r.multisample>1&&(c=this.getOptimalFilterTexture(f.width,f.height,r.resolution),c.filterFrame=f.filterFrame),n[h].apply(this,f,c,qe.CLEAR,r);const u=f;f=c,c=u}n[h].apply(this,f,l.renderTexture,qe.BLEND,r),h>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(f),this.returnFilterTexture(c)}r.clear(),this.statePool.push(r)}bindAndClear(t,r=qe.CLEAR){const{renderTexture:n,state:i}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t!=null&&t.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,n.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=i.stateId&1||this.forceClear;(r===qe.CLEAR||r===qe.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,r,n,i){const s=this.renderer;s.state.set(t.state),this.bindAndClear(n,i),t.uniforms.uSampler=r,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Ce.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Ce.TRIANGLE_STRIP))}calculateSpriteMatrix(t,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:s}=r._texture,a=t.set(i.width,0,0,i.height,n.x,n.y),o=r.worldTransform.copyTo(zt.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/s.width,1/s.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,r,n=1,i=Bt.NONE){return this.texturePool.getOptimalTexture(t,r,n,i)}getFilterTexture(t,r,n){if(typeof t=="number"){const s=t;t=r,r=s}t=t||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(t.width,t.height,r||t.resolution,n||Bt.NONE);return i.filterFrame=t.filterFrame,i}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,r){const n=Xn[0],i=Xn[1],s=Xn[2],a=Xn[3];n.set(r.left,r.top),i.set(r.left,r.bottom),s.set(r.right,r.top),a.set(r.right,r.bottom),t.apply(n,n),t.apply(i,i),t.apply(s,s),t.apply(a,a);const o=Math.min(n.x,i.x,s.x,a.x),l=Math.min(n.y,i.y,s.y,a.y),f=Math.max(n.x,i.x,s.x,a.x),c=Math.max(n.y,i.y,s.y,a.y);r.x=o,r.y=l,r.width=f-o,r.height=c-l}roundFrame(t,r,n,i,s){if(!(t.width<=0||t.height<=0||n.width<=0||n.height<=0)){if(s){const{a,b:o,c:l,d:f}=s;if((Math.abs(o)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(f)>1e-4))return}s=s?ks.copyFrom(s):ks.identity(),s.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(r),this.transformAABB(s.invert(),t)}}}cl.extension={type:vt.RendererSystem,name:"filter"},wt.add(cl);class Wd{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Bt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Yd=new At;class hl{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Ps(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new At,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;mt.PREFER_ENV===$e.WEBGL_LEGACY&&(r=null,n=null),r?t.drawBuffers=i=>r.drawBuffersWEBGL(i):(this.hasMRT=!1,t.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,r,n=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==n&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=n),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,n)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let a=0;a<t.colorTextures.length;a++){const o=t.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),r){const a=r.width>>n,o=r.height>>n,l=a/r.width;this.setViewport(r.x*l,r.y*l,a,o)}else{const a=t.width>>n,o=t.height>>n;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,r,n,i){const s=this.viewport;t=Math.round(t),r=Math.round(r),n=Math.round(n),i=Math.round(i),(s.width!==n||s.height!==i||s.x!==t||s.y!==r)&&(s.x=t,s.y=r,s.width=n,s.height=i,this.gl.viewport(t,r,n,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,r,n,i,s=Ii.COLOR|Ii.DEPTH){const{gl:a}=this;a.clearColor(t,r,n,i),a.clear(s)}initFramebuffer(t){const{gl:r}=this,n=new Wd(r.createFramebuffer());return n.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(t),t.disposeRunner.add(this),n}resizeFramebuffer(t){const{gl:r}=this,n=t.glFramebuffers[this.CONTEXT_UID];n.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,n.stencil),n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height));const i=t.colorTextures;let s=i.length;r.drawBuffers||(s=Math.min(s,1));for(let a=0;a<s;a++){const o=i[a],l=o.parentTextureArray||o;this.renderer.texture.bind(l,0),a===0&&n.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,l._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,r){const{gl:n}=this,i=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let a=s.length;n.drawBuffers||(a=Math.min(a,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer():i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let l=0;l<a;l++){const f=s[l],c=f.parentTextureArray||f;this.renderer.texture.bind(c,0),l===0&&i.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+l,f.target,c._glTextures[this.CONTEXT_UID].texture,r),o.push(n.COLOR_ATTACHMENT0+l))}if(o.length>1&&n.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const f=t.depthTexture;this.renderer.texture.bind(f,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,f._glTextures[this.CONTEXT_UID].texture,r)}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,t.width,t.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:r}=this;let n=Bt.NONE;if(t<=1||r===null)return n;for(let i=0;i<r.length;i++)if(r[i]<=t){n=r[i];break}return n===1&&(n=Bt.NONE),n}blit(t,r,n){const{current:i,renderer:s,gl:a,CONTEXT_UID:o}=this;if(s.context.webGLVersion!==2||!i)return;const l=i.glFramebuffers[o];if(!l)return;if(!t){if(!l.msaaBuffer)return;const c=i.colorTextures[0];if(!c)return;l.blitFramebuffer||(l.blitFramebuffer=new Ps(i.width,i.height),l.blitFramebuffer.addColorTexture(0,c)),t=l.blitFramebuffer,t.colorTextures[0]!==c&&(t.colorTextures[0]=c,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}r||(r=Yd,r.width=i.width,r.height=i.height),n||(n=r);const f=r.width===n.width&&r.height===n.height;this.bind(t),a.bindFramebuffer(a.READ_FRAMEBUFFER,l.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,a.COLOR_BUFFER_BIT,f?a.NEAREST:a.LINEAR)}disposeFramebuffer(t,r){const n=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!n)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),r||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,r)}disposeAll(t){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<r.length;n++)this.disposeFramebuffer(r[n],t)}forceStencil(){const t=this.current;if(!t)return;const r=t.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil)return;t.stencil=!0;const n=t.width,i=t.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,n,i):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,n,i),r.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new At}destroy(){this.renderer=null}}hl.extension={type:vt.RendererSystem,name:"framebuffer"},wt.add(hl);const Ms={5126:4,5123:2,5121:1};class dl{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let n=this.renderer.context.extensions.vertexArrayObject;mt.PREFER_ENV===$e.WEBGL_LEGACY&&(n=null),n?(t.createVertexArray=()=>n.createVertexArrayOES(),t.bindVertexArray=i=>n.bindVertexArrayOES(i),t.deleteVertexArray=i=>n.deleteVertexArrayOES(i)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const n=t.getExtension("ANGLE_instanced_arrays");n?(t.vertexAttribDivisor=(i,s)=>n.vertexAttribDivisorANGLE(i,s),t.drawElementsInstanced=(i,s,a,o,l)=>n.drawElementsInstancedANGLE(i,s,a,o,l),t.drawArraysInstanced=(i,s,a,o)=>n.drawArraysInstancedANGLE(i,s,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(t,r){r=r||this.renderer.shader.shader;const{gl:n}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const a=i[r.program.id]||this.initGeometryVao(t,r,s);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?n.bindVertexArray(a):this.activateVao(t,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,r=this.renderer.buffer;for(let n=0;n<t.buffers.length;n++){const i=t.buffers[n];r.update(i)}}checkCompatibility(t,r){const n=t.attributes,i=r.attributeData;for(const s in i)if(!n[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(t,r){const n=t.attributes,i=r.attributeData,s=["g",t.id];for(const a in n)i[a]&&s.push(a,i[a].location);return s.join("-")}initGeometryVao(t,r,n=!0){const i=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(t,o);const l=this.getSignature(t,o),f=t.glVertexArrayObjects[this.CONTEXT_UID];let c=f[l];if(c)return f[o.id]=c,c;const h=t.buffers,u=t.attributes,d={},p={};for(const v in h)d[v]=0,p[v]=0;for(const v in u)!u[v].size&&o.attributeData[v]?u[v].size=o.attributeData[v].size:u[v].size||console.warn(`PIXI Geometry attribute '${v}' size cannot be determined (likely the bound shader does not have the attribute)`),d[u[v].buffer]+=u[v].size*Ms[u[v].type];for(const v in u){const g=u[v],m=g.size;g.stride===void 0&&(d[g.buffer]===m*Ms[g.type]?g.stride=0:g.stride=d[g.buffer]),g.start===void 0&&(g.start=p[g.buffer],p[g.buffer]+=m*Ms[g.type])}c=i.createVertexArray(),i.bindVertexArray(c);for(let v=0;v<h.length;v++){const g=h[v];a.bind(g),n&&g._glBuffers[s].refCount++}return this.activateVao(t,o),f[o.id]=c,f[l]=c,i.bindVertexArray(null),a.unbind(de.ARRAY_BUFFER),c}disposeGeometry(t,r){var o;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const n=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(t.disposeRunner.remove(this),!!n){if(a)for(let l=0;l<s.length;l++){const f=s[l]._glBuffers[this.CONTEXT_UID];f&&(f.refCount--,f.refCount===0&&!r&&a.dispose(s[l],r))}if(!r){for(const l in n)if(l[0]==="g"){const f=n[l];this._activeVao===f&&this.unbind(),i.deleteVertexArray(f)}}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const r=Object.keys(this.managedGeometries);for(let n=0;n<r.length;n++)this.disposeGeometry(this.managedGeometries[r[n]],t)}activateVao(t,r){const n=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,a=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let l=null;for(const f in o){const c=o[f],h=a[c.buffer],u=h._glBuffers[i];if(r.attributeData[f]){l!==u&&(s.bind(h),l=u);const d=r.attributeData[f].location;if(n.enableVertexAttribArray(d),n.vertexAttribPointer(d,c.size,c.type||n.FLOAT,c.normalized,c.stride,c.start),c.instance)if(this.hasInstance)n.vertexAttribDivisor(d,c.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,r,n,i){const{gl:s}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,l=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(t,r||a.indexBuffer.data.length,l,(n||0)*o,i||1):s.drawElements(t,r||a.indexBuffer.data.length,l,(n||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(t,n,r||a.getSize(),i||1):s.drawArrays(t,n,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}dl.extension={type:vt.RendererSystem,name:"geometry"},wt.add(dl);const pl=new zt;class Kd{constructor(t,r){this._texture=t,this.mapCoord=new zt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,r){r===void 0&&(r=t);const n=this.mapCoord;for(let i=0;i<t.length;i+=2){const s=t[i],a=t[i+1];r[i]=s*n.a+a*n.c+n.tx,r[i+1]=s*n.b+a*n.d+n.ty}return r}update(t){const r=this._texture;if(!r||!r.valid||!t&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const n=r._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=r.orig,s=r.trim;s&&(pl.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(pl));const a=r.baseTexture,o=this.uClampFrame,l=this.clampMargin/a.resolution,f=this.clampOffset;return o[0]=(r._frame.x+l+f)/a.width,o[1]=(r._frame.y+l+f)/a.height,o[2]=(r._frame.x+r._frame.width-l+f)/a.width,o[3]=(r._frame.y+r._frame.height-l+f)/a.height,this.uClampOffset[0]=f/a.realWidth,this.uClampOffset[1]=f/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var Zd=`varying vec2 vMaskCoord;
380
387
  varying vec2 vTextureCoord;
381
388
 
382
389
  uniform sampler2D uSampler;
@@ -401,7 +408,23 @@ void main(void)
401
408
 
402
409
  gl_FragColor = original;
403
410
  }
404
- `,n),this.maskSprite=i,this.maskMatrix=new De}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,n,i){const o=this._maskSprite,s=o._texture;s.valid&&(s.uvMatrix||(s.uvMatrix=new lf(s,0)),s.uvMatrix.update(),this.uniforms.npmAlpha=s.baseTexture.alphaMode?0:1,this.uniforms.mask=s,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,o).prepend(s.uvMatrix.mapCoord),this.uniforms.alpha=o.worldAlpha,this.uniforms.maskClamp=s.uvMatrix.uClampFrame,e.applyFilter(this,r,n,i))}}class cf{constructor(e=null){this.type=Ce.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Tt.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ce.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class dl{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let n=r;if(!n.isMaskData){const o=this.maskDataPool.pop()||new cf;o.pooled=!0,o.maskObject=r,n=o}const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(i),n._colorMask=i?i._colorMask:15,n.autoDetect&&this.detect(n),n._target=e,n.type!==Ce.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Ce.SCISSOR:this.renderer.scissor.push(n);break;case Ce.STENCIL:this.renderer.stencil.push(n);break;case Ce.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Ce.COLOR:this.pushColorMask(n)}n.type===Ce.SPRITE&&this.maskStack.push(n)}pop(e){const r=this.maskStack.pop();if(r&&r._target===e){if(r.enabled)switch(r.type){case Ce.SCISSOR:this.renderer.scissor.pop(r);break;case Ce.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ce.SPRITE:this.popSpriteMask(r);break;case Ce.COLOR:this.popColorMask(r)}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const n=this.maskStack[this.maskStack.length-1];n.type===Ce.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=Ce.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Ce.SCISSOR:e.type=Ce.STENCIL:e.type=Ce.COLOR}pushSpriteMask(e){const{maskObject:r}=e,n=e._target;let i=e._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new uf]));const o=this.renderer,s=o.renderTexture;let u,p;if(s.current){const y=s.current;u=e.resolution||y.resolution,p=e.multisample??y.multisample}else u=e.resolution||o.resolution,p=e.multisample??o.multisample;i[0].resolution=u,i[0].multisample=p,i[0].maskSprite=r;const d=n.filterArea;n.filterArea=r.getBounds(!0),o.filter.push(n,i),n.filterArea=d,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,n=e._colorMask=r&e.colorMask;n!==r&&this.renderer.gl.colorMask((1&n)!=0,(2&n)!=0,(4&n)!=0,(8&n)!=0)}popColorMask(e){const r=e._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==r&&this.renderer.gl.colorMask((1&n)!=0,(2&n)!=0,(4&n)!=0,(8&n)!=0)}destroy(){this.renderer=null}}dl.extension={type:ae.RendererSystem,name:"mask"},me.add(dl);class pl{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,n=this.getStackLength();this.maskStack=e;const i=this.getStackLength();i!==n&&(i===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const yl=new De,ml=[],$n=class extends pl{constructor(t){super(t),this.glConst=ue.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:n}=this,i=n.renderTexture,o=r.getBounds(!0,ml.pop()??new ge);this.roundFrameToPixels(o,i.current?i.current.resolution:n.resolution,i.sourceFrame,i.destinationFrame,n.projection.transform),e&&o.fit(e),t._scissorRectLocal=o}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:n,d:i}=t;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(i)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||$n.isMatrixRotated(e.worldTransform)||$n.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,e,r,n,i){$n.isMatrixRotated(i)||((i=i?yl.copyFrom(i):yl.identity()).translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(i,t),t.fit(n),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&ml.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};let gl=$n;gl.extension={type:ae.RendererSystem,name:"scissor"},me.add(gl);class vl extends pl{constructor(e){super(e),this.glConst=ue.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:n}=this.renderer,i=e._stencilCounter;i===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;const o=e._colorMask;o!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,i,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,o!==0&&(e._colorMask=o,n.colorMask((1&o)!=0,(2&o)!=0,(4&o)!=0,(8&o)!=0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,i=n?n._colorMask:15;i!==0&&(n._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,i!==0&&(n._colorMask=i,r.colorMask((1&i)!=0,(2&i)!=0,(4&i)!=0,(8&i)!=0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}vl.extension={type:ae.RendererSystem,name:"stencil"},me.add(vl);class bl{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>(ye("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract)},prepare:{enumerable:!1,get:()=>(ye("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare)},interaction:{enumerable:!1,get:()=>(ye("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events)}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}bl.extension={type:[ae.RendererSystem,ae.CanvasRendererSystem],name:"_plugin"},me.add(bl);class _l{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new De,this.transform=null}update(e,r,n,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);const o=this.renderer;o.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,o.globalUniforms.update(),o.shader.shader&&o.shader.syncUniformGroup(o.shader.shader.uniforms.globals)}calculateProjection(e,r,n,i){const o=this.projectionMatrix,s=i?-1:1;o.identity(),o.a=1/r.width*2,o.d=s*(1/r.height*2),o.tx=-1-r.x*o.a,o.ty=-s-r.y*o.d}setTransform(e){}destroy(){this.renderer=null}}_l.extension={type:ae.RendererSystem,name:"projection"},me.add(_l);const hf=new To;class xl{constructor(e){this.renderer=e,this._tempMatrix=new De}generateTexture(e,r){const{region:n,...i}=r||{},o=n||e.getLocalBounds(null,!0);o.width===0&&(o.width=1),o.height===0&&(o.height=1);const s=Vn.create({width:o.width,height:o.height,...i});this._tempMatrix.tx=-o.x,this._tempMatrix.ty=-o.y;const u=e.transform;return e.transform=hf,this.renderer.render(e,{renderTexture:s,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=u,s}destroy(){}}xl.extension={type:[ae.RendererSystem,ae.CanvasRendererSystem],name:"textureGenerator"},me.add(xl);const Kt=new ge,rn=new ge;class El{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ge,this.destinationFrame=new ge,this.viewportFrame=new ge}bind(e=null,r,n){const i=this.renderer;let o,s,u;this.current=e,e?(o=e.baseTexture,u=o.resolution,r||(Kt.width=e.frame.width,Kt.height=e.frame.height,r=Kt),n||(rn.x=e.frame.x,rn.y=e.frame.y,rn.width=r.width,rn.height=r.height,n=rn),s=o.framebuffer):(u=i.resolution,r||(Kt.width=i._view.screen.width,Kt.height=i._view.screen.height,r=Kt),n||((n=Kt).width=r.width,n.height=r.height));const p=this.viewportFrame;p.x=n.x*u,p.y=n.y*u,p.width=n.width*u,p.height=n.height*u,e||(p.y=i.view.height-(p.y+p.height)),p.ceil(),this.renderer.framebuffer.bind(s,p),this.renderer.projection.update(n,r,u,!s),e?this.renderer.mask.setMaskStack(o.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(n)}clear(e,r){const n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=e?qe.shared.setValue(e):n,o=this.destinationFrame,s=this.current?this.current.baseTexture:this.renderer._view.screen,u=o.width!==s.width||o.height!==s.height;if(u){let{x:p,y:d,width:y,height:f}=this.viewportFrame;p=Math.round(p),d=Math.round(d),y=Math.round(y),f=Math.round(f),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(p,d,y,f)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,r),u&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}El.extension={type:ae.RendererSystem,name:"renderTexture"},me.add(El);class ff{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function df(t,e){var u;const r=$a(t,t.VERTEX_SHADER,e.vertexSrc),n=$a(t,t.FRAGMENT_SHADER,e.fragmentSrc),i=t.createProgram();t.attachShader(i,r),t.attachShader(i,n);const o=(u=e.extra)==null?void 0:u.transformFeedbackVaryings;if(o&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(i,o.names,o.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||function(p,d,y,f){p.getProgramParameter(d,p.LINK_STATUS)||(p.getShaderParameter(y,p.COMPILE_STATUS)||Ka(p,y),p.getShaderParameter(f,p.COMPILE_STATUS)||Ka(p,f),console.error("PixiJS Error: Could not initialize shader."),p.getProgramInfoLog(d)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",p.getProgramInfoLog(d)))}(t,i,r,n),e.attributeData=function(p,d){const y={},f=d.getProgramParameter(p,d.ACTIVE_ATTRIBUTES);for(let l=0;l<f;l++){const c=d.getActiveAttrib(p,l);if(c.name.startsWith("gl_"))continue;const a=Ja(d,c.type),h={type:a,name:c.name,size:Za(a),location:d.getAttribLocation(p,c.name)};y[c.name]=h}return y}(i,t),e.uniformData=function(p,d){const y={},f=d.getProgramParameter(p,d.ACTIVE_UNIFORMS);for(let l=0;l<f;l++){const c=d.getActiveUniform(p,l),a=c.name.replace(/\[.*?\]$/,""),h=!!c.name.match(/\[.*?\]$/),m=Ja(d,c.type);y[a]={name:a,index:l,type:m,size:c.size,isArray:h,value:Wa(m,c.size)}}return y}(i,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const p=Object.keys(e.attributeData);p.sort((d,y)=>d>y?1:-1);for(let d=0;d<p.length;d++)e.attributeData[p[d]].location=d,t.bindAttribLocation(i,d,p[d]);t.linkProgram(i)}t.deleteShader(r),t.deleteShader(n);const s={};for(const p in e.uniformData){const d=e.uniformData[p];s[p]={location:t.getUniformLocation(i,p),value:Wa(d.type,d.size)}}return new ff(i,s)}function pf(t,e,r,n,i){r.buffer.update(i)}const yf={float:`
411
+ `,Qd=`attribute vec2 aVertexPosition;
412
+ attribute vec2 aTextureCoord;
413
+
414
+ uniform mat3 projectionMatrix;
415
+ uniform mat3 otherMatrix;
416
+
417
+ varying vec2 vMaskCoord;
418
+ varying vec2 vTextureCoord;
419
+
420
+ void main(void)
421
+ {
422
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
423
+
424
+ vTextureCoord = aTextureCoord;
425
+ vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
426
+ }
427
+ `;class Jd extends Se{constructor(t,r,n){let i=null;typeof t!="string"&&r===void 0&&n===void 0&&(i=t,t=void 0,r=void 0,n=void 0),super(t||Qd,r||Zd,n),this.maskSprite=i,this.maskMatrix=new zt}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,r,n,i){const s=this._maskSprite,a=s._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new Kd(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,t.applyFilter(this,r,n,i))}}class tp{constructor(t=null){this.type=Ut.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Se.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ut.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class vl{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,r){let n=r;if(!n.isMaskData){const s=this.maskDataPool.pop()||new tp;s.pooled=!0,s.maskObject=r,n=s}const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(i),n._colorMask=i?i._colorMask:15,n.autoDetect&&this.detect(n),n._target=t,n.type!==Ut.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Ut.SCISSOR:this.renderer.scissor.push(n);break;case Ut.STENCIL:this.renderer.stencil.push(n);break;case Ut.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Ut.COLOR:this.pushColorMask(n);break}n.type===Ut.SPRITE&&this.maskStack.push(n)}pop(t){const r=this.maskStack.pop();if(!(!r||r._target!==t)){if(r.enabled)switch(r.type){case Ut.SCISSOR:this.renderer.scissor.pop(r);break;case Ut.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ut.SPRITE:this.popSpriteMask(r);break;case Ut.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const n=this.maskStack[this.maskStack.length-1];n.type===Ut.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(t){const r=t.maskObject;r?r.isSprite?t.type=Ut.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Ut.SCISSOR:t.type=Ut.STENCIL:t.type=Ut.COLOR}pushSpriteMask(t){const{maskObject:r}=t,n=t._target;let i=t._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new Jd]));const s=this.renderer,a=s.renderTexture;let o,l;if(a.current){const c=a.current;o=t.resolution||c.resolution,l=t.multisample??c.multisample}else o=t.resolution||s.resolution,l=t.multisample??s.multisample;i[0].resolution=o,i[0].multisample=l,i[0].maskSprite=r;const f=n.filterArea;n.filterArea=r.getBounds(!0),s.filter.push(n,i),n.filterArea=f,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const r=t._colorMask,n=t._colorMask=r&t.colorMask;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}popColorMask(t){const r=t._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}destroy(){this.renderer=null}}vl.extension={type:vt.RendererSystem,name:"mask"},wt.add(vl);class yl{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:r}=this.renderer,n=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==n&&(i===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const ml=new zt,gl=[],Wn=class extends yl{constructor(e){super(e),this.glConst=mt.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:r}=e,{renderer:n}=this,i=n.renderTexture,s=r.getBounds(!0,gl.pop()??new At);this.roundFrameToPixels(s,i.current?i.current.resolution:n.resolution,i.sourceFrame,i.destinationFrame,n.projection.transform),t&&s.fit(t),e._scissorRectLocal=s}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:r,c:n,d:i}=e;return(Math.abs(r)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Wn.isMatrixRotated(t.worldTransform)||Wn.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const r=e._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(e,t,r,n,i){Wn.isMatrixRotated(i)||(i=i?ml.copyFrom(i):ml.identity(),i.translate(-r.x,-r.y).scale(n.width/r.width,n.height/r.height).translate(n.x,n.y),this.renderer.filter.transformAABB(i,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&gl.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};let bl=Wn;bl.extension={type:vt.RendererSystem,name:"scissor"},wt.add(bl);class _l extends yl{constructor(t){super(t),this.glConst=mt.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const r=t.maskObject,{gl:n}=this.renderer,i=t._stencilCounter;i===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;s!==0&&(t._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,i,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(t._colorMask=s,n.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(t){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,i=n?n._colorMask:15;i!==0&&(n._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(n._colorMask=i,r.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}_l.extension={type:vt.RendererSystem,name:"stencil"},wt.add(_l);class xl{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Tt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return Tt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return Tt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const r in t)this.plugins[r]=new t[r](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}xl.extension={type:[vt.RendererSystem,vt.CanvasRendererSystem],name:"_plugin"},wt.add(xl);class El{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new zt,this.transform=null}update(t,r,n,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,r,n,i){const s=this.projectionMatrix,a=i?-1:1;s.identity(),s.a=1/r.width*2,s.d=a*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-a-r.y*s.d}setTransform(t){}destroy(){this.renderer=null}}El.extension={type:vt.RendererSystem,name:"projection"},wt.add(El);const ep=new Rs;class Tl{constructor(t){this.renderer=t,this._tempMatrix=new zt}generateTexture(t,r){const{region:n,...i}=r||{},s=n||t.getLocalBounds(null,!0);s.width===0&&(s.width=1),s.height===0&&(s.height=1);const a=zn.create({width:s.width,height:s.height,...i});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=t.transform;return t.transform=ep,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,a}destroy(){}}Tl.extension={type:[vt.RendererSystem,vt.CanvasRendererSystem],name:"textureGenerator"},wt.add(Tl);const Qe=new At,en=new At;class wl{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new At,this.destinationFrame=new At,this.viewportFrame=new At}bind(t=null,r,n){const i=this.renderer;this.current=t;let s,a,o;t?(s=t.baseTexture,o=s.resolution,r||(Qe.width=t.frame.width,Qe.height=t.frame.height,r=Qe),n||(en.x=t.frame.x,en.y=t.frame.y,en.width=r.width,en.height=r.height,n=en),a=s.framebuffer):(o=i.resolution,r||(Qe.width=i._view.screen.width,Qe.height=i._view.screen.height,r=Qe),n||(n=Qe,n.width=r.width,n.height=r.height));const l=this.viewportFrame;l.x=n.x*o,l.y=n.y*o,l.width=n.width*o,l.height=n.height*o,t||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(a,l),this.renderer.projection.update(n,r,o,!a),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(n)}clear(t,r){const n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=t?Xt.shared.setValue(t):n,s=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==a.width||s.height!==a.height;if(o){let{x:l,y:f,width:c,height:h}=this.viewportFrame;l=Math.round(l),f=Math.round(f),c=Math.round(c),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(l,f,c,h)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}wl.extension={type:vt.RendererSystem,name:"renderTexture"},wt.add(wl);class rp{constructor(t,r){this.program=t,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function np(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=t.getActiveAttrib(e,i);if(s.name.startsWith("gl_"))continue;const a=el(t,s.type),o={type:a,name:s.name,size:Jo(a),location:t.getAttribLocation(e,s.name)};r[s.name]=o}return r}function ip(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;i++){const s=t.getActiveUniform(e,i),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),l=el(t,s.type);r[a]={name:a,index:i,type:l,size:s.size,isArray:o,value:Ko(l,s.size)}}return r}function sp(e,t){var l;const r=Yo(e,e.VERTEX_SHADER,t.vertexSrc),n=Yo(e,e.FRAGMENT_SHADER,t.fragmentSrc),i=e.createProgram();e.attachShader(i,r),e.attachShader(i,n);const s=(l=t.extra)==null?void 0:l.transformFeedbackVaryings;if(s&&(typeof e.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):e.transformFeedbackVaryings(i,s.names,s.bufferMode==="separate"?e.SEPARATE_ATTRIBS:e.INTERLEAVED_ATTRIBS)),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||Pd(e,i,r,n),t.attributeData=np(i,e),t.uniformData=ip(i,e),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){const f=Object.keys(t.attributeData);f.sort((c,h)=>c>h?1:-1);for(let c=0;c<f.length;c++)t.attributeData[f[c]].location=c,e.bindAttribLocation(i,c,f[c]);e.linkProgram(i)}e.deleteShader(r),e.deleteShader(n);const a={};for(const f in t.uniformData){const c=t.uniformData[f];a[f]={location:e.getUniformLocation(i,f),value:Ko(c.type,c.size)}}return new rp(i,a)}function ap(e,t,r,n,i){r.buffer.update(i)}const op={float:`
405
428
  data[offset] = v;
406
429
  `,vec2:`
407
430
  data[offset] = v[0];
@@ -439,7 +462,7 @@ void main(void)
439
462
  {
440
463
  data[offset + i] = v[i];
441
464
  }
442
- `},wl={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function mf(t,e){if(!t.autoManage)return{size:0,syncFunc:pf};const r=function(s,u){const p=[];for(const d in s)u[d]&&p.push(u[d]);return p.sort((d,y)=>d.index-y.index),p}(t.uniforms,e),{uboElements:n,size:i}=function(s){const u=s.map(f=>({data:f,offset:0,dataLen:0,dirty:0}));let p=0,d=0,y=0;for(let f=0;f<u.length;f++){const l=u[f];if(p=wl[l.data.type],l.data.size>1&&(p=Math.max(p,16)*l.data.size),l.dataLen=p,d%p!=0&&d<16){const c=d%p%16;d+=c,y+=c}d+p>16?(y=16*Math.ceil(y/16),l.offset=y,y+=p,d=p):(l.offset=y,d+=p,y+=p)}return y=16*Math.ceil(y/16),{uboElements:u,size:y}}(r),o=[`
465
+ `},Al={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function lp(e){const t=e.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,n=0,i=0;for(let s=0;s<t.length;s++){const a=t[s];if(r=Al[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,n%r!==0&&n<16){const o=n%r%16;n+=o,i+=o}n+r>16?(i=Math.ceil(i/16)*16,a.offset=i,i+=r,n=r):(a.offset=i,n+=r,i+=r)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function up(e,t){const r=[];for(const n in e)t[n]&&r.push(t[n]);return r.sort((n,i)=>n.index-i.index),r}function fp(e,t){if(!e.autoManage)return{size:0,syncFunc:ap};const r=up(e.uniforms,t),{uboElements:n,size:i}=lp(r),s=[`
443
466
  var v = null;
444
467
  var v2 = null;
445
468
  var cv = null;
@@ -447,46 +470,31 @@ void main(void)
447
470
  var gl = renderer.gl
448
471
  var index = 0;
449
472
  var data = buffer.data;
450
- `];for(let s=0;s<n.length;s++){const u=n[s],p=t.uniforms[u.data.name],d=u.data.name;let y=!1;for(let f=0;f<_r.length;f++){const l=_r[f];if(l.codeUbo&&l.test(u.data,p)){o.push(`offset = ${u.offset/4};`,_r[f].codeUbo(u.data.name,p)),y=!0;break}}if(!y)if(u.data.size>1){const f=Za(u.data.type),l=Math.max(wl[u.data.type]/16,1),c=f/l,a=(4-c%4)%4;o.push(`
451
- cv = ud.${d}.value;
452
- v = uv.${d};
453
- offset = ${u.offset/4};
473
+ `];for(let a=0;a<n.length;a++){const o=n[a],l=e.uniforms[o.data.name],f=o.data.name;let c=!1;for(let h=0;h<xr.length;h++){const u=xr[h];if(u.codeUbo&&u.test(o.data,l)){s.push(`offset = ${o.offset/4};`,xr[h].codeUbo(o.data.name,l)),c=!0;break}}if(!c)if(o.data.size>1){const h=Jo(o.data.type),u=Math.max(Al[o.data.type]/16,1),d=h/u,p=(4-d%4)%4;s.push(`
474
+ cv = ud.${f}.value;
475
+ v = uv.${f};
476
+ offset = ${o.offset/4};
454
477
 
455
478
  t = 0;
456
479
 
457
- for(var i=0; i < ${u.data.size*l}; i++)
480
+ for(var i=0; i < ${o.data.size*u}; i++)
458
481
  {
459
- for(var j = 0; j < ${c}; j++)
482
+ for(var j = 0; j < ${d}; j++)
460
483
  {
461
484
  data[offset++] = v[t++];
462
485
  }
463
- offset += ${a};
486
+ offset += ${p};
464
487
  }
465
488
 
466
- `)}else{const f=yf[u.data.type];o.push(`
467
- cv = ud.${d}.value;
468
- v = uv.${d};
469
- offset = ${u.offset/4};
470
- ${f};
471
- `)}}return o.push(`
489
+ `)}else{const h=op[o.data.type];s.push(`
490
+ cv = ud.${f}.value;
491
+ v = uv.${f};
492
+ offset = ${o.offset/4};
493
+ ${h};
494
+ `)}}return s.push(`
472
495
  renderer.buffer.update(buffer);
473
- `),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join(`
474
- `))}}let gf=0;const Wn={textureCount:0,uboCount:0};class Tl{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=gf++}systemCheck(){if(!function(){if(typeof Jr=="boolean")return Jr;try{Jr=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Jr=!1}return Jr}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const n=e.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),r||(Wn.textureCount=0,Wn.uboCount=0,this.syncUniformGroup(e.uniformGroup,Wn)),i}setUniforms(e){const r=this.shader.program,n=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(n.uniformData,e,this.renderer)}syncUniformGroup(e,r){const n=this.getGlProgram();e.static&&e.dirtyId===n.uniformDirtyGroups[e.id]||(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,r))}syncUniforms(e,r,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,n)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=function(n,i){var s;const o=[`
475
- var v = null;
476
- var cv = null;
477
- var cu = null;
478
- var t = 0;
479
- var gl = renderer.gl;
480
- `];for(const u in n.uniforms){const p=i[u];if(!p){(s=n.uniforms[u])!=null&&s.group&&(n.uniforms[u].ubo?o.push(`
481
- renderer.shader.syncUniformBufferGroup(uv.${u}, '${u}');
482
- `):o.push(`
483
- renderer.shader.syncUniformGroup(uv.${u}, syncData);
484
- `));continue}const d=n.uniforms[u];let y=!1;for(let f=0;f<_r.length;f++)if(_r[f].test(p,d)){o.push(_r[f].code(u,d)),y=!0;break}if(!y){const f=(p.size!==1||p.isArray?Yh:Wh)[p.type].replace("location",`ud["${u}"].location`);o.push(`
485
- cu = ud["${u}"];
486
- cv = cu.value;
487
- v = uv["${u}"];
488
- ${f};`)}}return new Function("ud","uv","renderer","syncData",o.join(`
489
- `))}(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;const i=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,r);e.buffer.update(),i(n.uniformData,e.uniforms,this.renderer,Wn,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[r])}createSyncBufferGroup(e,r,n){const{gl:i}=this.renderer;this.renderer.buffer.bind(e.buffer);const o=this.gl.getUniformBlockIndex(r.program,n);r.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(r.program,o,this.shader.uniformBindCount),this.shader.uniformBindCount++;const s=this.getSignature(e,this.shader.program.uniformData,"ubo");let u=this._uboCache[s];if(u||(u=this._uboCache[s]=mf(e,this.shader.program.uniformData)),e.autoManage){const p=new Float32Array(u.size/4);e.buffer.update(p)}return r.uniformGroups[e.id]=u.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,n){const i=e.uniforms,o=[`${n}-`];for(const s in i)o.push(s),r[s]&&o.push(r[s].type);return o.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,n=e.program,i=df(r,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Tl.extension={type:ae.RendererSystem,name:"shader"},me.add(Tl);class Yn{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}Yn.defaultOptions={hello:!1},Yn.extension={type:[ae.RendererSystem,ae.CanvasRendererSystem],name:"startup"},me.add(Yn);const Co=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ee.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Mn,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=function(e,r=[]){return r[ee.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.ADD]=[e.ONE,e.ONE],r[ee.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.NONE]=[0,0],r[ee.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],r[ee.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],r[ee.SRC_IN]=[e.DST_ALPHA,e.ZERO],r[ee.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],r[ee.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],r[ee.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],r[ee.DST_IN]=[e.ZERO,e.SRC_ALPHA],r[ee.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],r[ee.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],r[ee.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],r[ee.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],r}(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(Co.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(Co.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],r=this.gl;e.length===2?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&r===-1?this.checks.push(t):e||r===-1||this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};let Al=Co;Al.extension={type:ae.RendererSystem,name:"state"},me.add(Al);class vf extends mn{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(i=>e.systems[i]),n=[...r,...Object.keys(e.systems).filter(i=>!r.includes(i))];for(const i of n)this.addSystem(e.systems[i],i)}addRunners(...e){e.forEach(r=>{this.runners[r]=new et(r)})}addSystem(e,r){const n=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=n,this._systemsHash[r]=n;for(const i in this.runners)this.runners[i].add(n);return this}emitWithCustomOptions(e,r){const n=Object.keys(this._systemsHash);e.items.forEach(i=>{const o=n.find(s=>this._systemsHash[s]===i);i[e.name](r[o])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Kn=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Kn.defaultMaxIdle,this.checkCountMax=Kn.defaultCheckCountMax,this.mode=Kn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Ci.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let n=0;n<e.length;n++){const i=e[n];!i.framebuffer&&this.count-i.touched>this.maxIdle&&(t.destroyTexture(i,!0),e[n]=null,r=!0)}if(r){let n=0;for(let i=0;i<e.length;i++)e[i]!==null&&(e[n++]=e[i]);e.length=n}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let n=t.children.length-1;n>=0;n--)this.unload(t.children[n])}destroy(){this.renderer=null}};let it=Kn;it.defaultMode=Ci.AUTO,it.defaultMaxIdle=3600,it.defaultCheckCountMax=600,it.extension={type:ae.RendererSystem,name:"textureGC"},me.add(it);class Ro{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=fe.UNSIGNED_BYTE,this.internalFormat=W.RGBA,this.samplerType=0}}class Ol{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new de,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(i){let o;return o="WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?{[fe.UNSIGNED_BYTE]:{[W.RGBA]:i.RGBA8,[W.RGB]:i.RGB8,[W.RG]:i.RG8,[W.RED]:i.R8,[W.RGBA_INTEGER]:i.RGBA8UI,[W.RGB_INTEGER]:i.RGB8UI,[W.RG_INTEGER]:i.RG8UI,[W.RED_INTEGER]:i.R8UI,[W.ALPHA]:i.ALPHA,[W.LUMINANCE]:i.LUMINANCE,[W.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[fe.BYTE]:{[W.RGBA]:i.RGBA8_SNORM,[W.RGB]:i.RGB8_SNORM,[W.RG]:i.RG8_SNORM,[W.RED]:i.R8_SNORM,[W.RGBA_INTEGER]:i.RGBA8I,[W.RGB_INTEGER]:i.RGB8I,[W.RG_INTEGER]:i.RG8I,[W.RED_INTEGER]:i.R8I},[fe.UNSIGNED_SHORT]:{[W.RGBA_INTEGER]:i.RGBA16UI,[W.RGB_INTEGER]:i.RGB16UI,[W.RG_INTEGER]:i.RG16UI,[W.RED_INTEGER]:i.R16UI,[W.DEPTH_COMPONENT]:i.DEPTH_COMPONENT16},[fe.SHORT]:{[W.RGBA_INTEGER]:i.RGBA16I,[W.RGB_INTEGER]:i.RGB16I,[W.RG_INTEGER]:i.RG16I,[W.RED_INTEGER]:i.R16I},[fe.UNSIGNED_INT]:{[W.RGBA_INTEGER]:i.RGBA32UI,[W.RGB_INTEGER]:i.RGB32UI,[W.RG_INTEGER]:i.RG32UI,[W.RED_INTEGER]:i.R32UI,[W.DEPTH_COMPONENT]:i.DEPTH_COMPONENT24},[fe.INT]:{[W.RGBA_INTEGER]:i.RGBA32I,[W.RGB_INTEGER]:i.RGB32I,[W.RG_INTEGER]:i.RG32I,[W.RED_INTEGER]:i.R32I},[fe.FLOAT]:{[W.RGBA]:i.RGBA32F,[W.RGB]:i.RGB32F,[W.RG]:i.RG32F,[W.RED]:i.R32F,[W.DEPTH_COMPONENT]:i.DEPTH_COMPONENT32F},[fe.HALF_FLOAT]:{[W.RGBA]:i.RGBA16F,[W.RGB]:i.RGB16F,[W.RG]:i.RG16F,[W.RED]:i.R16F},[fe.UNSIGNED_SHORT_5_6_5]:{[W.RGB]:i.RGB565},[fe.UNSIGNED_SHORT_4_4_4_4]:{[W.RGBA]:i.RGBA4},[fe.UNSIGNED_SHORT_5_5_5_1]:{[W.RGBA]:i.RGB5_A1},[fe.UNSIGNED_INT_2_10_10_10_REV]:{[W.RGBA]:i.RGB10_A2,[W.RGBA_INTEGER]:i.RGB10_A2UI},[fe.UNSIGNED_INT_10F_11F_11F_REV]:{[W.RGB]:i.R11F_G11F_B10F},[fe.UNSIGNED_INT_5_9_9_9_REV]:{[W.RGB]:i.RGB9_E5},[fe.UNSIGNED_INT_24_8]:{[W.DEPTH_STENCIL]:i.DEPTH24_STENCIL8},[fe.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[W.DEPTH_STENCIL]:i.DEPTH32F_STENCIL8}}:{[fe.UNSIGNED_BYTE]:{[W.RGBA]:i.RGBA,[W.RGB]:i.RGB,[W.ALPHA]:i.ALPHA,[W.LUMINANCE]:i.LUMINANCE,[W.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[fe.UNSIGNED_SHORT_5_6_5]:{[W.RGB]:i.RGB},[fe.UNSIGNED_SHORT_4_4_4_4]:{[W.RGBA]:i.RGBA},[fe.UNSIGNED_SHORT_5_5_5_1]:{[W.RGBA]:i.RGBA}},o}(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let i=0;i<r;i++)this.boundTextures[i]=null;this.emptyTextures={};const n=new Ro(e.createTexture());e.bindTexture(e.TEXTURE_2D,n.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=n,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new Ro(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let i=0;i<6;i++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let i=0;i<this.boundTextures.length;i++)this.bind(null,i)}bind(e,r=0){const{gl:n}=this;if(e=e==null?void 0:e.castToBaseTexture(),(e==null?void 0:e.valid)&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const i=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(e.target,i.texture)),i.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),this.updateTexture(e)):i.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let i=0;i<n.length;i++)n[i]===this.unknownTexture&&this.bind(null,i)}for(let i=0;i<n.length;i++)n[i]===e&&(this.currentLocation!==i&&(r.activeTexture(r.TEXTURE0+i),this.currentLocation=i),r.bindTexture(e.target,this.emptyTextures[e.target].texture),n[i]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:n,CONTEXT_UID:i}=this;if(n)for(let o=e-1;o>=0;--o){const s=r[o];s&&s._glTextures[i].samplerType!==ki.FLOAT&&this.renderer.texture.unbind(s)}}initTexture(e){const r=new Ro(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var n;r.internalFormat=((n=this.internalFormats[e.type])==null?void 0:n[e.format])??e.format,this.webGLVersion===2&&e.type===fe.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var i;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const n=this.renderer;if(this.initTextureType(e,r),(i=e.resource)==null?void 0:i.upload(n,e,r))r.samplerType!==ki.FLOAT&&(this.hasIntegerTextures=!0);else{const o=e.realWidth,s=e.realHeight,u=n.gl;(r.width!==o||r.height!==s||r.dirtyId<0)&&(r.width=o,r.height=s,u.texImage2D(e.target,0,r.internalFormat,o,s,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:n}=this;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const i=this.managedTextures.indexOf(e);i!==-1&&In(this.managedTextures,i,1)}}updateTextureStyle(e){var n;const r=e._glTextures[this.CONTEXT_UID];r&&(e.mipmap!==Ut.POW2&&this.webGLVersion===2||e.isPowerOfTwo?r.mipmap=e.mipmap>=1:r.mipmap=!1,this.webGLVersion===2||e.isPowerOfTwo?r.wrapMode=e.wrapMode:r.wrapMode=Ur.CLAMP,(n=e.resource)!=null&&n.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const n=this.gl;if(r.mipmap&&e.mipmap!==Ut.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,r.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===bt.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&e.anisotropicLevel>0&&e.scaleMode===bt.LINEAR){const o=Math.min(e.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===bt.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===bt.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}Ol.extension={type:ae.RendererSystem,name:"texture"},me.add(Ol);class Sl{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glTransformFeedbacks[n]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:n,renderer:i}=this;r&&i.shader.bind(r),n.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:n,CONTEXT_UID:i}=this,o=r.createTransformFeedback();e._glTransformFeedbacks[i]=o,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,o);for(let s=0;s<e.buffers.length;s++){const u=e.buffers[s];u&&(n.buffer.update(u),u._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,s,u._glBuffers[i].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),o}disposeTransformFeedback(e,r){const n=e._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this);const o=this.renderer.buffer;if(o)for(let s=0;s<e.buffers.length;s++){const u=e.buffers[s];if(!u)continue;const p=u._glBuffers[this.CONTEXT_UID];p&&(p.refCount--,p.refCount!==0||r||o.dispose(u,r))}n&&(r||i.deleteTransformFeedback(n),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Sl.extension={type:ae.RendererSystem,name:"transformFeedback"},me.add(Sl);class Zn{constructor(e){this.renderer=e}init(e){this.screen=new ge(0,0,e.width,e.height),this.element=e.view||ue.ADAPTER.createCanvas(),this.resolution=e.resolution||ue.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const n=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=n,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",n,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Zn.defaultOptions={width:800,height:600,resolution:ue.RESOLUTION,autoDensity:!1},Zn.extension={type:[ae.RendererSystem,ae.CanvasRendererSystem],name:"_view"},me.add(Zn),ue.PREFER_ENV=Dt.WEBGL2,ue.STRICT_TEXTURE_CACHE=!1,ue.RENDER_OPTIONS={...Hn.defaultOptions,...Gn.defaultOptions,...Zn.defaultOptions,...Yn.defaultOptions},Object.defineProperties(ue,{WRAP_MODE:{get:()=>de.defaultOptions.wrapMode,set(t){ye("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),de.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>de.defaultOptions.scaleMode,set(t){ye("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),de.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>de.defaultOptions.mipmap,set(t){ye("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),de.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>de.defaultOptions.anisotropicLevel,set(t){ye("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),de.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>(ye("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Tt.defaultResolution),set(t){Tt.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>(ye("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Tt.defaultMultisample),set(t){Tt.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>nt.defaultMaxTextures,set(t){ye("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),nt.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>nt.defaultBatchSize,set(t){ye("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),nt.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>nt.canUploadSameBuffer,set(t){ye("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),nt.canUploadSameBuffer=t}},GC_MODE:{get:()=>it.defaultMode,set(t){ye("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),it.defaultMode=t}},GC_MAX_IDLE:{get:()=>it.defaultMaxIdle,set(t){ye("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),it.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>it.defaultCheckCountMax,set(t){ye("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),it.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>wt.defaultVertexPrecision,set(t){ye("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),wt.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>wt.defaultFragmentPrecision,set(t){ye("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),wt.defaultFragmentPrecision=t}}});var Qn=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(Qn||{});class Io{constructor(e,r=null,n=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=n,this.once=i}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=e?null:r,this.previous=null,r}}const ze=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Io(null,null,1/0),this.deltaMS=1/ze.targetFPMS,this.elapsedMS=1/ze.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=Qn.NORMAL){return this._addListener(new Io(t,e,r))}addOnce(t,e,r=Qn.NORMAL){return this._addListener(new Io(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*ze.targetFPMS;const r=this._head;let n=r.next;for(;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,ze.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!ze._shared){const t=ze._shared=new ze;t.autoStart=!0,t._protected=!0}return ze._shared}static get system(){if(!ze._system){const t=ze._system=new ze;t.autoStart=!0,t._protected=!0}return ze._system}};let ot=ze;ot.targetFPMS=.06,Object.defineProperties(ue,{TARGET_FPMS:{get:()=>ot.targetFPMS,set(t){ye("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),ot.targetFPMS=t}}});class Nl{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,Qn.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?ot.shared:new ot,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Nl.extension=ae.Application,me.add(Nl),me.handleByList(ae.Renderer,[]);class kl{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const n=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,n)}else{const n=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n)}r>=Ne.HIGH?this.multisample=Ne.HIGH:r>=Ne.MEDIUM?this.multisample=Ne.MEDIUM:r>=Ne.LOW?this.multisample=Ne.LOW:this.multisample=Ne.NONE}destroy(){}}kl.extension={type:ae.RendererSystem,name:"_multisample"},me.add(kl);class bf{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Cl{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glBuffers[n]||this.createGLBuffer(e);r.bindBuffer(e.type,i.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:n,CONTEXT_UID:i}=this;if(this.boundBufferBases[r]!==e){const o=e._glBuffers[i]||this.createGLBuffer(e);this.boundBufferBases[r]=e,n.bindBufferBase(n.UNIFORM_BUFFER,r,o.buffer)}}bindBufferRange(e,r,n){const{gl:i,CONTEXT_UID:o}=this;n=n||0;const s=e._glBuffers[o]||this.createGLBuffer(e);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,s.buffer,256*n,256)}update(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glBuffers[n]||this.createGLBuffer(e);if(e._updateID!==i.updateID)if(i.updateID=e._updateID,r.bindBuffer(e.type,i.buffer),i.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const o=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,o)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const n=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),n&&(r||i.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let n=0;n<r.length;n++)this.dispose(this.managedBuffers[r[n]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:n}=this;return e._glBuffers[r]=new bf(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}Cl.extension={type:ae.RendererSystem,name:"buffer"},me.add(Cl);class Rl{constructor(e){this.renderer=e}render(e,r){const n=this.renderer;let i,o,s,u;if(r&&(i=r.renderTexture,o=r.clear,s=r.transform,u=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=s,!n.context.isLost){if(i||(this.lastObjectRendered=e),!u){const p=e.enableTempParent();e.updateTransform(),e.disableTempParent(p)}n.renderTexture.bind(i),n.batch.currentRenderer.start(),(o??n.background.clearBeforeRender)&&n.renderTexture.clear(),e.render(n),n.batch.currentRenderer.flush(),i&&(r.blit&&n.framebuffer.blit(),i.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}Rl.extension={type:ae.RendererSystem,name:"objectRenderer"},me.add(Rl);const Po=class extends vf{constructor(t){super(),this.type=Ts.WEBGL,t=Object.assign({},ue.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new tt({projectionMatrix:new De},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Po.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(ye("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!=="notMultiplied",t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=Po.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return!(t!=null&&t.forceCanvas)&&(co===void 0&&(co=function(){var r;const e={stencil:!0,failIfMajorPerformanceCaveat:ue.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!ue.ADAPTER.getWebGLRenderingContext())return!1;const n=ue.ADAPTER.createCanvas();let i=n.getContext("webgl",e)||n.getContext("experimental-webgl",e);const o=!!((r=i==null?void 0:i.getContextAttributes())!=null&&r.stencil);if(i){const s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,o}catch{return!1}}()),co)}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return ye("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return ye("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return ye("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return ye("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){ye("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return ye("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){ye("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return ye("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};let wr=Po;wr.extension={type:ae.Renderer,priority:1},wr.__plugins={},wr.__systems={},me.handleByMap(ae.RendererPlugin,wr.__plugins),me.handleByMap(ae.RendererSystem,wr.__systems),me.add(wr);class Il extends Zr{constructor(e,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let o=0;o<e;o++){const s=new de;this.items.push(s),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let n=0;n<this.length;n++)e[n]&&(e[n].castToBaseTexture?this.addBaseTextureAt(e[n].castToBaseTexture(),n):e[n]instanceof Zr?this.addResourceAt(e[n],n):this.addResourceAt(Ga(e[n],r),n))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const e=this.items.map(r=>r.resource).filter(r=>r).map(r=>r.load());return this._load=Promise.all(e).then(()=>{const{realWidth:r,realHeight:n}=this.items[0];return this.resize(r,n),Promise.resolve(this)}),this._load}}const nn=class extends Il{constructor(t,e){const{width:r,height:n,autoLoad:i,linkBaseTexture:o}=e||{};if(t&&t.length!==nn.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:r,height:n});for(let s=0;s<nn.SIDES;s++)this.items[s].target=ir.TEXTURE_CUBE_MAP_POSITIVE_X+s;this.linkBaseTexture=o!==!1,t&&this.initFromArray(t,e),i!==!1&&this.load()}bind(t){super.bind(t),t.target=ir.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=ir.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,r){const n=this.itemDirtyIds;for(let i=0;i<nn.SIDES;i++){const o=this.items[i];(n[i]<o.dirtyId||r.dirtyId<e.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(t,o,r),n[i]=o.dirtyId):n[i]<-1&&(t.gl.texImage2D(o.target,0,r.internalFormat,e.realWidth,e.realHeight,0,e.format,r.type,null),n[i]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===nn.SIDES}};let Pl=nn;Pl.SIDES=6;class Tr extends Mt{constructor(e,r){let n,i;r=r||{},typeof e=="string"?(n=Tr.EMPTY,i=e):(n=e,i=null),super(n),this.url=i,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load||(this._load=new Promise(async(e,r)=>{if(this.url!==null)try{const n=await ue.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await n.blob();if(this.destroyed)return;const o=await createImageBitmap(i,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===kt.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=o,this.update(),e(this)}catch(n){if(this.destroyed)return;r(n),this.onError.emit(n)}else e(this)})),this._load}upload(e,r,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,n)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Tr._EMPTY=Tr._EMPTY??ue.ADAPTER.createCanvas(0,0),Tr._EMPTY}}const Jn=class extends Mt{constructor(t,e){e=e||{},super(ue.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load||(this._load=new Promise(t=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),t(this)},Jn.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()})),this._load}_loadSvg(){const t=new Image;Mt.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=e*this.scale,i=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*e,i=this._overrideHeight||this._overrideWidth/e*r),n=Math.round(n),i=Math.round(i);const o=this.source;o.width=n,o.height=i,o._pixiId=`canvas_${Kr()}`,o.getContext("2d").drawImage(t,0,0,e,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(t){const e=Jn.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Jn.SVG_XML.test(t)}};let Mo=Jn;Mo.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Mo.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Lo=class extends Mt{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);const n=t[0].src||t[0];Mt.crossOrigin(r,n,e.crossorigin);for(let i=0;i<t.length;++i){const o=document.createElement("source");let{src:s,mime:u}=t[i];s=s||t[i];const p=s.split("?").shift().toLowerCase(),d=p.slice(p.lastIndexOf(".")+1);u=u||Lo.MIME_TYPES[d]||`video/${d}`,o.src=s,o.type=u,r.appendChild(o)}t=r}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),e.autoLoad!==!1&&this.load()}update(t=0){if(!this.destroyed){const e=ot.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(e=>{this.valid?e(this):(this._resolve=e,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ot.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(ot.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._isConnectedToTicker&&(ot.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(ot.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ot.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||Lo.TYPES.includes(e)}};let jo=Lo;jo.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],jo.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},vo.push(Tr,ol,class extends Mt{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}},jo,Mo,bo,Pl,class extends Il{constructor(t,e){const{width:r,height:n}=e||{};let i,o;Array.isArray(t)?(i=t,o=t.length):o=t,super(o,{width:r,height:n}),i&&this.initFromArray(i,e)}addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=ir.TEXTURE_2D_ARRAY}upload(t,e,r){const{length:n,itemDirtyIds:i,items:o}=this,{gl:s}=t;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,e.format,r.type,null);for(let u=0;u<n;u++){const p=o[u];i[u]<p.dirtyId&&(i[u]=p.dirtyId,p.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,u,p.resource.width,p.resource.height,1,e.format,r.type,p.resource.source))}return!0}});var P0=`attribute vec2 aVertexPosition;
496
+ `),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
497
+ `))}}let cp=0;const Yn={textureCount:0,uboCount:0};class Sl{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=cp++}systemCheck(){if(!Md())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,r){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const n=t.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),r||(Yn.textureCount=0,Yn.uboCount=0,this.syncUniformGroup(t.uniformGroup,Yn)),i}setUniforms(t){const r=this.shader.program,n=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(n.uniformData,t,this.renderer)}syncUniformGroup(t,r){const n=this.getGlProgram();(!t.static||t.dirtyId!==n.uniformDirtyGroups[t.id])&&(n.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,n,r))}syncUniforms(t,r,n){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(r.uniformData,t.uniforms,this.renderer,n)}createSyncGroups(t){const r=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=Rd(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[r],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,r){const n=this.getGlProgram();if(!t.static||t.dirtyId!==0||!n.uniformGroups[t.id]){t.dirtyId=0;const i=n.uniformGroups[t.id]||this.createSyncBufferGroup(t,n,r);t.buffer.update(),i(n.uniformData,t.uniforms,this.renderer,Yn,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,n.uniformBufferBindings[r])}createSyncBufferGroup(t,r,n){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(r.program,n);r.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=fp(t,this.shader.program.uniformData)),t.autoManage){const l=new Float32Array(o.size/4);t.buffer.update(l)}return r.uniformGroups[t.id]=o.syncFunc,r.uniformGroups[t.id]}getSignature(t,r,n){const i=t.uniforms,s=[`${n}-`];for(const a in i)s.push(a),r[a]&&s.push(r[a].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const r=this.gl,n=t.program,i=sp(r,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Sl.extension={type:vt.RendererSystem,name:"shader"},wt.add(Sl);class Kn{constructor(t){this.renderer=t}run(t){const{renderer:r}=this;r.runners.init.emit(r.options),t.hello&&console.log(`PixiJS 7.2.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}Kn.defaultOptions={hello:!1},Kn.extension={type:[vt.RendererSystem,vt.CanvasRendererSystem],name:"startup"},wt.add(Kn);function hp(e,t=[]){return t[ot.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.ADD]=[e.ONE,e.ONE],t[ot.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.NONE]=[0,0],t[ot.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[ot.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ot.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[ot.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[ot.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ot.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[ot.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[ot.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[ot.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[ot.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ot.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const dp=0,pp=1,vp=2,yp=3,mp=4,gp=5,Ls=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ot.NONE,this._blendEq=!1,this.map=[],this.map[dp]=this.setBlend,this.map[pp]=this.setOffset,this.map[vp]=this.setCullFace,this.map[yp]=this.setDepthTest,this.map[mp]=this.setFrontFace,this.map[gp]=this.setDepthMask,this.checks=[],this.defaultState=new Ln,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=hp(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,r=0;for(;t;)t&1&&this.map[r].call(this,!!(e.data&1<<r)),t=t>>1,r++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e=e||this.defaultState;for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(e){this.updateCheck(Ls.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Ls.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(e===this.blendMode)return;this.blendMode=e;const t=this.blendModes[e],r=this.gl;t.length===2?r.blendFunc(t[0],t[1]):r.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,r.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(e,t){const r=this.checks.indexOf(e);t&&r===-1?this.checks.push(e):!t&&r!==-1&&this.checks.splice(r,1)}static checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null}};let Ol=Ls;Ol.extension={type:vt.RendererSystem,name:"state"},wt.add(Ol);class bp extends yn{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const r=(t.priority??[]).filter(i=>t.systems[i]),n=[...r,...Object.keys(t.systems).filter(i=>!r.includes(i))];for(const i of n)this.addSystem(t.systems[i],i)}addRunners(...t){t.forEach(r=>{this.runners[r]=new re(r)})}addSystem(t,r){const n=new t(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=n,this._systemsHash[r]=n;for(const i in this.runners)this.runners[i].add(n);return this}emitWithCustomOptions(t,r){const n=Object.keys(this._systemsHash);t.items.forEach(i=>{const s=n.find(a=>this._systemsHash[a]===i);i[t.name](r[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const Zn=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Zn.defaultMaxIdle,this.checkCountMax=Zn.defaultCheckCountMax,this.mode=Zn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Ni.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let r=!1;for(let n=0;n<t.length;n++){const i=t[n];!i.framebuffer&&this.count-i.touched>this.maxIdle&&(e.destroyTexture(i,!0),t[n]=null,r=!0)}if(r){let n=0;for(let i=0;i<t.length;i++)t[i]!==null&&(t[n++]=t[i]);t.length=n}}unload(e){const t=this.renderer.texture,r=e._texture;r&&!r.framebuffer&&t.destroyTexture(r);for(let n=e.children.length-1;n>=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};let ae=Zn;ae.defaultMode=Ni.AUTO,ae.defaultMaxIdle=60*60,ae.defaultCheckCountMax=60*10,ae.extension={type:vt.RendererSystem,name:"textureGC"},wt.add(ae);class Fs{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=bt.UNSIGNED_BYTE,this.internalFormat=rt.RGBA,this.samplerType=0}}function _p(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[bt.UNSIGNED_BYTE]:{[rt.RGBA]:e.RGBA8,[rt.RGB]:e.RGB8,[rt.RG]:e.RG8,[rt.RED]:e.R8,[rt.RGBA_INTEGER]:e.RGBA8UI,[rt.RGB_INTEGER]:e.RGB8UI,[rt.RG_INTEGER]:e.RG8UI,[rt.RED_INTEGER]:e.R8UI,[rt.ALPHA]:e.ALPHA,[rt.LUMINANCE]:e.LUMINANCE,[rt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[bt.BYTE]:{[rt.RGBA]:e.RGBA8_SNORM,[rt.RGB]:e.RGB8_SNORM,[rt.RG]:e.RG8_SNORM,[rt.RED]:e.R8_SNORM,[rt.RGBA_INTEGER]:e.RGBA8I,[rt.RGB_INTEGER]:e.RGB8I,[rt.RG_INTEGER]:e.RG8I,[rt.RED_INTEGER]:e.R8I},[bt.UNSIGNED_SHORT]:{[rt.RGBA_INTEGER]:e.RGBA16UI,[rt.RGB_INTEGER]:e.RGB16UI,[rt.RG_INTEGER]:e.RG16UI,[rt.RED_INTEGER]:e.R16UI,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[bt.SHORT]:{[rt.RGBA_INTEGER]:e.RGBA16I,[rt.RGB_INTEGER]:e.RGB16I,[rt.RG_INTEGER]:e.RG16I,[rt.RED_INTEGER]:e.R16I},[bt.UNSIGNED_INT]:{[rt.RGBA_INTEGER]:e.RGBA32UI,[rt.RGB_INTEGER]:e.RGB32UI,[rt.RG_INTEGER]:e.RG32UI,[rt.RED_INTEGER]:e.R32UI,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[bt.INT]:{[rt.RGBA_INTEGER]:e.RGBA32I,[rt.RGB_INTEGER]:e.RGB32I,[rt.RG_INTEGER]:e.RG32I,[rt.RED_INTEGER]:e.R32I},[bt.FLOAT]:{[rt.RGBA]:e.RGBA32F,[rt.RGB]:e.RGB32F,[rt.RG]:e.RG32F,[rt.RED]:e.R32F,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[bt.HALF_FLOAT]:{[rt.RGBA]:e.RGBA16F,[rt.RGB]:e.RGB16F,[rt.RG]:e.RG16F,[rt.RED]:e.R16F},[bt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB565},[bt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA4},[bt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGB5_A1},[bt.UNSIGNED_INT_2_10_10_10_REV]:{[rt.RGBA]:e.RGB10_A2,[rt.RGBA_INTEGER]:e.RGB10_A2UI},[bt.UNSIGNED_INT_10F_11F_11F_REV]:{[rt.RGB]:e.R11F_G11F_B10F},[bt.UNSIGNED_INT_5_9_9_9_REV]:{[rt.RGB]:e.RGB9_E5},[bt.UNSIGNED_INT_24_8]:{[rt.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[bt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[rt.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[bt.UNSIGNED_BYTE]:{[rt.RGBA]:e.RGBA,[rt.RGB]:e.RGB,[rt.ALPHA]:e.ALPHA,[rt.LUMINANCE]:e.LUMINANCE,[rt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[bt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB},[bt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA},[bt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGBA}},t}class Il{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new _t,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=_p(t);const r=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let i=0;i<r;i++)this.boundTextures[i]=null;this.emptyTextures={};const n=new Fs(t.createTexture());t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Fs(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let i=0;i<this.boundTextures.length;i++)this.bind(null,i)}bind(t,r=0){const{gl:n}=this;if(t=t==null?void 0:t.castToBaseTexture(),t!=null&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[r]!==t&&(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),this.updateTexture(t)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[r]=t}else this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:r,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let i=0;i<n.length;i++)n[i]===this.unknownTexture&&this.bind(null,i)}for(let i=0;i<n.length;i++)n[i]===t&&(this.currentLocation!==i&&(r.activeTexture(r.TEXTURE0+i),this.currentLocation=i),r.bindTexture(t.target,this.emptyTextures[t.target].texture),n[i]=null)}ensureSamplerType(t){const{boundTextures:r,hasIntegerTextures:n,CONTEXT_UID:i}=this;if(n)for(let s=t-1;s>=0;--s){const a=r[s];a&&a._glTextures[i].samplerType!==Ri.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const r=new Fs(this.gl.createTexture());return r.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),r}initTextureType(t,r){var n;r.internalFormat=((n=this.internalFormats[t.type])==null?void 0:n[t.format])??t.format,this.webGLVersion===2&&t.type===bt.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=t.type}updateTexture(t){var i;const r=t._glTextures[this.CONTEXT_UID];if(!r)return;const n=this.renderer;if(this.initTextureType(t,r),(i=t.resource)!=null&&i.upload(n,t,r))r.samplerType!==Ri.FLOAT&&(this.hasIntegerTextures=!0);else{const s=t.realWidth,a=t.realHeight,o=n.gl;(r.width!==s||r.height!==a||r.dirtyId<0)&&(r.width=s,r.height=a,o.texImage2D(t.target,0,r.internalFormat,s,a,0,t.format,r.type,null))}t.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(t),r.dirtyId=t.dirtyId}destroyTexture(t,r){const{gl:n}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),n.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!r)){const i=this.managedTextures.indexOf(t);i!==-1&&kn(this.managedTextures,i,1)}}updateTextureStyle(t){var n;const r=t._glTextures[this.CONTEXT_UID];r&&((t.mipmap===Ge.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?r.mipmap=!1:r.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?r.wrapMode=Dr.CLAMP:r.wrapMode=t.wrapMode,(n=t.resource)!=null&&n.style(this.renderer,t,r)||this.setStyle(t,r),r.dirtyStyleId=t.dirtyStyleId)}setStyle(t,r){const n=this.gl;if(r.mipmap&&t.mipmap!==Ge.ON_MANUAL&&n.generateMipmap(t.target),n.texParameteri(t.target,n.TEXTURE_WRAP_S,r.wrapMode),n.texParameteri(t.target,n.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===xe.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===xe.LINEAR){const s=Math.min(t.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===xe.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===xe.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}Il.extension={type:vt.RendererSystem,name:"texture"},wt.add(Il);class Rl{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glTransformFeedbacks[n]||this.createGLTransformFeedback(t);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,r){const{gl:n,renderer:i}=this;r&&i.shader.bind(r),n.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:r,renderer:n,CONTEXT_UID:i}=this,s=r.createTransformFeedback();t._glTransformFeedbacks[i]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];o&&(n.buffer.update(o),o._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[i].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,r){const n=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];if(!o)continue;const l=o._glBuffers[this.CONTEXT_UID];l&&(l.refCount--,l.refCount===0&&!r&&s.dispose(o,r))}n&&(r||i.deleteTransformFeedback(n),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Rl.extension={type:vt.RendererSystem,name:"transformFeedback"},wt.add(Rl);class Qn{constructor(t){this.renderer=t}init(t){this.screen=new At(0,0,t.width,t.height),this.element=t.view||mt.ADAPTER.createCanvas(),this.resolution=t.resolution||mt.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,r){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(r*this.resolution);const n=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=n,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",n,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){var r;t&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Qn.defaultOptions={width:800,height:600,resolution:mt.RESOLUTION,autoDensity:!1},Qn.extension={type:[vt.RendererSystem,vt.CanvasRendererSystem],name:"_view"},wt.add(Qn),mt.PREFER_ENV=$e.WEBGL2,mt.STRICT_TEXTURE_CACHE=!1,mt.RENDER_OPTIONS={...Hn.defaultOptions,...qn.defaultOptions,...Qn.defaultOptions,...Kn.defaultOptions},Object.defineProperties(mt,{WRAP_MODE:{get(){return _t.defaultOptions.wrapMode},set(e){Tt("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),_t.defaultOptions.wrapMode=e}},SCALE_MODE:{get(){return _t.defaultOptions.scaleMode},set(e){Tt("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),_t.defaultOptions.scaleMode=e}},MIPMAP_TEXTURES:{get(){return _t.defaultOptions.mipmap},set(e){Tt("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),_t.defaultOptions.mipmap=e}},ANISOTROPIC_LEVEL:{get(){return _t.defaultOptions.anisotropicLevel},set(e){Tt("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),_t.defaultOptions.anisotropicLevel=e}},FILTER_RESOLUTION:{get(){return Tt("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Se.defaultResolution},set(e){Se.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return Tt("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Se.defaultMultisample},set(e){Se.defaultMultisample=e}},SPRITE_MAX_TEXTURES:{get(){return se.defaultMaxTextures},set(e){Tt("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),se.defaultMaxTextures=e}},SPRITE_BATCH_SIZE:{get(){return se.defaultBatchSize},set(e){Tt("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),se.defaultBatchSize=e}},CAN_UPLOAD_SAME_BUFFER:{get(){return se.canUploadSameBuffer},set(e){Tt("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),se.canUploadSameBuffer=e}},GC_MODE:{get(){return ae.defaultMode},set(e){Tt("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),ae.defaultMode=e}},GC_MAX_IDLE:{get(){return ae.defaultMaxIdle},set(e){Tt("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),ae.defaultMaxIdle=e}},GC_MAX_CHECK_COUNT:{get(){return ae.defaultCheckCountMax},set(e){Tt("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),ae.defaultCheckCountMax=e}},PRECISION_VERTEX:{get(){return Ae.defaultVertexPrecision},set(e){Tt("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Ae.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return Ae.defaultFragmentPrecision},set(e){Tt("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Ae.defaultFragmentPrecision=e}}});var Jn=(e=>(e[e.INTERACTION=50]="INTERACTION",e[e.HIGH=25]="HIGH",e[e.NORMAL=0]="NORMAL",e[e.LOW=-25]="LOW",e[e.UTILITY=-50]="UTILITY",e))(Jn||{});class Bs{constructor(t,r=null,n=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=r,this.priority=n,this.once=i}match(t,r=null){return this.fn===t&&this.context===r}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=t?null:r,this.previous=null,r}}const Yt=class{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Bs(null,null,1/0),this.deltaMS=1/Yt.targetFPMS,this.elapsedMS=1/Yt.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,r=Jn.NORMAL){return this._addListener(new Bs(e,t,r))}addOnce(e,t,r=Jn.NORMAL){return this._addListener(new Bs(e,t,r,!0))}_addListener(e){let t=this._head.next,r=this._head;if(!t)e.connect(r);else{for(;t;){if(e.priority>t.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}return this._startIfPossible(),this}remove(e,t){let r=this._head.next;for(;r;)r.match(e,t)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*Yt.targetFPMS;const r=this._head;let n=r.next;for(;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const t=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,t)/1e3,Yt.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!Yt._shared){const e=Yt._shared=new Yt;e.autoStart=!0,e._protected=!0}return Yt._shared}static get system(){if(!Yt._system){const e=Yt._system=new Yt;e.autoStart=!0,e._protected=!0}return Yt._system}};let oe=Yt;oe.targetFPMS=.06,Object.defineProperties(mt,{TARGET_FPMS:{get(){return oe.targetFPMS},set(e){Tt("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),oe.targetFPMS=e}}});class Nl{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,Jn.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?oe.shared:new oe,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Nl.extension=vt.Application,wt.add(Nl);const xp=[];wt.handleByList(vt.Renderer,xp);class Cl{constructor(t){this.renderer=t}contextChange(t){let r;if(this.renderer.context.webGLVersion===1){const n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),r=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else{const n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),r=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n)}r>=Bt.HIGH?this.multisample=Bt.HIGH:r>=Bt.MEDIUM?this.multisample=Bt.MEDIUM:r>=Bt.LOW?this.multisample=Bt.LOW:this.multisample=Bt.NONE}destroy(){}}Cl.extension={type:vt.RendererSystem,name:"_multisample"},wt.add(Cl);class Ep{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Pl{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glBuffers[n]||this.createGLBuffer(t);r.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:r}=this;r.bindBuffer(t,null)}bindBufferBase(t,r){const{gl:n,CONTEXT_UID:i}=this;if(this.boundBufferBases[r]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[r]=t,n.bindBufferBase(n.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(t,r,n){const{gl:i,CONTEXT_UID:s}=this;n=n||0;const a=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,a.buffer,n*256,256)}update(t){const{gl:r,CONTEXT_UID:n}=this,i=t._glBuffers[n]||this.createGLBuffer(t);if(t._updateID!==i.updateID)if(i.updateID=t._updateID,r.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)r.bufferSubData(t.type,0,t.data);else{const s=t.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,r.bufferData(t.type,t.data,s)}}dispose(t,r){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const n=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),n&&(r||i.deleteBuffer(n.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const r=Object.keys(this.managedBuffers);for(let n=0;n<r.length;n++)this.dispose(this.managedBuffers[r[n]],t)}createGLBuffer(t){const{CONTEXT_UID:r,gl:n}=this;return t._glBuffers[r]=new Ep(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[r]}}Pl.extension={type:vt.RendererSystem,name:"buffer"},wt.add(Pl);class kl{constructor(t){this.renderer=t}render(t,r){const n=this.renderer;let i,s,a,o;if(r&&(i=r.renderTexture,s=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=a,!n.context.isLost){if(i||(this.lastObjectRendered=t),!o){const l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}n.renderTexture.bind(i),n.batch.currentRenderer.start(),(s??n.background.clearBeforeRender)&&n.renderTexture.clear(),t.render(n),n.batch.currentRenderer.flush(),i&&(r.blit&&n.framebuffer.blit(),i.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}kl.extension={type:vt.RendererSystem,name:"objectRenderer"},wt.add(kl);const Us=class extends bp{constructor(e){super(),this.type=Sa.WEBGL,e=Object.assign({},mt.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new ne({projectionMatrix:new zt},!0);const t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Us.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(Tt("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=Us.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:Zh()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Tt("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return Tt("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return Tt("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return Tt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){Tt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return Tt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){Tt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return Tt("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};let wr=Us;wr.extension={type:vt.Renderer,priority:1},wr.__plugins={},wr.__systems={},wt.handleByMap(vt.RendererPlugin,wr.__plugins),wt.handleByMap(vt.RendererSystem,wr.__systems),wt.add(wr);class Ml extends Kr{constructor(t,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let s=0;s<t;s++){const a=new _t;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,r){for(let n=0;n<this.length;n++)t[n]&&(t[n].castToBaseTexture?this.addBaseTextureAt(t[n].castToBaseTexture(),n):t[n]instanceof Kr?this.addResourceAt(t[n],n):this.addResourceAt(Ho(t[n],r),n))}dispose(){for(let t=0,r=this.length;t<r;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[r].setResource(t),this}bind(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=t,this.items[r].on("update",t.update,t)}unbind(t){super.unbind(t);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",t.update,t)}load(){if(this._load)return this._load;const r=this.items.map(n=>n.resource).filter(n=>n).map(n=>n.load());return this._load=Promise.all(r).then(()=>{const{realWidth:n,realHeight:i}=this.items[0];return this.resize(n,i),Promise.resolve(this)}),this._load}}class Tp extends Ml{constructor(t,r){const{width:n,height:i}=r||{};let s,a;Array.isArray(t)?(s=t,a=t.length):a=t,super(a,{width:n,height:i}),s&&this.initFromArray(s,r)}addBaseTextureAt(t,r){if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=sr.TEXTURE_2D_ARRAY}upload(t,r,n){const{length:i,itemDirtyIds:s,items:a}=this,{gl:o}=t;n.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,i,0,r.format,n.type,null);for(let l=0;l<i;l++){const f=a[l];s[l]<f.dirtyId&&(s[l]=f.dirtyId,f.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,l,f.resource.width,f.resource.height,1,r.format,n.type,f.resource.source))}return!0}}class wp extends Be{constructor(t){super(t)}static test(t){const{OffscreenCanvas:r}=globalThis;return r&&t instanceof r?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const rn=class extends Ml{constructor(e,t){const{width:r,height:n,autoLoad:i,linkBaseTexture:s}=t||{};if(e&&e.length!==rn.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:r,height:n});for(let a=0;a<rn.SIDES;a++)this.items[a].target=sr.TEXTURE_CUBE_MAP_POSITIVE_X+a;this.linkBaseTexture=s!==!1,e&&this.initFromArray(e,t),i!==!1&&this.load()}bind(e){super.bind(e),e.target=sr.TEXTURE_CUBE_MAP}addBaseTextureAt(e,t,r){if(r===void 0&&(r=this.linkBaseTexture),!this.items[t])throw new Error(`Index ${t} is out of bounds`);if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=sr.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,r){const n=this.itemDirtyIds;for(let i=0;i<rn.SIDES;i++){const s=this.items[i];(n[i]<s.dirtyId||r.dirtyId<t.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(e,s,r),n[i]=s.dirtyId):n[i]<-1&&(e.gl.texImage2D(s.target,0,r.internalFormat,t.realWidth,t.realHeight,0,t.format,r.type,null),n[i]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===rn.SIDES}};let Ll=rn;Ll.SIDES=6;class Ar extends Be{constructor(t,r){r=r||{};let n,i;typeof t=="string"?(n=Ar.EMPTY,i=t):(n=t,i=null),super(n),this.url=i,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(t,r)=>{if(this.url===null){t(this);return}try{const n=await mt.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await n.blob();if(this.destroyed)return;const s=await createImageBitmap(i,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Pe.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=s,this.update(),t(this)}catch(n){if(this.destroyed)return;r(n),this.onError.emit(n)}}),this._load)}upload(t,r,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(t,r,n)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return Ar._EMPTY=Ar._EMPTY??mt.ADAPTER.createCanvas(0,0),Ar._EMPTY}}const ti=class extends Be{constructor(e,t){t=t||{},super(mt.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),e(this)},ti.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Be.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,i=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,i=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),i=Math.round(i);const s=this.source;s.width=n,s.height=i,s._pixiId=`canvas_${Yr()}`,s.getContext("2d").drawImage(e,0,0,t,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(e){const t=ti.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&ti.SVG_XML.test(e)}};let Ds=ti;Ds.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Ds.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const js=class extends Be{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Be.crossOrigin(r,n,t.crossorigin);for(let i=0;i<e.length;++i){const s=document.createElement("source");let{src:a,mime:o}=e[i];a=a||e[i];const l=a.split("?").shift().toLowerCase(),f=l.slice(l.lastIndexOf(".")+1);o=o||js.MIME_TYPES[f]||`video/${f}`,s.src=a,s.type=o,r.appendChild(s)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){const t=oe.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t),(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}load(){if(this._load)return this._load;const e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise(t=>{this.valid?t(this):(this._resolve=t,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(oe.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(oe.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._isConnectedToTicker&&(oe.shared.remove(this.update,this),this._isConnectedToTicker=!1);const e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(oe.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(oe.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e)}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||js.TYPES.includes(t)}};let $s=js;$s.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],$s.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},Ts.push(Ar,ol,wp,$s,Ds,ws,Ll,Tp);var Ap=`attribute vec2 aVertexPosition;
490
498
  attribute vec2 aTextureCoord;
491
499
 
492
500
  uniform mat3 projectionMatrix;
@@ -497,18 +505,7 @@ void main(void)
497
505
  {
498
506
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
499
507
  vTextureCoord = aTextureCoord;
500
- }`;class Fo extends Tt{constructor(e){super(`attribute vec2 aVertexPosition;
501
- attribute vec2 aTextureCoord;
502
-
503
- uniform mat3 projectionMatrix;
504
-
505
- varying vec2 vTextureCoord;
506
-
507
- void main(void)
508
- {
509
- gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
510
- vTextureCoord = aTextureCoord;
511
- }`,`varying vec2 vTextureCoord;
508
+ }`,Sp=`varying vec2 vTextureCoord;
512
509
  uniform sampler2D uSampler;
513
510
 
514
511
  uniform float gamma;
@@ -539,55 +536,55 @@ void main(void)
539
536
 
540
537
  gl_FragColor = c * alpha;
541
538
  }
542
- `),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,e)}apply(e,r,n,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,r,n,i)}}var Zt=(t=>(t.BlackAndWhite="BlackAndWhite",t.Sepia="Sepia",t.RetroVintage="RetroVintage",t.NightVision="NightVision",t.Normal="Normal",t.None="Normal",t))(Zt||{});const Bo=({pixiTransformerRef:t,imageRef:e,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:o,onDoubleClick:s,uniqueId:u=""})=>{const p=Qe.utils.string2hex("#F3C409"),d=Qe.utils.string2hex("#F3C409"),y=Q.useRef({isDragging:!1}),f=Q.useCallback(()=>{o&&!y.current.isDragging&&o(!0)},[o]),l=Q.useCallback(()=>{o&&!y.current.isDragging&&o(!1)},[o]),c=Q.useCallback(()=>{y.current.isDragging=!0},[]),a=Q.useCallback(()=>{y.current.isDragging=!1},[]),h=Q.useCallback(()=>{y.current.isDragging=!1},[]),m=Q.useCallback(()=>{console.log("dobule click in pixi transformer"),s&&s({uniqueId:u})},[s]),g=Q.useCallback(b=>{y.current.isDragging=!0,i&&i(b)},[i]),_=Q.useCallback(()=>{if(e.current===null)return;const b=e.current.x,E=e.current.y,x=e.current.width,v=e.current.height,T=e.current.rotation,O=[e.current.scale.x,e.current.scale.y];n&&n({uniqueId:u,transformation:{x:Math.round(b),y:Math.round(E),width:Math.round(Math.max(5,x)),height:Math.round(Math.max(5,v)),rotate:Math.round(T),scale:O}}),y.current.isDragging=!1},[n]);return Q.useEffect(()=>(t.current&&(t.current.on("mouseover",f),t.current.on("mouseout",l),t.current.on("mousedown",c),t.current.on("mouseup",a),t.current.on("mouseupoutside",h),t.current.addListener("dblclick",m)),()=>{t.current&&(t.current.off("mouseover",f),t.current.off("mouseout",l),t.current.off("mousedown",c),t.current.off("mouseup",a),t.current.off("mouseupoutside",h),t.current.removeListener("dblclick",m))}),[]),ie.jsx(oc.Transformer,{ref:t,group:r?[e.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:d},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:p,shape:"circle",radius:9},transformchange:g,transformcommit:_})};var ei={};Object.defineProperty(ei,"__esModule",{value:!0});var Do,_f=X;function Ml(){return Do||(Do=document.createElement("div")),Do}var ti=ei.emitCustomEvent=function(t,e){var r=Ml(),n=new CustomEvent(t,{detail:e});r.dispatchEvent(n)};ei.newCustomEventEmitter=function(){var t;function e(r){t=r}return e.emit=function(r,n){var i=new CustomEvent(r,{bubbles:!0,detail:n});t==null||t.dispatchEvent(i)},e};var on=ei.useCustomEventListener=function(t,e,r){var n;return _f.useEffect(function(){n=n||Ml();var i=function(o){var s=o.detail;e(s)};return n.addEventListener(t,i,!1),function(){n==null||n.removeEventListener(t,i,!1)}},r),function(i){n=i}};const Ar=Q.createContext({}),mt={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},Uo=t=>{let e={};switch(t){case"NONE":case"none":case"BOUNCE_OUT_DOWN":case"BOUNCE_OUT_LEFT":case"BOUNCE_OUT_RIGHT":case"BOUNCE_OUT_UP":break;case"BOUNCE_IN":e.from={duration:2,ease:"bounce.out",y:-1500};break;case"BOUNCE_IN_DOWN":e.from={ease:"bounce.out",y:-1500,duration:2};break;case"BOUNCE_IN_LEFT":e.from={ease:"bounce.out",x:-1500,duration:2};break;case"BOUNCE_IN_RIGHT":e.from={ease:"bounce.out",x:1500,duration:2};break;case"BOUNCE_IN_UP":e.from={ease:"bounce.out",y:1500,duration:2};break;case"BOUNCE_OUT":e.from={ease:"bounce.in",y:2,duration:2};break;case"FADE_IN":e.to={ease:"power4.in",alpha:1,duration:.5};break;case"FADE_IN_DOWN":e.fromTo={from:{y:-1e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break;case"FADE_IN_LEFT":e.fromTo={from:{x:-1e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_RIGHT":e.fromTo={from:{x:2e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_UP":e.fromTo={from:{y:2e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}}}return e};var xf=Object.prototype,Ll=function(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||xf)},Ef=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),wf=Ll,Tf=Ef,Af=Object.prototype.hasOwnProperty,jl=function(t){if(!wf(t))return Tf(t);var e=[];for(var r in Object(t))Af.call(t,r)&&r!="constructor"&&e.push(r);return e},Fl=typeof Bt=="object"&&Bt&&Bt.Object===Object&&Bt,Of=Fl,Sf=typeof self=="object"&&self&&self.Object===Object&&self,At=Of||Sf||Function("return this")(),Qt=At.Symbol,Bl=Qt,Dl=Object.prototype,Nf=Dl.hasOwnProperty,kf=Dl.toString,sn=Bl?Bl.toStringTag:void 0,Cf=function(t){var e=Nf.call(t,sn),r=t[sn];try{t[sn]=void 0;var n=!0}catch{}var i=kf.call(t);return n&&(e?t[sn]=r:delete t[sn]),i},Rf=Object.prototype.toString,If=Cf,Pf=function(t){return Rf.call(t)},Ul=Qt?Qt.toStringTag:void 0,an=function(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Ul&&Ul in Object(t)?If(t):Pf(t)},qo=function(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")},Mf=an,Lf=qo,ql=function(t){if(!Lf(t))return!1;var e=Mf(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},Go=At["__core-js_shared__"],Gl=function(){var t=/[^.]+$/.exec(Go&&Go.keys&&Go.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),jf=function(t){return!!Gl&&Gl in t},Ff=Function.prototype.toString,Hl=function(t){if(t!=null){try{return Ff.call(t)}catch{}try{return t+""}catch{}}return""},Bf=ql,Df=jf,Uf=qo,qf=Hl,Gf=/^\[object .+?Constructor\]$/,Hf=Function.prototype,zf=Object.prototype,Vf=Hf.toString,Xf=zf.hasOwnProperty,$f=RegExp("^"+Vf.call(Xf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wf=function(t){return!(!Uf(t)||Df(t))&&(Bf(t)?$f:Gf).test(qf(t))},Yf=function(t,e){return t==null?void 0:t[e]},Or=function(t,e){var r=Yf(t,e);return Wf(r)?r:void 0},Kf=Or(At,"DataView"),Ho=Or(At,"Map"),zo=Kf,Vo=Ho,Xo=Or(At,"Promise"),$o=Or(At,"Set"),Wo=Or(At,"WeakMap"),zl=an,Sr=Hl,Vl="[object Map]",Xl="[object Promise]",$l="[object Set]",Wl="[object WeakMap]",Yl="[object DataView]",Zf=Sr(zo),Qf=Sr(Vo),Jf=Sr(Xo),ed=Sr($o),td=Sr(Wo),Jt=zl;(zo&&Jt(new zo(new ArrayBuffer(1)))!=Yl||Vo&&Jt(new Vo)!=Vl||Xo&&Jt(Xo.resolve())!=Xl||$o&&Jt(new $o)!=$l||Wo&&Jt(new Wo)!=Wl)&&(Jt=function(t){var e=zl(t),r=e=="[object Object]"?t.constructor:void 0,n=r?Sr(r):"";if(n)switch(n){case Zf:return Yl;case Qf:return Vl;case Jf:return Xl;case ed:return $l;case td:return Wl}return e});var Kl=Jt,ln=function(t){return t!=null&&typeof t=="object"},rd=an,nd=ln,Zl=function(t){return nd(t)&&rd(t)=="[object Arguments]"},id=ln,Ql=Object.prototype,od=Ql.hasOwnProperty,sd=Ql.propertyIsEnumerable,ad=Zl(function(){return arguments}())?Zl:function(t){return id(t)&&od.call(t,"callee")&&!sd.call(t,"callee")},Yo=ad,gt=Array.isArray,Ko=function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991},ld=ql,ud=Ko,ri=function(t){return t!=null&&ud(t.length)&&!ld(t)},Zo={exports:{}},cd=function(){return!1};(function(t,e){var r=At,n=cd,i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||n;t.exports=u})(Zo,Zo.exports);var Qo=Zo.exports,hd=an,fd=Ko,dd=ln,be={};be["[object Float32Array]"]=be["[object Float64Array]"]=be["[object Int8Array]"]=be["[object Int16Array]"]=be["[object Int32Array]"]=be["[object Uint8Array]"]=be["[object Uint8ClampedArray]"]=be["[object Uint16Array]"]=be["[object Uint32Array]"]=!0,be["[object Arguments]"]=be["[object Array]"]=be["[object ArrayBuffer]"]=be["[object Boolean]"]=be["[object DataView]"]=be["[object Date]"]=be["[object Error]"]=be["[object Function]"]=be["[object Map]"]=be["[object Number]"]=be["[object Object]"]=be["[object RegExp]"]=be["[object Set]"]=be["[object String]"]=be["[object WeakMap]"]=!1;var pd=function(t){return dd(t)&&fd(t.length)&&!!be[hd(t)]},yd=function(t){return function(e){return t(e)}},Jo={exports:{}};(function(t,e){var r=Fl,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,s=function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s})(Jo,Jo.exports);var Jl=Jo.exports,md=pd,gd=yd,eu=Jl&&Jl.isTypedArray,es=eu?gd(eu):md,vd=jl,bd=Kl,_d=Yo,xd=gt,Ed=ri,wd=Qo,Td=Ll,Ad=es,Od=Object.prototype.hasOwnProperty;const Ke=nr(function(t){if(t==null)return!0;if(Ed(t)&&(xd(t)||typeof t=="string"||typeof t.splice=="function"||wd(t)||Ad(t)||_d(t)))return!t.length;var e=bd(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Td(t))return!vd(t).length;for(var r in t)if(Od.call(t,r))return!1;return!0}),Sd=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],ni=Q.forwardRef((t,e)=>{const[r,n]=Q.useState(!1),[i,o]=X.useState(!1),[s,u]=X.useState(!1),p=X.useRef(null),d=X.useRef(null),y=X.useRef(null),f=X.useRef(null),l=X.useRef(t.initialAlpha),{tl:c}=X.useContext(Ar),{uniqueId:a,startAt:h,endAt:m,initialAlpha:g,transformation:{x:_,y:b,width:E,height:x,colorCorrection:v,animation:T,effect:O},applyTransformer:A,disabled:N,pointerdown:k,pointerout:w,pointerover:C}=t;console.log("all abstract props",t);const{contrast:P=1,saturation:S=1,brightness:R=1,alpha:I=1,blurRadius:M=0}=v||{},L={...R>1&&{brightness:R},...P>1&&{contrast:P},...S>1&&{saturation:S},...I!==0&&{alpha:I}};Q.useImperativeHandle(e,()=>({getIsTransformerDragging:()=>i,getIsMouseOverTransformer:()=>s}),[i,s]),Q.useEffect(()=>{p.current&&n(!0)},[]);const j=B=>{l.current=B.alpha},q=B=>{l.current=B.alpha},G=()=>{console.log("reverse complete"),l.current=g};Q.useEffect(()=>{let B=ct.context(()=>{});if(p.current&&c.current){const U={duration:Number(m)-Number(h)},H={onStart:j,onReverseComplete:G,onStartParams:[{alpha:1}]},V={onComplete:q,onCompleteParams:[{alpha:0}]},$=Uo(T||"None");B=ct.context(()=>{var Y,J;c.current.to(p.current,{alpha:1,duration:.1,...H},h).from(p.current,{...U},h).to(p.current,{alpha:0,duration:.1,...V},Number(m)-.09),Ke($.from)?Ke($.to)?Ke($.fromTo)||c.current.fromTo(p.current,(Y=$.fromTo)==null?void 0:Y.from,(J=$.fromTo)==null?void 0:J.to,h):c.current.to(p.current,{...$.to},h):c.current.from(p.current,{...$.from},h)})}return()=>B.revert()},[T,h,m]);const z=Q.useCallback(()=>{o(!0)},[]),K=Q.useCallback(B=>{console.log("changeEnd",B),t.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),t.onAnchorTransformationEnd(B)),o(!1)},[]),F=le.withFilters(le.Container,{...M>0&&{blur:Qe.filters.BlurFilter},...!Ke(L)&&{adjust:Fo},matrix:Qe.filters.ColorMatrixFilter}),D=(v==null?void 0:v.enabled)||O&&O!==Zt.Normal;return ie.jsxs(le.Container,{ref:d,children:[ie.jsx(le.Container,{ref:p,alpha:l.current,position:[_,b],pivot:[_,b],width:E,height:x,...!N&&!i&&{interactive:!0,buttonMode:!0,pointerdown:k,pointerover:C,pointerout:w},children:ie.jsxs(le.Container,{children:[D&&ie.jsx(F,{scale:1,blur:{blur:M,quality:4},adjust:L,apply:({matrix:B})=>{O===Zt.BlackAndWhite?B.desaturate():O===Zt.Sepia?B.sepia():O===Zt.RetroVintage||O===Zt.NightVision?B.negative():O===Zt.Normal&&B.reset()},matrix:{enabled:!0,matrix:Sd},children:ie.jsx(le.Container,{ref:y,children:t.children})}),!D&&ie.jsx(le.Container,{ref:y,children:t.children})]})}),A&&ie.jsx(Bo,{pixiTransformerRef:f,imageRef:p,isMounted:r,transformCommit:K,transformChange:z,mouseoverEvent:u,uniqueId:a})]})});ni.whyDidYouRender={logOnDifferentValues:!0,customName:"AbstractContainer"};const Nd=Q.forwardRef((t,e)=>{const r=X.useRef(null),n=X.useRef(null),{src:i,transformation:{x:o,y:s,width:u,height:p,anchor:d},pointerdown:y,pointerup:f}=t;return ie.jsx(ni,{...t,ref:e,children:ie.jsx(le.Container,{ref:n,children:ie.jsx(le.Sprite,{image:i,width:u,height:p,anchor:d,ref:r,x:o,y:s,interactive:!0,pointerdown:y,pointerup:f})})})}),ii={build(t){const e=t.points;let r,n,i,o,s,u;if(t.type===je.CIRC){const a=t.shape;r=a.x,n=a.y,s=u=a.radius,i=o=0}else if(t.type===je.ELIP){const a=t.shape;r=a.x,n=a.y,s=a.width,u=a.height,i=o=0}else{const a=t.shape,h=a.width/2,m=a.height/2;r=a.x+h,n=a.y+m,s=u=Math.max(0,Math.min(a.radius,Math.min(h,m))),i=h-s,o=m-u}if(!(s>=0&&u>=0&&i>=0&&o>=0))return void(e.length=0);const p=Math.ceil(2.3*Math.sqrt(s+u)),d=8*p+(i?4:0)+(o?4:0);if(e.length=d,d===0)return;if(p===0)return e.length=8,e[0]=e[6]=r+i,e[1]=e[3]=n+o,e[2]=e[4]=r-i,void(e[5]=e[7]=n-o);let y=0,f=4*p+(i?2:0)+2,l=f,c=d;{const a=i+s,h=o,m=r+a,g=r-a,_=n+h;if(e[y++]=m,e[y++]=_,e[--f]=_,e[--f]=g,o){const b=n-h;e[l++]=g,e[l++]=b,e[--c]=b,e[--c]=m}}for(let a=1;a<p;a++){const h=Math.PI/2*(a/p),m=i+Math.cos(h)*s,g=o+Math.sin(h)*u,_=r+m,b=r-m,E=n+g,x=n-g;e[y++]=_,e[y++]=E,e[--f]=E,e[--f]=b,e[l++]=b,e[l++]=x,e[--c]=x,e[--c]=_}{const a=o+u,h=r+i,m=r-i,g=n+a,_=n-a;e[y++]=h,e[y++]=g,e[--c]=_,e[--c]=h,i&&(e[y++]=m,e[y++]=g,e[--c]=_,e[--c]=m)}},triangulate(t,e){const r=t.points,n=e.points,i=e.indices;if(r.length===0)return;let o=n.length/2;const s=o;let u,p;if(t.type!==je.RREC){const y=t.shape;u=y.x,p=y.y}else{const y=t.shape;u=y.x+y.width/2,p=y.y+y.height/2}const d=t.matrix;n.push(t.matrix?d.a*u+d.c*p+d.tx:u,t.matrix?d.b*u+d.d*p+d.ty:p),o++,n.push(r[0],r[1]);for(let y=2;y<r.length;y+=2)n.push(r[y],r[y+1]),i.push(o++,s,o);i.push(s+1,s,o)}};function tu(t,e=!1){const r=t.length;if(r<6)return;let n=0;for(let i=0,o=t[r-2],s=t[r-1];i<r;i+=2){const u=t[i],p=t[i+1];n+=(u-o)*(p+s),o=u,s=p}if(!e&&n>0||e&&n<=0){const i=r/2;for(let o=i+i%2;o<r;o+=2){const s=r-o-2,u=r-o-1,p=o,d=o+1;[t[s],t[p]]=[t[p],t[s]],[t[u],t[d]]=[t[d],t[u]]}}}const ru={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const n=t.holes,i=e.points,o=e.indices;if(r.length>=6){tu(r,!1);const s=[];for(let d=0;d<n.length;d++){const y=n[d];tu(y.points,!0),s.push(r.length/2),r=r.concat(y.points)}const u=Tc(r,s,2);if(!u)return;const p=i.length/2;for(let d=0;d<u.length;d+=3)o.push(u[d]+p),o.push(u[d+1]+p),o.push(u[d+2]+p);for(let d=0;d<r.length;d++)i.push(r[d])}}},kd={build(t){const e=t.shape,r=e.x,n=e.y,i=e.width,o=e.height,s=t.points;s.length=0,i>=0&&o>=0&&s.push(r,n,r+i,n,r+i,n+o,r,n+o)},triangulate(t,e){const r=t.points,n=e.points;if(r.length===0)return;const i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},Cd={build(t){ii.build(t)},triangulate(t,e){ii.triangulate(t,e)}};var st=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(st||{}),er=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(er||{});const Nr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class nu{static curveTo(e,r,n,i,o,s){const u=s[s.length-2],p=s[s.length-1]-r,d=u-e,y=i-r,f=n-e,l=Math.abs(p*f-d*y);if(l<1e-8||o===0)return s[s.length-2]===e&&s[s.length-1]===r||s.push(e,r),null;const c=p*p+d*d,a=y*y+f*f,h=p*y+d*f,m=o*Math.sqrt(c)/l,g=o*Math.sqrt(a)/l,_=m*h/c,b=g*h/a,E=m*f+g*d,x=m*y+g*p,v=d*(g+_),T=p*(g+_),O=f*(m+b),A=y*(m+b);return{cx:E+e,cy:x+r,radius:o,startAngle:Math.atan2(T-x,v-E),endAngle:Math.atan2(A-x,O-E),anticlockwise:d*y>f*p}}static arc(e,r,n,i,o,s,u,p,d){const y=u-s,f=Nr._segmentsCount(Math.abs(y)*o,40*Math.ceil(Math.abs(y)/jn)),l=y/(2*f),c=2*l,a=Math.cos(l),h=Math.sin(l),m=f-1,g=m%1/m;for(let _=0;_<=m;++_){const b=l+s+c*(_+g*_),E=Math.cos(b),x=-Math.sin(b);d.push((a*E+h*x)*o+n,(a*-x+h*E)*o+i)}}}class Rd{constructor(){this.reset()}begin(e,r,n){this.reset(),this.style=e,this.start=r,this.attribStart=n}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class ts{static curveLength(e,r,n,i,o,s,u,p){let d=0,y=0,f=0,l=0,c=0,a=0,h=0,m=0,g=0,_=0,b=0,E=e,x=r;for(let v=1;v<=10;++v)y=v/10,f=y*y,l=f*y,c=1-y,a=c*c,h=a*c,m=h*e+3*a*y*n+3*c*f*o+l*u,g=h*r+3*a*y*i+3*c*f*s+l*p,_=E-m,b=x-g,E=m,x=g,d+=Math.sqrt(_*_+b*b);return d}static curveTo(e,r,n,i,o,s,u){const p=u[u.length-2],d=u[u.length-1];u.length-=2;const y=Nr._segmentsCount(ts.curveLength(p,d,e,r,n,i,o,s));let f=0,l=0,c=0,a=0,h=0;u.push(p,d);for(let m=1,g=0;m<=y;++m)g=m/y,f=1-g,l=f*f,c=l*f,a=g*g,h=a*g,u.push(c*p+3*l*g*e+3*f*a*n+h*o,c*d+3*l*g*r+3*f*a*i+h*s)}}function iu(t,e,r,n,i,o,s,u){let p,d;s?(p=n,d=-r):(p=-n,d=r);const y=t-r*i+p,f=e-n*i+d,l=t+r*o+p,c=e+n*o+d;return u.push(y,f,l,c),2}function tr(t,e,r,n,i,o,s,u){const p=r-t,d=n-e;let y=Math.atan2(p,d),f=Math.atan2(i-t,o-e);u&&y<f?y+=2*Math.PI:!u&&y>f&&(f+=2*Math.PI);let l=y;const c=f-y,a=Math.abs(c),h=Math.sqrt(p*p+d*d),m=1+(15*a*Math.sqrt(h)/Math.PI>>0),g=c/m;if(l+=g,u){s.push(t,e,r,n);for(let _=1,b=l;_<m;_++,b+=g)s.push(t,e,t+Math.sin(b)*h,e+Math.cos(b)*h);s.push(t,e,i,o)}else{s.push(r,n,t,e);for(let _=1,b=l;_<m;_++,b+=g)s.push(t+Math.sin(b)*h,e+Math.cos(b)*h,t,e);s.push(i,o,t,e)}return 2*m}function ou(t,e){t.lineStyle.native?function(r,n){let i=0;const o=r.shape,s=r.points||o.points,u=o.type!==je.POLY||o.closeStroke;if(s.length===0)return;const p=n.points,d=n.indices,y=s.length/2,f=p.length/2;let l=f;for(p.push(s[0],s[1]),i=1;i<y;i++)p.push(s[2*i],s[2*i+1]),d.push(l,l+1),l++;u&&d.push(l,f)}(t,e):function(r,n){const i=r.shape;let o=r.points||i.points.slice();const s=n.closePointEps;if(o.length===0)return;const u=r.lineStyle,p=new Me(o[0],o[1]),d=new Me(o[o.length-2],o[o.length-1]),y=i.type!==je.POLY||i.closeStroke,f=Math.abs(p.x-d.x)<s&&Math.abs(p.y-d.y)<s;if(y){o=o.slice(),f&&(o.pop(),o.pop(),d.set(o[o.length-2],o[o.length-1]));const L=.5*(p.x+d.x),j=.5*(d.y+p.y);o.unshift(L,j),o.push(L,j)}const l=n.points,c=o.length/2;let a=o.length;const h=l.length/2,m=u.width/2,g=m*m,_=u.miterLimit*u.miterLimit;let b=o[0],E=o[1],x=o[2],v=o[3],T=0,O=0,A=-(E-v),N=b-x,k=0,w=0,C=Math.sqrt(A*A+N*N);A/=C,N/=C,A*=m,N*=m;const P=u.alignment,S=2*(1-P),R=2*P;y||(u.cap===er.ROUND?a+=tr(b-A*(S-R)*.5,E-N*(S-R)*.5,b-A*S,E-N*S,b+A*R,E+N*R,l,!0)+2:u.cap===er.SQUARE&&(a+=iu(b,E,A,N,S,R,!0,l))),l.push(b-A*S,E-N*S,b+A*R,E+N*R);for(let L=1;L<c-1;++L){b=o[2*(L-1)],E=o[2*(L-1)+1],x=o[2*L],v=o[2*L+1],T=o[2*(L+1)],O=o[2*(L+1)+1],A=-(E-v),N=b-x,C=Math.sqrt(A*A+N*N),A/=C,N/=C,A*=m,N*=m,k=-(v-O),w=x-T,C=Math.sqrt(k*k+w*w),k/=C,w/=C,k*=m,w*=m;const j=x-b,q=E-v,G=x-T,z=O-v,K=j*G+q*z,F=q*G-z*j,D=F<0;if(Math.abs(F)<.001*Math.abs(K)){l.push(x-A*S,v-N*S,x+A*R,v+N*R),K>=0&&(u.join===st.ROUND?a+=tr(x,v,x-A*S,v-N*S,x-k*S,v-w*S,l,!1)+4:a+=2,l.push(x-k*R,v-w*R,x+k*S,v+w*S));continue}const B=(-A+b)*(-N+v)-(-A+x)*(-N+E),U=(-k+T)*(-w+v)-(-k+x)*(-w+O),H=(j*U-G*B)/F,V=(z*B-q*U)/F,$=(H-x)*(H-x)+(V-v)*(V-v),Y=x+(H-x)*S,J=v+(V-v)*S,re=x-(H-x)*R,ve=v-(V-v)*R,ce=D?S:R,ne=$<=Math.min(j*j+q*q,G*G+z*z)+ce*ce*g;let oe=u.join;if(oe===st.MITER&&$/g>_&&(oe=st.BEVEL),ne)switch(oe){case st.MITER:l.push(Y,J,re,ve);break;case st.BEVEL:D?l.push(Y,J,x+A*R,v+N*R,Y,J,x+k*R,v+w*R):l.push(x-A*S,v-N*S,re,ve,x-k*S,v-w*S,re,ve),a+=2;break;case st.ROUND:D?(l.push(Y,J,x+A*R,v+N*R),a+=tr(x,v,x+A*R,v+N*R,x+k*R,v+w*R,l,!0)+4,l.push(Y,J,x+k*R,v+w*R)):(l.push(x-A*S,v-N*S,re,ve),a+=tr(x,v,x-A*S,v-N*S,x-k*S,v-w*S,l,!1)+4,l.push(x-k*S,v-w*S,re,ve))}else{switch(l.push(x-A*S,v-N*S,x+A*R,v+N*R),oe){case st.MITER:D?l.push(re,ve,re,ve):l.push(Y,J,Y,J),a+=2;break;case st.ROUND:a+=D?tr(x,v,x+A*R,v+N*R,x+k*R,v+w*R,l,!0)+2:tr(x,v,x-A*S,v-N*S,x-k*S,v-w*S,l,!1)+2}l.push(x-k*S,v-w*S,x+k*R,v+w*R),a+=2}}b=o[2*(c-2)],E=o[2*(c-2)+1],x=o[2*(c-1)],v=o[2*(c-1)+1],A=-(E-v),N=b-x,C=Math.sqrt(A*A+N*N),A/=C,N/=C,A*=m,N*=m,l.push(x-A*S,v-N*S,x+A*R,v+N*R),y||(u.cap===er.ROUND?a+=tr(x-A*(S-R)*.5,v-N*(S-R)*.5,x-A*S,v-N*S,x+A*R,v+N*R,l,!1)+2:u.cap===er.SQUARE&&(a+=iu(x,v,A,N,S,R,!1,l)));const I=n.indices,M=Nr.epsilon*Nr.epsilon;for(let L=h;L<a+h-2;++L)b=l[2*L],E=l[2*L+1],x=l[2*(L+1)],v=l[2*(L+1)+1],T=l[2*(L+2)],O=l[2*(L+2)+1],Math.abs(b*(v-O)+x*(O-E)+T*(E-v))<M||I.push(L,L+1,L+2)}(t,e)}class rs{static curveLength(e,r,n,i,o,s){const u=e-2*n+o,p=r-2*i+s,d=2*n-2*e,y=2*i-2*r,f=4*(u*u+p*p),l=4*(u*d+p*y),c=d*d+y*y,a=2*Math.sqrt(f+l+c),h=Math.sqrt(f),m=2*f*h,g=2*Math.sqrt(c),_=l/h;return(m*a+h*l*(a-g)+(4*c*f-l*l)*Math.log((2*h+_+a)/(_+g)))/(4*m)}static curveTo(e,r,n,i,o){const s=o[o.length-2],u=o[o.length-1],p=Nr._segmentsCount(rs.curveLength(s,u,e,r,n,i));let d=0,y=0;for(let f=1;f<=p;++f){const l=f/p;d=s+(e-s)*l,y=u+(r-u)*l,o.push(d+(e+(n-e)*l-d)*l,y+(r+(i-r)*l-y)*l)}}}const ns={[je.POLY]:ru,[je.CIRC]:ii,[je.ELIP]:ii,[je.RECT]:kd,[je.RREC]:Cd},su=[],oi=[];class is{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?ge.EMPTY:((e=e||new ge(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:n,b:i,c:o,d:s,tx:u,ty:p}=e,d=n*r.x+o*r.y+u,y=i*r.x+s*r.y+p;this.minX=Math.min(this.minX,d),this.maxX=Math.max(this.maxX,d),this.minY=Math.min(this.minY,y),this.maxY=Math.max(this.maxY,y)}addQuad(e){let r=this.minX,n=this.minY,i=this.maxX,o=this.maxY,s=e[0],u=e[1];r=s<r?s:r,n=u<n?u:n,i=s>i?s:i,o=u>o?u:o,s=e[2],u=e[3],r=s<r?s:r,n=u<n?u:n,i=s>i?s:i,o=u>o?u:o,s=e[4],u=e[5],r=s<r?s:r,n=u<n?u:n,i=s>i?s:i,o=u>o?u:o,s=e[6],u=e[7],r=s<r?s:r,n=u<n?u:n,i=s>i?s:i,o=u>o?u:o,this.minX=r,this.minY=n,this.maxX=i,this.maxY=o}addFrame(e,r,n,i,o){this.addFrameMatrix(e.worldTransform,r,n,i,o)}addFrameMatrix(e,r,n,i,o){const s=e.a,u=e.b,p=e.c,d=e.d,y=e.tx,f=e.ty;let l=this.minX,c=this.minY,a=this.maxX,h=this.maxY,m=s*r+p*n+y,g=u*r+d*n+f;l=m<l?m:l,c=g<c?g:c,a=m>a?m:a,h=g>h?g:h,m=s*i+p*n+y,g=u*i+d*n+f,l=m<l?m:l,c=g<c?g:c,a=m>a?m:a,h=g>h?g:h,m=s*r+p*o+y,g=u*r+d*o+f,l=m<l?m:l,c=g<c?g:c,a=m>a?m:a,h=g>h?g:h,m=s*i+p*o+y,g=u*i+d*o+f,l=m<l?m:l,c=g<c?g:c,a=m>a?m:a,h=g>h?g:h,this.minX=l,this.minY=c,this.maxX=a,this.maxY=h}addVertexData(e,r,n){let i=this.minX,o=this.minY,s=this.maxX,u=this.maxY;for(let p=r;p<n;p+=2){const d=e[p],y=e[p+1];i=d<i?d:i,o=y<o?y:o,s=d>s?d:s,u=y>u?y:u}this.minX=i,this.minY=o,this.maxX=s,this.maxY=u}addVertices(e,r,n,i){this.addVerticesMatrix(e.worldTransform,r,n,i)}addVerticesMatrix(e,r,n,i,o=0,s=o){const u=e.a,p=e.b,d=e.c,y=e.d,f=e.tx,l=e.ty;let c=this.minX,a=this.minY,h=this.maxX,m=this.maxY;for(let g=n;g<i;g+=2){const _=r[g],b=r[g+1],E=u*_+d*b+f,x=y*b+p*_+l;c=Math.min(c,E-o),h=Math.max(h,E+o),a=Math.min(a,x-s),m=Math.max(m,x+s)}this.minX=c,this.minY=a,this.maxX=h,this.maxY=m}addBounds(e){const r=this.minX,n=this.minY,i=this.maxX,o=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<n?e.minY:n,this.maxX=e.maxX>i?e.maxX:i,this.maxY=e.maxY>o?e.maxY:o}addBoundsMask(e,r){const n=e.minX>r.minX?e.minX:r.minX,i=e.minY>r.minY?e.minY:r.minY,o=e.maxX<r.maxX?e.maxX:r.maxX,s=e.maxY<r.maxY?e.maxY:r.maxY;if(n<=o&&i<=s){const u=this.minX,p=this.minY,d=this.maxX,y=this.maxY;this.minX=n<u?n:u,this.minY=i<p?i:p,this.maxX=o>d?o:d,this.maxY=s>y?s:y}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const n=e.minX>r.x?e.minX:r.x,i=e.minY>r.y?e.minY:r.y,o=e.maxX<r.x+r.width?e.maxX:r.x+r.width,s=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(n<=o&&i<=s){const u=this.minX,p=this.minY,d=this.maxX,y=this.maxY;this.minX=n<u?n:u,this.minY=i<p?i:p,this.maxX=o>d?o:d,this.maxY=s>y?s:y}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,n,i,o,s){e-=o,r-=s,n+=o,i+=s,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>i?this.maxY:i}}class kr extends mn{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new To,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new is,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const r=Object.keys(e);for(let n=0;n<r.length;++n){const i=r[n];Object.defineProperty(kr.prototype,i,Object.getOwnPropertyDescriptor(e,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new ge),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new ge),e=this._localBoundsRect),this._localBounds||(this._localBounds=new is);const r=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,o=this._boundsID;this._bounds=this._localBounds;const s=this.getBounds(!1,e);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-o,s}toGlobal(e,r,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,n,i){return r&&(e=r.toGlobal(e,n,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,n=1,i=1,o=0,s=0,u=0,p=0,d=0){return this.position.x=e,this.position.y=r,this.scale.x=n||1,this.scale.y=i||1,this.rotation=o,this.skew.x=s,this.skew.y=u,this.pivot.x=p,this.pivot.y=d,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new Id),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*Xh}set angle(e){this.transform.rotation=e*$h}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class Id extends kr{constructor(){super(...arguments),this.sortDirty=null}}kr.prototype.displayObjectUpdateTransform=kr.prototype.updateTransform;const Pd=new De;function Md(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const os=class extends kr{constructor(){super(),this.children=[],this.sortableChildren=os.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t,this.onChildrenChange(r<n?r:n)}getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);In(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(r===-1)return null;e.parent=null,e.transform._parentID=-1,In(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,In(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,n=e-r;let i;if(n>0&&n<=e){i=this.children.splice(r,n);for(let o=0;o<i.length;++o)i[o].parent=null,i[o].transform&&(i[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let o=0;o<i.length;++o)i[o].emit("removed",this),this.emit("childRemoved",i[o],this,o);return i}if(n===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const n=this.children[e];n._lastSortedIndex=e,t||n.zIndex===0||(t=!0)}t&&this.children.length>1&&this.children.sort(Md),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const r=this.children[t];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){const r=e._mask.isMaskData?e._mask.maskObject:e._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let n=0,i=this.children.length;n<i;++n){const o=this.children[n];o.visible&&o.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let r,n;this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==os.prototype._render&&(r=this.getBounds(!0));const i=t.projection.transform;if(i&&(n?(n=Pd.copyFrom(n),n.prepend(i)):n=i),r&&e.intersects(r,n))this._render(t);else if(this.cullArea)return;for(let o=0,s=this.children.length;o<s;++o){const u=this.children[o],p=u.cullable;u.cullable=p||!this.cullArea,u.render(t),u.cullable=p}}render(t){var e;if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||(e=this.filters)!=null&&e.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let r=0,n=this.children.length;r<n;++r)this.children[r].render(t)}}renderAdvanced(t){var i,o,s;const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let u=0;u<e.length;u++)e[u].enabled&&this._enabledFilters.push(e[u])}const n=e&&((i=this._enabledFilters)==null?void 0:i.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ce.NONE));if(n&&t.batch.flush(),e&&((o=this._enabledFilters)!=null&&o.length)&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let u=0,p=this.children.length;u<p;++u)this.children[u].render(t)}n&&t.batch.flush(),r&&t.mask.pop(this),e&&((s=this._enabledFilters)!=null&&s.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e=typeof t=="boolean"?t:t==null?void 0:t.children,r=this.removeChildren(0,this.children.length);if(e)for(let n=0;n<r.length;++n)r[n].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;this.scale.x=e!==0?t/e:1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;this.scale.y=e!==0?t/e:1,this._height=t}};let Cr=os;Cr.defaultSortableChildren=!1,Cr.prototype.containerUpdateTransform=Cr.prototype.updateTransform,Object.defineProperties(ue,{SORTABLE_CHILDREN:{get:()=>Cr.defaultSortableChildren,set(t){ye("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Cr.defaultSortableChildren=t}}});class si{constructor(e,r=null,n=null,i=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=r,this.matrix=i,this.type=e.type}clone(){return new si(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const Rr=new Me,au=class extends za{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new is,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),oi.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),su.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,n=null){const i=new si(t,e,r,n);return this.graphicsData.push(i),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new si(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const n=e[r];if(n.fillStyle.visible&&n.shape&&(n.matrix?n.matrix.applyInverse(t,Rr):Rr.copyFrom(t),n.shape.contains(Rr.x,Rr.y))){let i=!1;if(n.holes){for(let o=0;o<n.holes.length;o++)if(n.holes[o].shape.contains(Rr.x,Rr.y)){i=!0;break}}if(!i)return!0}}return!1}updateBatches(){if(!this.graphicsData.length)return void(this.batchable=!0);if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,n=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],n=r.style);for(let u=this.shapeIndex;u<e.length;u++){this.shapeIndex++;const p=e[u],d=p.fillStyle,y=p.lineStyle;ns[p.type].build(p),p.matrix&&this.transformPoints(p.points,p.matrix),(d.visible||y.visible)&&this.processHoles(p.holes);for(let f=0;f<2;f++){const l=f===0?d:y;if(!l.visible)continue;const c=l.texture.baseTexture,a=this.indices.length,h=this.points.length/2;c.wrapMode=Ur.REPEAT,f===0?this.processFill(p):this.processLine(p);const m=this.points.length/2-h;m!==0&&(r&&!this._compareStyles(n,l)&&(r.end(a,h),r=null),r||(r=su.pop()||new Rd,r.begin(l,a,h),this.batches.push(r),n=l),this.addUvs(this.points,t,l.texture,h,m,l.matrix))}}const i=this.indices.length,o=this.points.length/2;if(r&&r.end(i,o),this.batches.length===0)return void(this.batchable=!0);const s=o>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&s===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=s?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e)&&t.texture.baseTexture===e.texture.baseTexture&&t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const r=this.graphicsData[t],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const n=t[e];for(let i=0;i<n.size;i++){const o=n.start+i;this.indicesUint16[o]=this.indicesUint16[o]-n.attribStart}}}isBatchable(){if(this.points.length>131070)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<2*au.BATCHABLE_SIZE}buildDrawCalls(){let t=++de._globalBatch;for(let y=0;y<this.drawCalls.length;y++)this.drawCalls[y].texArray.clear(),oi.push(this.drawCalls[y]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let n=oi.pop();n||(n=new _o,n.texArray=new Oo),n.texArray.count=0,n.start=0,n.size=0,n.type=Nt.TRIANGLES;let i=0,o=null,s=0,u=!1,p=Nt.TRIANGLES,d=0;this.drawCalls.push(n);for(let y=0;y<this.batches.length;y++){const f=this.batches[y],l=8,c=f.style,a=c.texture.baseTexture;u!==!!c.native&&(u=!!c.native,p=u?Nt.LINES:Nt.TRIANGLES,o=null,i=l,t++),o!==a&&(o=a,a._batchEnabled!==t&&(i===l&&(t++,i=0,n.size>0&&(n=oi.pop(),n||(n=new _o,n.texArray=new Oo),this.drawCalls.push(n)),n.start=d,n.size=0,n.texArray.count=0,n.type=p),a.touched=1,a._batchEnabled=t,a._batchLocation=i,a.wrapMode=Ur.REPEAT,n.texArray.elements[n.texArray.count++]=a,i++)),n.size+=f.size,d+=f.size,s=a._batchLocation,this.addColors(e,c.color,c.alpha,f.attribSize,f.attribStart),this.addTextureIds(r,s,f.attribSize,f.attribStart)}de._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(3*t.length*4),o=new Float32Array(i),s=new Uint32Array(i);let u=0;for(let p=0;p<t.length/2;p++)o[u++]=t[2*p],o[u++]=t[2*p+1],o[u++]=e[2*p],o[u++]=e[2*p+1],s[u++]=r[p],o[u++]=n[p];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?ru.triangulate(t,this):ns[t.type].triangulate(t,this)}processLine(t){ou(t,this);for(let e=0;e<t.holes.length;e++)ou(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];ns[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const n=t[2*r],i=t[2*r+1];t[2*r]=e.a*n+e.c*i+e.tx,t[2*r+1]=e.b*n+e.d*i+e.ty}}addColors(t,e,r,n,i=0){const o=qe.shared.setValue(e).toLittleEndianNumber(),s=qe.shared.setValue(o).toPremultiplied(r);t.length=Math.max(t.length,i+n);for(let u=0;u<n;u++)t[i+u]=s}addTextureIds(t,e,r,n=0){t.length=Math.max(t.length,n+r);for(let i=0;i<r;i++)t[n+i]=e}addUvs(t,e,r,n,i,o=null){let s=0;const u=e.length,p=r.frame;for(;s<i;){let y=t[2*(n+s)],f=t[2*(n+s)+1];if(o){const l=o.a*y+o.c*f+o.tx;f=o.b*y+o.d*f+o.ty,y=l}s++,e.push(y/p.width,f/p.height)}const d=r.baseTexture;(p.width<d.width||p.height<d.height)&&this.adjustUvs(e,r,u,i)}adjustUvs(t,e,r,n){const i=e.baseTexture,o=1e-6,s=r+2*n,u=e.frame,p=u.width/i.width,d=u.height/i.height;let y=u.x/u.width,f=u.y/u.height,l=Math.floor(t[r]+o),c=Math.floor(t[r+1]+o);for(let a=r+2;a<s;a+=2)l=Math.min(l,Math.floor(t[a]+o)),c=Math.min(c,Math.floor(t[a+1]+o));y-=l,f-=c;for(let a=r;a<s;a+=2)t[a]=(t[a]+y)*p,t[a+1]=(t[a+1]+f)*d}};let lu=au;lu.BATCHABLE_SIZE=100;class ai{constructor(){this.color=16777215,this.alpha=1,this.texture=pe.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new ai;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=pe.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ss extends ai{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=er.BUTT,this.join=st.MITER,this.miterLimit=10}clone(){const e=new ss;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const as={},li=class extends Cr{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new ai,this._lineStyle=new ss,this._matrix=null,this._holeMode=!1,this.state=Mn.for2d(),this._geometry=t||new lu,this._geometry.refCount++,this._transformID=-1,this._tintColor=new qe(16777215),this.blendMode=ee.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new li(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,n=.5,i=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:r,alignment:n,native:i}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:pe.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:er.BUTT,join:st.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Qr,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Qr,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return n===t&&i===e||r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,n){this._initCurve();const i=this.currentPath.points;return i.length===0&&this.moveTo(0,0),rs.curveTo(t,e,r,n,i),this}bezierCurveTo(t,e,r,n,i,o){return this._initCurve(),ts.curveTo(t,e,r,n,i,o,this.currentPath.points),this}arcTo(t,e,r,n,i){this._initCurve(t,e);const o=this.currentPath.points,s=nu.curveTo(t,e,r,n,i,o);if(s){const{cx:u,cy:p,radius:d,startAngle:y,endAngle:f,anticlockwise:l}=s;this.arc(u,p,d,y,f,l)}return this}arc(t,e,r,n,i,o=!1){if(n===i)return this;if(!o&&i<=n?i+=jn:o&&n<=i&&(n+=jn),i-n===0)return this;const s=t+Math.cos(n)*r,u=e+Math.sin(n)*r,p=this._geometry.closePointEps;let d=this.currentPath?this.currentPath.points:null;if(d){const y=Math.abs(d[d.length-2]-s),f=Math.abs(d[d.length-1]-u);y<p&&f<p||d.push(s,u)}else this.moveTo(s,u),d=this.currentPath.points;return nu.arc(s,u,t,e,r,n,i,o,d),this}beginFill(t=0,e){return this.beginTextureFill({texture:pe.WHITE,color:t,alpha:e})}normalizeColor(t){const e=qe.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:pe.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,n){return this.drawShape(new ge(t,e,r,n))}drawRoundedRect(t,e,r,n,i){return this.drawShape(new Eo(t,e,r,n,i))}drawCircle(t,e,r){return this.drawShape(new xo(t,e,r))}drawEllipse(t,e,r,n){return this.drawShape(new class nc{constructor(o=0,s=0,u=0,p=0){this.x=o,this.y=s,this.width=u,this.height=p,this.type=je.ELIP}clone(){return new nc(this.x,this.y,this.width,this.height)}contains(o,s){if(this.width<=0||this.height<=0)return!1;let u=(o-this.x)/this.width,p=(s-this.y)/this.height;return u*=u,p*=p,u+p<=1}getBounds(){return new ge(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}(t,e,r,n))}drawPolygon(...t){let e,r=!0;const n=t[0];n.points?(r=n.closeStroke,e=n.points):e=Array.isArray(t[0])?t[0]:t;const i=new Qr(e);return i.closeStroke=r,this.drawShape(i),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return!(t.length!==1||t[0].shape.type!==je.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(let n=0;n<r;n++){const i=t.batches[n],o=i.style.color,s=new Float32Array(this.vertexData.buffer,4*i.attribStart*2,2*i.attribSize),u=new Float32Array(t.uvsFloat32.buffer,4*i.attribStart*2,2*i.attribSize),p={vertexData:s,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*i.start,i.size),uvs:u,_batchRGB:qe.shared.setValue(o).toRgbArray(),_tintRGB:o,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=p}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const n=this.batches[e];n.worldAlpha=this.worldAlpha*n.alpha,t.plugins[this.pluginName].render(n)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,n=this.worldAlpha,i=e.uniforms,o=r.drawCalls;i.translationMatrix=this.transform.worldTransform,qe.shared.setValue(this._tintColor).premultiply(n).toArray(i.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let s=0,u=o.length;s<u;s++)this._renderDrawCallDirect(t,r.drawCalls[s])}_renderDrawCallDirect(t,e){const{texArray:r,type:n,size:i,start:o}=e,s=r.count;for(let u=0;u<s;u++)t.texture.bind(r.elements[u],u);t.geometry.draw(n,i,o)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!as[r]){const{maxTextures:n}=t.plugins[r],i=new Int32Array(n);for(let u=0;u<n;u++)i[u]=u;const o={tint:new Float32Array([1,1,1,1]),translationMatrix:new De,default:tt.from({uSamplers:i},!0)},s=t.plugins[r]._shader.program;as[r]=new en(s,o)}e=as[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:n,maxY:i}=t.bounds;this._bounds.addFrame(this.transform,e,r,n,i)}containsPoint(t){return this.worldTransform.applyInverse(t,li._TEMP_POINT),this._geometry.containsPoint(li._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=qe.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,n=e.b,i=e.c,o=e.d,s=e.tx,u=e.ty,p=this._geometry.points,d=this.vertexData;let y=0;for(let f=0;f<p.length;f+=2){const l=p[f],c=p[f+1];d[y++]=r*l+i*c+s,d[y++]=o*c+n*l+u}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let ls=li;ls.curves=Nr,ls._TEMP_POINT=new Me,typeof globalThis<"u"||typeof window<"u"||(typeof global<"u"?global:typeof self<"u");var us={},Ld={get exports(){return us},set exports(t){us=t}};/*!
543
- * d-path-parser - v1.0.0
544
- * by Massimo Artizzu (MaxArt2501)
545
- *
546
- * https://github.com/MaxArt2501/d-path-parser
547
- *
548
- * Licensed under the MIT License
549
- * See LICENSE for details
550
- */(function(t,e){t.exports=function(r){for(var n={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},i={number:function(a){return+l("number",a)},"coordinate pair":function(a){var h=l("number",a);return h!==null||a?(l("comma"),{x:+h,y:+l("number",!0)}):null},"arc definition":function(a){var h=i["coordinate pair"](a);if(!h&&!a)return null;l("comma");var m=+l("number",!0);l("comma",!0);var g=!!+l("flag",!0);l("comma");var _=!!+l("flag",!0);return l("comma"),{radii:h,rotation:m,large:g,clockwise:_,end:i["coordinate pair"](!0)}}},o=0,s=[];o<r.length;){var u,p=l("command"),d=p.toUpperCase(),y=p!==d;switch(d){case"M":u=c("coordinate pair").map(function(a,h){return h===1&&(p=y?"l":"L"),f({end:a})});break;case"L":case"T":u=c("coordinate pair").map(function(a){return f({end:a})});break;case"C":if((u=c("coordinate pair")).length%3)throw Error("Expected coordinate pair triplet at position "+o);u=u.reduce(function(a,h,m){var g=m%3;return g?a[a.length-1][g===1?"cp2":"end"]=h:a.push(f({cp1:h})),a},[]);break;case"Q":case"S":if(1&(u=c("coordinate pair")).length)throw Error("Expected coordinate pair couple at position "+o);u=u.reduce(function(a,h,m){return 1&m?a[a.length-1].end=h:a.push(f({cp:h})),a},[]);break;case"H":case"V":u=c("number").map(function(a){return f({value:a})});break;case"A":u=c("arc definition").map(f);break;case"Z":u=[{code:"Z"}]}s.push.apply(s,u)}return s;function f(a){return a.code=p,a.relative=y,a}function l(a,h){n[a].lastIndex=o;var m=n[a].exec(r);if(!m||m.index!==o){if(!h)return null;throw Error("Expected "+a+" at position "+o)}return o=n[a].lastIndex,m[1]}function c(a){for(var h,m=[],g=!0;h=i[a](g);)m.push(h),g=!!l("comma");return m}}})(Ld);const jd=/^\s+/,Fd=/\s+$/;function Z(t,e){if(e=e||{},(t=t||"")instanceof Z)return t;if(!(this instanceof Z))return new Z(t,e);var r=function(n){var i={r:0,g:0,b:0},o=1,s=null,u=null,p=null,d=!1,y=!1;return typeof n=="string"&&(n=function(f){f=f.replace(jd,"").replace(Fd,"").toLowerCase();var l,c=!1;if(cs[f])f=cs[f],c=!0;else if(f=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(l=lt.rgb.exec(f))?{r:l[1],g:l[2],b:l[3]}:(l=lt.rgba.exec(f))?{r:l[1],g:l[2],b:l[3],a:l[4]}:(l=lt.hsl.exec(f))?{h:l[1],s:l[2],l:l[3]}:(l=lt.hsla.exec(f))?{h:l[1],s:l[2],l:l[3],a:l[4]}:(l=lt.hsv.exec(f))?{h:l[1],s:l[2],v:l[3]}:(l=lt.hsva.exec(f))?{h:l[1],s:l[2],v:l[3],a:l[4]}:(l=lt.hex8.exec(f))?{r:Ve(l[1]),g:Ve(l[2]),b:Ve(l[3]),a:mu(l[4]),format:c?"name":"hex8"}:(l=lt.hex6.exec(f))?{r:Ve(l[1]),g:Ve(l[2]),b:Ve(l[3]),format:c?"name":"hex"}:(l=lt.hex4.exec(f))?{r:Ve(l[1]+""+l[1]),g:Ve(l[2]+""+l[2]),b:Ve(l[3]+""+l[3]),a:mu(l[4]+""+l[4]),format:c?"name":"hex8"}:(l=lt.hex3.exec(f))?{r:Ve(l[1]+""+l[1]),g:Ve(l[2]+""+l[2]),b:Ve(l[3]+""+l[3]),format:c?"name":"hex"}:!1}(n)),typeof n=="object"&&(Ot(n.r)&&Ot(n.g)&&Ot(n.b)?(i=function(f,l,c){return{r:255*_e(f,255),g:255*_e(l,255),b:255*_e(c,255)}}(n.r,n.g,n.b),d=!0,y=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Ot(n.h)&&Ot(n.s)&&Ot(n.v)?(s=un(n.s),u=un(n.v),i=function(f,l,c){f=6*_e(f,360),l=_e(l,100),c=_e(c,100);var a=Math.floor(f),h=f-a,m=c*(1-l),g=c*(1-h*l),_=c*(1-(1-h)*l),b=a%6,E=[c,g,m,m,_,c][b],x=[_,c,c,g,m,m][b],v=[m,m,_,c,c,g][b];return{r:255*E,g:255*x,b:255*v}}(n.h,s,u),d=!0,y="hsv"):Ot(n.h)&&Ot(n.s)&&Ot(n.l)&&(s=un(n.s),p=un(n.l),i=function(f,l,c){var a,h,m;function g(E,x,v){return v<0&&(v+=1),v>1&&(v-=1),v<1/6?E+6*(x-E)*v:v<.5?x:v<2/3?E+(x-E)*(2/3-v)*6:E}if(f=_e(f,360),l=_e(l,100),c=_e(c,100),l===0)a=h=m=c;else{var _=c<.5?c*(1+l):c+l-c*l,b=2*c-_;a=g(b,_,f+1/3),h=g(b,_,f),m=g(b,_,f-1/3)}return{r:255*a,g:255*h,b:255*m}}(n.h,s,p),d=!0,y="hsl"),n.hasOwnProperty("a")&&(o=n.a)),o=pu(o),{ok:d,format:n.format||y,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function uu(t,e,r){t=_e(t,255),e=_e(e,255),r=_e(r,255);var n,i,o=Math.max(t,e,r),s=Math.min(t,e,r),u=(o+s)/2;if(o==s)n=i=0;else{var p=o-s;switch(i=u>.5?p/(2-o-s):p/(o+s),o){case t:n=(e-r)/p+(e<r?6:0);break;case e:n=(r-t)/p+2;break;case r:n=(t-e)/p+4}n/=6}return{h:n,s:i,l:u}}function cu(t,e,r){t=_e(t,255),e=_e(e,255),r=_e(r,255);var n,i,o=Math.max(t,e,r),s=Math.min(t,e,r),u=o,p=o-s;if(i=o===0?0:p/o,o==s)n=0;else{switch(o){case t:n=(e-r)/p+(e<r?6:0);break;case e:n=(r-t)/p+2;break;case r:n=(t-e)/p+4}n/=6}return{h:n,s:i,v:u}}function hu(t,e,r,n){var i=[at(Math.round(t).toString(16)),at(Math.round(e).toString(16)),at(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function fu(t,e,r,n){return[at(yu(n)),at(Math.round(t).toString(16)),at(Math.round(e).toString(16)),at(Math.round(r).toString(16))].join("")}function Bd(t,e){e=e===0?0:e||10;var r=Z(t).toHsl();return r.s-=e/100,r.s=ui(r.s),Z(r)}function Dd(t,e){e=e===0?0:e||10;var r=Z(t).toHsl();return r.s+=e/100,r.s=ui(r.s),Z(r)}function Ud(t){return Z(t).desaturate(100)}function qd(t,e){e=e===0?0:e||10;var r=Z(t).toHsl();return r.l+=e/100,r.l=ui(r.l),Z(r)}function Gd(t,e){e=e===0?0:e||10;var r=Z(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-e/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-e/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-e/100*255))),Z(r)}function Hd(t,e){e=e===0?0:e||10;var r=Z(t).toHsl();return r.l-=e/100,r.l=ui(r.l),Z(r)}function zd(t,e){var r=Z(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,Z(r)}function Vd(t){var e=Z(t).toHsl();return e.h=(e.h+180)%360,Z(e)}function du(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Z(t).toHsl(),n=[Z(t)],i=360/e,o=1;o<e;o++)n.push(Z({h:(r.h+o*i)%360,s:r.s,l:r.l}));return n}function Xd(t){var e=Z(t).toHsl(),r=e.h;return[Z(t),Z({h:(r+72)%360,s:e.s,l:e.l}),Z({h:(r+216)%360,s:e.s,l:e.l})]}function $d(t,e,r){e=e||6,r=r||30;var n=Z(t).toHsl(),i=360/r,o=[Z(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(Z(n));return o}function Wd(t,e){e=e||6;for(var r=Z(t).toHsv(),n=r.h,i=r.s,o=r.v,s=[],u=1/e;e--;)s.push(Z({h:n,s:i,v:o})),o=(o+u)%1;return s}Z.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=pu(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=cu(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=cu(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return this._a==1?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=uu(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=uu(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return this._a==1?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return hu(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(e,r,n,i,o){var s=[at(Math.round(e).toString(16)),at(Math.round(r).toString(16)),at(Math.round(n).toString(16)),at(yu(i))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*_e(this._r,255))+"%",g:Math.round(100*_e(this._g,255))+"%",b:Math.round(100*_e(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*_e(this._r,255))+"%, "+Math.round(100*_e(this._g,255))+"%, "+Math.round(100*_e(this._b,255))+"%)":"rgba("+Math.round(100*_e(this._r,255))+"%, "+Math.round(100*_e(this._g,255))+"%, "+Math.round(100*_e(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(Yd[hu(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+fu(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=Z(t);r="#"+fu(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||t!=="hex"&&t!=="hex6"&&t!=="hex3"&&t!=="hex4"&&t!=="hex8"&&t!=="name"?(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),t!=="hex"&&t!=="hex6"||(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString()):t==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return Z(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(qd,arguments)},brighten:function(){return this._applyModification(Gd,arguments)},darken:function(){return this._applyModification(Hd,arguments)},desaturate:function(){return this._applyModification(Bd,arguments)},saturate:function(){return this._applyModification(Dd,arguments)},greyscale:function(){return this._applyModification(Ud,arguments)},spin:function(){return this._applyModification(zd,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination($d,arguments)},complement:function(){return this._applyCombination(Vd,arguments)},monochromatic:function(){return this._applyCombination(Wd,arguments)},splitcomplement:function(){return this._applyCombination(Xd,arguments)},triad:function(){return this._applyCombination(du,[3])},tetrad:function(){return this._applyCombination(du,[4])}},Z.fromRatio=function(t,e){if(typeof t=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=n==="a"?t[n]:un(t[n]));t=r}return Z(t,e)},Z.equals=function(t,e){return!(!t||!e)&&Z(t).toRgbString()==Z(e).toRgbString()},Z.random=function(){return Z.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Z.mix=function(t,e,r){r=r===0?0:r||50;var n=Z(t).toRgb(),i=Z(e).toRgb(),o=r/100;return Z({r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a})},Z.readability=function(t,e){var r=Z(t),n=Z(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},Z.isReadable=function(t,e,r){var n,i,o=Z.readability(t,e);switch(i=!1,(n=function(s){var u,p;return u=((s=s||{level:"AA",size:"small"}).level||"AA").toUpperCase(),p=(s.size||"small").toLowerCase(),u!=="AA"&&u!=="AAA"&&(u="AA"),p!=="small"&&p!=="large"&&(p="small"),{level:u,size:p}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},Z.mostReadable=function(t,e,r){var n,i,o,s,u=null,p=0;i=(r=r||{}).includeFallbackColors,o=r.level,s=r.size;for(var d=0;d<e.length;d++)(n=Z.readability(t,e[d]))>p&&(p=n,u=Z(e[d]));return Z.isReadable(t,u,{level:o,size:s})||!i?u:(r.includeFallbackColors=!1,Z.mostReadable(t,["#fff","#000"],r))};var cs=Z.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Yd=Z.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(cs);function pu(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _e(t,e){(function(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1})(t)&&(t="100%");var r=function(n){return typeof n=="string"&&n.indexOf("%")!=-1}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function ui(t){return Math.min(1,Math.max(0,t))}function Ve(t){return parseInt(t,16)}function at(t){return t.length==1?"0"+t:""+t}function un(t){return t<=1&&(t=100*t+"%"),t}function yu(t){return Math.round(255*parseFloat(t)).toString(16)}function mu(t){return Ve(t)/255}var Lt,ci,hi,lt=(ci="[\\s|\\(]+("+(Lt="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Lt+")[,|\\s]+("+Lt+")\\s*\\)?",hi="[\\s|\\(]+("+Lt+")[,|\\s]+("+Lt+")[,|\\s]+("+Lt+")[,|\\s]+("+Lt+")\\s*\\)?",{CSS_UNIT:new RegExp(Lt),rgb:new RegExp("rgb"+ci),rgba:new RegExp("rgba"+hi),hsl:new RegExp("hsl"+ci),hsla:new RegExp("hsla"+hi),hsv:new RegExp("hsv"+ci),hsva:new RegExp("hsva"+hi),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Ot(t){return!!lt.CSS_UNIT.exec(t)}var Kd=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(r,n){var i=[],o=!0,s=!1,u=void 0;try{for(var p,d=r[Symbol.iterator]();!(o=(p=d.next()).done)&&(i.push(p.value),!n||i.length!==n);o=!0);}catch(y){s=!0,u=y}finally{try{!o&&d.return&&d.return()}finally{if(s)throw u}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},cn=2*Math.PI,hs=function(t,e,r,n,i,o,s){var u=t.x,p=t.y;return{x:n*(u*=e)-i*(p*=r)+o,y:i*u+n*p+s}},Zd=function(t,e){var r=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),s=Math.sin(t+e);return[{x:n-i*r,y:i+n*r},{x:o+s*r,y:s-o*r},{x:o,y:s}]},gu=function(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)},vu=function(t){var e=t.px,r=t.py,n=t.cx,i=t.cy,o=t.rx,s=t.ry,u=t.xAxisRotation,p=u===void 0?0:u,d=t.largeArcFlag,y=d===void 0?0:d,f=t.sweepFlag,l=f===void 0?0:f,c=[];if(o===0||s===0)return[];var a=Math.sin(p*cn/360),h=Math.cos(p*cn/360),m=h*(e-n)/2+a*(r-i)/2,g=-a*(e-n)/2+h*(r-i)/2;if(m===0&&g===0)return[];o=Math.abs(o),s=Math.abs(s);var _=Math.pow(m,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(s,2);_>1&&(o*=Math.sqrt(_),s*=Math.sqrt(_));var b=function(w,C,P,S,R,I,M,L,j,q,G,z){var K=Math.pow(R,2),F=Math.pow(I,2),D=Math.pow(G,2),B=Math.pow(z,2),U=K*F-K*B-F*D;U<0&&(U=0),U/=K*B+F*D;var H=(U=Math.sqrt(U)*(M===L?-1:1))*R/I*z,V=U*-I/R*G,$=q*H-j*V+(w+P)/2,Y=j*H+q*V+(C+S)/2,J=(G-H)/R,re=(z-V)/I,ve=(-G-H)/R,ce=(-z-V)/I,ne=gu(1,0,J,re),oe=gu(J,re,ve,ce);return L===0&&oe>0&&(oe-=cn),L===1&&oe<0&&(oe+=cn),[$,Y,ne,oe]}(e,r,n,i,o,s,y,l,a,h,m,g),E=Kd(b,4),x=E[0],v=E[1],T=E[2],O=E[3],A=Math.abs(O)/(cn/4);Math.abs(1-A)<1e-7&&(A=1);var N=Math.max(Math.ceil(A),1);O/=N;for(var k=0;k<N;k++)c.push(Zd(T,O)),T+=O;return c.map(function(w){var C=hs(w[0],o,s,h,a,x,v),P=C.x,S=C.y,R=hs(w[1],o,s,h,a,x,v),I=R.x,M=R.y,L=hs(w[2],o,s,h,a,x,v);return{x1:P,y1:S,x2:I,y2:M,x:L.x,y:L.y}})};class Qd extends ls{constructor(e){super(),this.lineColor=null,e&&this.drawSVG(e)}drawSVG(e){if(typeof e=="string"){const r=document.createElement("div");r.innerHTML=e.trim(),e=r.querySelector("svg")}if(!e)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(e),this._svgChildren(e.children),this}_svgChildren(e,r=!1){for(let n=0;n<e.length;n++){const i=e[n];switch(this._svgFill(i,r),i.nodeName.toLowerCase()){case"path":this._svgPath(i);break;case"circle":case"ellipse":this._svgCircle(i);break;case"rect":this._svgRect(i);break;case"polygon":this._svgPoly(i,!0);break;case"polyline":this._svgPoly(i);break;case"g":break;default:console.info(`[PIXI.SVG] <${i.nodeName}> elements unsupported`)}this._svgChildren(i.children,!0)}}_hexToUint(e){if(e[0]==="#")return(e=e.substr(1)).length===3&&(e=e.replace(/([a-f0-9])/gi,"$1$1")),parseInt(e,16);const{r,g:n,b:i}=Z(e).toRgb();return(r<<16)+(n<<8)+i}_svgCircle(e){let r="r",n="r";const i=e.nodeName==="elipse";i&&(r+="x",n+="y");const o=parseFloat(e.getAttribute(n)),s=parseFloat(e.getAttribute(r)),u=e.getAttribute("cx"),p=e.getAttribute("cy");let d=0,y=0;u!==null&&(d=parseFloat(u)),p!==null&&(y=parseFloat(p)),i?this.drawEllipse(d,y,o,s):this.drawCircle(d,y,o)}_svgRect(e){const r=parseFloat(e.getAttribute("x")),n=parseFloat(e.getAttribute("y")),i=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),s=parseFloat(e.getAttribute("rx"));s?this.drawRoundedRect(r,n,i,o,s):this.drawRect(r,n,i,o)}_convertStyleName(e){return e.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(e){const r=e.getAttribute("style"),n=e.getAttribute("opacity"),i={fill:e.getAttribute("fill"),opacity:n||e.getAttribute("fill-opacity"),stroke:e.getAttribute("stroke"),strokeOpacity:n||e.getAttribute("stroke-opacity"),strokeWidth:e.getAttribute("stroke-width"),cap:e.getAttribute("stroke-linecap"),join:e.getAttribute("stroke-linejoin"),miterLimit:e.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(o=>{const[s,u]=o.split(":");if(s){const p=this._convertStyleName(s);i[p]||(i[p]=u.trim())}}),i}_svgPoly(e,r){const n=e.getAttribute("points").split(/[ ,]/g).map(i=>parseInt(i,10));this.drawPolygon(n),r&&this.closePath()}_svgFill(e,r){const{fill:n,opacity:i,stroke:o,strokeOpacity:s,strokeWidth:u,cap:p,join:d,miterLimit:y}=this._svgStyle(e),f=o!==null?1:0,l=u!==null?parseFloat(u):f,c=o!==null?this._hexToUint(o):this.lineColor;n?n==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(n),i!==null?parseFloat(i):1):r||this.beginFill(0),this.lineStyle({width:o===null&&u===null&&r?this.line.width:l,alpha:s===null?this.line.alpha:parseFloat(s),color:o===null&&r?this.line.color:c,cap:p===null&&r?this.line.cap:p,join:d===null&&r?this.line.join:d,miterLimit:y===null&&r?this.line.miterLimit:parseFloat(y)}),e.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(e){const r=e.getAttribute("d");let n=0,i=0;const o=us(r.trim());for(let s=0;s<o.length;s++){const u=o[s];switch(u.code){case"m":this.moveTo(n+=u.end.x,i+=u.end.y);break;case"M":this.moveTo(n=u.end.x,i=u.end.y);break;case"H":this.lineTo(n=u.value,i);break;case"h":this.lineTo(n+=u.value,i);break;case"V":this.lineTo(n,i=u.value);break;case"v":this.lineTo(n,i+=u.value);break;case"Z":this.closePath();break;case"L":this.lineTo(n=u.end.x,i=u.end.y);break;case"l":this.lineTo(n+=u.end.x,i+=u.end.y);break;case"C":this.bezierCurveTo(u.cp1.x,u.cp1.y,u.cp2.x,u.cp2.y,n=u.end.x,i=u.end.y);break;case"c":{const p=n,d=i;this.bezierCurveTo(p+u.cp1.x,d+u.cp1.y,p+u.cp2.x,d+u.cp2.y,n+=u.end.x,i+=u.end.y);break}case"s":case"q":{const p=n,d=i;this.quadraticCurveTo(p+u.cp.x,d+u.cp.y,n+=u.end.x,i+=u.end.y);break}case"S":case"Q":this.quadraticCurveTo(u.cp.x,u.cp.y,n=u.end.x,i=u.end.y);break;case"a":vu({px:n,py:i,cx:n+=u.end.x,cy:i+=u.end.y,rx:u.radii.x,ry:u.radii.y,xAxisRotation:u.rotation,largeArcFlag:u.large?1:0,sweepFlag:u.clockwise?1:0}).forEach(({x1:p,y1:d,x2:y,y2:f,x:l,y:c})=>this.bezierCurveTo(p,d,y,f,l,c));break;case"A":vu({px:n,py:i,cx:n=u.end.x,cy:i=u.end.y,rx:u.radii.x,ry:u.radii.y,xAxisRotation:u.rotation,largeArcFlag:u.large?1:0,sweepFlag:u.clockwise?1:0}).forEach(({x1:p,y1:d,x2:y,y2:f,x:l,y:c})=>this.bezierCurveTo(p,d,y,f,l,c));break;default:console.info("[PIXI.SVG] Draw command not supported:",u.code,u)}}}}var fi={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Jd=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function Ir(t){return t>=48&&t<=57}function ep(t){return t>=48&&t<=57||t===43||t===45||t===46}function tp(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function di(t){for(;t.index<t.max&&((e=t.path.charCodeAt(t.index))===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&Jd.indexOf(e)>=0);)t.index++;var e}function rp(t){var e=t.path.charCodeAt(t.index);return e===48?(t.param=0,void t.index++):e===49?(t.param=1,void t.index++):void(t.err="SvgPath: arc flag can be 0 or 1 only (at pos "+t.index+")")}function np(t){var e,r=t.index,n=r,i=t.max,o=!1,s=!1,u=!1,p=!1;if(n>=i)t.err="SvgPath: missed param (at pos "+n+")";else if((e=t.path.charCodeAt(n))!==43&&e!==45||(e=++n<i?t.path.charCodeAt(n):0),Ir(e)||e===46){if(e!==46){if(o=e===48,e=++n<i?t.path.charCodeAt(n):0,o&&n<i&&e&&Ir(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+r+")");for(;n<i&&Ir(t.path.charCodeAt(n));)n++,s=!0;e=n<i?t.path.charCodeAt(n):0}if(e===46){for(p=!0,n++;Ir(t.path.charCodeAt(n));)n++,u=!0;e=n<i?t.path.charCodeAt(n):0}if(e===101||e===69){if(p&&!s&&!u||((e=++n<i?t.path.charCodeAt(n):0)!==43&&e!==45||n++,!(n<i&&Ir(t.path.charCodeAt(n)))))return void(t.err="SvgPath: invalid float exponent (at pos "+n+")");for(;n<i&&Ir(t.path.charCodeAt(n));)n++}t.index=n,t.param=parseFloat(t.path.slice(r,n))+0}else t.err="SvgPath: param should start with 0..9 or `.` (at pos "+n+")"}function fs(t){var e,r;r=(e=t.path[t.segmentStart]).toLowerCase();var n=t.data;if(r==="m"&&n.length>2&&(t.result.push([e,n[0],n[1]]),n=n.slice(2),r="l",e=e==="m"?"l":"L"),r==="r")t.result.push([e].concat(n));else for(;n.length>=fi[r]&&(t.result.push([e].concat(n.splice(0,fi[r]))),fi[r]););}function ip(t){var e,r,n,i,o,s=t.max;if(t.segmentStart=t.index,r=function(u){return(32|u)==97}(e=t.path.charCodeAt(t.index)),function(u){switch(32|u){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(e))if(i=fi[t.path[t.index].toLowerCase()],t.index++,di(t),t.data=[],i){for(n=!1;;){for(o=i;o>0;o--){if(!r||o!==3&&o!==4?np(t):rp(t),t.err.length)return void fs(t);t.data.push(t.param),di(t),n=!1,t.index<s&&t.path.charCodeAt(t.index)===44&&(t.index++,di(t),n=!0)}if(!n&&(t.index>=t.max||!ep(t.path.charCodeAt(t.index))))break}fs(t)}else fs(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}function ut(){if(!(this instanceof ut))return new ut;this.queue=[],this.cache=null}ut.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0||(this.cache=null,this.queue.push(t)),this},ut.prototype.translate=function(t,e){return t===0&&e===0||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},ut.prototype.scale=function(t,e){return t===1&&e===1||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},ut.prototype.rotate=function(t,e,r){var n,i,o;return t!==0&&(this.translate(e,r),n=t*Math.PI/180,i=Math.cos(n),o=Math.sin(n),this.queue.push([i,o,-o,i,0,0]),this.cache=null,this.translate(-e,-r)),this},ut.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},ut.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},ut.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=(e=this.cache,r=this.queue[t],[e[0]*r[0]+e[2]*r[1],e[1]*r[0]+e[3]*r[1],e[0]*r[2]+e[2]*r[3],e[1]*r[2]+e[3]*r[3],e[0]*r[4]+e[2]*r[5]+e[4],e[1]*r[4]+e[3]*r[5]+e[5]]);var e,r;return this.cache},ut.prototype.calc=function(t,e,r){var n;return this.queue.length?(this.cache||(this.cache=this.toArray()),[t*(n=this.cache)[0]+e*n[2]+(r?0:n[4]),t*n[1]+e*n[3]+(r?0:n[5])]):[t,e]};var bu=ut,op=bu,sp={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},ap=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,lp=/[\s,]+/,hn=2*Math.PI;function _u(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)}function up(t,e){var r=1.3333333333333333*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),s=Math.sin(t+e);return[n,i,n-i*r,i+n*r,o+s*r,s-o*r,o,s]}var fn=1e-10,xu=Math.PI/180;function dn(t,e,r){if(!(this instanceof dn))return new dn(t,e,r);this.rx=t,this.ry=e,this.ax=r}dn.prototype.transform=function(t){var e=Math.cos(this.ax*xu),r=Math.sin(this.ax*xu),n=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],i=n[0]*n[0]+n[2]*n[2],o=n[1]*n[1]+n[3]*n[3],s=((n[0]-n[3])*(n[0]-n[3])+(n[2]+n[1])*(n[2]+n[1]))*((n[0]+n[3])*(n[0]+n[3])+(n[2]-n[1])*(n[2]-n[1])),u=(i+o)/2;if(s<fn*u)return this.rx=this.ry=Math.sqrt(u),this.ax=0,this;var p=n[0]*n[1]+n[2]*n[3],d=u+(s=Math.sqrt(s))/2,y=u-s/2;return this.ax=Math.abs(p)<fn&&Math.abs(d-o)<fn?90:180*Math.atan(Math.abs(p)>Math.abs(d-o)?(d-i)/p:p/(d-o))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(d),this.ry=Math.sqrt(y)):(this.ax+=90,this.rx=Math.sqrt(y),this.ry=Math.sqrt(d)),this},dn.prototype.isDegenerate=function(){return this.rx<fn*this.ry||this.ry<fn*this.rx};var cp=function(t){var e=new tp(t),r=e.max;for(di(e);e.index<r&&!e.err.length;)ip(e);return e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}},hp=function(t){var e,r,n=new op;return t.split(ap).forEach(function(i){if(i.length)if(sp[i]===void 0)switch(r=i.split(lp).map(function(o){return+o||0}),e){case"matrix":return void(r.length===6&&n.matrix(r));case"scale":return void(r.length===1?n.scale(r[0],r[0]):r.length===2&&n.scale(r[0],r[1]));case"rotate":return void(r.length===1?n.rotate(r[0],0,0):r.length===3&&n.rotate(r[0],r[1],r[2]));case"translate":return void(r.length===1?n.translate(r[0],0):r.length===2&&n.translate(r[0],r[1]));case"skewX":return void(r.length===1&&n.skewX(r[0]));case"skewY":return void(r.length===1&&n.skewY(r[0]))}else e=i}),n},jt=bu,fp=function(t,e,r,n,i,o,s,u,p){var d=Math.sin(p*hn/360),y=Math.cos(p*hn/360),f=y*(t-r)/2+d*(e-n)/2,l=-d*(t-r)/2+y*(e-n)/2;if(f===0&&l===0)return[];if(s===0||u===0)return[];s=Math.abs(s),u=Math.abs(u);var c=f*f/(s*s)+l*l/(u*u);c>1&&(s*=Math.sqrt(c),u*=Math.sqrt(c));var a=function(E,x,v,T,O,A,N,k,w,C){var P=C*(E-v)/2+w*(x-T)/2,S=-w*(E-v)/2+C*(x-T)/2,R=N*N,I=k*k,M=P*P,L=S*S,j=R*I-R*L-I*M;j<0&&(j=0),j/=R*L+I*M;var q=(j=Math.sqrt(j)*(O===A?-1:1))*N/k*S,G=j*-k/N*P,z=C*q-w*G+(E+v)/2,K=w*q+C*G+(x+T)/2,F=(P-q)/N,D=(S-G)/k,B=(-P-q)/N,U=(-S-G)/k,H=_u(1,0,F,D),V=_u(F,D,B,U);return A===0&&V>0&&(V-=hn),A===1&&V<0&&(V+=hn),[z,K,H,V]}(t,e,r,n,i,o,s,u,d,y),h=[],m=a[2],g=a[3],_=Math.max(Math.ceil(Math.abs(g)/(hn/4)),1);g/=_;for(var b=0;b<_;b++)h.push(up(m,g)),m+=g;return h.map(function(E){for(var x=0;x<E.length;x+=2){var v=E[x+0],T=E[x+1],O=y*(v*=s)-d*(T*=u),A=d*v+y*T;E[x+0]=O+a[0],E[x+1]=A+a[1]}return E})},dp=dn;function Te(t){if(!(this instanceof Te))return new Te(t);var e=cp(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}Te.from=function(t){if(typeof t=="string")return new Te(t);if(t instanceof Te){var e=new Te("");return e.err=t.err,e.segments=t.segments.map(function(r){return r.slice()}),e.__stack=t.__stack.map(function(r){return jt().matrix(r.toArray())}),e}throw new Error("SvgPath.from: invalid param type "+t)},Te.prototype.__matrix=function(t){var e,r=this;t.queue.length&&this.iterate(function(n,i,o,s){var u,p,d,y;switch(n[0]){case"v":p=(u=t.calc(0,n[1],!0))[0]===0?["v",u[1]]:["l",u[0],u[1]];break;case"V":p=(u=t.calc(o,n[1],!1))[0]===t.calc(o,s,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":p=(u=t.calc(n[1],0,!0))[1]===0?["h",u[0]]:["l",u[0],u[1]];break;case"H":p=(u=t.calc(n[1],s,!1))[1]===t.calc(o,s,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var f=t.toArray(),l=dp(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),u=t.calc(n[6],n[7],n[0]==="a"),n[0]==="A"&&n[6]===o&&n[7]===s||n[0]==="a"&&n[6]===0&&n[7]===0){p=[n[0]==="a"?"l":"L",u[0],u[1]];break}p=l.isDegenerate()?[n[0]==="a"?"l":"L",u[0],u[1]]:[n[0],l.rx,l.ry,l.ax,n[4],n[5],u[0],u[1]];break;case"m":y=i>0,p=["m",(u=t.calc(n[1],n[2],y))[0],u[1]];break;default:for(p=[d=n[0]],y=d.toLowerCase()===d,e=1;e<n.length;e+=2)u=t.calc(n[e],n[e+1],y),p.push(u[0],u[1])}r.segments[i]=p},!0)},Te.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(this.__stack.length===1)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=jt(),e=this.__stack.length;--e>=0;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},Te.prototype.toString=function(){var t="",e="",r=!1;this.__evaluateStack();for(var n=0,i=this.segments.length;n<i;n++){var o=this.segments[n],s=o[0];s!==e||s==="m"||s==="M"?(s==="m"&&e==="z"&&(t+=" "),t+=s,r=!1):r=!0;for(var u=1;u<o.length;u++){var p=o[u];u===1?r&&p>=0&&(t+=" "):p>=0&&(t+=" "),t+=p}e=s}return t},Te.prototype.translate=function(t,e){return this.__stack.push(jt().translate(t,e||0)),this},Te.prototype.scale=function(t,e){return this.__stack.push(jt().scale(t,e||e===0?e:t)),this},Te.prototype.rotate=function(t,e,r){return this.__stack.push(jt().rotate(t,e||0,r||0)),this},Te.prototype.skewX=function(t){return this.__stack.push(jt().skewX(t)),this},Te.prototype.skewY=function(t){return this.__stack.push(jt().skewY(t)),this},Te.prototype.matrix=function(t){return this.__stack.push(jt().matrix(t)),this},Te.prototype.transform=function(t){return t.trim()?(this.__stack.push(hp(t)),this):this},Te.prototype.round=function(t){var e,r=0,n=0,i=0,o=0;return t=t||0,this.__evaluateStack(),this.segments.forEach(function(s){var u=s[0].toLowerCase()===s[0];switch(s[0]){case"H":case"h":return u&&(s[1]+=i),i=s[1]-s[1].toFixed(t),void(s[1]=+s[1].toFixed(t));case"V":case"v":return u&&(s[1]+=o),o=s[1]-s[1].toFixed(t),void(s[1]=+s[1].toFixed(t));case"Z":case"z":return i=r,void(o=n);case"M":case"m":return u&&(s[1]+=i,s[2]+=o),i=s[1]-s[1].toFixed(t),o=s[2]-s[2].toFixed(t),r=i,n=o,s[1]=+s[1].toFixed(t),void(s[2]=+s[2].toFixed(t));case"A":case"a":return u&&(s[6]+=i,s[7]+=o),i=s[6]-s[6].toFixed(t),o=s[7]-s[7].toFixed(t),s[1]=+s[1].toFixed(t),s[2]=+s[2].toFixed(t),s[3]=+s[3].toFixed(t+2),s[6]=+s[6].toFixed(t),void(s[7]=+s[7].toFixed(t));default:return e=s.length,u&&(s[e-2]+=i,s[e-1]+=o),i=s[e-2]-s[e-2].toFixed(t),o=s[e-1]-s[e-1].toFixed(t),void s.forEach(function(p,d){d&&(s[d]=+s[d].toFixed(t))})}}),this},Te.prototype.iterate=function(t,e){var r,n,i,o=this.segments,s={},u=!1,p=0,d=0,y=0,f=0;if(e||this.__evaluateStack(),o.forEach(function(l,c){var a=t(l,c,p,d);Array.isArray(a)&&(s[c]=a,u=!0);var h=l[0]===l[0].toLowerCase();switch(l[0]){case"m":case"M":return p=l[1]+(h?p:0),d=l[2]+(h?d:0),y=p,void(f=d);case"h":case"H":return void(p=l[1]+(h?p:0));case"v":case"V":return void(d=l[1]+(h?d:0));case"z":case"Z":return p=y,void(d=f);default:p=l[l.length-2]+(h?p:0),d=l[l.length-1]+(h?d:0)}}),!u)return this;for(i=[],r=0;r<o.length;r++)if(s[r]!==void 0)for(n=0;n<s[r].length;n++)i.push(s[r][n]);else i.push(o[r]);return this.segments=i,this},Te.prototype.abs=function(){return this.iterate(function(t,e,r,n){var i,o=t[0],s=o.toUpperCase();if(o!==s)switch(t[0]=s,o){case"v":return void(t[1]+=n);case"a":return t[6]+=r,void(t[7]+=n);default:for(i=1;i<t.length;i++)t[i]+=i%2?r:n}},!0),this},Te.prototype.rel=function(){return this.iterate(function(t,e,r,n){var i,o=t[0],s=o.toLowerCase();if(o!==s&&(e!==0||o!=="M"))switch(t[0]=s,o){case"V":return void(t[1]-=n);case"A":return t[6]-=r,void(t[7]-=n);default:for(i=1;i<t.length;i++)t[i]-=i%2?r:n}},!0),this},Te.prototype.unarc=function(){return this.iterate(function(t,e,r,n){var i,o,s,u=[],p=t[0];return p!=="A"&&p!=="a"?null:(p==="a"?(o=r+t[6],s=n+t[7]):(o=t[6],s=t[7]),(i=fp(r,n,o,s,t[4],t[5],t[1],t[2],t[3])).length===0?[[t[0]==="a"?"l":"L",t[6],t[7]]]:(i.forEach(function(d){u.push(["C",d[2],d[3],d[4],d[5],d[6],d[7]])}),u))}),this},Te.prototype.unshort=function(){var t,e,r,n,i,o=this.segments;return this.iterate(function(s,u,p,d){var y,f=s[0],l=f.toUpperCase();u&&(l==="T"?(y=f==="t",(r=o[u-1])[0]==="Q"?(t=r[1]-p,e=r[2]-d):r[0]==="q"?(t=r[1]-r[3],e=r[2]-r[4]):(t=0,e=0),n=-t,i=-e,y||(n+=p,i+=d),o[u]=[y?"q":"Q",n,i,s[1],s[2]]):l==="S"&&(y=f==="s",(r=o[u-1])[0]==="C"?(t=r[3]-p,e=r[4]-d):r[0]==="c"?(t=r[3]-r[5],e=r[4]-r[6]):(t=0,e=0),n=-t,i=-e,y||(n+=p,i+=d),o[u]=[y?"c":"C",n,i,s[1],s[2],s[3],s[4]]))}),this};const pp=nr(Te);var Eu=function(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i},yp=function(){this.__data__=[],this.size=0},wu=function(t,e){return t===e||t!=t&&e!=e},mp=wu,pi=function(t,e){for(var r=t.length;r--;)if(mp(t[r][0],e))return r;return-1},gp=pi,vp=Array.prototype.splice,bp=pi,_p=pi,xp=pi,Ep=yp,wp=function(t){var e=this.__data__,r=gp(e,t);return!(r<0)&&(r==e.length-1?e.pop():vp.call(e,r,1),--this.size,!0)},Tp=function(t){var e=this.__data__,r=bp(e,t);return r<0?void 0:e[r][1]},Ap=function(t){return _p(this.__data__,t)>-1},Op=function(t,e){var r=this.__data__,n=xp(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Pr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Pr.prototype.clear=Ep,Pr.prototype.delete=wp,Pr.prototype.get=Tp,Pr.prototype.has=Ap,Pr.prototype.set=Op;var yi=Pr,Sp=yi,Np=function(){this.__data__=new Sp,this.size=0},kp=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Cp=function(t){return this.__data__.get(t)},Rp=function(t){return this.__data__.has(t)},mi=Or(Object,"create"),Tu=mi,Ip=function(){this.__data__=Tu?Tu(null):{},this.size=0},Pp=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Mp=mi,Lp=Object.prototype.hasOwnProperty,jp=function(t){var e=this.__data__;if(Mp){var r=e[t];return r==="__lodash_hash_undefined__"?void 0:r}return Lp.call(e,t)?e[t]:void 0},Fp=mi,Bp=Object.prototype.hasOwnProperty,Dp=mi,Up=Ip,qp=Pp,Gp=jp,Hp=function(t){var e=this.__data__;return Fp?e[t]!==void 0:Bp.call(e,t)},zp=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Dp&&e===void 0?"__lodash_hash_undefined__":e,this};function Mr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Mr.prototype.clear=Up,Mr.prototype.delete=qp,Mr.prototype.get=Gp,Mr.prototype.has=Hp,Mr.prototype.set=zp;var Au=Mr,Vp=yi,Xp=Ho,$p=function(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null},gi=function(t,e){var r=t.__data__;return $p(e)?r[typeof e=="string"?"string":"hash"]:r.map},Wp=gi,Yp=gi,Kp=gi,Zp=gi,Qp=function(){this.size=0,this.__data__={hash:new Au,map:new(Xp||Vp),string:new Au}},Jp=function(t){var e=Wp(this,t).delete(t);return this.size-=e?1:0,e},ey=function(t){return Yp(this,t).get(t)},ty=function(t){return Kp(this,t).has(t)},ry=function(t,e){var r=Zp(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Lr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Lr.prototype.clear=Qp,Lr.prototype.delete=Jp,Lr.prototype.get=ey,Lr.prototype.has=ty,Lr.prototype.set=ry;var ds=Lr,ny=yi,iy=Ho,oy=ds,sy=yi,ay=Np,ly=kp,uy=Cp,cy=Rp,hy=function(t,e){var r=this.__data__;if(r instanceof ny){var n=r.__data__;if(!iy||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new oy(n)}return r.set(t,e),this.size=r.size,this};function jr(t){var e=this.__data__=new sy(t);this.size=e.size}jr.prototype.clear=ay,jr.prototype.delete=ly,jr.prototype.get=uy,jr.prototype.has=cy,jr.prototype.set=hy;var Ou=jr,fy=ds,dy=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},py=function(t){return this.__data__.has(t)};function vi(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new fy;++e<r;)this.add(t[e])}vi.prototype.add=vi.prototype.push=dy,vi.prototype.has=py;var yy=vi,my=function(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},gy=function(t,e){return t.has(e)},Su=function(t,e,r,n,i,o){var s=1&r,u=t.length,p=e.length;if(u!=p&&!(s&&p>u))return!1;var d=o.get(t),y=o.get(e);if(d&&y)return d==e&&y==t;var f=-1,l=!0,c=2&r?new yy:void 0;for(o.set(t,e),o.set(e,t);++f<u;){var a=t[f],h=e[f];if(n)var m=s?n(h,a,f,e,t,o):n(a,h,f,t,e,o);if(m!==void 0){if(m)continue;l=!1;break}if(c){if(!my(e,function(g,_){if(!gy(c,_)&&(a===g||i(a,g,r,n,o)))return c.push(_)})){l=!1;break}}else if(a!==h&&!i(a,h,r,n,o)){l=!1;break}}return o.delete(t),o.delete(e),l},vy=function(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r},Nu=At.Uint8Array,by=wu,_y=Su,xy=vy,Ey=function(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r},ku=Qt?Qt.prototype:void 0,ps=ku?ku.valueOf:void 0,wy=function(t,e,r,n,i,o,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Nu(t),new Nu(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return by(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=xy;case"[object Set]":var p=1&n;if(u||(u=Ey),t.size!=e.size&&!p)return!1;var d=s.get(t);if(d)return d==e;n|=2,s.set(t,e);var y=_y(u(t),u(e),n,i,o,s);return s.delete(t),y;case"[object Symbol]":if(ps)return ps.call(t)==ps.call(e)}return!1},Ty=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t},Ay=gt,Oy=function(t,e,r){var n=e(t);return Ay(t)?n:Ty(n,r(t))},Sy=function(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o},Ny=function(){return[]},ky=Object.prototype.propertyIsEnumerable,Cu=Object.getOwnPropertySymbols,Cy=Cu?function(t){return t==null?[]:(t=Object(t),Sy(Cu(t),function(e){return ky.call(t,e)}))}:Ny,Ry=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},Iy=/^(?:0|[1-9]\d*)$/,Ru=function(t,e){var r=typeof t;return!!(e=e??9007199254740991)&&(r=="number"||r!="symbol"&&Iy.test(t))&&t>-1&&t%1==0&&t<e},Py=Ry,My=Yo,Ly=gt,jy=Qo,Fy=Ru,By=es,Dy=Object.prototype.hasOwnProperty,Uy=function(t,e){var r=Ly(t),n=!r&&My(t),i=!r&&!n&&jy(t),o=!r&&!n&&!i&&By(t),s=r||n||i||o,u=s?Py(t.length,String):[],p=u.length;for(var d in t)!e&&!Dy.call(t,d)||s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Fy(d,p))||u.push(d);return u},qy=jl,Gy=ri,ys=function(t){return Gy(t)?Uy(t):qy(t)},Hy=Oy,zy=Cy,Vy=ys,Iu=function(t){return Hy(t,Vy,zy)},Xy=Object.prototype.hasOwnProperty,ms=Ou,$y=Su,Wy=wy,Yy=function(t,e,r,n,i,o){var s=1&r,u=Iu(t),p=u.length;if(p!=Iu(e).length&&!s)return!1;for(var d=p;d--;){var y=u[d];if(!(s?y in e:Xy.call(e,y)))return!1}var f=o.get(t),l=o.get(e);if(f&&l)return f==e&&l==t;var c=!0;o.set(t,e),o.set(e,t);for(var a=s;++d<p;){var h=t[y=u[d]],m=e[y];if(n)var g=s?n(m,h,y,e,t,o):n(h,m,y,t,e,o);if(!(g===void 0?h===m||i(h,m,r,n,o):g)){c=!1;break}a||(a=y=="constructor")}if(c&&!a){var _=t.constructor,b=e.constructor;_==b||!("constructor"in t)||!("constructor"in e)||typeof _=="function"&&_ instanceof _&&typeof b=="function"&&b instanceof b||(c=!1)}return o.delete(t),o.delete(e),c},Pu=Kl,Mu=gt,Lu=Qo,Ky=es,ju="[object Arguments]",Fu="[object Array]",bi="[object Object]",Bu=Object.prototype.hasOwnProperty,Zy=function(t,e,r,n,i,o){var s=Mu(t),u=Mu(e),p=s?Fu:Pu(t),d=u?Fu:Pu(e),y=(p=p==ju?bi:p)==bi,f=(d=d==ju?bi:d)==bi,l=p==d;if(l&&Lu(t)){if(!Lu(e))return!1;s=!0,y=!1}if(l&&!y)return o||(o=new ms),s||Ky(t)?$y(t,e,r,n,i,o):Wy(t,e,p,r,n,i,o);if(!(1&r)){var c=y&&Bu.call(t,"__wrapped__"),a=f&&Bu.call(e,"__wrapped__");if(c||a){var h=c?t.value():t,m=a?e.value():e;return o||(o=new ms),i(h,m,r,n,o)}}return!!l&&(o||(o=new ms),Yy(t,e,r,n,i,o))},Du=ln,Uu=function t(e,r,n,i,o){return e===r||(e==null||r==null||!Du(e)&&!Du(r)?e!=e&&r!=r:Zy(e,r,n,i,t,o))},Qy=Ou,Jy=Uu,em=qo,qu=function(t){return t==t&&!em(t)},tm=qu,rm=ys,Gu=function(t,e){return function(r){return r!=null&&r[t]===e&&(e!==void 0||t in Object(r))}},nm=function(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var u=r[i];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<o;){var p=(u=r[i])[0],d=t[p],y=u[1];if(s&&u[2]){if(d===void 0&&!(p in t))return!1}else{var f=new Qy;if(n)var l=n(d,y,p,t,e,f);if(!(l===void 0?Jy(y,d,3,n,f):l))return!1}}return!0},im=function(t){for(var e=rm(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,tm(i)]}return e},om=Gu,sm=function(t){var e=im(t);return e.length==1&&e[0][2]?om(e[0][0],e[0][1]):function(r){return r===t||nm(r,t,e)}},am=an,lm=ln,gs=function(t){return typeof t=="symbol"||lm(t)&&am(t)=="[object Symbol]"},um=gt,cm=gs,hm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fm=/^\w*$/,vs=function(t,e){if(um(t))return!1;var r=typeof t;return!(r!="number"&&r!="symbol"&&r!="boolean"&&t!=null&&!cm(t))||fm.test(t)||!hm.test(t)||e!=null&&t in Object(e)},Hu=ds;function bs(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(bs.Cache||Hu),r}bs.Cache=Hu;var dm=bs,pm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ym=/\\(\\)?/g,mm=function(t){var e=dm(t,function(n){return r.size===500&&r.clear(),n}),r=e.cache;return e}(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(pm,function(r,n,i,o){e.push(i?o.replace(ym,"$1"):n||r)}),e}),gm=mm,vm=Eu,bm=gt,_m=gs,zu=Qt?Qt.prototype:void 0,Vu=zu?zu.toString:void 0,xm=function t(e){if(typeof e=="string")return e;if(bm(e))return vm(e,t)+"";if(_m(e))return Vu?Vu.call(e):"";var r=e+"";return r=="0"&&1/e==-1/0?"-0":r},Em=xm,wm=gt,Tm=vs,Am=gm,Om=function(t){return t==null?"":Em(t)},Xu=function(t,e){return wm(t)?t:Tm(t,e)?[t]:Am(Om(t))},Sm=gs,_i=function(t){if(typeof t=="string"||Sm(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e},Nm=Xu,km=_i,$u=function(t,e){for(var r=0,n=(e=Nm(e,t)).length;t!=null&&r<n;)t=t[km(e[r++])];return r&&r==n?t:void 0},Cm=$u,Rm=function(t,e,r){var n=t==null?void 0:Cm(t,e);return n===void 0?r:n},Im=Xu,Pm=Yo,Mm=gt,Lm=Ru,jm=Ko,Fm=_i,Bm=function(t,e){return t!=null&&e in Object(t)},Dm=function(t,e,r){for(var n=-1,i=(e=Im(e,t)).length,o=!1;++n<i;){var s=Fm(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:!!(i=t==null?0:t.length)&&jm(i)&&Lm(s,i)&&(Mm(t)||Pm(t))},Um=Uu,qm=Rm,Gm=function(t,e){return t!=null&&Dm(t,e,Bm)},Hm=vs,zm=qu,Vm=Gu,Xm=_i,$m=$u,Wm=function(t){return function(e){return e==null?void 0:e[t]}},Ym=function(t){return function(e){return $m(e,t)}},Km=vs,Zm=_i,Qm=sm,Jm=function(t,e){return Hm(t)&&zm(e)?Vm(Xm(t),e):function(r){var n=qm(r,t);return n===void 0&&n===e?Gm(r,t):Um(e,n,3)}},e0=function(t){return t},t0=gt,r0=function(t){return Km(t)?Wm(Zm(t)):Ym(t)},n0=function(t){return typeof t=="function"?t:t==null?e0:typeof t=="object"?t0(t)?Jm(t[0],t[1]):Qm(t):r0(t)},i0=function(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),u=s.length;u--;){var p=s[t?u:++i];if(r(o[p],p,o)===!1)break}return e}}(),o0=ys,s0=ri,a0=function(t,e){return function(r,n){if(r==null)return r;if(!s0(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}(function(t,e){return t&&i0(t,e,o0)}),l0=ri,u0=Eu,c0=n0,h0=function(t,e){var r=-1,n=l0(t)?Array(t.length):[];return a0(t,function(i,o,s){n[++r]=e(i,o,s)}),n},f0=gt;const d0=nr(function(t,e){return(f0(t)?u0:h0)(t,c0(e))});var rr={},Wu={},St={};Object.defineProperty(St,"__esModule",{value:!0}),St.loop=St.conditional=St.parse=void 0,St.parse=function t(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(r))r.forEach(function(s){return t(e,s,n,i)});else if(typeof r=="function")r(e,n,i,t);else{var o=Object.keys(r)[0];Array.isArray(r[o])?(i[o]={},t(e,r[o],n,i[o])):i[o]=r[o](e,n,i,t)}return n},St.conditional=function(t,e){return function(r,n,i,o){e(r,n,i)&&o(r,t,n,i)}},St.loop=function(t,e){return function(r,n,i,o){for(var s=[],u=r.pos;e(r,n,i);){var p={};if(o(r,t,n,p),r.pos===u)break;u=r.pos,s.push(p)}return s}};var Se={};Object.defineProperty(Se,"__esModule",{value:!0}),Se.readBits=Se.readArray=Se.readUnsigned=Se.readString=Se.peekBytes=Se.readBytes=Se.peekByte=Se.readByte=Se.buildStream=void 0,Se.buildStream=function(t){return{data:t,pos:0}};var p0=function(){return function(t){return t.data[t.pos++]}};Se.readByte=p0,Se.peekByte=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+t]}};var xi=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};Se.readBytes=xi,Se.peekBytes=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}},Se.readString=function(t){return function(e){return Array.from(xi(t)(e)).map(function(r){return String.fromCharCode(r)}).join("")}},Se.readUnsigned=function(t){return function(e){var r=xi(2)(e);return t?(r[1]<<8)+r[0]:(r[0]<<8)+r[1]}},Se.readArray=function(t,e){return function(r,n,i){for(var o=typeof e=="function"?e(r,n,i):e,s=xi(t),u=new Array(o),p=0;p<o;p++)u[p]=s(r);return u}},Se.readBits=function(t){return function(e){for(var r=function(o){return o.data[o.pos++]}(e),n=new Array(8),i=0;i<8;i++)n[7-i]=!!(r&1<<i);return Object.keys(t).reduce(function(o,s){var u=t[s];return u.length?o[s]=function(p,d,y){for(var f=0,l=0;l<y;l++)f+=p[d+l]&&Math.pow(2,y-l-1);return f}(n,u.index,u.length):o[s]=n[u.index],o},{})}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=St,r=Se,n={blocks:function(y){for(var f=[],l=y.data.length,c=0,a=(0,r.readByte)()(y);a!==0&&a;a=(0,r.readByte)()(y)){if(y.pos+a>=l){var h=l-y.pos;f.push((0,r.readBytes)(h)(y)),c+=h;break}f.push((0,r.readBytes)(a)(y)),c+=a}for(var m=new Uint8Array(c),g=0,_=0;_<f.length;_++)m.set(f[_],g),g+=f[_].length;return m}},i=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(y){var f=(0,r.peekBytes)(2)(y);return f[0]===33&&f[1]===249}),o=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(y,f,l){return Math.pow(2,l.descriptor.lct.size+1)})},function(y,f,l){return l.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(y){return(0,r.peekByte)()(y)===44}),s=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(y,f,l){return(0,r.readBytes)(l.text.blockSize)(y)}},n]},function(y){var f=(0,r.peekBytes)(2)(y);return f[0]===33&&f[1]===1}),u=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(y,f,l){return(0,r.readString)(l.blockSize)(y)}},n]},function(y){var f=(0,r.peekBytes)(2)(y);return f[0]===33&&f[1]===255}),p=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(y){var f=(0,r.peekBytes)(2)(y);return f[0]===33&&f[1]===254}),d=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(y,f){return Math.pow(2,f.lsd.gct.size+1)})},function(y,f){return f.lsd.gct.exists}),{frames:(0,e.loop)([i,u,p,o,s],function(y){var f=(0,r.peekByte)()(y);return f===33||f===44})}];t.default=d}(Wu);var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.deinterlace=void 0,Ei.deinterlace=function(t,e){for(var r=new Array(t.length),n=t.length/e,i=function(y,f){var l=t.slice(f*e,(f+1)*e);r.splice.apply(r,[y*e,e].concat(l))},o=[0,4,2,1],s=[8,8,4,2],u=0,p=0;p<4;p++)for(var d=o[p];d<n;d+=s[p])i(d,u),u++;return r};var wi={};Object.defineProperty(wi,"__esModule",{value:!0}),wi.lzw=void 0,wi.lzw=function(t,e,r){var n,i,o,s,u,p,d,y,f,l,c,a,h,m,g,_,b=4096,E=r,x=new Array(r),v=new Array(b),T=new Array(b),O=new Array(4097);for(u=(i=1<<(l=t))+1,n=i+2,d=-1,o=(1<<(s=l+1))-1,y=0;y<i;y++)v[y]=0,T[y]=y;for(c=a=h=m=g=_=0,f=0;f<E;){if(m===0){if(a<s){c+=e[_]<<a,a+=8,_++;continue}if(y=c&o,c>>=s,a-=s,y>n||y==u)break;if(y==i){o=(1<<(s=l+1))-1,n=i+2,d=-1;continue}if(d==-1){O[m++]=T[y],d=y,h=y;continue}for(p=y,y==n&&(O[m++]=h,y=d);y>i;)O[m++]=T[y],y=v[y];h=255&T[y],O[m++]=h,n<b&&(v[n]=d,T[n]=h,!(++n&o)&&n<b&&(s++,o+=n)),d=p}m--,x[g++]=O[m],f++}for(f=g;f<E;f++)x[f]=0;return x},Object.defineProperty(rr,"__esModule",{value:!0}),rr.decompressFrames=rr.decompressFrame=rr.parseGIF=void 0;var Ti,y0=(Ti=Wu)&&Ti.__esModule?Ti:{default:Ti},m0=St,g0=Se,v0=Ei,b0=wi;rr.parseGIF=function(t){var e=new Uint8Array(t);return(0,m0.parse)((0,g0.buildStream)(e),y0.default)};var Yu=function(t,e,r){if(t.image){var n=t.image,i=n.descriptor.width*n.descriptor.height,o=(0,b0.lzw)(n.data.minCodeSize,n.data.blocks,i);n.descriptor.lct.interlaced&&(o=(0,v0.deinterlace)(o,n.descriptor.width));var s={pixels:o,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?s.colorTable=n.lct:s.colorTable=e,t.gce&&(s.delay=10*(t.gce.delay||10),s.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(s.transparentIndex=t.gce.transparentColorIndex)),r&&(s.patch=function(u){for(var p=u.pixels.length,d=new Uint8ClampedArray(4*p),y=0;y<p;y++){var f=4*y,l=u.pixels[y],c=u.colorTable[l]||[0,0,0];d[f]=c[0],d[f+1]=c[1],d[f+2]=c[2],d[f+3]=l!==u.transparentIndex?255:0}return d}(s)),s}console.warn("gif frame does not have associated image.")};rr.decompressFrame=Yu,rr.decompressFrames=function(t,e){return t.frames.filter(function(r){return r.image}).map(function(r){return Yu(r,t.gct,e)})};const Ku=(t,e={})=>{typeof e=="function"&&(e=e(t));const r=e.loaded&&t.loaded!==e.loaded,{playing:n,...i}=e,o={...t,...i};return r&&Object.assign(o,{playing:o.autoPlay&&o.loaded}),e.delays==null&&e.frames==null||Object.assign(o,{length:o.frames.length}),e.index==null&&e.frames==null||Object.assign(o,{index:o.length===0?0:(o.length+o.index)%o.length}),e.playing!=null&&Object.assign(o,o.loaded?{playing:n}:{autoPlay:n}),o},_0=t=>Ku({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},t);function x0(t){const e=new Blob(['function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n'],{type:"application/javascript"}),r=URL.createObjectURL(e),n=new Worker(r,t);return URL.revokeObjectURL(r),n}const E0=t=>{const e=(r=>{const n=X.useRef(r);return X.useEffect(()=>{n.current=r},[r]),n})(t);return X.useCallback(r=>e.current&&e.current(r),[])},w0=((t,e)=>{const r={};return()=>(r.instance||(r.instance=t()),X.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(e&&e(r.instance),delete r.instance,delete r.timeout)})}),[r,e]),r.instance)})(()=>new x0,t=>t.terminate()),T0=(t,e)=>{const r=E0(e),n=w0();X.useEffect(()=>{if(typeof t=="string"){const i=o=>{const s=o.data||o;if(s.src===t){const p=s.error?s:(u=s,{...u,frames:u.frames.map(d=>{const y=new ImageData(u.width,u.height);return y.data.set(new Uint8ClampedArray(d)),y})});r(p)}var u};return n.addEventListener("message",i),n.postMessage({src:t,type:"parse"}),()=>{n.postMessage({src:t,type:"cancel"}),n.removeEventListener("message",i)}}},[n,t])},Zu=Q.memo(({isPlaying:t,forwardRef:e,...r})=>{const n=Q.useRef(null);return Q.useImperativeHandle(e,()=>n.current,[n]),Q.useEffect(()=>{if(n.current===null)return;const i=n.current;i[t?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[t]),ie.jsx(le.AnimatedSprite,{ref:n,...r,isPlaying:t})}),A0=le.withFilters(le.Container,{blur:Qe.filters.BlurFilter,adjust:Fo,matrix:Qe.filters.ColorMatrixFilter}),O0=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],S0={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1};var Qu={exports:{}};/*!
551
- * Quill Editor v1.3.7
552
- * https://quilljs.com/
553
- * Copyright (c) 2014, Jason Chen
554
- * Copyright (c) 2013, salesforce.com
555
- */(function(t,e){var r;typeof self<"u",r=function(){return function(n){var i={};function o(s){if(i[s])return i[s].exports;var u=i[s]={i:s,l:!1,exports:{}};return n[s].call(u.exports,u,u.exports,o),u.l=!0,u.exports}return o.m=n,o.c=i,o.d=function(s,u,p){o.o(s,u)||Object.defineProperty(s,u,{configurable:!1,enumerable:!0,get:p})},o.n=function(s){var u=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(u,"a",u),u},o.o=function(s,u){return Object.prototype.hasOwnProperty.call(s,u)},o.p="",o(o.s=109)}([function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=o(17),u=o(18),p=o(19),d=o(45),y=o(46),f=o(47),l=o(48),c=o(49),a=o(12),h=o(32),m=o(33),g=o(31),_=o(1),b={Scope:_.Scope,create:_.create,find:_.find,query:_.query,register:_.register,Container:s.default,Format:u.default,Leaf:p.default,Embed:l.default,Scroll:d.default,Block:f.default,Inline:y.default,Text:c.default,Attributor:{Attribute:a.default,Class:h.default,Style:m.default,Store:g.default}};i.default=b},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,m){h.__proto__=m}||function(h,m){for(var g in m)m.hasOwnProperty(g)&&(h[g]=m[g])},function(h,m){function g(){this.constructor=h}s(h,m),h.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)});Object.defineProperty(i,"__esModule",{value:!0});var p=function(h){function m(g){var _=this;return g="[Parchment] "+g,(_=h.call(this,g)||this).message=g,_.name=_.constructor.name,_}return u(m,h),m}(Error);i.ParchmentError=p;var d,y={},f={},l={},c={};function a(h,m){var g;if(m===void 0&&(m=d.ANY),typeof h=="string")g=c[h]||y[h];else if(h instanceof Text||h.nodeType===Node.TEXT_NODE)g=c.text;else if(typeof h=="number")h&d.LEVEL&d.BLOCK?g=c.block:h&d.LEVEL&d.INLINE&&(g=c.inline);else if(h instanceof HTMLElement){var _=(h.getAttribute("class")||"").split(/\s+/);for(var b in _)if(g=f[_[b]])break;g=g||l[h.tagName]}return g==null?null:m&d.LEVEL&g.scope&&m&d.TYPE&g.scope?g:null}i.DATA_KEY="__blot",function(h){h[h.TYPE=3]="TYPE",h[h.LEVEL=12]="LEVEL",h[h.ATTRIBUTE=13]="ATTRIBUTE",h[h.BLOT=14]="BLOT",h[h.INLINE=7]="INLINE",h[h.BLOCK=11]="BLOCK",h[h.BLOCK_BLOT=10]="BLOCK_BLOT",h[h.INLINE_BLOT=6]="INLINE_BLOT",h[h.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",h[h.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",h[h.ANY=15]="ANY"}(d=i.Scope||(i.Scope={})),i.create=function(h,m){var g=a(h);if(g==null)throw new p("Unable to create "+h+" blot");var _=g,b=h instanceof Node||h.nodeType===Node.TEXT_NODE?h:_.create(m);return new _(b,m)},i.find=function h(m,g){return g===void 0&&(g=!1),m==null?null:m[i.DATA_KEY]!=null?m[i.DATA_KEY].blot:g?h(m.parentNode,g):null},i.query=a,i.register=function h(){for(var m=[],g=0;g<arguments.length;g++)m[g]=arguments[g];if(m.length>1)return m.map(function(b){return h(b)});var _=m[0];if(typeof _.blotName!="string"&&typeof _.attrName!="string")throw new p("Invalid definition");if(_.blotName==="abstract")throw new p("Cannot register abstract class");return c[_.blotName||_.attrName]=_,typeof _.keyName=="string"?y[_.keyName]=_:(_.className!=null&&(f[_.className]=_),_.tagName!=null&&(Array.isArray(_.tagName)?_.tagName=_.tagName.map(function(b){return b.toUpperCase()}):_.tagName=_.tagName.toUpperCase(),(Array.isArray(_.tagName)?_.tagName:[_.tagName]).forEach(function(b){l[b]!=null&&_.className!=null||(l[b]=_)}))),_}},function(n,i,o){var s=o(51),u=o(11),p=o(3),d=o(20),y=String.fromCharCode(0),f=function(l){Array.isArray(l)?this.ops=l:l!=null&&Array.isArray(l.ops)?this.ops=l.ops:this.ops=[]};f.prototype.insert=function(l,c){var a={};return l.length===0?this:(a.insert=l,c!=null&&typeof c=="object"&&Object.keys(c).length>0&&(a.attributes=c),this.push(a))},f.prototype.delete=function(l){return l<=0?this:this.push({delete:l})},f.prototype.retain=function(l,c){if(l<=0)return this;var a={retain:l};return c!=null&&typeof c=="object"&&Object.keys(c).length>0&&(a.attributes=c),this.push(a)},f.prototype.push=function(l){var c=this.ops.length,a=this.ops[c-1];if(l=p(!0,{},l),typeof a=="object"){if(typeof l.delete=="number"&&typeof a.delete=="number")return this.ops[c-1]={delete:a.delete+l.delete},this;if(typeof a.delete=="number"&&l.insert!=null&&(c-=1,typeof(a=this.ops[c-1])!="object"))return this.ops.unshift(l),this;if(u(l.attributes,a.attributes)){if(typeof l.insert=="string"&&typeof a.insert=="string")return this.ops[c-1]={insert:a.insert+l.insert},typeof l.attributes=="object"&&(this.ops[c-1].attributes=l.attributes),this;if(typeof l.retain=="number"&&typeof a.retain=="number")return this.ops[c-1]={retain:a.retain+l.retain},typeof l.attributes=="object"&&(this.ops[c-1].attributes=l.attributes),this}}return c===this.ops.length?this.ops.push(l):this.ops.splice(c,0,l),this},f.prototype.chop=function(){var l=this.ops[this.ops.length-1];return l&&l.retain&&!l.attributes&&this.ops.pop(),this},f.prototype.filter=function(l){return this.ops.filter(l)},f.prototype.forEach=function(l){this.ops.forEach(l)},f.prototype.map=function(l){return this.ops.map(l)},f.prototype.partition=function(l){var c=[],a=[];return this.forEach(function(h){(l(h)?c:a).push(h)}),[c,a]},f.prototype.reduce=function(l,c){return this.ops.reduce(l,c)},f.prototype.changeLength=function(){return this.reduce(function(l,c){return c.insert?l+d.length(c):c.delete?l-c.delete:l},0)},f.prototype.length=function(){return this.reduce(function(l,c){return l+d.length(c)},0)},f.prototype.slice=function(l,c){l=l||0,typeof c!="number"&&(c=1/0);for(var a=[],h=d.iterator(this.ops),m=0;m<c&&h.hasNext();){var g;m<l?g=h.next(l-m):(g=h.next(c-m),a.push(g)),m+=d.length(g)}return new f(a)},f.prototype.compose=function(l){var c=d.iterator(this.ops),a=d.iterator(l.ops),h=[],m=a.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var g=m.retain;c.peekType()==="insert"&&c.peekLength()<=g;)g-=c.peekLength(),h.push(c.next());m.retain-g>0&&a.next(m.retain-g)}for(var _=new f(h);c.hasNext()||a.hasNext();)if(a.peekType()==="insert")_.push(a.next());else if(c.peekType()==="delete")_.push(c.next());else{var b=Math.min(c.peekLength(),a.peekLength()),E=c.next(b),x=a.next(b);if(typeof x.retain=="number"){var v={};typeof E.retain=="number"?v.retain=b:v.insert=E.insert;var T=d.attributes.compose(E.attributes,x.attributes,typeof E.retain=="number");if(T&&(v.attributes=T),_.push(v),!a.hasNext()&&u(_.ops[_.ops.length-1],v)){var O=new f(c.rest());return _.concat(O).chop()}}else typeof x.delete=="number"&&typeof E.retain=="number"&&_.push(x)}return _.chop()},f.prototype.concat=function(l){var c=new f(this.ops.slice());return l.ops.length>0&&(c.push(l.ops[0]),c.ops=c.ops.concat(l.ops.slice(1))),c},f.prototype.diff=function(l,c){if(this.ops===l.ops)return new f;var a=[this,l].map(function(b){return b.map(function(E){if(E.insert!=null)return typeof E.insert=="string"?E.insert:y;throw new Error("diff() called "+(b===l?"on":"with")+" non-document")}).join("")}),h=new f,m=s(a[0],a[1],c),g=d.iterator(this.ops),_=d.iterator(l.ops);return m.forEach(function(b){for(var E=b[1].length;E>0;){var x=0;switch(b[0]){case s.INSERT:x=Math.min(_.peekLength(),E),h.push(_.next(x));break;case s.DELETE:x=Math.min(E,g.peekLength()),g.next(x),h.delete(x);break;case s.EQUAL:x=Math.min(g.peekLength(),_.peekLength(),E);var v=g.next(x),T=_.next(x);u(v.insert,T.insert)?h.retain(x,d.attributes.diff(v.attributes,T.attributes)):h.push(T).delete(x)}E-=x}}),h.chop()},f.prototype.eachLine=function(l,c){c=c||`
556
- `;for(var a=d.iterator(this.ops),h=new f,m=0;a.hasNext();){if(a.peekType()!=="insert")return;var g=a.peek(),_=d.length(g)-a.peekLength(),b=typeof g.insert=="string"?g.insert.indexOf(c,_)-_:-1;if(b<0)h.push(a.next());else if(b>0)h.push(a.next(b));else{if(l(h,a.next(1).attributes||{},m)===!1)return;m+=1,h=new f}}h.length()>0&&l(h,{},m)},f.prototype.transform=function(l,c){if(c=!!c,typeof l=="number")return this.transformPosition(l,c);for(var a=d.iterator(this.ops),h=d.iterator(l.ops),m=new f;a.hasNext()||h.hasNext();)if(a.peekType()!=="insert"||!c&&h.peekType()==="insert")if(h.peekType()==="insert")m.push(h.next());else{var g=Math.min(a.peekLength(),h.peekLength()),_=a.next(g),b=h.next(g);if(_.delete)continue;b.delete?m.push(b):m.retain(g,d.attributes.transform(_.attributes,b.attributes,c))}else m.retain(d.length(a.next()));return m.chop()},f.prototype.transformPosition=function(l,c){c=!!c;for(var a=d.iterator(this.ops),h=0;a.hasNext()&&h<=l;){var m=a.peekLength(),g=a.peekType();a.next(),g!=="delete"?(g==="insert"&&(h<l||!c)&&(l+=m),h+=m):l-=Math.min(m,l-h)}return l},n.exports=f},function(n,i){var o=Object.prototype.hasOwnProperty,s=Object.prototype.toString,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,d=function(c){return typeof Array.isArray=="function"?Array.isArray(c):s.call(c)==="[object Array]"},y=function(c){if(!c||s.call(c)!=="[object Object]")return!1;var a,h=o.call(c,"constructor"),m=c.constructor&&c.constructor.prototype&&o.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!m)return!1;for(a in c);return a===void 0||o.call(c,a)},f=function(c,a){u&&a.name==="__proto__"?u(c,a.name,{enumerable:!0,configurable:!0,value:a.newValue,writable:!0}):c[a.name]=a.newValue},l=function(c,a){if(a==="__proto__"){if(!o.call(c,a))return;if(p)return p(c,a).value}return c[a]};n.exports=function c(){var a,h,m,g,_,b,E=arguments[0],x=1,v=arguments.length,T=!1;for(typeof E=="boolean"&&(T=E,E=arguments[1]||{},x=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});x<v;++x)if((a=arguments[x])!=null)for(h in a)m=l(E,h),E!==(g=l(a,h))&&(T&&g&&(y(g)||(_=d(g)))?(_?(_=!1,b=m&&d(m)?m:[]):b=m&&y(m)?m:{},f(E,{name:h,newValue:c(T,b,g)})):g!==void 0&&f(E,{name:h,newValue:g}));return E}},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.BlockEmbed=i.bubbleFormats=void 0;var s=function(){function x(v,T){for(var O=0;O<T.length;O++){var A=T[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,T,O){return T&&x(v.prototype,T),O&&x(v,O),v}}(),u=function x(v,T,O){v===null&&(v=Function.prototype);var A=Object.getOwnPropertyDescriptor(v,T);if(A===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:x(N,T,O)}if("value"in A)return A.value;var k=A.get;return k!==void 0?k.call(O):void 0},p=a(o(3)),d=a(o(2)),y=a(o(0)),f=a(o(16)),l=a(o(6)),c=a(o(7));function a(x){return x&&x.__esModule?x:{default:x}}function h(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function m(x,v){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!v||typeof v!="object"&&typeof v!="function"?x:v}function g(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}var _=function(x){function v(){return h(this,v),m(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return g(v,x),s(v,[{key:"attach",value:function(){u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"attach",this).call(this),this.attributes=new y.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new d.default().insert(this.value(),(0,p.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(T,O){var A=y.default.query(T,y.default.Scope.BLOCK_ATTRIBUTE);A!=null&&this.attributes.attribute(A,O)}},{key:"formatAt",value:function(T,O,A,N){this.format(A,N)}},{key:"insertAt",value:function(T,O,A){if(typeof O=="string"&&O.endsWith(`
557
- `)){var N=y.default.create(b.blotName);this.parent.insertBefore(N,T===0?this:this.next),N.insertAt(0,O.slice(0,-1))}else u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,T,O,A)}}]),v}(y.default.Embed);_.scope=y.default.Scope.BLOCK_BLOT;var b=function(x){function v(T){h(this,v);var O=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,T));return O.cache={},O}return g(v,x),s(v,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(y.default.Leaf).reduce(function(T,O){return O.length()===0?T:T.insert(O.value(),E(O))},new d.default).insert(`
558
- `,E(this))),this.cache.delta}},{key:"deleteAt",value:function(T,O){u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"deleteAt",this).call(this,T,O),this.cache={}}},{key:"formatAt",value:function(T,O,A,N){O<=0||(y.default.query(A,y.default.Scope.BLOCK)?T+O===this.length()&&this.format(A,N):u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,T,Math.min(O,this.length()-T-1),A,N),this.cache={})}},{key:"insertAt",value:function(T,O,A){if(A!=null)return u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,T,O,A);if(O.length!==0){var N=O.split(`
559
- `),k=N.shift();k.length>0&&(T<this.length()-1||this.children.tail==null?u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,Math.min(T,this.length()-1),k):this.children.tail.insertAt(this.children.tail.length(),k),this.cache={});var w=this;N.reduce(function(C,P){return(w=w.split(C,!0)).insertAt(0,P),P.length},T+k.length)}}},{key:"insertBefore",value:function(T,O){var A=this.children.head;u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,T,O),A instanceof f.default&&A.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(T,O){u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"moveChildren",this).call(this,T,O),this.cache={}}},{key:"optimize",value:function(T){u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,T),this.cache={}}},{key:"path",value:function(T){return u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"path",this).call(this,T,!0)}},{key:"removeChild",value:function(T){u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"removeChild",this).call(this,T),this.cache={}}},{key:"split",value:function(T){var O=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(O&&(T===0||T>=this.length()-1)){var A=this.clone();return T===0?(this.parent.insertBefore(A,this),this):(this.parent.insertBefore(A,this.next),A)}var N=u(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"split",this).call(this,T,O);return this.cache={},N}}]),v}(y.default.Block);function E(x){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x==null?v:(typeof x.formats=="function"&&(v=(0,p.default)(v,x.formats())),x.parent==null||x.parent.blotName=="scroll"||x.parent.statics.scope!==x.statics.scope?v:E(x.parent,v))}b.blotName="block",b.tagName="P",b.defaultChild="break",b.allowedChildren=[l.default,y.default.Embed,c.default],i.bubbleFormats=E,i.BlockEmbed=_,i.default=b},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.overload=i.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},u=function(k,w){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return function(C,P){var S=[],R=!0,I=!1,M=void 0;try{for(var L,j=C[Symbol.iterator]();!(R=(L=j.next()).done)&&(S.push(L.value),!P||S.length!==P);R=!0);}catch(q){I=!0,M=q}finally{try{!R&&j.return&&j.return()}finally{if(I)throw M}}return S}(k,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")},p=function(){function k(w,C){for(var P=0;P<C.length;P++){var S=C[P];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,C,P){return C&&k(w.prototype,C),P&&k(w,P),w}}();o(50);var d=b(o(2)),y=b(o(14)),f=b(o(8)),l=b(o(9)),c=b(o(0)),a=o(15),h=b(a),m=b(o(3)),g=b(o(10)),_=b(o(34));function b(k){return k&&k.__esModule?k:{default:k}}function E(k,w,C){return w in k?Object.defineProperty(k,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):k[w]=C,k}var x=(0,g.default)("quill"),v=function(){function k(w){var C=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(function(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}(this,k),this.options=T(w,P),this.container=this.options.container,this.container==null)return x.error("Invalid Quill container",w);this.options.debug&&k.debug(this.options.debug);var S=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new f.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new y.default(this.scroll),this.selection=new h.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(f.default.events.EDITOR_CHANGE,function(I){I===f.default.events.TEXT_CHANGE&&C.root.classList.toggle("ql-blank",C.editor.isBlank())}),this.emitter.on(f.default.events.SCROLL_UPDATE,function(I,M){var L=C.selection.lastRange,j=L&&L.length===0?L.index:void 0;O.call(C,function(){return C.editor.update(null,M,j)},I)});var R=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+S+"<p><br></p></div>");this.setContents(R),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return p(k,null,[{key:"debug",value:function(w){w===!0&&(w="log"),g.default.level(w)}},{key:"find",value:function(w){return w.__quill||c.default.find(w)}},{key:"import",value:function(w){return this.imports[w]==null&&x.error("Cannot import "+w+". Are you sure it was registered?"),this.imports[w]}},{key:"register",value:function(w,C){var P=this,S=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(typeof w!="string"){var R=w.attrName||w.blotName;typeof R=="string"?this.register("formats/"+R,w,C):Object.keys(w).forEach(function(I){P.register(I,w[I],C)})}else this.imports[w]==null||S||x.warn("Overwriting "+w+" with",C),this.imports[w]=C,(w.startsWith("blots/")||w.startsWith("formats/"))&&C.blotName!=="abstract"?c.default.register(C):w.startsWith("modules")&&typeof C.register=="function"&&C.register()}}]),p(k,[{key:"addContainer",value:function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof w=="string"){var P=w;(w=document.createElement("div")).classList.add(P)}return this.container.insertBefore(w,C),w}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(w,C,P){var S=this,R=A(w,C,P),I=u(R,4);return w=I[0],C=I[1],P=I[3],O.call(this,function(){return S.editor.deleteText(w,C)},P,w,-1*C)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var w=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.scroll.enable(w),this.container.classList.toggle("ql-disabled",!w)}},{key:"focus",value:function(){var w=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=w,this.scrollIntoView()}},{key:"format",value:function(w,C){var P=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;return O.call(this,function(){var R=P.getSelection(!0),I=new d.default;if(R==null)return I;if(c.default.query(w,c.default.Scope.BLOCK))I=P.editor.formatLine(R.index,R.length,E({},w,C));else{if(R.length===0)return P.selection.format(w,C),I;I=P.editor.formatText(R.index,R.length,E({},w,C))}return P.setSelection(R,f.default.sources.SILENT),I},S)}},{key:"formatLine",value:function(w,C,P,S,R){var I,M=this,L=A(w,C,P,S,R),j=u(L,4);return w=j[0],C=j[1],I=j[2],R=j[3],O.call(this,function(){return M.editor.formatLine(w,C,I)},R,w,0)}},{key:"formatText",value:function(w,C,P,S,R){var I,M=this,L=A(w,C,P,S,R),j=u(L,4);return w=j[0],C=j[1],I=j[2],R=j[3],O.call(this,function(){return M.editor.formatText(w,C,I)},R,w,0)}},{key:"getBounds",value:function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=void 0;P=typeof w=="number"?this.selection.getBounds(w,C):this.selection.getBounds(w.index,w.length);var S=this.container.getBoundingClientRect();return{bottom:P.bottom-S.top,height:P.height,left:P.left-S.left,right:P.right-S.left,top:P.top-S.top,width:P.width}}},{key:"getContents",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-w,P=A(w,C),S=u(P,2);return w=S[0],C=S[1],this.editor.getContents(w,C)}},{key:"getFormat",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof w=="number"?this.editor.getFormat(w,C):this.editor.getFormat(w.index,w.length)}},{key:"getIndex",value:function(w){return w.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(w){return this.scroll.leaf(w)}},{key:"getLine",value:function(w){return this.scroll.line(w)}},{key:"getLines",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof w!="number"?this.scroll.lines(w.index,w.length):this.scroll.lines(w,C)}},{key:"getModule",value:function(w){return this.theme.modules[w]}},{key:"getSelection",value:function(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-w,P=A(w,C),S=u(P,2);return w=S[0],C=S[1],this.editor.getText(w,C)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(w,C,P){var S=this,R=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k.sources.API;return O.call(this,function(){return S.editor.insertEmbed(w,C,P)},R,w)}},{key:"insertText",value:function(w,C,P,S,R){var I,M=this,L=A(w,0,P,S,R),j=u(L,4);return w=j[0],I=j[2],R=j[3],O.call(this,function(){return M.editor.insertText(w,C,I)},R,w,C.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(w,C,P){this.clipboard.dangerouslyPasteHTML(w,C,P)}},{key:"removeFormat",value:function(w,C,P){var S=this,R=A(w,C,P),I=u(R,4);return w=I[0],C=I[1],P=I[3],O.call(this,function(){return S.editor.removeFormat(w,C)},P,w)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(w){var C=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return O.call(this,function(){w=new d.default(w);var S=C.getLength(),R=C.editor.deleteText(0,S),I=C.editor.applyDelta(w),M=I.ops[I.ops.length-1];return M!=null&&typeof M.insert=="string"&&M.insert[M.insert.length-1]===`
560
- `&&(C.editor.deleteText(C.getLength()-1,1),I.delete(1)),R.compose(I)},P)}},{key:"setSelection",value:function(w,C,P){if(w==null)this.selection.setRange(null,C||k.sources.API);else{var S=A(w,C,P),R=u(S,4);w=R[0],C=R[1],P=R[3],this.selection.setRange(new a.Range(w,C),P),P!==f.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API,P=new d.default().insert(w);return this.setContents(P,C)}},{key:"update",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,C=this.scroll.update(w);return this.selection.update(w),C}},{key:"updateContents",value:function(w){var C=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return O.call(this,function(){return w=new d.default(w),C.editor.applyDelta(w,P)},P,!0)}}]),k}();function T(k,w){if((w=(0,m.default)(!0,{container:k,modules:{clipboard:!0,keyboard:!0,history:!0}},w)).theme&&w.theme!==v.DEFAULTS.theme){if(w.theme=v.import("themes/"+w.theme),w.theme==null)throw new Error("Invalid theme "+w.theme+". Did you register it?")}else w.theme=_.default;var C=(0,m.default)(!0,{},w.theme.DEFAULTS);[C,w].forEach(function(S){S.modules=S.modules||{},Object.keys(S.modules).forEach(function(R){S.modules[R]===!0&&(S.modules[R]={})})});var P=Object.keys(C.modules).concat(Object.keys(w.modules)).reduce(function(S,R){var I=v.import("modules/"+R);return I==null?x.error("Cannot load "+R+" module. Are you sure you registered it?"):S[R]=I.DEFAULTS||{},S},{});return w.modules!=null&&w.modules.toolbar&&w.modules.toolbar.constructor!==Object&&(w.modules.toolbar={container:w.modules.toolbar}),w=(0,m.default)(!0,{},v.DEFAULTS,{modules:P},C,w),["bounds","container","scrollingContainer"].forEach(function(S){typeof w[S]=="string"&&(w[S]=document.querySelector(w[S]))}),w.modules=Object.keys(w.modules).reduce(function(S,R){return w.modules[R]&&(S[R]=w.modules[R]),S},{}),w}function O(k,w,C,P){if(this.options.strict&&!this.isEnabled()&&w===f.default.sources.USER)return new d.default;var S=C==null?null:this.getSelection(),R=this.editor.delta,I=k();if(S!=null&&(C===!0&&(C=S.index),P==null?S=N(S,I,w):P!==0&&(S=N(S,C,P,w)),this.setSelection(S,f.default.sources.SILENT)),I.length()>0){var M,L,j=[f.default.events.TEXT_CHANGE,I,R,w];(M=this.emitter).emit.apply(M,[f.default.events.EDITOR_CHANGE].concat(j)),w!==f.default.sources.SILENT&&(L=this.emitter).emit.apply(L,j)}return I}function A(k,w,C,P,S){var R={};return typeof k.index=="number"&&typeof k.length=="number"?typeof w!="number"?(S=P,P=C,C=w,w=k.length,k=k.index):(w=k.length,k=k.index):typeof w!="number"&&(S=P,P=C,C=w,w=0),(C===void 0?"undefined":s(C))==="object"?(R=C,S=P):typeof C=="string"&&(P!=null?R[C]=P:S=C),[k,w,R,S=S||f.default.sources.API]}function N(k,w,C,P){if(k==null)return null;var S=void 0,R=void 0;if(w instanceof d.default){var I=[k.index,k.index+k.length].map(function(q){return w.transformPosition(q,P!==f.default.sources.USER)}),M=u(I,2);S=M[0],R=M[1]}else{var L=[k.index,k.index+k.length].map(function(q){return q<w||q===w&&P===f.default.sources.USER?q:C>=0?q+C:Math.max(w,q+C)}),j=u(L,2);S=j[0],R=j[1]}return new a.Range(S,R-S)}v.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},v.events=f.default.events,v.sources=f.default.sources,v.version="1.3.7",v.imports={delta:d.default,parchment:c.default,"core/module":l.default,"core/theme":_.default},i.expandConfig=T,i.overload=A,i.default=v},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function l(c,a){for(var h=0;h<a.length;h++){var m=a[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,a,h){return a&&l(c.prototype,a),h&&l(c,h),c}}(),u=function l(c,a,h){c===null&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,a);if(m===void 0){var g=Object.getPrototypeOf(c);return g===null?void 0:l(g,a,h)}if("value"in m)return m.value;var _=m.get;return _!==void 0?_.call(h):void 0},p=y(o(7)),d=y(o(0));function y(l){return l&&l.__esModule?l:{default:l}}var f=function(l){function c(){return function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")}(this,c),function(a,h){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?a:h}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);a.prototype=Object.create(h&&h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(a,h):a.__proto__=h)}(c,l),s(c,[{key:"formatAt",value:function(a,h,m,g){if(c.compare(this.statics.blotName,m)<0&&d.default.query(m,d.default.Scope.BLOT)){var _=this.isolate(a,h);g&&_.wrap(m,g)}else u(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"formatAt",this).call(this,a,h,m,g)}},{key:"optimize",value:function(a){if(u(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"optimize",this).call(this,a),this.parent instanceof c&&c.compare(this.statics.blotName,this.parent.statics.blotName)>0){var h=this.parent.isolate(this.offset(),this.length());this.moveChildren(h),h.wrap(this)}}}],[{key:"compare",value:function(a,h){var m=c.order.indexOf(a),g=c.order.indexOf(h);return m>=0||g>=0?m-g:a===h?0:a<h?-1:1}}]),c}(d.default.Inline);f.allowedChildren=[f,d.default.Embed,p.default],f.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],i.default=f},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(p){return p&&p.__esModule?p:{default:p}}(o(0)),u=function(p){function d(){return function(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}(this,d),function(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||typeof f!="object"&&typeof f!="function"?y:f}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return function(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}(d,p),d}(s.default.Text);i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function l(c,a){for(var h=0;h<a.length;h++){var m=a[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,a,h){return a&&l(c.prototype,a),h&&l(c,h),c}}(),u=function l(c,a,h){c===null&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,a);if(m===void 0){var g=Object.getPrototypeOf(c);return g===null?void 0:l(g,a,h)}if("value"in m)return m.value;var _=m.get;return _!==void 0?_.call(h):void 0},p=d(o(54));function d(l){return l&&l.__esModule?l:{default:l}}var y=(0,d(o(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(l){document.addEventListener(l,function(){for(var c=arguments.length,a=Array(c),h=0;h<c;h++)a[h]=arguments[h];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(m){var g;m.__quill&&m.__quill.emitter&&(g=m.__quill.emitter).handleDOM.apply(g,a)})})});var f=function(l){function c(){(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c);var a=function(h,m){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||typeof m!="object"&&typeof m!="function"?h:m}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return a.listeners={},a.on("error",y.error),a}return function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);a.prototype=Object.create(h&&h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(a,h):a.__proto__=h)}(c,l),s(c,[{key:"emit",value:function(){y.log.apply(y,arguments),u(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(a){for(var h=arguments.length,m=Array(h>1?h-1:0),g=1;g<h;g++)m[g-1]=arguments[g];(this.listeners[a.type]||[]).forEach(function(_){var b=_.node,E=_.handler;(a.target===b||b.contains(a.target))&&E.apply(void 0,[a].concat(m))})}},{key:"listenDOM",value:function(a,h,m){this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push({node:h,handler:m})}}]),c}(p.default);f.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},f.sources={API:"api",SILENT:"silent",USER:"user"},i.default=f},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function u(p){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(function(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")})(this,u),this.quill=p,this.options=d};s.DEFAULTS={},i.default=s},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=["error","warn","log","info"],u="warn";function p(y){if(s.indexOf(y)<=s.indexOf(u)){for(var f,l=arguments.length,c=Array(l>1?l-1:0),a=1;a<l;a++)c[a-1]=arguments[a];(f=console)[y].apply(f,c)}}function d(y){return s.reduce(function(f,l){return f[l]=p.bind(console,l,y),f},{})}p.level=d.level=function(y){u=y},i.default=d},function(n,i,o){var s=Array.prototype.slice,u=o(52),p=o(53),d=n.exports=function(l,c,a){return a||(a={}),l===c||(l instanceof Date&&c instanceof Date?l.getTime()===c.getTime():!l||!c||typeof l!="object"&&typeof c!="object"?a.strict?l===c:l==c:function(h,m,g){var _,b;if(y(h)||y(m)||h.prototype!==m.prototype)return!1;if(p(h))return!!p(m)&&(h=s.call(h),m=s.call(m),d(h,m,g));if(f(h)){if(!f(m)||h.length!==m.length)return!1;for(_=0;_<h.length;_++)if(h[_]!==m[_])return!1;return!0}try{var E=u(h),x=u(m)}catch{return!1}if(E.length!=x.length)return!1;for(E.sort(),x.sort(),_=E.length-1;_>=0;_--)if(E[_]!=x[_])return!1;for(_=E.length-1;_>=0;_--)if(b=E[_],!d(h[b],m[b],g))return!1;return typeof h==typeof m}(l,c,a))};function y(l){return l==null}function f(l){return!(!l||typeof l!="object"||typeof l.length!="number"||typeof l.copy!="function"||typeof l.slice!="function"||l.length>0&&typeof l[0]!="number")}},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=o(1),u=function(){function p(d,y,f){f===void 0&&(f={}),this.attrName=d,this.keyName=y;var l=s.Scope.TYPE&s.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&s.Scope.LEVEL|l:this.scope=s.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return p.keys=function(d){return[].map.call(d.attributes,function(y){return y.name})},p.prototype.add=function(d,y){return!!this.canAdd(d,y)&&(d.setAttribute(this.keyName,y),!0)},p.prototype.canAdd=function(d,y){return s.query(d,s.Scope.BLOT&(this.scope|s.Scope.TYPE))!=null&&(this.whitelist==null||(typeof y=="string"?this.whitelist.indexOf(y.replace(/["']/g,""))>-1:this.whitelist.indexOf(y)>-1))},p.prototype.remove=function(d){d.removeAttribute(this.keyName)},p.prototype.value=function(d){var y=d.getAttribute(this.keyName);return this.canAdd(d,y)&&y?y:""},p}();i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.Code=void 0;var s=function(E,x){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return function(v,T){var O=[],A=!0,N=!1,k=void 0;try{for(var w,C=v[Symbol.iterator]();!(A=(w=C.next()).done)&&(O.push(w.value),!T||O.length!==T);A=!0);}catch(P){N=!0,k=P}finally{try{!A&&C.return&&C.return()}finally{if(N)throw k}}return O}(E,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=function(){function E(x,v){for(var T=0;T<v.length;T++){var O=v[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(x,O.key,O)}}return function(x,v,T){return v&&E(x.prototype,v),T&&E(x,T),x}}(),p=function E(x,v,T){x===null&&(x=Function.prototype);var O=Object.getOwnPropertyDescriptor(x,v);if(O===void 0){var A=Object.getPrototypeOf(x);return A===null?void 0:E(A,v,T)}if("value"in O)return O.value;var N=O.get;return N!==void 0?N.call(T):void 0},d=a(o(2)),y=a(o(0)),f=a(o(4)),l=a(o(6)),c=a(o(7));function a(E){return E&&E.__esModule?E:{default:E}}function h(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function m(E,x){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!x||typeof x!="object"&&typeof x!="function"?E:x}function g(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(E,x):E.__proto__=x)}var _=function(E){function x(){return h(this,x),m(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return g(x,E),x}(l.default);_.blotName="code",_.tagName="CODE";var b=function(E){function x(){return h(this,x),m(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return g(x,E),u(x,[{key:"delta",value:function(){var v=this,T=this.domNode.textContent;return T.endsWith(`
561
- `)&&(T=T.slice(0,-1)),T.split(`
562
- `).reduce(function(O,A){return O.insert(A).insert(`
563
- `,v.formats())},new d.default)}},{key:"format",value:function(v,T){if(v!==this.statics.blotName||!T){var O=this.descendant(c.default,this.length()-1),A=s(O,1)[0];A!=null&&A.deleteAt(A.length()-1,1),p(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,v,T)}}},{key:"formatAt",value:function(v,T,O,A){if(T!==0&&y.default.query(O,y.default.Scope.BLOCK)!=null&&(O!==this.statics.blotName||A!==this.statics.formats(this.domNode))){var N=this.newlineIndex(v);if(!(N<0||N>=v+T)){var k=this.newlineIndex(v,!0)+1,w=N-k+1,C=this.isolate(k,w),P=C.next;C.format(O,A),P instanceof x&&P.formatAt(0,v-k+T-w,O,A)}}}},{key:"insertAt",value:function(v,T,O){if(O==null){var A=this.descendant(c.default,v),N=s(A,2),k=N[0],w=N[1];k.insertAt(w,T)}}},{key:"length",value:function(){var v=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
564
- `)?v:v+1}},{key:"newlineIndex",value:function(v){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1])return this.domNode.textContent.slice(0,v).lastIndexOf(`
565
- `);var T=this.domNode.textContent.slice(v).indexOf(`
566
- `);return T>-1?v+T:-1}},{key:"optimize",value:function(v){this.domNode.textContent.endsWith(`
567
- `)||this.appendChild(y.default.create("text",`
568
- `)),p(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,v);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===T.statics.formats(T.domNode)&&(T.optimize(v),T.moveChildren(this),T.remove())}},{key:"replace",value:function(v){p(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,v),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(T){var O=y.default.find(T);O==null?T.parentNode.removeChild(T):O instanceof y.default.Embed?O.remove():O.unwrap()})}}],[{key:"create",value:function(v){var T=p(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,v);return T.setAttribute("spellcheck",!1),T}},{key:"formats",value:function(){return!0}}]),x}(f.default);b.blotName="code-block",b.tagName="PRE",b.TAB=" ",i.Code=_,i.default=b},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},u=function(O,A){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return function(N,k){var w=[],C=!0,P=!1,S=void 0;try{for(var R,I=N[Symbol.iterator]();!(C=(R=I.next()).done)&&(w.push(R.value),!k||w.length!==k);C=!0);}catch(M){P=!0,S=M}finally{try{!C&&I.return&&I.return()}finally{if(P)throw S}}return w}(O,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")},p=function(){function O(A,N){for(var k=0;k<N.length;k++){var w=N[k];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(A,w.key,w)}}return function(A,N,k){return N&&O(A.prototype,N),k&&O(A,k),A}}(),d=E(o(2)),y=E(o(20)),f=E(o(0)),l=E(o(13)),c=E(o(24)),a=o(4),h=E(a),m=E(o(16)),g=E(o(21)),_=E(o(11)),b=E(o(3));function E(O){return O&&O.__esModule?O:{default:O}}var x=/^[ -~]*$/,v=function(){function O(A){(function(N,k){if(!(N instanceof k))throw new TypeError("Cannot call a class as a function")})(this,O),this.scroll=A,this.delta=this.getDelta()}return p(O,[{key:"applyDelta",value:function(A){var N=this,k=!1;this.scroll.update();var w=this.scroll.length();return this.scroll.batchStart(),(A=function(C){return C.reduce(function(P,S){if(S.insert===1){var R=(0,g.default)(S.attributes);return delete R.image,P.insert({image:S.attributes.image},R)}if(S.attributes==null||S.attributes.list!==!0&&S.attributes.bullet!==!0||((S=(0,g.default)(S)).attributes.list?S.attributes.list="ordered":(S.attributes.list="bullet",delete S.attributes.bullet)),typeof S.insert=="string"){var I=S.insert.replace(/\r\n/g,`
539
+ `;class Gs extends Se{constructor(t){super(Ap,Sp),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,t)}apply(t,r,n,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,r,n,i)}}var Je=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(Je||{});const qs=({pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:a,uniqueId:o=""})=>{const l=te.utils.string2hex("#F3C409"),f=te.utils.string2hex("#F3C409"),c=st.useRef({isDragging:!1}),h=st.useCallback(()=>{s&&!c.current.isDragging&&s(!0)},[s]),u=st.useCallback(()=>{s&&!c.current.isDragging&&s(!1)},[s]),d=st.useCallback(()=>{c.current.isDragging=!0},[]),p=st.useCallback(()=>{c.current.isDragging=!1},[]),v=st.useCallback(()=>{c.current.isDragging=!1},[]),g=st.useCallback(()=>{console.log("dobule click in pixi transformer"),a&&a({uniqueId:o})},[a]),m=st.useCallback(_=>{c.current.isDragging=!0,i&&i(_)},[i]),b=st.useCallback(()=>{if(t.current===null)return;const _=t.current.x,y=t.current.y,x=t.current.width,O=t.current.height,T=t.current.rotation,E=[t.current.scale.x,t.current.scale.y];n&&n({uniqueId:o,transformation:{x:Math.round(_),y:Math.round(y),width:Math.round(Math.max(5,x)),height:Math.round(Math.max(5,O)),rotate:Math.round(T),scale:E}}),c.current.isDragging=!1},[n]);return st.useEffect(()=>(e.current&&(e.current.on("mouseover",h),e.current.on("mouseout",u),e.current.on("mousedown",d),e.current.on("mouseup",p),e.current.on("mouseupoutside",v),e.current.addListener("dblclick",g)),()=>{e.current&&(e.current.off("mouseover",h),e.current.off("mouseout",u),e.current.off("mousedown",d),e.current.off("mouseup",p),e.current.off("mouseupoutside",v),e.current.removeListener("dblclick",g))}),[]),dt.jsx(pf.Transformer,{ref:e,group:r?[t.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:f},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:l,shape:"circle",radius:9},transformchange:m,transformcommit:b})};var ei={};Object.defineProperty(ei,"__esModule",{value:!0});var Op=Q,Hs;function Fl(){return Hs||(Hs=document.createElement("div")),Hs}function Ip(e,t,r){var n;return Op.useEffect(function(){n=n||Fl();var i=function(s){var a=s.detail;t(a)};return n.addEventListener(e,i,!1),function(){n==null||n.removeEventListener(e,i,!1)}},r),function(i){n=i}}function Rp(e,t){var r=Fl(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function Np(){var e;function t(r){e=r}return t.emit=function(r,n){var i=new CustomEvent(r,{bubbles:!0,detail:n});e==null||e.dispatchEvent(i)},t}var ri=ei.emitCustomEvent=Rp;ei.newCustomEventEmitter=Np;var nn=ei.useCustomEventListener=Ip;const Sr=st.createContext({}),ge={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},Cp=({children:e})=>{const[t,r]=Q.useState(!1),n=Q.useRef(),i=Q.useRef(),s=Q.useRef(.001);Q.useLayoutEffect(()=>(i.current=he.context(()=>{n.current&&n.current.progress(0).kill(),n.current=he.timeline({paused:!0,defaults:{duration:0}})}),()=>i.current.revert()),[]);const a=Q.useCallback(()=>{let g=n.current.time();s.current=g},[]);Q.useEffect(()=>{const v=n.current;v.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){v.pause(),a()}).eventCallback("onUpdate",function(){a()}).eventCallback("onPause",function(){a()}).eventCallback("onResume",function(){a()}).eventCallback("onComplete",function(){v.pause(),v.revert(),ri(ge.STOP),ri(ge.COMPLETE),console.log("Emitted events"),a()})},[]);const o=Q.useCallback(()=>{n.current.revert()},[]),l=Q.useCallback(()=>{n.current.restart()},[]),f=Q.useCallback(()=>{const v=n.current;v.repeat(1),v.restart()},[]),c=Q.useCallback(v=>{n.current.seek(v)},[]),h=Q.useCallback(()=>{n.current.seek(4)},[]),u=Q.useCallback(()=>{const v=n.current;return v?v.totalDuration():0},[]),d=()=>{n.current.pause(),ri(ge.PAUSE)},p=()=>{n.current.resume(),ri(ge.RESUME)};return nn(ge.DRAGGING_START,()=>{r(!0)}),nn(ge.DRAGGING_END,()=>{r(!1)}),dt.jsx(Sr.Provider,{value:{gsapCtx:i,tl:n,handlePlay:p,handlePause:d,handleReset:o,handleSeek:c,handleSeekTest:h,handleRestart:l,handleRepeat:f,playerTimeRef:s,isDragging:t,getTimelineDuration:u},children:e})},Vs=e=>{let t={};switch(e){case"NONE":case"none":break;case"BOUNCE_IN":t.from={duration:2,ease:"bounce.out",y:-1500};break;case"BOUNCE_IN_DOWN":t.from={ease:"bounce.out",y:-1500,duration:2};break;case"BOUNCE_IN_LEFT":t.from={ease:"bounce.out",x:-1500,duration:2};break;case"BOUNCE_IN_RIGHT":t.from={ease:"bounce.out",x:1500,duration:2};break;case"BOUNCE_IN_UP":t.from={ease:"bounce.out",y:1500,duration:2};break;case"BOUNCE_OUT":t.from={ease:"bounce.in",y:2,duration:2};break;case"BOUNCE_OUT_DOWN":break;case"BOUNCE_OUT_LEFT":break;case"BOUNCE_OUT_RIGHT":break;case"BOUNCE_OUT_UP":break;case"FADE_IN":t.to={ease:"power4.in",alpha:1,duration:.5};break;case"FADE_IN_DOWN":t.fromTo={from:{y:-1e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break;case"FADE_IN_LEFT":t.fromTo={from:{x:-1e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_RIGHT":t.fromTo={from:{x:2e3,alpha:0},to:{ease:"power4.in",x:0,alpha:1,duration:1}};break;case"FADE_IN_UP":t.fromTo={from:{y:2e3,alpha:0},to:{ease:"power4.in",y:0,alpha:1,duration:1}};break}return t};var Pp=Object.prototype;function kp(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Pp;return e===r}var Bl=kp;function Mp(e,t){return function(r){return e(t(r))}}var Lp=Mp,Fp=Lp,Bp=Fp(Object.keys,Object),Up=Bp,Dp=Bl,jp=Up,$p=Object.prototype,Gp=$p.hasOwnProperty;function qp(e){if(!Dp(e))return jp(e);var t=[];for(var r in Object(e))Gp.call(e,r)&&r!="constructor"&&t.push(r);return t}var Ul=qp,Hp=typeof Ne=="object"&&Ne&&Ne.Object===Object&&Ne,Dl=Hp,Vp=Dl,zp=typeof self=="object"&&self&&self.Object===Object&&self,Xp=Vp||zp||Function("return this")(),Oe=Xp,Wp=Oe,Yp=Wp.Symbol,ni=Yp,jl=ni,$l=Object.prototype,Kp=$l.hasOwnProperty,Zp=$l.toString,sn=jl?jl.toStringTag:void 0;function Qp(e){var t=Kp.call(e,sn),r=e[sn];try{e[sn]=void 0;var n=!0}catch{}var i=Zp.call(e);return n&&(t?e[sn]=r:delete e[sn]),i}var Jp=Qp,tv=Object.prototype,ev=tv.toString;function rv(e){return ev.call(e)}var nv=rv,Gl=ni,iv=Jp,sv=nv,av="[object Null]",ov="[object Undefined]",ql=Gl?Gl.toStringTag:void 0;function lv(e){return e==null?e===void 0?ov:av:ql&&ql in Object(e)?iv(e):sv(e)}var an=lv;function uv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zs=uv,fv=an,cv=zs,hv="[object AsyncFunction]",dv="[object Function]",pv="[object GeneratorFunction]",vv="[object Proxy]";function yv(e){if(!cv(e))return!1;var t=fv(e);return t==dv||t==pv||t==hv||t==vv}var Hl=yv,mv=Oe,gv=mv["__core-js_shared__"],bv=gv,Xs=bv,Vl=function(){var e=/[^.]+$/.exec(Xs&&Xs.keys&&Xs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _v(e){return!!Vl&&Vl in e}var xv=_v,Ev=Function.prototype,Tv=Ev.toString;function wv(e){if(e!=null){try{return Tv.call(e)}catch{}try{return e+""}catch{}}return""}var zl=wv,Av=Hl,Sv=xv,Ov=zs,Iv=zl,Rv=/[\\^$.*+?()[\]{}|]/g,Nv=/^\[object .+?Constructor\]$/,Cv=Function.prototype,Pv=Object.prototype,kv=Cv.toString,Mv=Pv.hasOwnProperty,Lv=RegExp("^"+kv.call(Mv).replace(Rv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fv(e){if(!Ov(e)||Sv(e))return!1;var t=Av(e)?Lv:Nv;return t.test(Iv(e))}var Bv=Fv;function Uv(e,t){return e==null?void 0:e[t]}var Dv=Uv,jv=Bv,$v=Dv;function Gv(e,t){var r=$v(e,t);return jv(r)?r:void 0}var Or=Gv,qv=Or,Hv=Oe,Vv=qv(Hv,"DataView"),zv=Vv,Xv=Or,Wv=Oe,Yv=Xv(Wv,"Map"),Ws=Yv,Kv=Or,Zv=Oe,Qv=Kv(Zv,"Promise"),Jv=Qv,ty=Or,ey=Oe,ry=ty(ey,"Set"),ny=ry,iy=Or,sy=Oe,ay=iy(sy,"WeakMap"),oy=ay,Ys=zv,Ks=Ws,Zs=Jv,Qs=ny,Js=oy,Xl=an,Ir=zl,Wl="[object Map]",ly="[object Object]",Yl="[object Promise]",Kl="[object Set]",Zl="[object WeakMap]",Ql="[object DataView]",uy=Ir(Ys),fy=Ir(Ks),cy=Ir(Zs),hy=Ir(Qs),dy=Ir(Js),tr=Xl;(Ys&&tr(new Ys(new ArrayBuffer(1)))!=Ql||Ks&&tr(new Ks)!=Wl||Zs&&tr(Zs.resolve())!=Yl||Qs&&tr(new Qs)!=Kl||Js&&tr(new Js)!=Zl)&&(tr=function(e){var t=Xl(e),r=t==ly?e.constructor:void 0,n=r?Ir(r):"";if(n)switch(n){case uy:return Ql;case fy:return Wl;case cy:return Yl;case hy:return Kl;case dy:return Zl}return t});var Jl=tr;function py(e){return e!=null&&typeof e=="object"}var on=py,vy=an,yy=on,my="[object Arguments]";function gy(e){return yy(e)&&vy(e)==my}var by=gy,tu=by,_y=on,eu=Object.prototype,xy=eu.hasOwnProperty,Ey=eu.propertyIsEnumerable,Ty=tu(function(){return arguments}())?tu:function(e){return _y(e)&&xy.call(e,"callee")&&!Ey.call(e,"callee")},ta=Ty,wy=Array.isArray,be=wy,Ay=9007199254740991;function Sy(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ay}var ea=Sy,Oy=Hl,Iy=ea;function Ry(e){return e!=null&&Iy(e.length)&&!Oy(e)}var ii=Ry,si={exports:{}};function Ny(){return!1}var Cy=Ny;si.exports,function(e,t){var r=Oe,n=Cy,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?r.Buffer:void 0,l=o?o.isBuffer:void 0,f=l||n;e.exports=f}(si,si.exports);var ra=si.exports,Py=an,ky=ea,My=on,Ly="[object Arguments]",Fy="[object Array]",By="[object Boolean]",Uy="[object Date]",Dy="[object Error]",jy="[object Function]",$y="[object Map]",Gy="[object Number]",qy="[object Object]",Hy="[object RegExp]",Vy="[object Set]",zy="[object String]",Xy="[object WeakMap]",Wy="[object ArrayBuffer]",Yy="[object DataView]",Ky="[object Float32Array]",Zy="[object Float64Array]",Qy="[object Int8Array]",Jy="[object Int16Array]",tm="[object Int32Array]",em="[object Uint8Array]",rm="[object Uint8ClampedArray]",nm="[object Uint16Array]",im="[object Uint32Array]",Ot={};Ot[Ky]=Ot[Zy]=Ot[Qy]=Ot[Jy]=Ot[tm]=Ot[em]=Ot[rm]=Ot[nm]=Ot[im]=!0,Ot[Ly]=Ot[Fy]=Ot[Wy]=Ot[By]=Ot[Yy]=Ot[Uy]=Ot[Dy]=Ot[jy]=Ot[$y]=Ot[Gy]=Ot[qy]=Ot[Hy]=Ot[Vy]=Ot[zy]=Ot[Xy]=!1;function sm(e){return My(e)&&ky(e.length)&&!!Ot[Py(e)]}var am=sm;function om(e){return function(t){return e(t)}}var lm=om,ai={exports:{}};ai.exports,function(e,t){var r=Dl,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,a=s&&r.process,o=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o}(ai,ai.exports);var um=ai.exports,fm=am,cm=lm,ru=um,nu=ru&&ru.isTypedArray,hm=nu?cm(nu):fm,na=hm,dm=Ul,pm=Jl,vm=ta,ym=be,mm=ii,gm=ra,bm=Bl,_m=na,xm="[object Map]",Em="[object Set]",Tm=Object.prototype,wm=Tm.hasOwnProperty;function Am(e){if(e==null)return!0;if(mm(e)&&(ym(e)||typeof e=="string"||typeof e.splice=="function"||gm(e)||_m(e)||vm(e)))return!e.length;var t=pm(e);if(t==xm||t==Em)return!e.size;if(bm(e))return!dm(e).length;for(var r in e)if(wm.call(e,r))return!1;return!0}var Sm=Am;const Jt=ir(Sm),Om=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],oi=st.forwardRef((e,t)=>{const[r,n]=st.useState(!1),[i,s]=Q.useState(!1),[a,o]=Q.useState(!1),l=Q.useRef(null),f=Q.useRef(null),c=Q.useRef(null),h=Q.useRef(null),u=Q.useRef(e.initialAlpha),{tl:d}=Q.useContext(Sr),{uniqueId:p,startAt:v,endAt:g,initialAlpha:m,transformation:{x:b,y:_,width:y,height:x,colorCorrection:O,animation:T,effect:E},applyTransformer:N,disabled:A,pointerdown:w,pointerout:S,pointerover:I}=e;console.log("all abstract props",e);const{contrast:C=1,saturation:F=1,brightness:D=1,alpha:U=1,blurRadius:X=0}=O||{},j={...D>1&&{brightness:D},...C>1&&{contrast:C},...F>1&&{saturation:F},...U!==0&&{alpha:U}};st.useImperativeHandle(t,()=>({getIsTransformerDragging:()=>i,getIsMouseOverTransformer:()=>a}),[i,a]),st.useEffect(()=>{l.current&&n(!0)},[]);const k=B=>{u.current=B.alpha},R=B=>{u.current=B.alpha},P=()=>{console.log("reverse complete"),u.current=m};st.useEffect(()=>{let B=he.context(()=>{});if(l.current&&d.current){const q={duration:Number(g)-Number(v)},H={onStart:k,onReverseComplete:P,onStartParams:[{alpha:1}]},z={onComplete:R,onCompleteParams:[{alpha:0}]},Y=Vs(T||"None");B=he.context(()=>{var J,et;d.current.to(l.current,{alpha:1,duration:.1,...H},v).from(l.current,{...q},v).to(l.current,{alpha:0,duration:.1,...z},Number(g)-.09),Jt(Y.from)?Jt(Y.to)?Jt(Y.fromTo)||d.current.fromTo(l.current,(J=Y.fromTo)==null?void 0:J.from,(et=Y.fromTo)==null?void 0:et.to,v):d.current.to(l.current,{...Y.to},v):d.current.from(l.current,{...Y.from},v)})}return()=>B.revert()},[T,v,g]);const L=st.useCallback(()=>{s(!0)},[]),$=st.useCallback(B=>{console.log("changeEnd",B),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(B)),s(!1)},[]),G=yt.withFilters(yt.Container,{...X>0&&{blur:te.filters.BlurFilter},...!Jt(j)&&{adjust:Gs},matrix:te.filters.ColorMatrixFilter}),M=(O==null?void 0:O.enabled)||E&&E!==Je.Normal;return dt.jsxs(yt.Container,{ref:f,children:[dt.jsx(yt.Container,{ref:l,alpha:u.current,position:[b,_],pivot:[b,_],width:y,height:x,...!A&&!i&&{interactive:!0,buttonMode:!0,pointerdown:w,pointerover:I,pointerout:S},children:dt.jsxs(yt.Container,{children:[M&&dt.jsx(G,{scale:1,blur:{blur:X,quality:4},adjust:j,apply:({matrix:B})=>{E===Je.BlackAndWhite?B.desaturate():E===Je.Sepia?B.sepia():E===Je.RetroVintage||E===Je.NightVision?B.negative():E===Je.Normal&&B.reset()},matrix:{enabled:!0,matrix:Om},children:dt.jsx(yt.Container,{ref:c,children:e.children})}),!M&&dt.jsx(yt.Container,{ref:c,children:e.children})]})}),N&&dt.jsx(qs,{pixiTransformerRef:h,imageRef:l,isMounted:r,transformCommit:$,transformChange:L,mouseoverEvent:o,uniqueId:p})]})});oi.whyDidYouRender={logOnDifferentValues:!0,customName:"AbstractContainer"};const Im=st.forwardRef((e,t)=>{const r=Q.useRef(null),n=Q.useRef(null),{src:i,transformation:{x:s,y:a,width:o,height:l,anchor:f},pointerdown:c,pointerup:h}=e;return dt.jsx(oi,{...e,ref:t,children:dt.jsx(yt.Container,{ref:n,children:dt.jsx(yt.Sprite,{image:i,width:o,height:l,anchor:f,ref:r,x:s,y:a,interactive:!0,pointerdown:c,pointerup:h})})})}),li={build(e){const t=e.points;let r,n,i,s,a,o;if(e.type===qt.CIRC){const p=e.shape;r=p.x,n=p.y,a=o=p.radius,i=s=0}else if(e.type===qt.ELIP){const p=e.shape;r=p.x,n=p.y,a=p.width,o=p.height,i=s=0}else{const p=e.shape,v=p.width/2,g=p.height/2;r=p.x+v,n=p.y+g,a=o=Math.max(0,Math.min(p.radius,Math.min(v,g))),i=v-a,s=g-o}if(!(a>=0&&o>=0&&i>=0&&s>=0)){t.length=0;return}const l=Math.ceil(2.3*Math.sqrt(a+o)),f=l*8+(i?4:0)+(s?4:0);if(t.length=f,f===0)return;if(l===0){t.length=8,t[0]=t[6]=r+i,t[1]=t[3]=n+s,t[2]=t[4]=r-i,t[5]=t[7]=n-s;return}let c=0,h=l*4+(i?2:0)+2,u=h,d=f;{const p=i+a,v=s,g=r+p,m=r-p,b=n+v;if(t[c++]=g,t[c++]=b,t[--h]=b,t[--h]=m,s){const _=n-v;t[u++]=m,t[u++]=_,t[--d]=_,t[--d]=g}}for(let p=1;p<l;p++){const v=Math.PI/2*(p/l),g=i+Math.cos(v)*a,m=s+Math.sin(v)*o,b=r+g,_=r-g,y=n+m,x=n-m;t[c++]=b,t[c++]=y,t[--h]=y,t[--h]=_,t[u++]=_,t[u++]=x,t[--d]=x,t[--d]=b}{const p=i,v=s+o,g=r+p,m=r-p,b=n+v,_=n-v;t[c++]=g,t[c++]=b,t[--d]=_,t[--d]=g,i&&(t[c++]=m,t[c++]=b,t[--d]=_,t[--d]=m)}},triangulate(e,t){const r=e.points,n=t.points,i=t.indices;if(r.length===0)return;let s=n.length/2;const a=s;let o,l;if(e.type!==qt.RREC){const c=e.shape;o=c.x,l=c.y}else{const c=e.shape;o=c.x+c.width/2,l=c.y+c.height/2}const f=e.matrix;n.push(e.matrix?f.a*o+f.c*l+f.tx:o,e.matrix?f.b*o+f.d*l+f.ty:l),s++,n.push(r[0],r[1]);for(let c=2;c<r.length;c+=2)n.push(r[c],r[c+1]),i.push(s++,a,s);i.push(a+1,a,s)}};function iu(e,t=!1){const r=e.length;if(r<6)return;let n=0;for(let i=0,s=e[r-2],a=e[r-1];i<r;i+=2){const o=e[i],l=e[i+1];n+=(o-s)*(l+a),s=o,a=l}if(!t&&n>0||t&&n<=0){const i=r/2;for(let s=i+i%2;s<r;s+=2){const a=r-s-2,o=r-s-1,l=s,f=s+1;[e[a],e[l]]=[e[l],e[a]],[e[o],e[f]]=[e[f],e[o]]}}}const su={build(e){e.points=e.shape.points.slice()},triangulate(e,t){let r=e.points;const n=e.holes,i=t.points,s=t.indices;if(r.length>=6){iu(r,!1);const a=[];for(let f=0;f<n.length;f++){const c=n[f];iu(c.points,!0),a.push(r.length/2),r=r.concat(c.points)}const o=$f(r,a,2);if(!o)return;const l=i.length/2;for(let f=0;f<o.length;f+=3)s.push(o[f]+l),s.push(o[f+1]+l),s.push(o[f+2]+l);for(let f=0;f<r.length;f++)i.push(r[f])}}},Rm={build(e){const t=e.shape,r=t.x,n=t.y,i=t.width,s=t.height,a=e.points;a.length=0,i>=0&&s>=0&&a.push(r,n,r+i,n,r+i,n+s,r,n+s)},triangulate(e,t){const r=e.points,n=t.points;if(r.length===0)return;const i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},Nm={build(e){li.build(e)},triangulate(e,t){li.triangulate(e,t)}};var le=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(le||{}),er=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(er||{});const Rr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(e,t=20){if(!this.adaptive||!e||isNaN(e))return t;let r=Math.ceil(e/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class au{static curveTo(t,r,n,i,s,a){const o=a[a.length-2],f=a[a.length-1]-r,c=o-t,h=i-r,u=n-t,d=Math.abs(f*u-c*h);if(d<1e-8||s===0)return(a[a.length-2]!==t||a[a.length-1]!==r)&&a.push(t,r),null;const p=f*f+c*c,v=h*h+u*u,g=f*h+c*u,m=s*Math.sqrt(p)/d,b=s*Math.sqrt(v)/d,_=m*g/p,y=b*g/v,x=m*u+b*c,O=m*h+b*f,T=c*(b+_),E=f*(b+_),N=u*(m+y),A=h*(m+y),w=Math.atan2(E-O,T-x),S=Math.atan2(A-O,N-x);return{cx:x+t,cy:O+r,radius:s,startAngle:w,endAngle:S,anticlockwise:c*h>u*f}}static arc(t,r,n,i,s,a,o,l,f){const c=o-a,h=Rr._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/Bn)*40),u=c/(h*2),d=u*2,p=Math.cos(u),v=Math.sin(u),g=h-1,m=g%1/g;for(let b=0;b<=g;++b){const _=b+m*b,y=u+a+d*_,x=Math.cos(y),O=-Math.sin(y);f.push((p*x+v*O)*s+n,(p*-O+v*x)*s+i)}}}class Cm{constructor(){this.reset()}begin(t,r,n){this.reset(),this.style=t,this.start=r,this.attribStart=n}end(t,r){this.attribSize=r-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class ia{static curveLength(t,r,n,i,s,a,o,l){let c=0,h=0,u=0,d=0,p=0,v=0,g=0,m=0,b=0,_=0,y=0,x=t,O=r;for(let T=1;T<=10;++T)h=T/10,u=h*h,d=u*h,p=1-h,v=p*p,g=v*p,m=g*t+3*v*h*n+3*p*u*s+d*o,b=g*r+3*v*h*i+3*p*u*a+d*l,_=x-m,y=O-b,x=m,O=b,c+=Math.sqrt(_*_+y*y);return c}static curveTo(t,r,n,i,s,a,o){const l=o[o.length-2],f=o[o.length-1];o.length-=2;const c=Rr._segmentsCount(ia.curveLength(l,f,t,r,n,i,s,a));let h=0,u=0,d=0,p=0,v=0;o.push(l,f);for(let g=1,m=0;g<=c;++g)m=g/c,h=1-m,u=h*h,d=u*h,p=m*m,v=p*m,o.push(d*l+3*u*m*t+3*h*p*n+v*s,d*f+3*u*m*r+3*h*p*i+v*a)}}function ou(e,t,r,n,i,s,a,o){const l=e-r*i,f=t-n*i,c=e+r*s,h=t+n*s;let u,d;a?(u=n,d=-r):(u=-n,d=r);const p=l+u,v=f+d,g=c+u,m=h+d;return o.push(p,v,g,m),2}function rr(e,t,r,n,i,s,a,o){const l=r-e,f=n-t;let c=Math.atan2(l,f),h=Math.atan2(i-e,s-t);o&&c<h?c+=Math.PI*2:!o&&c>h&&(h+=Math.PI*2);let u=c;const d=h-c,p=Math.abs(d),v=Math.sqrt(l*l+f*f),g=(15*p*Math.sqrt(v)/Math.PI>>0)+1,m=d/g;if(u+=m,o){a.push(e,t,r,n);for(let b=1,_=u;b<g;b++,_+=m)a.push(e,t,e+Math.sin(_)*v,t+Math.cos(_)*v);a.push(e,t,i,s)}else{a.push(r,n,e,t);for(let b=1,_=u;b<g;b++,_+=m)a.push(e+Math.sin(_)*v,t+Math.cos(_)*v,e,t);a.push(i,s,e,t)}return g*2}function Pm(e,t){const r=e.shape;let n=e.points||r.points.slice();const i=t.closePointEps;if(n.length===0)return;const s=e.lineStyle,a=new Gt(n[0],n[1]),o=new Gt(n[n.length-2],n[n.length-1]),l=r.type!==qt.POLY||r.closeStroke,f=Math.abs(a.x-o.x)<i&&Math.abs(a.y-o.y)<i;if(l){n=n.slice(),f&&(n.pop(),n.pop(),o.set(n[n.length-2],n[n.length-1]));const U=(a.x+o.x)*.5,X=(o.y+a.y)*.5;n.unshift(U,X),n.push(U,X)}const c=t.points,h=n.length/2;let u=n.length;const d=c.length/2,p=s.width/2,v=p*p,g=s.miterLimit*s.miterLimit;let m=n[0],b=n[1],_=n[2],y=n[3],x=0,O=0,T=-(b-y),E=m-_,N=0,A=0,w=Math.sqrt(T*T+E*E);T/=w,E/=w,T*=p,E*=p;const S=s.alignment,I=(1-S)*2,C=S*2;l||(s.cap===er.ROUND?u+=rr(m-T*(I-C)*.5,b-E*(I-C)*.5,m-T*I,b-E*I,m+T*C,b+E*C,c,!0)+2:s.cap===er.SQUARE&&(u+=ou(m,b,T,E,I,C,!0,c))),c.push(m-T*I,b-E*I,m+T*C,b+E*C);for(let U=1;U<h-1;++U){m=n[(U-1)*2],b=n[(U-1)*2+1],_=n[U*2],y=n[U*2+1],x=n[(U+1)*2],O=n[(U+1)*2+1],T=-(b-y),E=m-_,w=Math.sqrt(T*T+E*E),T/=w,E/=w,T*=p,E*=p,N=-(y-O),A=_-x,w=Math.sqrt(N*N+A*A),N/=w,A/=w,N*=p,A*=p;const X=_-m,j=b-y,k=_-x,R=O-y,P=X*k+j*R,L=j*k-R*X,$=L<0;if(Math.abs(L)<.001*Math.abs(P)){c.push(_-T*I,y-E*I,_+T*C,y+E*C),P>=0&&(s.join===le.ROUND?u+=rr(_,y,_-T*I,y-E*I,_-N*I,y-A*I,c,!1)+4:u+=2,c.push(_-N*C,y-A*C,_+N*I,y+A*I));continue}const G=(-T+m)*(-E+y)-(-T+_)*(-E+b),M=(-N+x)*(-A+y)-(-N+_)*(-A+O),B=(X*M-k*G)/L,q=(R*G-j*M)/L,H=(B-_)*(B-_)+(q-y)*(q-y),z=_+(B-_)*I,Y=y+(q-y)*I,J=_-(B-_)*C,et=y-(q-y)*C,at=Math.min(X*X+j*j,k*k+R*R),lt=$?I:C,Nt=at+lt*lt*v,It=H<=Nt;let V=s.join;if(V===le.MITER&&H/v>g&&(V=le.BEVEL),It)switch(V){case le.MITER:{c.push(z,Y,J,et);break}case le.BEVEL:{$?c.push(z,Y,_+T*C,y+E*C,z,Y,_+N*C,y+A*C):c.push(_-T*I,y-E*I,J,et,_-N*I,y-A*I,J,et),u+=2;break}case le.ROUND:{$?(c.push(z,Y,_+T*C,y+E*C),u+=rr(_,y,_+T*C,y+E*C,_+N*C,y+A*C,c,!0)+4,c.push(z,Y,_+N*C,y+A*C)):(c.push(_-T*I,y-E*I,J,et),u+=rr(_,y,_-T*I,y-E*I,_-N*I,y-A*I,c,!1)+4,c.push(_-N*I,y-A*I,J,et));break}}else{switch(c.push(_-T*I,y-E*I,_+T*C,y+E*C),V){case le.MITER:{$?c.push(J,et,J,et):c.push(z,Y,z,Y),u+=2;break}case le.ROUND:{$?u+=rr(_,y,_+T*C,y+E*C,_+N*C,y+A*C,c,!0)+2:u+=rr(_,y,_-T*I,y-E*I,_-N*I,y-A*I,c,!1)+2;break}}c.push(_-N*I,y-A*I,_+N*C,y+A*C),u+=2}}m=n[(h-2)*2],b=n[(h-2)*2+1],_=n[(h-1)*2],y=n[(h-1)*2+1],T=-(b-y),E=m-_,w=Math.sqrt(T*T+E*E),T/=w,E/=w,T*=p,E*=p,c.push(_-T*I,y-E*I,_+T*C,y+E*C),l||(s.cap===er.ROUND?u+=rr(_-T*(I-C)*.5,y-E*(I-C)*.5,_-T*I,y-E*I,_+T*C,y+E*C,c,!1)+2:s.cap===er.SQUARE&&(u+=ou(_,y,T,E,I,C,!1,c)));const F=t.indices,D=Rr.epsilon*Rr.epsilon;for(let U=d;U<u+d-2;++U)m=c[U*2],b=c[U*2+1],_=c[(U+1)*2],y=c[(U+1)*2+1],x=c[(U+2)*2],O=c[(U+2)*2+1],!(Math.abs(m*(y-O)+_*(O-b)+x*(b-y))<D)&&F.push(U,U+1,U+2)}function km(e,t){let r=0;const n=e.shape,i=e.points||n.points,s=n.type!==qt.POLY||n.closeStroke;if(i.length===0)return;const a=t.points,o=t.indices,l=i.length/2,f=a.length/2;let c=f;for(a.push(i[0],i[1]),r=1;r<l;r++)a.push(i[r*2],i[r*2+1]),o.push(c,c+1),c++;s&&o.push(c,f)}function lu(e,t){e.lineStyle.native?km(e,t):Pm(e,t)}class sa{static curveLength(t,r,n,i,s,a){const o=t-2*n+s,l=r-2*i+a,f=2*n-2*t,c=2*i-2*r,h=4*(o*o+l*l),u=4*(o*f+l*c),d=f*f+c*c,p=2*Math.sqrt(h+u+d),v=Math.sqrt(h),g=2*h*v,m=2*Math.sqrt(d),b=u/v;return(g*p+v*u*(p-m)+(4*d*h-u*u)*Math.log((2*v+b+p)/(b+m)))/(4*g)}static curveTo(t,r,n,i,s){const a=s[s.length-2],o=s[s.length-1],l=Rr._segmentsCount(sa.curveLength(a,o,t,r,n,i));let f=0,c=0;for(let h=1;h<=l;++h){const u=h/l;f=a+(t-a)*u,c=o+(r-o)*u,s.push(f+(t+(n-t)*u-f)*u,c+(r+(i-r)*u-c)*u)}}}const aa={[qt.POLY]:su,[qt.CIRC]:li,[qt.ELIP]:li,[qt.RECT]:Rm,[qt.RREC]:Nm},uu=[],ui=[];class oa{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?At.EMPTY:(t=t||new At(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,r){const{a:n,b:i,c:s,d:a,tx:o,ty:l}=t,f=n*r.x+s*r.y+o,c=i*r.x+a*r.y+l;this.minX=Math.min(this.minX,f),this.maxX=Math.max(this.maxX,f),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let r=this.minX,n=this.minY,i=this.maxX,s=this.maxY,a=t[0],o=t[1];r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[2],o=t[3],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[4],o=t[5],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,a=t[6],o=t[7],r=a<r?a:r,n=o<n?o:n,i=a>i?a:i,s=o>s?o:s,this.minX=r,this.minY=n,this.maxX=i,this.maxY=s}addFrame(t,r,n,i,s){this.addFrameMatrix(t.worldTransform,r,n,i,s)}addFrameMatrix(t,r,n,i,s){const a=t.a,o=t.b,l=t.c,f=t.d,c=t.tx,h=t.ty;let u=this.minX,d=this.minY,p=this.maxX,v=this.maxY,g=a*r+l*n+c,m=o*r+f*n+h;u=g<u?g:u,d=m<d?m:d,p=g>p?g:p,v=m>v?m:v,g=a*i+l*n+c,m=o*i+f*n+h,u=g<u?g:u,d=m<d?m:d,p=g>p?g:p,v=m>v?m:v,g=a*r+l*s+c,m=o*r+f*s+h,u=g<u?g:u,d=m<d?m:d,p=g>p?g:p,v=m>v?m:v,g=a*i+l*s+c,m=o*i+f*s+h,u=g<u?g:u,d=m<d?m:d,p=g>p?g:p,v=m>v?m:v,this.minX=u,this.minY=d,this.maxX=p,this.maxY=v}addVertexData(t,r,n){let i=this.minX,s=this.minY,a=this.maxX,o=this.maxY;for(let l=r;l<n;l+=2){const f=t[l],c=t[l+1];i=f<i?f:i,s=c<s?c:s,a=f>a?f:a,o=c>o?c:o}this.minX=i,this.minY=s,this.maxX=a,this.maxY=o}addVertices(t,r,n,i){this.addVerticesMatrix(t.worldTransform,r,n,i)}addVerticesMatrix(t,r,n,i,s=0,a=s){const o=t.a,l=t.b,f=t.c,c=t.d,h=t.tx,u=t.ty;let d=this.minX,p=this.minY,v=this.maxX,g=this.maxY;for(let m=n;m<i;m+=2){const b=r[m],_=r[m+1],y=o*b+f*_+h,x=c*_+l*b+u;d=Math.min(d,y-s),v=Math.max(v,y+s),p=Math.min(p,x-a),g=Math.max(g,x+a)}this.minX=d,this.minY=p,this.maxX=v,this.maxY=g}addBounds(t){const r=this.minX,n=this.minY,i=this.maxX,s=this.maxY;this.minX=t.minX<r?t.minX:r,this.minY=t.minY<n?t.minY:n,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,r){const n=t.minX>r.minX?t.minX:r.minX,i=t.minY>r.minY?t.minY:r.minY,s=t.maxX<r.maxX?t.maxX:r.maxX,a=t.maxY<r.maxY?t.maxY:r.maxY;if(n<=s&&i<=a){const o=this.minX,l=this.minY,f=this.maxX,c=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=s>f?s:f,this.maxY=a>c?a:c}}addBoundsMatrix(t,r){this.addFrameMatrix(r,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,r){const n=t.minX>r.x?t.minX:r.x,i=t.minY>r.y?t.minY:r.y,s=t.maxX<r.x+r.width?t.maxX:r.x+r.width,a=t.maxY<r.y+r.height?t.maxY:r.y+r.height;if(n<=s&&i<=a){const o=this.minX,l=this.minY,f=this.maxX,c=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=s>f?s:f,this.maxY=a>c?a:c}}pad(t=0,r=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=r,this.maxY+=r)}addFramePad(t,r,n,i,s,a){t-=s,r-=a,n+=s,i+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>i?this.maxY:i}}class Nr extends yn{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Rs,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new oa,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const r=Object.keys(t);for(let n=0;n<r.length;++n){const i=r[n];Object.defineProperty(Nr.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,r){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new At),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new At),t=this._localBoundsRect),this._localBounds||(this._localBounds=new oa);const r=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-s,a}toGlobal(t,r,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,r)}toLocal(t,r,n,i){return r&&(t=r.toGlobal(t,n,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,n)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)}setTransform(t=0,r=0,n=1,i=1,s=0,a=0,o=0,l=0,f=0){return this.position.x=t,this.position.y=r,this.scale.x=n||1,this.scale.y=i||1,this.rotation=s,this.skew.x=a,this.skew.y=o,this.pivot.x=l,this.pivot.y=f,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new Mm),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*xd}set angle(t){this.transform.rotation=t*Ed}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=t,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class Mm extends Nr{constructor(){super(...arguments),this.sortDirty=null}}Nr.prototype.displayObjectUpdateTransform=Nr.prototype.updateTransform;const Lm=new zt;function Fm(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}const la=class extends Nr{constructor(){super(),this.children=[],this.sortableChildren=la.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(e){}addChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.addChild(e[t]);else{const t=e[0];t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this)}return e[0]}addChildAt(e,t){if(t<0||t>this.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const r=this.getChildIndex(e),n=this.getChildIndex(t);this.children[r]=t,this.children[n]=e,this.onChildrenChange(r<n?r:n)}getChildIndex(e){const t=this.children.indexOf(e);if(t===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return t}setChildIndex(e,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(e);kn(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t<e.length;t++)this.removeChild(e[t]);else{const t=e[0],r=this.children.indexOf(t);if(r===-1)return null;t.parent=null,t.transform._parentID=-1,kn(this.children,r,1),this._boundsID++,this.onChildrenChange(r),t.emit("removed",this),this.emit("childRemoved",t,this,r)}return e[0]}removeChildAt(e){const t=this.getChildAt(e);return t.parent=null,t.transform._parentID=-1,kn(this.children,e,1),this._boundsID++,this.onChildrenChange(e),t.emit("removed",this),this.emit("childRemoved",t,this,e),t}removeChildren(e=0,t=this.children.length){const r=e,n=t,i=n-r;let s;if(i>0&&i<=n){s=this.children.splice(r,i);for(let a=0;a<s.length;++a)s[a].parent=null,s[a].transform&&(s[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let a=0;a<s.length;++a)s[a].emit("removed",this),this.emit("childRemoved",s[a],this,a);return s}else if(i===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let e=!1;for(let t=0,r=this.children.length;t<r;++t){const n=this.children[t];n._lastSortedIndex=t,!e&&n.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(Fm),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e<t;++e){const r=this.children[e];r.visible&&r.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let e=0;e<this.children.length;e++){const t=this.children[e];if(!(!t.visible||!t.renderable))if(t.calculateBounds(),t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;r?(r.calculateBounds(),this._bounds.addBoundsMask(t._bounds,r._bounds)):this._bounds.addBounds(t._bounds)}else t.filterArea?this._bounds.addBoundsArea(t._bounds,t.filterArea):this._bounds.addBounds(t._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(e,t=!1){const r=super.getLocalBounds(e);if(!t)for(let n=0,i=this.children.length;n<i;++n){const s=this.children[n];s.visible&&s.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(e){const t=e.renderTexture.sourceFrame;if(!(t.width>0&&t.height>0))return;let r,n;this.cullArea?(r=this.cullArea,n=this.worldTransform):this._render!==la.prototype._render&&(r=this.getBounds(!0));const i=e.projection.transform;if(i&&(n?(n=Lm.copyFrom(n),n.prepend(i)):n=i),r&&t.intersects(r,n))this._render(e);else if(this.cullArea)return;for(let s=0,a=this.children.length;s<a;++s){const o=this.children[s],l=o.cullable;o.cullable=l||!this.cullArea,o.render(e),o.cullable=l}}render(e){var t;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(t=this.filters)!=null&&t.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(let r=0,n=this.children.length;r<n;++r)this.children[r].render(e)}}renderAdvanced(e){var i,s,a;const t=this.filters,r=this._mask;if(t){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let o=0;o<t.length;o++)t[o].enabled&&this._enabledFilters.push(t[o])}const n=t&&((i=this._enabledFilters)==null?void 0:i.length)||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Ut.NONE));if(n&&e.batch.flush(),t&&((s=this._enabledFilters)!=null&&s.length)&&e.filter.push(this,this._enabledFilters),r&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(let o=0,l=this.children.length;o<l;++o)this.children[o].render(e)}n&&e.batch.flush(),r&&e.mask.pop(this),t&&((a=this._enabledFilters)!=null&&a.length)&&e.filter.pop()}_render(e){}destroy(e){super.destroy(),this.sortDirty=!1;const t=typeof e=="boolean"?e:e==null?void 0:e.children,r=this.removeChildren(0,this.children.length);if(t)for(let n=0;n<r.length;++n)r[n].destroy(e)}get width(){return this.scale.x*this.getLocalBounds().width}set width(e){const t=this.getLocalBounds().width;t!==0?this.scale.x=e/t:this.scale.x=1,this._width=e}get height(){return this.scale.y*this.getLocalBounds().height}set height(e){const t=this.getLocalBounds().height;t!==0?this.scale.y=e/t:this.scale.y=1,this._height=e}};let Cr=la;Cr.defaultSortableChildren=!1,Cr.prototype.containerUpdateTransform=Cr.prototype.updateTransform,Object.defineProperties(mt,{SORTABLE_CHILDREN:{get(){return Cr.defaultSortableChildren},set(e){Tt("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Cr.defaultSortableChildren=e}}});class fi{constructor(t,r=null,n=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=n,this.fillStyle=r,this.matrix=i,this.type=t.type}clone(){return new fi(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const Pr=new Gt,fu=class extends zo{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new oa,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),ui.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t.reset(),uu.push(t)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,r=null,n=null){const i=new fi(e,t,r,n);return this.graphicsData.push(i),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const r=new fi(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=n.lineStyle,n.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(e){const t=this.graphicsData;for(let r=0;r<t.length;++r){const n=t[r];if(n.fillStyle.visible&&n.shape&&(n.matrix?n.matrix.applyInverse(e,Pr):Pr.copyFrom(e),n.shape.contains(Pr.x,Pr.y))){let i=!1;if(n.holes){for(let s=0;s<n.holes.length;s++)if(n.holes[s].shape.contains(Pr.x,Pr.y)){i=!0;break}}if(!i)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const e=this.uvs,t=this.graphicsData;let r=null,n=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],n=r.style);for(let o=this.shapeIndex;o<t.length;o++){this.shapeIndex++;const l=t[o],f=l.fillStyle,c=l.lineStyle;aa[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(f.visible||c.visible)&&this.processHoles(l.holes);for(let u=0;u<2;u++){const d=u===0?f:c;if(!d.visible)continue;const p=d.texture.baseTexture,v=this.indices.length,g=this.points.length/2;p.wrapMode=Dr.REPEAT,u===0?this.processFill(l):this.processLine(l);const m=this.points.length/2-g;m!==0&&(r&&!this._compareStyles(n,d)&&(r.end(v,g),r=null),r||(r=uu.pop()||new Cm,r.begin(d,v,g),this.batches.push(r),n=d),this.addUvs(this.points,e,d.texture,g,m,d.matrix))}}const i=this.indices.length,s=this.points.length/2;if(r&&r.end(i,s),this.batches.length===0){this.batchable=!0;return}const a=s>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e<t;e++){const r=this.graphicsData[e],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const e=this.batches;for(let t=0,r=e.length;t<r;t++){const n=e[t];for(let i=0;i<n.size;i++){const s=n.start+i;this.indicesUint16[s]=this.indicesUint16[s]-n.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<fu.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++_t._globalBatch;for(let c=0;c<this.drawCalls.length;c++)this.drawCalls[c].texArray.clear(),ui.push(this.drawCalls[c]);this.drawCalls.length=0;const t=this.colors,r=this.textureIds;let n=ui.pop();n||(n=new As,n.texArray=new Cs),n.texArray.count=0,n.start=0,n.size=0,n.type=Ce.TRIANGLES;let i=0,s=null,a=0,o=!1,l=Ce.TRIANGLES,f=0;this.drawCalls.push(n);for(let c=0;c<this.batches.length;c++){const h=this.batches[c],u=8,d=h.style,p=d.texture.baseTexture;o!==!!d.native&&(o=!!d.native,l=o?Ce.LINES:Ce.TRIANGLES,s=null,i=u,e++),s!==p&&(s=p,p._batchEnabled!==e&&(i===u&&(e++,i=0,n.size>0&&(n=ui.pop(),n||(n=new As,n.texArray=new Cs),this.drawCalls.push(n)),n.start=f,n.size=0,n.texArray.count=0,n.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=i,p.wrapMode=Dr.REPEAT,n.texArray.elements[n.texArray.count++]=p,i++)),n.size+=h.size,f+=h.size,a=p._batchLocation,this.addColors(t,d.color,d.alpha,h.attribSize,h.attribStart),this.addTextureIds(r,a,h.attribSize,h.attribStart)}_t._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,r=this.colors,n=this.textureIds,i=new ArrayBuffer(e.length*3*4),s=new Float32Array(i),a=new Uint32Array(i);let o=0;for(let l=0;l<e.length/2;l++)s[o++]=e[l*2],s[o++]=e[l*2+1],s[o++]=t[l*2],s[o++]=t[l*2+1],a[o++]=r[l],s[o++]=n[l];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?su.triangulate(e,this):aa[e.type].triangulate(e,this)}processLine(e){lu(e,this);for(let t=0;t<e.holes.length;t++)lu(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){const r=e[t];aa[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)}transformPoints(e,t){for(let r=0;r<e.length/2;r++){const n=e[r*2],i=e[r*2+1];e[r*2]=t.a*n+t.c*i+t.tx,e[r*2+1]=t.b*n+t.d*i+t.ty}}addColors(e,t,r,n,i=0){const s=Xt.shared.setValue(t).toLittleEndianNumber(),a=Xt.shared.setValue(s).toPremultiplied(r);e.length=Math.max(e.length,i+n);for(let o=0;o<n;o++)e[i+o]=a}addTextureIds(e,t,r,n=0){e.length=Math.max(e.length,n+r);for(let i=0;i<r;i++)e[n+i]=t}addUvs(e,t,r,n,i,s=null){let a=0;const o=t.length,l=r.frame;for(;a<i;){let c=e[(n+a)*2],h=e[(n+a)*2+1];if(s){const u=s.a*c+s.c*h+s.tx;h=s.b*c+s.d*h+s.ty,c=u}a++,t.push(c/l.width,h/l.height)}const f=r.baseTexture;(l.width<f.width||l.height<f.height)&&this.adjustUvs(t,r,o,i)}adjustUvs(e,t,r,n){const i=t.baseTexture,s=1e-6,a=r+n*2,o=t.frame,l=o.width/i.width,f=o.height/i.height;let c=o.x/o.width,h=o.y/o.height,u=Math.floor(e[r]+s),d=Math.floor(e[r+1]+s);for(let p=r+2;p<a;p+=2)u=Math.min(u,Math.floor(e[p]+s)),d=Math.min(d,Math.floor(e[p+1]+s));c-=u,h-=d;for(let p=r;p<a;p+=2)e[p]=(e[p]+c)*l,e[p+1]=(e[p+1]+h)*f}};let cu=fu;cu.BATCHABLE_SIZE=100;class ci{constructor(){this.color=16777215,this.alpha=1,this.texture=xt.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new ci;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=xt.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ua extends ci{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=er.BUTT,this.join=le.MITER,this.miterLimit=10}clone(){const t=new ua;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const fa={},hi=class extends Cr{constructor(e=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new ci,this._lineStyle=new ua,this._matrix=null,this._holeMode=!1,this.state=Ln.for2d(),this._geometry=e||new cu,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Xt(16777215),this.blendMode=ot.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new hi(this._geometry)}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(e=null,t=0,r,n=.5,i=!1){return typeof e=="number"&&(e={width:e,color:t,alpha:r,alignment:n,native:i}),this.lineTextureStyle(e)}lineTextureStyle(e){const t={width:0,texture:xt.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:er.BUTT,join:le.MITER,miterLimit:10};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const r=e.width>0&&e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:r},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new Zr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Zr,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,n=r[r.length-2],i=r[r.length-1];return(n!==e||i!==t)&&r.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,r,n){this._initCurve();const i=this.currentPath.points;return i.length===0&&this.moveTo(0,0),sa.curveTo(e,t,r,n,i),this}bezierCurveTo(e,t,r,n,i,s){return this._initCurve(),ia.curveTo(e,t,r,n,i,s,this.currentPath.points),this}arcTo(e,t,r,n,i){this._initCurve(e,t);const s=this.currentPath.points,a=au.curveTo(e,t,r,n,i,s);if(a){const{cx:o,cy:l,radius:f,startAngle:c,endAngle:h,anticlockwise:u}=a;this.arc(o,l,f,c,h,u)}return this}arc(e,t,r,n,i,s=!1){if(n===i)return this;if(!s&&i<=n?i+=Bn:s&&n<=i&&(n+=Bn),i-n===0)return this;const o=e+Math.cos(n)*r,l=t+Math.sin(n)*r,f=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const h=Math.abs(c[c.length-2]-o),u=Math.abs(c[c.length-1]-l);h<f&&u<f||c.push(o,l)}else this.moveTo(o,l),c=this.currentPath.points;return au.arc(o,l,e,t,r,n,i,s,c),this}beginFill(e=0,t){return this.beginTextureFill({texture:xt.WHITE,color:e,alpha:t})}normalizeColor(e){const t=Xt.shared.setValue(e.color??0);e.color=t.toNumber(),e.alpha??(e.alpha=t.alpha)}beginTextureFill(e){const t={texture:xt.WHITE,color:16777215,matrix:null};e=Object.assign(t,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const r=e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:r},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,r,n){return this.drawShape(new At(e,t,r,n))}drawRoundedRect(e,t,r,n,i){return this.drawShape(new Os(e,t,r,n,i))}drawCircle(e,t,r){return this.drawShape(new Ss(e,t,r))}drawEllipse(e,t,r,n){return this.drawShape(new Td(e,t,r,n))}drawPolygon(...e){let t,r=!0;const n=e[0];n.points?(r=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const i=new Zr(t);return i.closeStroke=r,this.drawShape(i),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===qt.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,r=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(e.points);for(let n=0;n<r;n++){const i=e.batches[n],s=i.style.color,a=new Float32Array(this.vertexData.buffer,i.attribStart*4*2,i.attribSize*2),o=new Float32Array(e.uvsFloat32.buffer,i.attribStart*4*2,i.attribSize*2),l=new Uint16Array(e.indicesUint16.buffer,i.start*2,i.size),f={vertexData:a,blendMode:t,indices:l,uvs:o,_batchRGB:Xt.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=f}}_renderBatched(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let t=0,r=this.batches.length;t<r;t++){const n=this.batches[t];n.worldAlpha=this.worldAlpha*n.alpha,e.plugins[this.pluginName].render(n)}}}_renderDirect(e){const t=this._resolveDirectShader(e),r=this._geometry,n=this.worldAlpha,i=t.uniforms,s=r.drawCalls;i.translationMatrix=this.transform.worldTransform,Xt.shared.setValue(this._tintColor).premultiply(n).toArray(i.tint),e.shader.bind(t),e.geometry.bind(r,t),e.state.set(this.state);for(let a=0,o=s.length;a<o;a++)this._renderDrawCallDirect(e,r.drawCalls[a])}_renderDrawCallDirect(e,t){const{texArray:r,type:n,size:i,start:s}=t,a=r.count;for(let o=0;o<a;o++)e.texture.bind(r.elements[o],o);e.geometry.draw(n,i,s)}_resolveDirectShader(e){let t=this.shader;const r=this.pluginName;if(!t){if(!fa[r]){const{maxTextures:n}=e.plugins[r],i=new Int32Array(n);for(let o=0;o<n;o++)i[o]=o;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new zt,default:ne.from({uSamplers:i},!0)},a=e.plugins[r]._shader.program;fa[r]=new Jr(a,s)}t=fa[r]}return t}_calculateBounds(){this.finishPoly();const e=this._geometry;if(!e.graphicsData.length)return;const{minX:t,minY:r,maxX:n,maxY:i}=e.bounds;this._bounds.addFrame(this.transform,t,r,n,i)}containsPoint(e){return this.worldTransform.applyInverse(e,hi._TEMP_POINT),this._geometry.containsPoint(hi._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t._tintRGB=Xt.shared.setValue(this._tintColor).multiply(t._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const e=this.transform._worldID;if(this._transformID===e)return;this._transformID=e;const t=this.transform.worldTransform,r=t.a,n=t.b,i=t.c,s=t.d,a=t.tx,o=t.ty,l=this._geometry.points,f=this.vertexData;let c=0;for(let h=0;h<l.length;h+=2){const u=l[h],d=l[h+1];f[c++]=r*u+i*d+a,f[c++]=s*d+n*u+o}}closePath(){const e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this}setMatrix(e){return this._matrix=e,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(e)}};let ca=hi;ca.curves=Rr,ca._TEMP_POINT=new Gt;var Bm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ha={},Um={get exports(){return ha},set exports(e){ha=e}};/*!
540
+ * d-path-parser - v1.0.0
541
+ * by Massimo Artizzu (MaxArt2501)
542
+ *
543
+ * https://github.com/MaxArt2501/d-path-parser
544
+ *
545
+ * Licensed under the MIT License
546
+ * See LICENSE for details
547
+ */(function(e,t){(function(r,n){e.exports=n()})(Bm,function(){return function(n){for(var i={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},s={number:function(v){return+d("number",v)},"coordinate pair":function(v){var g=d("number",v);if(g===null&&!v)return null;d("comma");var m=d("number",!0);return{x:+g,y:+m}},"arc definition":function(v){var g=s["coordinate pair"](v);if(!g&&!v)return null;d("comma");var m=+d("number",!0);d("comma",!0);var b=!!+d("flag",!0);d("comma");var _=!!+d("flag",!0);d("comma");var y=s["coordinate pair"](!0);return{radii:g,rotation:m,large:b,clockwise:_,end:y}}},a=0,o=[];a<n.length;){var l=d("command"),f=l.toUpperCase(),c=l!==f,h;switch(f){case"M":h=p("coordinate pair").map(function(v,g){return g===1&&(l=c?"l":"L"),u({end:v})});break;case"L":case"T":h=p("coordinate pair").map(function(v){return u({end:v})});break;case"C":if(h=p("coordinate pair"),h.length%3)throw Error("Expected coordinate pair triplet at position "+a);h=h.reduce(function(v,g,m){var b=m%3;if(!b)v.push(u({cp1:g}));else{var _=v[v.length-1];_[b===1?"cp2":"end"]=g}return v},[]);break;case"Q":case"S":if(h=p("coordinate pair"),h.length&1)throw Error("Expected coordinate pair couple at position "+a);h=h.reduce(function(v,g,m){var b=m&1;if(!b)v.push(u({cp:g}));else{var _=v[v.length-1];_.end=g}return v},[]);break;case"H":case"V":h=p("number").map(function(v){return u({value:v})});break;case"A":h=p("arc definition").map(u);break;case"Z":h=[{code:"Z"}];break}o.push.apply(o,h)}return o;function u(v){return v.code=l,v.relative=c,v}function d(v,g){i[v].lastIndex=a;var m=i[v].exec(n);if(!m||m.index!==a){if(!g)return null;throw Error("Expected "+v+" at position "+a)}return a=i[v].lastIndex,m[1]}function p(v){for(var g=[],m,b=!0;m=s[v](b);)g.push(m),b=!!d("comma");return g}}})})(Um);const Dm=/^\s+/,jm=/\s+$/;function it(e,t){if(e=e||"",t=t||{},e instanceof it)return e;if(!(this instanceof it))return new it(e,t);var r=$m(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}it.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,r,n,i,s,a;return t=e.r/255,r=e.g/255,n=e.b/255,t<=.03928?i=t/12.92:i=Math.pow((t+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*s+.0722*a},setAlpha:function(e){return this._a=mu(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=du(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=du(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=hu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=hu(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return pu(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Vm(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Rt(this._r,255)*100)+"%",g:Math.round(Rt(this._g,255)*100)+"%",b:Math.round(Rt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Rt(this._r,255)*100)+"%, "+Math.round(Rt(this._g,255)*100)+"%, "+Math.round(Rt(this._b,255)*100)+"%)":"rgba("+Math.round(Rt(this._r,255)*100)+"%, "+Math.round(Rt(this._g,255)*100)+"%, "+Math.round(Rt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ng[pu(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+vu(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=it(e);r="#"+vu(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return it(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(Ym,arguments)},brighten:function(){return this._applyModification(Km,arguments)},darken:function(){return this._applyModification(Zm,arguments)},desaturate:function(){return this._applyModification(zm,arguments)},saturate:function(){return this._applyModification(Xm,arguments)},greyscale:function(){return this._applyModification(Wm,arguments)},spin:function(){return this._applyModification(Qm,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(eg,arguments)},complement:function(){return this._applyCombination(Jm,arguments)},monochromatic:function(){return this._applyCombination(rg,arguments)},splitcomplement:function(){return this._applyCombination(tg,arguments)},triad:function(){return this._applyCombination(yu,[3])},tetrad:function(){return this._applyCombination(yu,[4])}},it.fromRatio=function(e,t){if(typeof e=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=ln(e[n]));e=r}return it(e,t)};function $m(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,a=!1,o=!1;return typeof e=="string"&&(e=og(e)),typeof e=="object"&&(Ie(e.r)&&Ie(e.g)&&Ie(e.b)?(t=Gm(e.r,e.g,e.b),a=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ie(e.h)&&Ie(e.s)&&Ie(e.v)?(n=ln(e.s),i=ln(e.v),t=Hm(e.h,n,i),a=!0,o="hsv"):Ie(e.h)&&Ie(e.s)&&Ie(e.l)&&(n=ln(e.s),s=ln(e.l),t=qm(e.h,n,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=mu(r),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function Gm(e,t,r){return{r:Rt(e,255)*255,g:Rt(t,255)*255,b:Rt(r,255)*255}}function hu(e,t,r){e=Rt(e,255),t=Rt(t,255),r=Rt(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,a,o=(n+i)/2;if(n==i)s=a=0;else{var l=n-i;switch(a=o>.5?l/(2-n-i):l/(n+i),n){case e:s=(t-r)/l+(t<r?6:0);break;case t:s=(r-e)/l+2;break;case r:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,l:o}}function qm(e,t,r){var n,i,s;e=Rt(e,360),t=Rt(t,100),r=Rt(r,100);function a(f,c,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?f+(c-f)*6*h:h<1/2?c:h<2/3?f+(c-f)*(2/3-h)*6:f}if(t===0)n=i=s=r;else{var o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;n=a(l,o,e+1/3),i=a(l,o,e),s=a(l,o,e-1/3)}return{r:n*255,g:i*255,b:s*255}}function du(e,t,r){e=Rt(e,255),t=Rt(t,255),r=Rt(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,a,o=n,l=n-i;if(a=n===0?0:l/n,n==i)s=0;else{switch(n){case e:s=(t-r)/l+(t<r?6:0);break;case t:s=(r-e)/l+2;break;case r:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,v:o}}function Hm(e,t,r){e=Rt(e,360)*6,t=Rt(t,100),r=Rt(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),a=r*(1-i*t),o=r*(1-(1-i)*t),l=n%6,f=[r,a,s,s,o,r][l],c=[o,r,r,a,s,s][l],h=[s,s,o,r,r,a][l];return{r:f*255,g:c*255,b:h*255}}function pu(e,t,r,n){var i=[ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Vm(e,t,r,n,i){var s=[ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(r).toString(16)),ue(gu(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function vu(e,t,r,n){var i=[ue(gu(n)),ue(Math.round(e).toString(16)),ue(Math.round(t).toString(16)),ue(Math.round(r).toString(16))];return i.join("")}it.equals=function(e,t){return!e||!t?!1:it(e).toRgbString()==it(t).toRgbString()},it.random=function(){return it.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function zm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.s-=t/100,r.s=di(r.s),it(r)}function Xm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.s+=t/100,r.s=di(r.s),it(r)}function Wm(e){return it(e).desaturate(100)}function Ym(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.l+=t/100,r.l=di(r.l),it(r)}function Km(e,t){t=t===0?0:t||10;var r=it(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),it(r)}function Zm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.l-=t/100,r.l=di(r.l),it(r)}function Qm(e,t){var r=it(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,it(r)}function Jm(e){var t=it(e).toHsl();return t.h=(t.h+180)%360,it(t)}function yu(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=it(e).toHsl(),n=[it(e)],i=360/t,s=1;s<t;s++)n.push(it({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function tg(e){var t=it(e).toHsl(),r=t.h;return[it(e),it({h:(r+72)%360,s:t.s,l:t.l}),it({h:(r+216)%360,s:t.s,l:t.l})]}function eg(e,t,r){t=t||6,r=r||30;var n=it(e).toHsl(),i=360/r,s=[it(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(it(n));return s}function rg(e,t){t=t||6;for(var r=it(e).toHsv(),n=r.h,i=r.s,s=r.v,a=[],o=1/t;t--;)a.push(it({h:n,s:i,v:s})),s=(s+o)%1;return a}it.mix=function(e,t,r){r=r===0?0:r||50;var n=it(e).toRgb(),i=it(t).toRgb(),s=r/100,a={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return it(a)},it.readability=function(e,t){var r=it(e),n=it(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},it.isReadable=function(e,t,r){var n=it.readability(e,t),i,s;switch(s=!1,i=lg(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s},it.mostReadable=function(e,t,r){var n=null,i=0,s,a,o,l;r=r||{},a=r.includeFallbackColors,o=r.level,l=r.size;for(var f=0;f<t.length;f++)s=it.readability(e,t[f]),s>i&&(i=s,n=it(t[f]));return it.isReadable(e,n,{level:o,size:l})||!a?n:(r.includeFallbackColors=!1,it.mostReadable(e,["#fff","#000"],r))};var da=it.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ng=it.hexNames=ig(da);function ig(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function mu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Rt(e,t){sg(e)&&(e="100%");var r=ag(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function di(e){return Math.min(1,Math.max(0,e))}function Kt(e){return parseInt(e,16)}function sg(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function ag(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ue(e){return e.length==1?"0"+e:""+e}function ln(e){return e<=1&&(e=e*100+"%"),e}function gu(e){return Math.round(parseFloat(e)*255).toString(16)}function bu(e){return Kt(e)/255}var fe=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ie(e){return!!fe.CSS_UNIT.exec(e)}function og(e){e=e.replace(Dm,"").replace(jm,"").toLowerCase();var t=!1;if(da[e])e=da[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=fe.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=fe.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=fe.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=fe.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=fe.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=fe.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=fe.hex8.exec(e))?{r:Kt(r[1]),g:Kt(r[2]),b:Kt(r[3]),a:bu(r[4]),format:t?"name":"hex8"}:(r=fe.hex6.exec(e))?{r:Kt(r[1]),g:Kt(r[2]),b:Kt(r[3]),format:t?"name":"hex"}:(r=fe.hex4.exec(e))?{r:Kt(r[1]+""+r[1]),g:Kt(r[2]+""+r[2]),b:Kt(r[3]+""+r[3]),a:bu(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=fe.hex3.exec(e))?{r:Kt(r[1]+""+r[1]),g:Kt(r[2]+""+r[2]),b:Kt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function lg(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}var ug=function(){function e(t,r){var n=[],i=!0,s=!1,a=void 0;try{for(var o=t[Symbol.iterator](),l;!(i=(l=o.next()).done)&&(n.push(l.value),!(r&&n.length===r));i=!0);}catch(f){s=!0,a=f}finally{try{!i&&o.return&&o.return()}finally{if(s)throw a}}return n}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),un=Math.PI*2,pa=function(t,r,n,i,s,a,o){var l=t.x,f=t.y;l*=r,f*=n;var c=i*l-s*f,h=s*l+i*f;return{x:c+a,y:h+o}},fg=function(t,r){var n=r===1.5707963267948966?.551915024494:r===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(r/4),i=Math.cos(t),s=Math.sin(t),a=Math.cos(t+r),o=Math.sin(t+r);return[{x:i-s*n,y:s+i*n},{x:a+o*n,y:o-a*n},{x:a,y:o}]},_u=function(t,r,n,i){var s=t*i-r*n<0?-1:1,a=t*n+r*i;return a>1&&(a=1),a<-1&&(a=-1),s*Math.acos(a)},cg=function(t,r,n,i,s,a,o,l,f,c,h,u){var d=Math.pow(s,2),p=Math.pow(a,2),v=Math.pow(h,2),g=Math.pow(u,2),m=d*p-d*g-p*v;m<0&&(m=0),m/=d*g+p*v,m=Math.sqrt(m)*(o===l?-1:1);var b=m*s/a*u,_=m*-a/s*h,y=c*b-f*_+(t+n)/2,x=f*b+c*_+(r+i)/2,O=(h-b)/s,T=(u-_)/a,E=(-h-b)/s,N=(-u-_)/a,A=_u(1,0,O,T),w=_u(O,T,E,N);return l===0&&w>0&&(w-=un),l===1&&w<0&&(w+=un),[y,x,A,w]},xu=function(t){var r=t.px,n=t.py,i=t.cx,s=t.cy,a=t.rx,o=t.ry,l=t.xAxisRotation,f=l===void 0?0:l,c=t.largeArcFlag,h=c===void 0?0:c,u=t.sweepFlag,d=u===void 0?0:u,p=[];if(a===0||o===0)return[];var v=Math.sin(f*un/360),g=Math.cos(f*un/360),m=g*(r-i)/2+v*(n-s)/2,b=-v*(r-i)/2+g*(n-s)/2;if(m===0&&b===0)return[];a=Math.abs(a),o=Math.abs(o);var _=Math.pow(m,2)/Math.pow(a,2)+Math.pow(b,2)/Math.pow(o,2);_>1&&(a*=Math.sqrt(_),o*=Math.sqrt(_));var y=cg(r,n,i,s,a,o,h,d,v,g,m,b),x=ug(y,4),O=x[0],T=x[1],E=x[2],N=x[3],A=Math.abs(N)/(un/4);Math.abs(1-A)<1e-7&&(A=1);var w=Math.max(Math.ceil(A),1);N/=w;for(var S=0;S<w;S++)p.push(fg(E,N)),E+=N;return p.map(function(I){var C=pa(I[0],a,o,g,v,O,T),F=C.x,D=C.y,U=pa(I[1],a,o,g,v,O,T),X=U.x,j=U.y,k=pa(I[2],a,o,g,v,O,T),R=k.x,P=k.y;return{x1:F,y1:D,x2:X,y2:j,x:R,y:P}})};class hg extends ca{constructor(t){super(),this.lineColor=null,t&&this.drawSVG(t)}drawSVG(t){if(typeof t=="string"){const r=document.createElement("div");r.innerHTML=t.trim(),t=r.querySelector("svg")}if(!t)throw new Error("Missing <svg> element in SVG constructor");return this._svgFill(t),this._svgChildren(t.children),this}_svgChildren(t,r=!1){for(let n=0;n<t.length;n++){const i=t[n];switch(this._svgFill(i,r),i.nodeName.toLowerCase()){case"path":{this._svgPath(i);break}case"circle":case"ellipse":{this._svgCircle(i);break}case"rect":{this._svgRect(i);break}case"polygon":{this._svgPoly(i,!0);break}case"polyline":{this._svgPoly(i);break}case"g":break;default:{console.info(`[PIXI.SVG] <${i.nodeName}> elements unsupported`);break}}this._svgChildren(i.children,!0)}}_hexToUint(t){if(t[0]==="#")return t=t.substr(1),t.length===3&&(t=t.replace(/([a-f0-9])/ig,"$1$1")),parseInt(t,16);const{r,g:n,b:i}=it(t).toRgb();return(r<<16)+(n<<8)+i}_svgCircle(t){let r="r",n="r";const i=t.nodeName==="elipse";i&&(r+="x",n+="y");const s=parseFloat(t.getAttribute(n)),a=parseFloat(t.getAttribute(r)),o=t.getAttribute("cx"),l=t.getAttribute("cy");let f=0,c=0;o!==null&&(f=parseFloat(o)),l!==null&&(c=parseFloat(l)),i?this.drawEllipse(f,c,s,a):this.drawCircle(f,c,s)}_svgRect(t){const r=parseFloat(t.getAttribute("x")),n=parseFloat(t.getAttribute("y")),i=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=parseFloat(t.getAttribute("rx"));a?this.drawRoundedRect(r,n,i,s,a):this.drawRect(r,n,i,s)}_convertStyleName(t){return t.trim().replace("-width","Width").replace(/.*-(line)?/,"")}_svgStyle(t){const r=t.getAttribute("style"),n=t.getAttribute("opacity"),i={fill:t.getAttribute("fill"),opacity:n||t.getAttribute("fill-opacity"),stroke:t.getAttribute("stroke"),strokeOpacity:n||t.getAttribute("stroke-opacity"),strokeWidth:t.getAttribute("stroke-width"),cap:t.getAttribute("stroke-linecap"),join:t.getAttribute("stroke-linejoin"),miterLimit:t.getAttribute("stroke-miterlimit")};return r!==null&&r.split(";").forEach(s=>{const[a,o]=s.split(":");if(a){const l=this._convertStyleName(a);i[l]||(i[l]=o.trim())}}),i}_svgPoly(t,r){const n=t.getAttribute("points").split(/[ ,]/g).map(i=>parseInt(i,10));this.drawPolygon(n),r&&this.closePath()}_svgFill(t,r){const{fill:n,opacity:i,stroke:s,strokeOpacity:a,strokeWidth:o,cap:l,join:f,miterLimit:c}=this._svgStyle(t),u=o!==null?parseFloat(o):s!==null?1:0,d=s!==null?this._hexToUint(s):this.lineColor;n?n==="none"?this.beginFill(0,0):this.beginFill(this._hexToUint(n),i!==null?parseFloat(i):1):r||this.beginFill(0),this.lineStyle({width:s===null&&o===null&&r?this.line.width:u,alpha:a===null?this.line.alpha:parseFloat(a),color:s===null&&r?this.line.color:d,cap:l===null&&r?this.line.cap:l,join:f===null&&r?this.line.join:f,miterLimit:c===null&&r?this.line.miterLimit:parseFloat(c)}),t.getAttribute("fill-rule")&&console.info('[PIXI.SVG] "fill-rule" attribute is not supported')}_svgPath(t){const r=t.getAttribute("d");let n=0,i=0;const s=ha(r.trim());for(let a=0;a<s.length;a++){const o=s[a];switch(o.code){case"m":{this.moveTo(n+=o.end.x,i+=o.end.y);break}case"M":{this.moveTo(n=o.end.x,i=o.end.y);break}case"H":{this.lineTo(n=o.value,i);break}case"h":{this.lineTo(n+=o.value,i);break}case"V":{this.lineTo(n,i=o.value);break}case"v":{this.lineTo(n,i+=o.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(n=o.end.x,i=o.end.y);break}case"l":{this.lineTo(n+=o.end.x,i+=o.end.y);break}case"C":{this.bezierCurveTo(o.cp1.x,o.cp1.y,o.cp2.x,o.cp2.y,n=o.end.x,i=o.end.y);break}case"c":{const l=n,f=i;this.bezierCurveTo(l+o.cp1.x,f+o.cp1.y,l+o.cp2.x,f+o.cp2.y,n+=o.end.x,i+=o.end.y);break}case"s":case"q":{const l=n,f=i;this.quadraticCurveTo(l+o.cp.x,f+o.cp.y,n+=o.end.x,i+=o.end.y);break}case"S":case"Q":{this.quadraticCurveTo(o.cp.x,o.cp.y,n=o.end.x,i=o.end.y);break}case"a":{xu({px:n,py:i,cx:n+=o.end.x,cy:i+=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:l,y1:f,x2:c,y2:h,x:u,y:d})=>this.bezierCurveTo(l,f,c,h,u,d));break}case"A":{xu({px:n,py:i,cx:n=o.end.x,cy:i=o.end.y,rx:o.radii.x,ry:o.radii.y,xAxisRotation:o.rotation,largeArcFlag:o.large?1:0,sweepFlag:o.clockwise?1:0}).forEach(({x1:l,y1:f,x2:c,y2:h,x:u,y:d})=>this.bezierCurveTo(l,f,c,h,u,d));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var pi={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},dg=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function pg(e){return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&dg.indexOf(e)>=0}function vg(e){switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function yg(e){return(e|32)===97}function kr(e){return e>=48&&e<=57}function mg(e){return e>=48&&e<=57||e===43||e===45||e===46}function gg(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function vi(e){for(;e.index<e.max&&pg(e.path.charCodeAt(e.index));)e.index++}function bg(e){var t=e.path.charCodeAt(e.index);if(t===48){e.param=0,e.index++;return}if(t===49){e.param=1,e.index++;return}e.err="SvgPath: arc flag can be 0 or 1 only (at pos "+e.index+")"}function _g(e){var t=e.index,r=t,n=e.max,i=!1,s=!1,a=!1,o=!1,l;if(r>=n){e.err="SvgPath: missed param (at pos "+r+")";return}if(l=e.path.charCodeAt(r),(l===43||l===45)&&(r++,l=r<n?e.path.charCodeAt(r):0),!kr(l)&&l!==46){e.err="SvgPath: param should start with 0..9 or `.` (at pos "+r+")";return}if(l!==46){if(i=l===48,r++,l=r<n?e.path.charCodeAt(r):0,i&&r<n&&l&&kr(l)){e.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+t+")";return}for(;r<n&&kr(e.path.charCodeAt(r));)r++,s=!0;l=r<n?e.path.charCodeAt(r):0}if(l===46){for(o=!0,r++;kr(e.path.charCodeAt(r));)r++,a=!0;l=r<n?e.path.charCodeAt(r):0}if(l===101||l===69){if(o&&!s&&!a){e.err="SvgPath: invalid float exponent (at pos "+r+")";return}if(r++,l=r<n?e.path.charCodeAt(r):0,(l===43||l===45)&&r++,r<n&&kr(e.path.charCodeAt(r)))for(;r<n&&kr(e.path.charCodeAt(r));)r++;else{e.err="SvgPath: invalid float exponent (at pos "+r+")";return}}e.index=r,e.param=parseFloat(e.path.slice(t,r))+0}function va(e){var t,r;t=e.path[e.segmentStart],r=t.toLowerCase();var n=e.data;if(r==="m"&&n.length>2&&(e.result.push([t,n[0],n[1]]),n=n.slice(2),r="l",t=t==="m"?"l":"L"),r==="r")e.result.push([t].concat(n));else for(;n.length>=pi[r]&&(e.result.push([t].concat(n.splice(0,pi[r]))),!!pi[r]););}function xg(e){var t=e.max,r,n,i,s,a;if(e.segmentStart=e.index,r=e.path.charCodeAt(e.index),n=yg(r),!vg(r)){e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")";return}if(s=pi[e.path[e.index].toLowerCase()],e.index++,vi(e),e.data=[],!s){va(e);return}for(i=!1;;){for(a=s;a>0;a--){if(n&&(a===3||a===4)?bg(e):_g(e),e.err.length){va(e);return}e.data.push(e.param),vi(e),i=!1,e.index<t&&e.path.charCodeAt(e.index)===44&&(e.index++,vi(e),i=!0)}if(!i&&(e.index>=e.max||!mg(e.path.charCodeAt(e.index))))break}va(e)}var Eg=function(t){var r=new gg(t),n=r.max;for(vi(r);r.index<n&&!r.err.length;)xg(r);return r.result.length&&("mM".indexOf(r.result[0][0])<0?(r.err="SvgPath: string should start with `M` or `m`",r.result=[]):r.result[0][0]="M"),{err:r.err,segments:r.result}};function Tg(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function ce(){if(!(this instanceof ce))return new ce;this.queue=[],this.cache=null}ce.prototype.matrix=function(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0?this:(this.cache=null,this.queue.push(e),this)},ce.prototype.translate=function(e,t){return(e!==0||t!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},ce.prototype.scale=function(e,t){return(e!==1||t!==1)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},ce.prototype.rotate=function(e,t,r){var n,i,s;return e!==0&&(this.translate(t,r),n=e*Math.PI/180,i=Math.cos(n),s=Math.sin(n),this.queue.push([i,s,-s,i,0,0]),this.cache=null,this.translate(-t,-r)),this},ce.prototype.skewX=function(e){return e!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(e*Math.PI/180),1,0,0])),this},ce.prototype.skewY=function(e){return e!==0&&(this.cache=null,this.queue.push([1,Math.tan(e*Math.PI/180),0,1,0,0])),this},ce.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var e=1;e<this.queue.length;e++)this.cache=Tg(this.cache,this.queue[e]);return this.cache},ce.prototype.calc=function(e,t,r){var n;return this.queue.length?(this.cache||(this.cache=this.toArray()),n=this.cache,[e*n[0]+t*n[2]+(r?0:n[4]),e*n[1]+t*n[3]+(r?0:n[5])]):[e,t]};var Eu=ce,wg=Eu,Ag={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},Sg=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,Og=/[\s,]+/,Ig=function(t){var r=new wg,n,i;return t.split(Sg).forEach(function(s){if(s.length){if(typeof Ag[s]<"u"){n=s;return}switch(i=s.split(Og).map(function(a){return+a||0}),n){case"matrix":i.length===6&&r.matrix(i);return;case"scale":i.length===1?r.scale(i[0],i[0]):i.length===2&&r.scale(i[0],i[1]);return;case"rotate":i.length===1?r.rotate(i[0],0,0):i.length===3&&r.rotate(i[0],i[1],i[2]);return;case"translate":i.length===1?r.translate(i[0],0):i.length===2&&r.translate(i[0],i[1]);return;case"skewX":i.length===1&&r.skewX(i[0]);return;case"skewY":i.length===1&&r.skewY(i[0]);return}}}),r},fn=Math.PI*2;function Tu(e,t,r,n){var i=e*n-t*r<0?-1:1,s=e*r+t*n;return s>1&&(s=1),s<-1&&(s=-1),i*Math.acos(s)}function Rg(e,t,r,n,i,s,a,o,l,f){var c=f*(e-r)/2+l*(t-n)/2,h=-l*(e-r)/2+f*(t-n)/2,u=a*a,d=o*o,p=c*c,v=h*h,g=u*d-u*v-d*p;g<0&&(g=0),g/=u*v+d*p,g=Math.sqrt(g)*(i===s?-1:1);var m=g*a/o*h,b=g*-o/a*c,_=f*m-l*b+(e+r)/2,y=l*m+f*b+(t+n)/2,x=(c-m)/a,O=(h-b)/o,T=(-c-m)/a,E=(-h-b)/o,N=Tu(1,0,x,O),A=Tu(x,O,T,E);return s===0&&A>0&&(A-=fn),s===1&&A<0&&(A+=fn),[_,y,N,A]}function Ng(e,t){var r=1.3333333333333333*Math.tan(t/4),n=Math.cos(e),i=Math.sin(e),s=Math.cos(e+t),a=Math.sin(e+t);return[n,i,n-i*r,i+n*r,s+a*r,a-s*r,s,a]}var Cg=function(t,r,n,i,s,a,o,l,f){var c=Math.sin(f*fn/360),h=Math.cos(f*fn/360),u=h*(t-n)/2+c*(r-i)/2,d=-c*(t-n)/2+h*(r-i)/2;if(u===0&&d===0)return[];if(o===0||l===0)return[];o=Math.abs(o),l=Math.abs(l);var p=u*u/(o*o)+d*d/(l*l);p>1&&(o*=Math.sqrt(p),l*=Math.sqrt(p));var v=Rg(t,r,n,i,s,a,o,l,c,h),g=[],m=v[2],b=v[3],_=Math.max(Math.ceil(Math.abs(b)/(fn/4)),1);b/=_;for(var y=0;y<_;y++)g.push(Ng(m,b)),m+=b;return g.map(function(x){for(var O=0;O<x.length;O+=2){var T=x[O+0],E=x[O+1];T*=o,E*=l;var N=h*T-c*E,A=c*T+h*E;x[O+0]=N+v[0],x[O+1]=A+v[1]}return x})},cn=1e-10,wu=Math.PI/180;function hn(e,t,r){if(!(this instanceof hn))return new hn(e,t,r);this.rx=e,this.ry=t,this.ax=r}hn.prototype.transform=function(e){var t=Math.cos(this.ax*wu),r=Math.sin(this.ax*wu),n=[this.rx*(e[0]*t+e[2]*r),this.rx*(e[1]*t+e[3]*r),this.ry*(-e[0]*r+e[2]*t),this.ry*(-e[1]*r+e[3]*t)],i=n[0]*n[0]+n[2]*n[2],s=n[1]*n[1]+n[3]*n[3],a=((n[0]-n[3])*(n[0]-n[3])+(n[2]+n[1])*(n[2]+n[1]))*((n[0]+n[3])*(n[0]+n[3])+(n[2]-n[1])*(n[2]-n[1])),o=(i+s)/2;if(a<cn*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var l=n[0]*n[1]+n[2]*n[3];a=Math.sqrt(a);var f=o+a/2,c=o-a/2;return this.ax=Math.abs(l)<cn&&Math.abs(f-s)<cn?90:Math.atan(Math.abs(l)>Math.abs(f-s)?(f-i)/l:l/(f-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(f),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(f)),this},hn.prototype.isDegenerate=function(){return this.rx<cn*this.ry||this.ry<cn*this.rx};var Pg=hn,kg=Eg,Mg=Ig,Ue=Eu,Lg=Cg,Fg=Pg;function Mt(e){if(!(this instanceof Mt))return new Mt(e);var t=kg(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}Mt.from=function(e){if(typeof e=="string")return new Mt(e);if(e instanceof Mt){var t=new Mt("");return t.err=e.err,t.segments=e.segments.map(function(r){return r.slice()}),t.__stack=e.__stack.map(function(r){return Ue().matrix(r.toArray())}),t}throw new Error("SvgPath.from: invalid param type "+e)},Mt.prototype.__matrix=function(e){var t=this,r;e.queue.length&&this.iterate(function(n,i,s,a){var o,l,f,c;switch(n[0]){case"v":o=e.calc(0,n[1],!0),l=o[0]===0?["v",o[1]]:["l",o[0],o[1]];break;case"V":o=e.calc(s,n[1],!1),l=o[0]===e.calc(s,a,!1)[0]?["V",o[1]]:["L",o[0],o[1]];break;case"h":o=e.calc(n[1],0,!0),l=o[1]===0?["h",o[0]]:["l",o[0],o[1]];break;case"H":o=e.calc(n[1],a,!1),l=o[1]===e.calc(s,a,!1)[1]?["H",o[0]]:["L",o[0],o[1]];break;case"a":case"A":var h=e.toArray(),u=Fg(n[1],n[2],n[3]).transform(h);if(h[0]*h[3]-h[1]*h[2]<0&&(n[5]=n[5]?"0":"1"),o=e.calc(n[6],n[7],n[0]==="a"),n[0]==="A"&&n[6]===s&&n[7]===a||n[0]==="a"&&n[6]===0&&n[7]===0){l=[n[0]==="a"?"l":"L",o[0],o[1]];break}u.isDegenerate()?l=[n[0]==="a"?"l":"L",o[0],o[1]]:l=[n[0],u.rx,u.ry,u.ax,n[4],n[5],o[0],o[1]];break;case"m":c=i>0,o=e.calc(n[1],n[2],c),l=["m",o[0],o[1]];break;default:for(f=n[0],l=[f],c=f.toLowerCase()===f,r=1;r<n.length;r+=2)o=e.calc(n[r],n[r+1],c),l.push(o[0],o[1])}t.segments[i]=l},!0)},Mt.prototype.__evaluateStack=function(){var e,t;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(e=Ue(),t=this.__stack.length;--t>=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},Mt.prototype.toString=function(){var e="",t="",r=!1;this.__evaluateStack();for(var n=0,i=this.segments.length;n<i;n++){var s=this.segments[n],a=s[0];a!==t||a==="m"||a==="M"?(a==="m"&&t==="z"&&(e+=" "),e+=a,r=!1):r=!0;for(var o=1;o<s.length;o++){var l=s[o];o===1?r&&l>=0&&(e+=" "):l>=0&&(e+=" "),e+=l}t=a}return e},Mt.prototype.translate=function(e,t){return this.__stack.push(Ue().translate(e,t||0)),this},Mt.prototype.scale=function(e,t){return this.__stack.push(Ue().scale(e,!t&&t!==0?e:t)),this},Mt.prototype.rotate=function(e,t,r){return this.__stack.push(Ue().rotate(e,t||0,r||0)),this},Mt.prototype.skewX=function(e){return this.__stack.push(Ue().skewX(e)),this},Mt.prototype.skewY=function(e){return this.__stack.push(Ue().skewY(e)),this},Mt.prototype.matrix=function(e){return this.__stack.push(Ue().matrix(e)),this},Mt.prototype.transform=function(e){return e.trim()?(this.__stack.push(Mg(e)),this):this},Mt.prototype.round=function(e){var t=0,r=0,n=0,i=0,s;return e=e||0,this.__evaluateStack(),this.segments.forEach(function(a){var o=a[0].toLowerCase()===a[0];switch(a[0]){case"H":case"h":o&&(a[1]+=n),n=a[1]-a[1].toFixed(e),a[1]=+a[1].toFixed(e);return;case"V":case"v":o&&(a[1]+=i),i=a[1]-a[1].toFixed(e),a[1]=+a[1].toFixed(e);return;case"Z":case"z":n=t,i=r;return;case"M":case"m":o&&(a[1]+=n,a[2]+=i),n=a[1]-a[1].toFixed(e),i=a[2]-a[2].toFixed(e),t=n,r=i,a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e);return;case"A":case"a":o&&(a[6]+=n,a[7]+=i),n=a[6]-a[6].toFixed(e),i=a[7]-a[7].toFixed(e),a[1]=+a[1].toFixed(e),a[2]=+a[2].toFixed(e),a[3]=+a[3].toFixed(e+2),a[6]=+a[6].toFixed(e),a[7]=+a[7].toFixed(e);return;default:s=a.length,o&&(a[s-2]+=n,a[s-1]+=i),n=a[s-2]-a[s-2].toFixed(e),i=a[s-1]-a[s-1].toFixed(e),a.forEach(function(l,f){f&&(a[f]=+a[f].toFixed(e))});return}}),this},Mt.prototype.iterate=function(e,t){var r=this.segments,n={},i=!1,s=0,a=0,o=0,l=0,f,c,h;if(t||this.__evaluateStack(),r.forEach(function(u,d){var p=e(u,d,s,a);Array.isArray(p)&&(n[d]=p,i=!0);var v=u[0]===u[0].toLowerCase();switch(u[0]){case"m":case"M":s=u[1]+(v?s:0),a=u[2]+(v?a:0),o=s,l=a;return;case"h":case"H":s=u[1]+(v?s:0);return;case"v":case"V":a=u[1]+(v?a:0);return;case"z":case"Z":s=o,a=l;return;default:s=u[u.length-2]+(v?s:0),a=u[u.length-1]+(v?a:0)}}),!i)return this;for(h=[],f=0;f<r.length;f++)if(typeof n[f]<"u")for(c=0;c<n[f].length;c++)h.push(n[f][c]);else h.push(r[f]);return this.segments=h,this},Mt.prototype.abs=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toUpperCase(),a;if(i!==s)switch(e[0]=s,i){case"v":e[1]+=n;return;case"a":e[6]+=r,e[7]+=n;return;default:for(a=1;a<e.length;a++)e[a]+=a%2?r:n}},!0),this},Mt.prototype.rel=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toLowerCase(),a;if(i!==s&&!(t===0&&i==="M"))switch(e[0]=s,i){case"V":e[1]-=n;return;case"A":e[6]-=r,e[7]-=n;return;default:for(a=1;a<e.length;a++)e[a]-=a%2?r:n}},!0),this},Mt.prototype.unarc=function(){return this.iterate(function(e,t,r,n){var i,s,a,o=[],l=e[0];return l!=="A"&&l!=="a"?null:(l==="a"?(s=r+e[6],a=n+e[7]):(s=e[6],a=e[7]),i=Lg(r,n,s,a,e[4],e[5],e[1],e[2],e[3]),i.length===0?[[e[0]==="a"?"l":"L",e[6],e[7]]]:(i.forEach(function(f){o.push(["C",f[2],f[3],f[4],f[5],f[6],f[7]])}),o))}),this},Mt.prototype.unshort=function(){var e=this.segments,t,r,n,i,s;return this.iterate(function(a,o,l,f){var c=a[0],h=c.toUpperCase(),u;o&&(h==="T"?(u=c==="t",n=e[o-1],n[0]==="Q"?(t=n[1]-l,r=n[2]-f):n[0]==="q"?(t=n[1]-n[3],r=n[2]-n[4]):(t=0,r=0),i=-t,s=-r,u||(i+=l,s+=f),e[o]=[u?"q":"Q",i,s,a[1],a[2]]):h==="S"&&(u=c==="s",n=e[o-1],n[0]==="C"?(t=n[3]-l,r=n[4]-f):n[0]==="c"?(t=n[3]-n[5],r=n[4]-n[6]):(t=0,r=0),i=-t,s=-r,u||(i+=l,s+=f),e[o]=[u?"c":"C",i,s,a[1],a[2],a[3],a[4]]))}),this};var Bg=Mt,Ug=Bg;const Dg=ir(Ug),jg=e=>{const[t,r]=st.useState(null),n=Q.useRef(null),i=Q.useRef(null),s=Q.useRef(null),{path:a,transformation:{x:o,y:l,width:f,height:c,anchor:h,fill:u,stroke:d="none",strokeWidth:p=0},pointerdown:v,pointerup:g}=e,m=yt.useApp();return st.useEffect(()=>{const b=Dg(a).scale(5).translate(0,0).toString(),_=`<svg xmlns="http://www.w3.org/2000/svg" width="${f}" height="${c}">
548
+ <path stroke="${d}" stroke-width="${p}" fill="${u}" d="${b}">
549
+ </path>
550
+ </svg>`,y=new hg(_),x=m.renderer.generateTexture(y);return r(x),()=>{}},[m,a,d,p,u]),dt.jsx(oi,{...e,children:dt.jsx(yt.Container,{ref:i,children:dt.jsx(yt.Container,{ref:s,children:t&&dt.jsx(yt.Sprite,{texture:t,width:f,height:c,anchor:h,ref:n,x:o,y:l,interactive:!0,pointerdown:v,pointerup:g})})})})},$g=e=>{const t={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=st.useState(!1),n=Q.useRef(t);console.log("allProps",e);const i=Q.useRef(null),s=Q.useRef(null),{tl:a,playerTimeRef:o}=Q.useContext(Sr),{uniqueId:l,src:f,startAt:c,endAt:h,mute:u,speed:d}=e,p=st.useRef(null);nn(ge.PAUSE,()=>{var y;console.log("pause event"),i.current&&((y=p.current)==null||y.pause(),n.current.isPlaying=!1)});const v=y=>{var x;i.current&&(console.log("audio gsapOnStart",y),o.current>=y&&o.current<=h&&((x=p.current)==null||x.play({volume:u?0:1,start:y,end:h,speed:d||1}),n.current.isPlaying=!0,n.current.completed=!1))},g=()=>{var y;i.current&&(console.log("audio gsapOnStart",c),(y=p.current)==null||y.stop(),n.current.isPlaying=!1,n.current.completed=!0)},m=y=>{var x,O,T;i.current&&!n.current.isPlaying&&!n.current.completed&&(console.log("audio gsapOnUpdate",y),(x=p.current)==null||x.refresh(),(O=p.current)==null||O.refreshPaused(),(T=p.current)==null||T.resume(),n.current.isPlaying=!0)},b=()=>{};Q.useEffect(()=>{let y=he.context(()=>{});if(i.current&&a.current){const x={duration:Number(h)-Number(c),onStart:v,onComplete:g,onStartParams:[c],onCompleteParams:[],onInterrupt:b,onUpdate:m,onUpdateParams:[]};y=he.context(()=>{a.current.to(i.current,{alpha:1,duration:.01},c).from(s.current,{...x},c).to(i.current,{alpha:0,duration:.1},Number(h)-.1)})}return()=>y.revert()},[c,h]),st.useEffect(()=>{i.current&&r(!0)},[]),st.useEffect(()=>{i.current&&p.current&&(console.log("soundref",p.current),n.current.mute=u,n.current.speed=d,console.log("containerAudio",p.current.volume),p.current.volume=u?0:1)},[u,d]);const _=st.useCallback((y,x)=>{p.current=x,n.current.loaded=!0},[]);return st.useEffect(()=>(Jt(f)||(p.current=vf.Sound.from({url:f,preload:!0,singleInstance:!0,loaded:_})),()=>{}),[l,f,_]),dt.jsx(yt.Container,{ref:i})};function Gg(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Au=Gg;function qg(){this.__data__=[],this.size=0}var Hg=qg;function Vg(e,t){return e===t||e!==e&&t!==t}var Su=Vg,zg=Su;function Xg(e,t){for(var r=e.length;r--;)if(zg(e[r][0],t))return r;return-1}var yi=Xg,Wg=yi,Yg=Array.prototype,Kg=Yg.splice;function Zg(e){var t=this.__data__,r=Wg(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Kg.call(t,r,1),--this.size,!0}var Qg=Zg,Jg=yi;function t0(e){var t=this.__data__,r=Jg(t,e);return r<0?void 0:t[r][1]}var e0=t0,r0=yi;function n0(e){return r0(this.__data__,e)>-1}var i0=n0,s0=yi;function a0(e,t){var r=this.__data__,n=s0(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var o0=a0,l0=Hg,u0=Qg,f0=e0,c0=i0,h0=o0;function Mr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Mr.prototype.clear=l0,Mr.prototype.delete=u0,Mr.prototype.get=f0,Mr.prototype.has=c0,Mr.prototype.set=h0;var mi=Mr,d0=mi;function p0(){this.__data__=new d0,this.size=0}var v0=p0;function y0(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var m0=y0;function g0(e){return this.__data__.get(e)}var b0=g0;function _0(e){return this.__data__.has(e)}var x0=_0,E0=Or,T0=E0(Object,"create"),gi=T0,Ou=gi;function w0(){this.__data__=Ou?Ou(null):{},this.size=0}var A0=w0;function S0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var O0=S0,I0=gi,R0="__lodash_hash_undefined__",N0=Object.prototype,C0=N0.hasOwnProperty;function P0(e){var t=this.__data__;if(I0){var r=t[e];return r===R0?void 0:r}return C0.call(t,e)?t[e]:void 0}var k0=P0,M0=gi,L0=Object.prototype,F0=L0.hasOwnProperty;function B0(e){var t=this.__data__;return M0?t[e]!==void 0:F0.call(t,e)}var U0=B0,D0=gi,j0="__lodash_hash_undefined__";function $0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=D0&&t===void 0?j0:t,this}var G0=$0,q0=A0,H0=O0,V0=k0,z0=U0,X0=G0;function Lr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Lr.prototype.clear=q0,Lr.prototype.delete=H0,Lr.prototype.get=V0,Lr.prototype.has=z0,Lr.prototype.set=X0;var W0=Lr,Iu=W0,Y0=mi,K0=Ws;function Z0(){this.size=0,this.__data__={hash:new Iu,map:new(K0||Y0),string:new Iu}}var Q0=Z0;function J0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var tb=J0,eb=tb;function rb(e,t){var r=e.__data__;return eb(t)?r[typeof t=="string"?"string":"hash"]:r.map}var bi=rb,nb=bi;function ib(e){var t=nb(this,e).delete(e);return this.size-=t?1:0,t}var sb=ib,ab=bi;function ob(e){return ab(this,e).get(e)}var lb=ob,ub=bi;function fb(e){return ub(this,e).has(e)}var cb=fb,hb=bi;function db(e,t){var r=hb(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var pb=db,vb=Q0,yb=sb,mb=lb,gb=cb,bb=pb;function Fr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Fr.prototype.clear=vb,Fr.prototype.delete=yb,Fr.prototype.get=mb,Fr.prototype.has=gb,Fr.prototype.set=bb;var ya=Fr,_b=mi,xb=Ws,Eb=ya,Tb=200;function wb(e,t){var r=this.__data__;if(r instanceof _b){var n=r.__data__;if(!xb||n.length<Tb-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Eb(n)}return r.set(e,t),this.size=r.size,this}var Ab=wb,Sb=mi,Ob=v0,Ib=m0,Rb=b0,Nb=x0,Cb=Ab;function Br(e){var t=this.__data__=new Sb(e);this.size=t.size}Br.prototype.clear=Ob,Br.prototype.delete=Ib,Br.prototype.get=Rb,Br.prototype.has=Nb,Br.prototype.set=Cb;var Ru=Br,Pb="__lodash_hash_undefined__";function kb(e){return this.__data__.set(e,Pb),this}var Mb=kb;function Lb(e){return this.__data__.has(e)}var Fb=Lb,Bb=ya,Ub=Mb,Db=Fb;function _i(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Bb;++t<r;)this.add(e[t])}_i.prototype.add=_i.prototype.push=Ub,_i.prototype.has=Db;var jb=_i;function $b(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Gb=$b;function qb(e,t){return e.has(t)}var Hb=qb,Vb=jb,zb=Gb,Xb=Hb,Wb=1,Yb=2;function Kb(e,t,r,n,i,s){var a=r&Wb,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var f=s.get(e),c=s.get(t);if(f&&c)return f==t&&c==e;var h=-1,u=!0,d=r&Yb?new Vb:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],v=t[h];if(n)var g=a?n(v,p,h,t,e,s):n(p,v,h,e,t,s);if(g!==void 0){if(g)continue;u=!1;break}if(d){if(!zb(t,function(m,b){if(!Xb(d,b)&&(p===m||i(p,m,r,n,s)))return d.push(b)})){u=!1;break}}else if(!(p===v||i(p,v,r,n,s))){u=!1;break}}return s.delete(e),s.delete(t),u}var Nu=Kb,Zb=Oe,Qb=Zb.Uint8Array,Jb=Qb;function t1(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var e1=t1;function r1(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var n1=r1,Cu=ni,Pu=Jb,i1=Su,s1=Nu,a1=e1,o1=n1,l1=1,u1=2,f1="[object Boolean]",c1="[object Date]",h1="[object Error]",d1="[object Map]",p1="[object Number]",v1="[object RegExp]",y1="[object Set]",m1="[object String]",g1="[object Symbol]",b1="[object ArrayBuffer]",_1="[object DataView]",ku=Cu?Cu.prototype:void 0,ma=ku?ku.valueOf:void 0;function x1(e,t,r,n,i,s,a){switch(r){case _1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b1:return!(e.byteLength!=t.byteLength||!s(new Pu(e),new Pu(t)));case f1:case c1:case p1:return i1(+e,+t);case h1:return e.name==t.name&&e.message==t.message;case v1:case m1:return e==t+"";case d1:var o=a1;case y1:var l=n&l1;if(o||(o=o1),e.size!=t.size&&!l)return!1;var f=a.get(e);if(f)return f==t;n|=u1,a.set(e,t);var c=s1(o(e),o(t),n,i,s,a);return a.delete(e),c;case g1:if(ma)return ma.call(e)==ma.call(t)}return!1}var E1=x1;function T1(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var w1=T1,A1=w1,S1=be;function O1(e,t,r){var n=t(e);return S1(e)?n:A1(n,r(e))}var I1=O1;function R1(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}var N1=R1;function C1(){return[]}var P1=C1,k1=N1,M1=P1,L1=Object.prototype,F1=L1.propertyIsEnumerable,Mu=Object.getOwnPropertySymbols,B1=Mu?function(e){return e==null?[]:(e=Object(e),k1(Mu(e),function(t){return F1.call(e,t)}))}:M1,U1=B1;function D1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var j1=D1,$1=9007199254740991,G1=/^(?:0|[1-9]\d*)$/;function q1(e,t){var r=typeof e;return t=t??$1,!!t&&(r=="number"||r!="symbol"&&G1.test(e))&&e>-1&&e%1==0&&e<t}var Lu=q1,H1=j1,V1=ta,z1=be,X1=ra,W1=Lu,Y1=na,K1=Object.prototype,Z1=K1.hasOwnProperty;function Q1(e,t){var r=z1(e),n=!r&&V1(e),i=!r&&!n&&X1(e),s=!r&&!n&&!i&&Y1(e),a=r||n||i||s,o=a?H1(e.length,String):[],l=o.length;for(var f in e)(t||Z1.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||W1(f,l)))&&o.push(f);return o}var J1=Q1,t_=J1,e_=Ul,r_=ii;function n_(e){return r_(e)?t_(e):e_(e)}var ga=n_,i_=I1,s_=U1,a_=ga;function o_(e){return i_(e,a_,s_)}var l_=o_,Fu=l_,u_=1,f_=Object.prototype,c_=f_.hasOwnProperty;function h_(e,t,r,n,i,s){var a=r&u_,o=Fu(e),l=o.length,f=Fu(t),c=f.length;if(l!=c&&!a)return!1;for(var h=l;h--;){var u=o[h];if(!(a?u in t:c_.call(t,u)))return!1}var d=s.get(e),p=s.get(t);if(d&&p)return d==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<l;){u=o[h];var m=e[u],b=t[u];if(n)var _=a?n(b,m,u,t,e,s):n(m,b,u,e,t,s);if(!(_===void 0?m===b||i(m,b,r,n,s):_)){v=!1;break}g||(g=u=="constructor")}if(v&&!g){var y=e.constructor,x=t.constructor;y!=x&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof x=="function"&&x instanceof x)&&(v=!1)}return s.delete(e),s.delete(t),v}var d_=h_,ba=Ru,p_=Nu,v_=E1,y_=d_,Bu=Jl,Uu=be,Du=ra,m_=na,g_=1,ju="[object Arguments]",$u="[object Array]",xi="[object Object]",b_=Object.prototype,Gu=b_.hasOwnProperty;function __(e,t,r,n,i,s){var a=Uu(e),o=Uu(t),l=a?$u:Bu(e),f=o?$u:Bu(t);l=l==ju?xi:l,f=f==ju?xi:f;var c=l==xi,h=f==xi,u=l==f;if(u&&Du(e)){if(!Du(t))return!1;a=!0,c=!1}if(u&&!c)return s||(s=new ba),a||m_(e)?p_(e,t,r,n,i,s):v_(e,t,l,r,n,i,s);if(!(r&g_)){var d=c&&Gu.call(e,"__wrapped__"),p=h&&Gu.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,g=p?t.value():t;return s||(s=new ba),i(v,g,r,n,s)}}return u?(s||(s=new ba),y_(e,t,r,n,i,s)):!1}var x_=__,E_=x_,qu=on;function Hu(e,t,r,n,i){return e===t?!0:e==null||t==null||!qu(e)&&!qu(t)?e!==e&&t!==t:E_(e,t,r,n,Hu,i)}var Vu=Hu,T_=Ru,w_=Vu,A_=1,S_=2;function O_(e,t,r,n){var i=r.length,s=i,a=!n;if(e==null)return!s;for(e=Object(e);i--;){var o=r[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=r[i];var l=o[0],f=e[l],c=o[1];if(a&&o[2]){if(f===void 0&&!(l in e))return!1}else{var h=new T_;if(n)var u=n(f,c,l,e,t,h);if(!(u===void 0?w_(c,f,A_|S_,n,h):u))return!1}}return!0}var I_=O_,R_=zs;function N_(e){return e===e&&!R_(e)}var zu=N_,C_=zu,P_=ga;function k_(e){for(var t=P_(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,C_(i)]}return t}var M_=k_;function L_(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Xu=L_,F_=I_,B_=M_,U_=Xu;function D_(e){var t=B_(e);return t.length==1&&t[0][2]?U_(t[0][0],t[0][1]):function(r){return r===e||F_(r,e,t)}}var j_=D_,$_=an,G_=on,q_="[object Symbol]";function H_(e){return typeof e=="symbol"||G_(e)&&$_(e)==q_}var _a=H_,V_=be,z_=_a,X_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W_=/^\w*$/;function Y_(e,t){if(V_(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||z_(e)?!0:W_.test(e)||!X_.test(e)||t!=null&&e in Object(t)}var xa=Y_,Wu=ya,K_="Expected a function";function Ea(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(K_);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(Ea.Cache||Wu),r}Ea.Cache=Wu;var Z_=Ea,Q_=Z_,J_=500;function tx(e){var t=Q_(e,function(n){return r.size===J_&&r.clear(),n}),r=t.cache;return t}var ex=tx,rx=ex,nx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ix=/\\(\\)?/g,sx=rx(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(nx,function(r,n,i,s){t.push(i?s.replace(ix,"$1"):n||r)}),t}),ax=sx,Yu=ni,ox=Au,lx=be,ux=_a,fx=1/0,Ku=Yu?Yu.prototype:void 0,Zu=Ku?Ku.toString:void 0;function Qu(e){if(typeof e=="string")return e;if(lx(e))return ox(e,Qu)+"";if(ux(e))return Zu?Zu.call(e):"";var t=e+"";return t=="0"&&1/e==-fx?"-0":t}var cx=Qu,hx=cx;function dx(e){return e==null?"":hx(e)}var px=dx,vx=be,yx=xa,mx=ax,gx=px;function bx(e,t){return vx(e)?e:yx(e,t)?[e]:mx(gx(e))}var Ju=bx,_x=_a,xx=1/0;function Ex(e){if(typeof e=="string"||_x(e))return e;var t=e+"";return t=="0"&&1/e==-xx?"-0":t}var Ei=Ex,Tx=Ju,wx=Ei;function Ax(e,t){t=Tx(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[wx(t[r++])];return r&&r==n?e:void 0}var tf=Ax,Sx=tf;function Ox(e,t,r){var n=e==null?void 0:Sx(e,t);return n===void 0?r:n}var Ix=Ox;function Rx(e,t){return e!=null&&t in Object(e)}var Nx=Rx,Cx=Ju,Px=ta,kx=be,Mx=Lu,Lx=ea,Fx=Ei;function Bx(e,t,r){t=Cx(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var a=Fx(t[n]);if(!(s=e!=null&&r(e,a)))break;e=e[a]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&Lx(i)&&Mx(a,i)&&(kx(e)||Px(e)))}var Ux=Bx,Dx=Nx,jx=Ux;function $x(e,t){return e!=null&&jx(e,t,Dx)}var Gx=$x,qx=Vu,Hx=Ix,Vx=Gx,zx=xa,Xx=zu,Wx=Xu,Yx=Ei,Kx=1,Zx=2;function Qx(e,t){return zx(e)&&Xx(t)?Wx(Yx(e),t):function(r){var n=Hx(r,e);return n===void 0&&n===t?Vx(r,e):qx(t,n,Kx|Zx)}}var Jx=Qx;function tE(e){return e}var eE=tE;function rE(e){return function(t){return t==null?void 0:t[e]}}var nE=rE,iE=tf;function sE(e){return function(t){return iE(t,e)}}var aE=sE,oE=nE,lE=aE,uE=xa,fE=Ei;function cE(e){return uE(e)?oE(fE(e)):lE(e)}var hE=cE,dE=j_,pE=Jx,vE=eE,yE=be,mE=hE;function gE(e){return typeof e=="function"?e:e==null?vE:typeof e=="object"?yE(e)?pE(e[0],e[1]):dE(e):mE(e)}var bE=gE;function _E(e){return function(t,r,n){for(var i=-1,s=Object(t),a=n(t),o=a.length;o--;){var l=a[e?o:++i];if(r(s[l],l,s)===!1)break}return t}}var xE=_E,EE=xE,TE=EE(),wE=TE,AE=wE,SE=ga;function OE(e,t){return e&&AE(e,t,SE)}var IE=OE,RE=ii;function NE(e,t){return function(r,n){if(r==null)return r;if(!RE(r))return e(r,n);for(var i=r.length,s=t?i:-1,a=Object(r);(t?s--:++s<i)&&n(a[s],s,a)!==!1;);return r}}var CE=NE,PE=IE,kE=CE,ME=kE(PE),LE=ME,FE=LE,BE=ii;function UE(e,t){var r=-1,n=BE(e)?Array(e.length):[];return FE(e,function(i,s,a){n[++r]=t(i,s,a)}),n}var DE=UE,jE=Au,$E=bE,GE=DE,qE=be;function HE(e,t){var r=qE(e)?jE:GE;return r(e,$E(t))}var VE=HE;const zE=ir(VE);var nr={},ef={},Re={};Object.defineProperty(Re,"__esModule",{value:!0}),Re.loop=Re.conditional=Re.parse=void 0;var XE=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(r))r.forEach(function(a){return e(t,a,n,i)});else if(typeof r=="function")r(t,n,i,e);else{var s=Object.keys(r)[0];Array.isArray(r[s])?(i[s]={},e(t,r[s],n,i[s])):i[s]=r[s](t,n,i,e)}return n};Re.parse=XE;var WE=function(t,r){return function(n,i,s,a){r(n,i,s)&&a(n,t,i,s)}};Re.conditional=WE;var YE=function(t,r){return function(n,i,s,a){for(var o=[],l=n.pos;r(n,i,s);){var f={};if(a(n,t,i,f),n.pos===l)break;l=n.pos,o.push(f)}return o}};Re.loop=YE;var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.readBits=Ft.readArray=Ft.readUnsigned=Ft.readString=Ft.peekBytes=Ft.readBytes=Ft.peekByte=Ft.readByte=Ft.buildStream=void 0;var KE=function(t){return{data:t,pos:0}};Ft.buildStream=KE;var rf=function(){return function(t){return t.data[t.pos++]}};Ft.readByte=rf;var ZE=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+t]}};Ft.peekByte=ZE;var Ti=function(t){return function(r){return r.data.subarray(r.pos,r.pos+=t)}};Ft.readBytes=Ti;var QE=function(t){return function(r){return r.data.subarray(r.pos,r.pos+t)}};Ft.peekBytes=QE;var JE=function(t){return function(r){return Array.from(Ti(t)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};Ft.readString=JE;var tT=function(t){return function(r){var n=Ti(2)(r);return t?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};Ft.readUnsigned=tT;var eT=function(t,r){return function(n,i,s){for(var a=typeof r=="function"?r(n,i,s):r,o=Ti(t),l=new Array(a),f=0;f<a;f++)l[f]=o(n);return l}};Ft.readArray=eT;var rT=function(t,r,n){for(var i=0,s=0;s<n;s++)i+=t[r+s]&&Math.pow(2,n-s-1);return i},nT=function(t){return function(r){for(var n=rf()(r),i=new Array(8),s=0;s<8;s++)i[7-s]=!!(n&1<<s);return Object.keys(t).reduce(function(a,o){var l=t[o];return l.length?a[o]=rT(i,l.index,l.length):a[o]=i[l.index],a},{})}};Ft.readBits=nT,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Re,r=Ft,n={blocks:function(u){for(var d=0,p=[],v=u.data.length,g=0,m=(0,r.readByte)()(u);m!==d&&m;m=(0,r.readByte)()(u)){if(u.pos+m>=v){var b=v-u.pos;p.push((0,r.readBytes)(b)(u)),g+=b;break}p.push((0,r.readBytes)(m)(u)),g+=m}for(var _=new Uint8Array(g),y=0,x=0;x<p.length;x++)_.set(p[x],y),y+=p[x].length;return _}},i=(0,t.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(h){var u=(0,r.peekBytes)(2)(h);return u[0]===33&&u[1]===249}),s=(0,t.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,r.readArray)(3,function(h,u,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(h,u,d){return d.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(h){return(0,r.peekByte)()(h)===44}),a=(0,t.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(u,d,p){return(0,r.readBytes)(p.text.blockSize)(u)}},n]},function(h){var u=(0,r.peekBytes)(2)(h);return u[0]===33&&u[1]===1}),o=(0,t.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(u,d,p){return(0,r.readString)(p.blockSize)(u)}},n]},function(h){var u=(0,r.peekBytes)(2)(h);return u[0]===33&&u[1]===255}),l=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(h){var u=(0,r.peekBytes)(2)(h);return u[0]===33&&u[1]===254}),f=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,t.conditional)({gct:(0,r.readArray)(3,function(h,u){return Math.pow(2,u.lsd.gct.size+1)})},function(h,u){return u.lsd.gct.exists}),{frames:(0,t.loop)([i,o,l,s,a],function(h){var u=(0,r.peekByte)()(h);return u===33||u===44})}],c=f;e.default=c}(ef);var wi={};Object.defineProperty(wi,"__esModule",{value:!0}),wi.deinterlace=void 0;var iT=function(t,r){for(var n=new Array(t.length),i=t.length/r,s=function(u,d){var p=t.slice(d*r,(d+1)*r);n.splice.apply(n,[u*r,r].concat(p))},a=[0,4,2,1],o=[8,8,4,2],l=0,f=0;f<4;f++)for(var c=a[f];c<i;c+=o[f])s(c,l),l++;return n};wi.deinterlace=iT;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.lzw=void 0;var sT=function(t,r,n){var i=4096,s=-1,a=n,o,l,f,c,h,u,d,O,p,v,x,g,T,E,A,N,m=new Array(n),b=new Array(i),_=new Array(i),y=new Array(i+1);for(g=t,l=1<<g,h=l+1,o=l+2,d=s,c=g+1,f=(1<<c)-1,p=0;p<l;p++)b[p]=0,_[p]=p;var x,O,T,E,N,A;for(x=O=T=E=N=A=0,v=0;v<a;){if(E===0){if(O<c){x+=r[A]<<O,O+=8,A++;continue}if(p=x&f,x>>=c,O-=c,p>o||p==h)break;if(p==l){c=g+1,f=(1<<c)-1,o=l+2,d=s;continue}if(d==s){y[E++]=_[p],d=p,T=p;continue}for(u=p,p==o&&(y[E++]=T,p=d);p>l;)y[E++]=_[p],p=b[p];T=_[p]&255,y[E++]=T,o<i&&(b[o]=d,_[o]=T,o++,!(o&f)&&o<i&&(c++,f+=o)),d=u}E--,m[N++]=y[E],v++}for(v=N;v<a;v++)m[v]=0;return m};Ai.lzw=sT,Object.defineProperty(nr,"__esModule",{value:!0}),nr.decompressFrames=nr.decompressFrame=nr.parseGIF=void 0;var aT=cT(ef),oT=Re,lT=Ft,uT=wi,fT=Ai;function cT(e){return e&&e.__esModule?e:{default:e}}var hT=function(t){var r=new Uint8Array(t);return(0,oT.parse)((0,lT.buildStream)(r),aT.default)};nr.parseGIF=hT;var dT=function(t){for(var r=t.pixels.length,n=new Uint8ClampedArray(r*4),i=0;i<r;i++){var s=i*4,a=t.pixels[i],o=t.colorTable[a]||[0,0,0];n[s]=o[0],n[s+1]=o[1],n[s+2]=o[2],n[s+3]=a!==t.transparentIndex?255:0}return n},nf=function(t,r,n){if(!t.image){console.warn("gif frame does not have associated image.");return}var i=t.image,s=i.descriptor.width*i.descriptor.height,a=(0,fT.lzw)(i.data.minCodeSize,i.data.blocks,s);i.descriptor.lct.interlaced&&(a=(0,uT.deinterlace)(a,i.descriptor.width));var o={pixels:a,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return i.descriptor.lct&&i.descriptor.lct.exists?o.colorTable=i.lct:o.colorTable=r,t.gce&&(o.delay=(t.gce.delay||10)*10,o.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(o.transparentIndex=t.gce.transparentColorIndex)),n&&(o.patch=dT(o)),o};nr.decompressFrame=nf;var pT=function(t,r){return t.frames.filter(function(n){return n.image}).map(function(n){return nf(n,t.gct,r)})};nr.decompressFrames=pT;const sf=(e,t={})=>{typeof t=="function"&&(t=t(e));const r=t.loaded&&e.loaded!==t.loaded,{playing:n,...i}=t,s={...e,...i};return r&&Object.assign(s,{playing:s.autoPlay&&s.loaded}),(t.delays!=null||t.frames!=null)&&Object.assign(s,{length:s.frames.length}),(t.index!=null||t.frames!=null)&&Object.assign(s,{index:s.length===0?0:(s.length+s.index)%s.length}),t.playing!=null&&Object.assign(s,s.loaded?{playing:n}:{autoPlay:n}),s},vT=e=>sf({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},e),yT=e=>Q.useReducer(sf,e,vT);var mT='function e(e){var r={exports:{}};return e(r,r.exports),r.exports}var r=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.loop=r.conditional=r.parse=void 0;r.parse=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,a)}));else if("function"==typeof t)t(r,n,a,e);else{var i=Object.keys(t)[0];Array.isArray(t[i])?(a[i]={},e(r,t[i],n,a[i])):a[i]=t[i](r,n,a,e)}return n};r.conditional=function(e,r){return function(t,n,a,i){r(t,n,a)&&i(t,e,n,a)}};r.loop=function(e,r){return function(t,n,a,i){for(var o=[];r(t,n,a);){var s={};i(t,e,n,s),o.push(s)}return o}}})),t=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readBits=r.readArray=r.readUnsigned=r.readString=r.peekBytes=r.readBytes=r.peekByte=r.readByte=r.buildStream=void 0;r.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};r.readByte=t;r.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};r.readBytes=n;r.peekBytes=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};r.readString=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};r.readUnsigned=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};r.readArray=function(e,r){return function(t,a,i){for(var o="function"==typeof r?r(t,a,i):r,s=n(e),d=new Array(o),c=0;c<o;c++)d[c]=s(t);return d}};r.readBits=function(e){return function(r){for(var t=function(e){return e.data[e.pos++]}(r),n=new Array(8),a=0;a<8;a++)n[7-a]=!!(t&1<<a);return Object.keys(e).reduce((function(r,t){var a=e[t];return a.length?r[t]=function(e,r,t){for(var n=0,a=0;a<t;a++)n+=e[r+a]&&Math.pow(2,t-a-1);return n}(n,a.index,a.length):r[t]=n[a.index],r}),{})}}})),n=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={blocks:function(e){for(var r=[],n=e.data.length,a=0,i=(0,t.readByte)()(e);0!==i;i=(0,t.readByte)()(e)){if(e.pos+i>=n){var o=n-e.pos;r.push((0,t.readBytes)(o)(e)),a+=o;break}r.push((0,t.readBytes)(i)(e)),a+=i}for(var s=new Uint8Array(a),d=0,c=0;c<r.length;c++)s.set(r[c],d),d+=r[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},a]}]},(function(e){return 44===(0,t.peekByte)()(e)})),s=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),d=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},a]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,d,c,o,s],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];n.default=u})),a=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deinterlace=void 0;r.deinterlace=function(e,r){for(var t=new Array(e.length),n=e.length/r,a=function(n,a){var i=e.slice(a*r,(a+1)*r);t.splice.apply(t,[n*r,r].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,d=0;d<4;d++)for(var c=i[d];c<n;c+=o[d])a(c,s),s++;return t}})),i=e((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lzw=void 0;r.lzw=function(e,r,t){var n,a,i,o,s,d,c,u,l,f,p,g,y,h,v,m,x=4096,B=t,w=new Array(t),b=new Array(x),k=new Array(x),A=new Array(4097);for(s=(a=1<<(f=e))+1,n=a+2,c=-1,i=(1<<(o=f+1))-1,u=0;u<a;u++)b[u]=0,k[u]=u;for(p=g=y=h=v=m=0,l=0;l<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(u=p&i,p>>=o,g-=o,u>n||u==s)break;if(u==a){i=(1<<(o=f+1))-1,n=a+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(d=u,u==n&&(A[h++]=y,u=c);u>a;)A[h++]=k[u],u=b[u];y=255&k[u],A[h++]=y,n<x&&(b[n]=c,k[n]=y,0==(++n&i)&&n<x&&(o++,i+=n)),c=d}h--,w[v++]=A[h],l++}for(l=v;l<B;l++)w[l]=0;return w}})),o=e((function(e,o){Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFrames=o.decompressFrame=o.parseGIF=void 0;var s,d=(s=n)&&s.__esModule?s:{default:s};o.parseGIF=function(e){var n=new Uint8Array(e);return(0,r.parse)((0,t.buildStream)(n),d.default)};var c=function(e,r,t){if(e.image){var n=e.image,o=n.descriptor.width*n.descriptor.height,s=(0,i.lzw)(n.data.minCodeSize,n.data.blocks,o);n.descriptor.lct.interlaced&&(s=(0,a.deinterlace)(s,n.descriptor.width));var d={pixels:s,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?d.colorTable=n.lct:d.colorTable=r,e.gce&&(d.delay=10*(e.gce.delay||10),d.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(d.transparentIndex=e.gce.transparentColorIndex)),t&&(d.patch=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var a=4*n,i=e.pixels[n],o=e.colorTable[i]||[0,0,0];t[a]=o[0],t[a+1]=o[1],t[a+2]=o[2],t[a+3]=i!==e.transparentIndex?255:0}return t}(d)),d}console.warn("gif frame does not have associated image.")};o.decompressFrame=c;o.decompressFrames=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return c(t,e.gct,r)}))}}));const s=(e,r,t)=>{const{width:n,height:a,top:i,left:o}=r.dims,s=i*t.width+o;for(let i=0;i<a;i++)for(let a=0;a<n;a++){const o=i*n+a,d=r.pixels[o];if(d!==r.transparentIndex){const n=s+i*t.width+a,o=r.colorTable[d]||[0,0,0];e[4*n]=o[0],e[4*n+1]=o[1],e[4*n+2]=o[2],e[4*n+3]=255}}return e},d=new Map;self.addEventListener("message",(e=>{const{type:r,src:t}=e.data||e;switch(r){case"parse":if(!d.has(t)){const e=new AbortController,r={signal:e.signal};d.set(t,e),((e,{signal:r})=>fetch(e,{signal:r}).then((e=>{if(!e.headers.get("Content-Type").includes("image/gif"))throw Error(`Wrong content type: "${e.headers.get("Content-Type")}"`);return e.arrayBuffer()})).then((e=>o.parseGIF(e))).then((e=>((e=>{let r=null;for(const t of e.frames)r=t.gce?t.gce:r,"image"in t&&!("gce"in t)&&(t.gce=r)})(e),e))).then((e=>Promise.all([o.decompressFrames(e,!1),{width:e.lsd.width,height:e.lsd.height}]))).then((([e,r])=>{const t=[],n=r.width*r.height*4;for(let a=0;a<e.length;++a){const i=e[a],o=0===a||2===e[a-1].disposalType?new Uint8ClampedArray(n):t[a-1].slice();t.push(s(o,i,r))}return{...r,loaded:!0,delays:e.map((e=>e.delay)),frames:t}})))(t,r).then((e=>{self.postMessage(Object.assign(e,{src:t}),e.frames.map((e=>e.buffer)))})).catch((e=>{self.postMessage({src:t,error:e,loaded:!0})})).finally((()=>{d.delete(t)}))}break;case"cancel":if(d.has(t)){d.get(t).abort(),d.delete(t)}}}));\n';function gT(e){const t=new Blob([mT],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r,e);return URL.revokeObjectURL(r),n}const bT=e=>({...e,frames:e.frames.map(t=>{const r=new ImageData(e.width,e.height);return r.data.set(new Uint8ClampedArray(t)),r})}),_T=(e,t)=>{const r={};return()=>(r.instance||(r.instance=e()),Q.useLayoutEffect(()=>(r.timeout?(clearTimeout(r.timeout),delete r.timeout):r.usageCount=(r.usageCount||0)+1,()=>{r.timeout=setTimeout(()=>{r.usageCount=r.usageCount-1,r.usageCount===0&&(t&&t(r.instance),delete r.instance,delete r.timeout)})}),[r,t]),r.instance)},xT=e=>{const t=Q.useRef(e);return Q.useEffect(()=>{t.current=e},[e]),t},ET=e=>{const t=xT(e);return Q.useCallback(r=>t.current&&t.current(r),[])},TT=_T(()=>new gT,e=>e.terminate()),wT=(e,t)=>{const r=ET(t),n=TT();Q.useEffect(()=>{if(typeof e=="string"){const i=s=>{const a=s.data||s;if(a.src===e){const o=a.error?a:bT(a);r(o)}};return n.addEventListener("message",i),n.postMessage({src:e,type:"parse"}),()=>{n.postMessage({src:e,type:"cancel"}),n.removeEventListener("message",i)}}},[n,e])},AT=({isPlaying:e,forwardRef:t,...r})=>{const n=st.useRef(null);return st.useImperativeHandle(t,()=>n.current,[n]),st.useEffect(()=>{if(n.current===null)return;const i=n.current;i[e?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[e]),dt.jsx(yt.AnimatedSprite,{ref:n,...r,isPlaying:e})},af=st.memo(AT),ST=yt.withFilters(yt.Container,{blur:te.filters.BlurFilter,adjust:Gs,matrix:te.filters.ColorMatrixFilter}),OT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],IT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},RT=e=>{const[t,r]=st.useState([]),[,n]=st.useState(0),[i,s]=st.useState([]),[,a]=Q.useState(0),[,o]=Q.useState(!1),[l,f]=Q.useState(!1),[,c]=Q.useState(!1),[h,u]=yT({autoPlay:!1}),d=st.useRef(null),p=Q.useRef(null),v=Q.useRef(null),g=Q.useRef(null),m=Q.useRef(null),b=Q.useRef(null),_=Q.useRef(IT),y=Q.useRef(e.initialAlpha),{tl:x}=Q.useContext(Sr),{frames:O,delays:T,loaded:E}=h,{uniqueId:N,src:A,startAt:w,endAt:S,locked:I,loop:C,transformation:{width:F=0,height:D=0,x:U,y:X,rotation:j=0,scale:k,animation:R,colorCorrection:P,effect:L},pointerdown:$,pointerup:G,mousedown:M,mouseup:B,pointerover:q,mouseover:H,mouseout:z,pointerout:Y,applyTransformer:J,onAnchorTransformationEnd:et}=e,{contrast:at=1,saturation:lt=1,exposure:Nt=1,blurRadius:It=0,alpha:V=1}=P||{},W={brightness:Nt,contrast:at,saturation:lt,alpha:V},Z=yt.useApp();wT(A,u),nn(ge.PAUSE,ut=>{console.log("pause event",ut),p.current&&(p.current.stop(),_.current.isPlaying=!1)});const tt=st.useCallback(ut=>{console.log("changeEnd",ut),et&&et(ut)},[]);st.useEffect(()=>{if(!Jt(O)){const ut=zE(O,_e=>{const{data:Lt,width:dn,height:Si}=_e,BT=new Uint8Array(Lt);return te.Texture.fromBuffer(BT,dn,Si)}),je=ut.map((_e,Lt)=>({texture:_e,time:T[Lt]}));r(ut),s(je);let Ur=0;T.forEach(_e=>{Ur+=_e*10}),n(Ur)}},[O,T]);const K=ut=>{p.current&&(p.current.gotoAndPlay(ut||0),_.current.isPlaying=!0)},ft=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},ct=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},ht=()=>{p.current&&!_.current.isPlaying&&(p.current.play(),_.current.isPlaying=!0)},nt=()=>{o(!0)},St=ut=>{y.current=ut.alpha},Et=ut=>{y.current=ut.alpha};Q.useEffect(()=>{let ut=he.context(()=>{});if(v.current&&x.current){const je={duration:Number(S)-Number(w),onStart:K,onComplete:ft,onStartParams:[w],onCompleteParams:[],onInterrupt:ct,onUpdate:ht,onUpdateParams:[]},Ur={onStart:St,onStartParams:[{alpha:1}]},_e={onComplete:Et,onCompleteParams:[{alpha:0}]},Lt=Vs(R||"None");ut=he.context(()=>{var dn,Si;x.current.to(v.current,{alpha:1,duration:.01,...Ur},w).from(v.current,{...je},w).to(v.current,{alpha:0,duration:.1,..._e},Number(S)-.09),Jt(Lt.from)?Jt(Lt.to)?Jt(Lt.fromTo)||x.current.fromTo(v.current,(dn=Lt.fromTo)==null?void 0:dn.from,(Si=Lt.fromTo)==null?void 0:Si.to,w):x.current.to(v.current,{alpha:1,duration:.2,...Lt.to},w):x.current.from(v.current,{...Lt.from},w)})}return()=>ut.revert()},[R,w,S]);const De=st.useCallback(()=>{f(!0)},[]);Z.ticker.add(ut=>{d.current&&(d.current.rotation+=.01*ut,d.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,Math.PI*2*.6,!1))});const gt=st.useCallback(ut=>{ut.clear()},[]);return dt.jsxs(yt.Container,{ref:g,children:[dt.jsx(yt.Container,{ref:v,alpha:y.current,position:[U,X],pivot:[U,X],width:F,height:D,children:dt.jsxs(yt.Container,{ref:m,children:[!E&&dt.jsx(yt.Container,{anchor:.5,position:[F/2,D/2],children:dt.jsx(yt.Graphics,{x:U,y:X,ref:d,draw:gt})}),t&&t.length>0&&dt.jsx(ST,{scale:1,blur:{blur:It,quality:4},adjust:W,apply:({matrix:ut})=>{L==="BlackAndWhite"?ut.desaturate():L==="Sepia"?ut.sepia():L==="RetroVintage"||L==="NightVision"?ut.negative():L==="Normal"&&ut.reset()},matrix:{enabled:!0,matrix:OT},children:dt.jsx(af,{x:U,y:X,width:F,height:D,rotation:j,animationSpeed:1,loop:C,textures:i,onComplete:nt,onFrameChange:ut=>a(ut),anchor:.5,...!I&&!l&&{interactive:!0,buttonMode:!0,pointerdown:$,pointerover:q,pointerout:Y,pointerup:G,mousedown:M,mouseup:B,mouseover:H,mouseout:z},forwardRef:p,scale:k})})]})}),J&&dt.jsx(qs,{pixiTransformerRef:b,imageRef:v,isMounted:E,transformCommit:tt,transformChange:De,mouseoverEvent:c,uniqueId:N})]})};var of={exports:{}};/*!
551
+ * Quill Editor v1.3.7
552
+ * https://quilljs.com/
553
+ * Copyright (c) 2014, Jason Chen
554
+ * Copyright (c) 2013, salesforce.com
555
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Ne,function(){return function(r){var n={};function i(s){if(n[s])return n[s].exports;var a=n[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=r,i.c=n,i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(17),a=i(18),o=i(19),l=i(45),f=i(46),c=i(47),h=i(48),u=i(49),d=i(12),p=i(32),v=i(33),g=i(31),m=i(1),b={Scope:m.Scope,create:m.create,find:m.find,query:m.query,register:m.register,Container:s.default,Format:a.default,Leaf:o.default,Embed:h.default,Scroll:l.default,Block:c.default,Inline:f.default,Text:u.default,Attributor:{Attribute:d.default,Class:p.default,Style:v.default,Store:g.default}};n.default=b},function(r,n,i){var s=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,b){m.__proto__=b}||function(m,b){for(var _ in b)b.hasOwnProperty(_)&&(m[_]=b[_])};return function(m,b){g(m,b);function _(){this.constructor=m}m.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=function(g){s(m,g);function m(b){var _=this;return b="[Parchment] "+b,_=g.call(this,b)||this,_.message=b,_.name=_.constructor.name,_}return m}(Error);n.ParchmentError=a;var o={},l={},f={},c={};n.DATA_KEY="__blot";var h;(function(g){g[g.TYPE=3]="TYPE",g[g.LEVEL=12]="LEVEL",g[g.ATTRIBUTE=13]="ATTRIBUTE",g[g.BLOT=14]="BLOT",g[g.INLINE=7]="INLINE",g[g.BLOCK=11]="BLOCK",g[g.BLOCK_BLOT=10]="BLOCK_BLOT",g[g.INLINE_BLOT=6]="INLINE_BLOT",g[g.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",g[g.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",g[g.ANY=15]="ANY"})(h=n.Scope||(n.Scope={}));function u(g,m){var b=p(g);if(b==null)throw new a("Unable to create "+g+" blot");var _=b,y=g instanceof Node||g.nodeType===Node.TEXT_NODE?g:_.create(m);return new _(y,m)}n.create=u;function d(g,m){return m===void 0&&(m=!1),g==null?null:g[n.DATA_KEY]!=null?g[n.DATA_KEY].blot:m?d(g.parentNode,m):null}n.find=d;function p(g,m){m===void 0&&(m=h.ANY);var b;if(typeof g=="string")b=c[g]||o[g];else if(g instanceof Text||g.nodeType===Node.TEXT_NODE)b=c.text;else if(typeof g=="number")g&h.LEVEL&h.BLOCK?b=c.block:g&h.LEVEL&h.INLINE&&(b=c.inline);else if(g instanceof HTMLElement){var _=(g.getAttribute("class")||"").split(/\s+/);for(var y in _)if(b=l[_[y]],b)break;b=b||f[g.tagName]}return b==null?null:m&h.LEVEL&b.scope&&m&h.TYPE&b.scope?b:null}n.query=p;function v(){for(var g=[],m=0;m<arguments.length;m++)g[m]=arguments[m];if(g.length>1)return g.map(function(y){return v(y)});var b=g[0];if(typeof b.blotName!="string"&&typeof b.attrName!="string")throw new a("Invalid definition");if(b.blotName==="abstract")throw new a("Cannot register abstract class");if(c[b.blotName||b.attrName]=b,typeof b.keyName=="string")o[b.keyName]=b;else if(b.className!=null&&(l[b.className]=b),b.tagName!=null){Array.isArray(b.tagName)?b.tagName=b.tagName.map(function(y){return y.toUpperCase()}):b.tagName=b.tagName.toUpperCase();var _=Array.isArray(b.tagName)?b.tagName:[b.tagName];_.forEach(function(y){(f[y]==null||b.className==null)&&(f[y]=b)})}return b}n.register=v},function(r,n,i){var s=i(51),a=i(11),o=i(3),l=i(20),f=String.fromCharCode(0),c=function(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]};c.prototype.insert=function(h,u){var d={};return h.length===0?this:(d.insert=h,u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(d.attributes=u),this.push(d))},c.prototype.delete=function(h){return h<=0?this:this.push({delete:h})},c.prototype.retain=function(h,u){if(h<=0)return this;var d={retain:h};return u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(d.attributes=u),this.push(d)},c.prototype.push=function(h){var u=this.ops.length,d=this.ops[u-1];if(h=o(!0,{},h),typeof d=="object"){if(typeof h.delete=="number"&&typeof d.delete=="number")return this.ops[u-1]={delete:d.delete+h.delete},this;if(typeof d.delete=="number"&&h.insert!=null&&(u-=1,d=this.ops[u-1],typeof d!="object"))return this.ops.unshift(h),this;if(a(h.attributes,d.attributes)){if(typeof h.insert=="string"&&typeof d.insert=="string")return this.ops[u-1]={insert:d.insert+h.insert},typeof h.attributes=="object"&&(this.ops[u-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof d.retain=="number")return this.ops[u-1]={retain:d.retain+h.retain},typeof h.attributes=="object"&&(this.ops[u-1].attributes=h.attributes),this}}return u===this.ops.length?this.ops.push(h):this.ops.splice(u,0,h),this},c.prototype.chop=function(){var h=this.ops[this.ops.length-1];return h&&h.retain&&!h.attributes&&this.ops.pop(),this},c.prototype.filter=function(h){return this.ops.filter(h)},c.prototype.forEach=function(h){this.ops.forEach(h)},c.prototype.map=function(h){return this.ops.map(h)},c.prototype.partition=function(h){var u=[],d=[];return this.forEach(function(p){var v=h(p)?u:d;v.push(p)}),[u,d]},c.prototype.reduce=function(h,u){return this.ops.reduce(h,u)},c.prototype.changeLength=function(){return this.reduce(function(h,u){return u.insert?h+l.length(u):u.delete?h-u.delete:h},0)},c.prototype.length=function(){return this.reduce(function(h,u){return h+l.length(u)},0)},c.prototype.slice=function(h,u){h=h||0,typeof u!="number"&&(u=1/0);for(var d=[],p=l.iterator(this.ops),v=0;v<u&&p.hasNext();){var g;v<h?g=p.next(h-v):(g=p.next(u-v),d.push(g)),v+=l.length(g)}return new c(d)},c.prototype.compose=function(h){var u=l.iterator(this.ops),d=l.iterator(h.ops),p=[],v=d.peek();if(v!=null&&typeof v.retain=="number"&&v.attributes==null){for(var g=v.retain;u.peekType()==="insert"&&u.peekLength()<=g;)g-=u.peekLength(),p.push(u.next());v.retain-g>0&&d.next(v.retain-g)}for(var m=new c(p);u.hasNext()||d.hasNext();)if(d.peekType()==="insert")m.push(d.next());else if(u.peekType()==="delete")m.push(u.next());else{var b=Math.min(u.peekLength(),d.peekLength()),_=u.next(b),y=d.next(b);if(typeof y.retain=="number"){var x={};typeof _.retain=="number"?x.retain=b:x.insert=_.insert;var O=l.attributes.compose(_.attributes,y.attributes,typeof _.retain=="number");if(O&&(x.attributes=O),m.push(x),!d.hasNext()&&a(m.ops[m.ops.length-1],x)){var T=new c(u.rest());return m.concat(T).chop()}}else typeof y.delete=="number"&&typeof _.retain=="number"&&m.push(y)}return m.chop()},c.prototype.concat=function(h){var u=new c(this.ops.slice());return h.ops.length>0&&(u.push(h.ops[0]),u.ops=u.ops.concat(h.ops.slice(1))),u},c.prototype.diff=function(h,u){if(this.ops===h.ops)return new c;var d=[this,h].map(function(b){return b.map(function(_){if(_.insert!=null)return typeof _.insert=="string"?_.insert:f;var y=b===h?"on":"with";throw new Error("diff() called "+y+" non-document")}).join("")}),p=new c,v=s(d[0],d[1],u),g=l.iterator(this.ops),m=l.iterator(h.ops);return v.forEach(function(b){for(var _=b[1].length;_>0;){var y=0;switch(b[0]){case s.INSERT:y=Math.min(m.peekLength(),_),p.push(m.next(y));break;case s.DELETE:y=Math.min(_,g.peekLength()),g.next(y),p.delete(y);break;case s.EQUAL:y=Math.min(g.peekLength(),m.peekLength(),_);var x=g.next(y),O=m.next(y);a(x.insert,O.insert)?p.retain(y,l.attributes.diff(x.attributes,O.attributes)):p.push(O).delete(y);break}_-=y}}),p.chop()},c.prototype.eachLine=function(h,u){u=u||`
556
+ `;for(var d=l.iterator(this.ops),p=new c,v=0;d.hasNext();){if(d.peekType()!=="insert")return;var g=d.peek(),m=l.length(g)-d.peekLength(),b=typeof g.insert=="string"?g.insert.indexOf(u,m)-m:-1;if(b<0)p.push(d.next());else if(b>0)p.push(d.next(b));else{if(h(p,d.next(1).attributes||{},v)===!1)return;v+=1,p=new c}}p.length()>0&&h(p,{},v)},c.prototype.transform=function(h,u){if(u=!!u,typeof h=="number")return this.transformPosition(h,u);for(var d=l.iterator(this.ops),p=l.iterator(h.ops),v=new c;d.hasNext()||p.hasNext();)if(d.peekType()==="insert"&&(u||p.peekType()!=="insert"))v.retain(l.length(d.next()));else if(p.peekType()==="insert")v.push(p.next());else{var g=Math.min(d.peekLength(),p.peekLength()),m=d.next(g),b=p.next(g);if(m.delete)continue;b.delete?v.push(b):v.retain(g,l.attributes.transform(m.attributes,b.attributes,u))}return v.chop()},c.prototype.transformPosition=function(h,u){u=!!u;for(var d=l.iterator(this.ops),p=0;d.hasNext()&&p<=h;){var v=d.peekLength(),g=d.peekType();if(d.next(),g==="delete"){h-=Math.min(v,h-p);continue}else g==="insert"&&(p<h||!u)&&(h+=v);p+=v}return h},r.exports=c},function(r,n){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):s.call(d)==="[object Array]"},f=function(d){if(!d||s.call(d)!=="[object Object]")return!1;var p=i.call(d,"constructor"),v=d.constructor&&d.constructor.prototype&&i.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!v)return!1;var g;for(g in d);return typeof g>"u"||i.call(d,g)},c=function(d,p){a&&p.name==="__proto__"?a(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},h=function(d,p){if(p==="__proto__")if(i.call(d,p)){if(o)return o(d,p).value}else return;return d[p]};r.exports=function u(){var d,p,v,g,m,b,_=arguments[0],y=1,x=arguments.length,O=!1;for(typeof _=="boolean"&&(O=_,_=arguments[1]||{},y=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});y<x;++y)if(d=arguments[y],d!=null)for(p in d)v=h(_,p),g=h(d,p),_!==g&&(O&&g&&(f(g)||(m=l(g)))?(m?(m=!1,b=v&&l(v)?v:[]):b=v&&f(v)?v:{},c(_,{name:p,newValue:u(O,b,g)})):typeof g<"u"&&c(_,{name:p,newValue:g}));return _}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var s=function(){function w(S,I){for(var C=0;C<I.length;C++){var F=I[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(S,F.key,F)}}return function(S,I,C){return I&&w(S.prototype,I),C&&w(S,C),S}}(),a=function w(S,I,C){S===null&&(S=Function.prototype);var F=Object.getOwnPropertyDescriptor(S,I);if(F===void 0){var D=Object.getPrototypeOf(S);return D===null?void 0:w(D,I,C)}else{if("value"in F)return F.value;var U=F.get;return U===void 0?void 0:U.call(C)}},o=i(3),l=_(o),f=i(2),c=_(f),h=i(0),u=_(h),d=i(16),p=_(d),v=i(6),g=_(v),m=i(7),b=_(m);function _(w){return w&&w.__esModule?w:{default:w}}function y(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function x(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function O(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var T=1,E=function(w){O(S,w);function S(){return y(this,S),x(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return s(S,[{key:"attach",value:function(){a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"attach",this).call(this),this.attributes=new u.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new c.default().insert(this.value(),(0,l.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(C,F){var D=u.default.query(C,u.default.Scope.BLOCK_ATTRIBUTE);D!=null&&this.attributes.attribute(D,F)}},{key:"formatAt",value:function(C,F,D,U){this.format(D,U)}},{key:"insertAt",value:function(C,F,D){if(typeof F=="string"&&F.endsWith(`
557
+ `)){var U=u.default.create(N.blotName);this.parent.insertBefore(U,C===0?this:this.next),U.insertAt(0,F.slice(0,-1))}else a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertAt",this).call(this,C,F,D)}}]),S}(u.default.Embed);E.scope=u.default.Scope.BLOCK_BLOT;var N=function(w){O(S,w);function S(I){y(this,S);var C=x(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,I));return C.cache={},C}return s(S,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(u.default.Leaf).reduce(function(C,F){return F.length()===0?C:C.insert(F.value(),A(F))},new c.default).insert(`
558
+ `,A(this))),this.cache.delta}},{key:"deleteAt",value:function(C,F){a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"deleteAt",this).call(this,C,F),this.cache={}}},{key:"formatAt",value:function(C,F,D,U){F<=0||(u.default.query(D,u.default.Scope.BLOCK)?C+F===this.length()&&this.format(D,U):a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"formatAt",this).call(this,C,Math.min(F,this.length()-C-1),D,U),this.cache={})}},{key:"insertAt",value:function(C,F,D){if(D!=null)return a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertAt",this).call(this,C,F,D);if(F.length!==0){var U=F.split(`
559
+ `),X=U.shift();X.length>0&&(C<this.length()-1||this.children.tail==null?a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertAt",this).call(this,Math.min(C,this.length()-1),X):this.children.tail.insertAt(this.children.tail.length(),X),this.cache={});var j=this;U.reduce(function(k,R){return j=j.split(k,!0),j.insertAt(0,R),R.length},C+X.length)}}},{key:"insertBefore",value:function(C,F){var D=this.children.head;a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertBefore",this).call(this,C,F),D instanceof p.default&&D.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"length",this).call(this)+T),this.cache.length}},{key:"moveChildren",value:function(C,F){a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"moveChildren",this).call(this,C,F),this.cache={}}},{key:"optimize",value:function(C){a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,C),this.cache={}}},{key:"path",value:function(C){return a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"path",this).call(this,C,!0)}},{key:"removeChild",value:function(C){a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"removeChild",this).call(this,C),this.cache={}}},{key:"split",value:function(C){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(F&&(C===0||C>=this.length()-T)){var D=this.clone();return C===0?(this.parent.insertBefore(D,this),this):(this.parent.insertBefore(D,this.next),D)}else{var U=a(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"split",this).call(this,C,F);return this.cache={},U}}}]),S}(u.default.Block);N.blotName="block",N.tagName="P",N.defaultChild="break",N.allowedChildren=[g.default,u.default.Embed,b.default];function A(w){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return w==null||(typeof w.formats=="function"&&(S=(0,l.default)(S,w.formats())),w.parent==null||w.parent.blotName=="scroll"||w.parent.statics.scope!==w.statics.scope)?S:A(w.parent,S)}n.bubbleFormats=A,n.BlockEmbed=E,n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(k,R){var P=[],L=!0,$=!1,G=void 0;try{for(var M=k[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(P.push(B.value),!(R&&P.length===R));L=!0);}catch(q){$=!0,G=q}finally{try{!L&&M.return&&M.return()}finally{if($)throw G}}return P}return function(k,R){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return j(k,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(k,R){for(var P=0;P<R.length;P++){var L=R[P];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}return function(k,R,P){return R&&j(k.prototype,R),P&&j(k,P),k}}();i(50);var l=i(2),f=A(l),c=i(14),h=A(c),u=i(8),d=A(u),p=i(9),v=A(p),g=i(0),m=A(g),b=i(15),_=A(b),y=i(3),x=A(y),O=i(10),T=A(O),E=i(34),N=A(E);function A(j){return j&&j.__esModule?j:{default:j}}function w(j,k,R){return k in j?Object.defineProperty(j,k,{value:R,enumerable:!0,configurable:!0,writable:!0}):j[k]=R,j}function S(j,k){if(!(j instanceof k))throw new TypeError("Cannot call a class as a function")}var I=(0,T.default)("quill"),C=function(){o(j,null,[{key:"debug",value:function(R){R===!0&&(R="log"),T.default.level(R)}},{key:"find",value:function(R){return R.__quill||m.default.find(R)}},{key:"import",value:function(R){return this.imports[R]==null&&I.error("Cannot import "+R+". Are you sure it was registered?"),this.imports[R]}},{key:"register",value:function(R,P){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof R!="string"){var G=R.attrName||R.blotName;typeof G=="string"?this.register("formats/"+G,R,P):Object.keys(R).forEach(function(M){L.register(M,R[M],P)})}else this.imports[R]!=null&&!$&&I.warn("Overwriting "+R+" with",P),this.imports[R]=P,(R.startsWith("blots/")||R.startsWith("formats/"))&&P.blotName!=="abstract"?m.default.register(P):R.startsWith("modules")&&typeof P.register=="function"&&P.register()}}]);function j(k){var R=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(S(this,j),this.options=F(k,P),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",k);this.options.debug&&j.debug(this.options.debug);var L=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new d.default,this.scroll=m.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new h.default(this.scroll),this.selection=new _.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(d.default.events.EDITOR_CHANGE,function(G){G===d.default.events.TEXT_CHANGE&&R.root.classList.toggle("ql-blank",R.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function(G,M){var B=R.selection.lastRange,q=B&&B.length===0?B.index:void 0;D.call(R,function(){return R.editor.update(null,M,q)},G)});var $=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+L+"<p><br></p></div>");this.setContents($),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(j,[{key:"addContainer",value:function(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof R=="string"){var L=R;R=document.createElement("div"),R.classList.add(L)}return this.container.insertBefore(R,P),R}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(R,P,L){var $=this,G=U(R,P,L),M=a(G,4);return R=M[0],P=M[1],L=M[3],D.call(this,function(){return $.editor.deleteText(R,P)},L,R,-1*P)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(R),this.container.classList.toggle("ql-disabled",!R)}},{key:"focus",value:function(){var R=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=R,this.scrollIntoView()}},{key:"format",value:function(R,P){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;return D.call(this,function(){var G=L.getSelection(!0),M=new f.default;if(G==null)return M;if(m.default.query(R,m.default.Scope.BLOCK))M=L.editor.formatLine(G.index,G.length,w({},R,P));else{if(G.length===0)return L.selection.format(R,P),M;M=L.editor.formatText(G.index,G.length,w({},R,P))}return L.setSelection(G,d.default.sources.SILENT),M},$)}},{key:"formatLine",value:function(R,P,L,$,G){var M=this,B=void 0,q=U(R,P,L,$,G),H=a(q,4);return R=H[0],P=H[1],B=H[2],G=H[3],D.call(this,function(){return M.editor.formatLine(R,P,B)},G,R,0)}},{key:"formatText",value:function(R,P,L,$,G){var M=this,B=void 0,q=U(R,P,L,$,G),H=a(q,4);return R=H[0],P=H[1],B=H[2],G=H[3],D.call(this,function(){return M.editor.formatText(R,P,B)},G,R,0)}},{key:"getBounds",value:function(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=void 0;typeof R=="number"?L=this.selection.getBounds(R,P):L=this.selection.getBounds(R.index,R.length);var $=this.container.getBoundingClientRect();return{bottom:L.bottom-$.top,height:L.height,left:L.left-$.left,right:L.right-$.left,top:L.top-$.top,width:L.width}}},{key:"getContents",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-R,L=U(R,P),$=a(L,2);return R=$[0],P=$[1],this.editor.getContents(R,P)}},{key:"getFormat",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof R=="number"?this.editor.getFormat(R,P):this.editor.getFormat(R.index,R.length)}},{key:"getIndex",value:function(R){return R.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(R){return this.scroll.leaf(R)}},{key:"getLine",value:function(R){return this.scroll.line(R)}},{key:"getLines",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof R!="number"?this.scroll.lines(R.index,R.length):this.scroll.lines(R,P)}},{key:"getModule",value:function(R){return this.theme.modules[R]}},{key:"getSelection",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return R&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-R,L=U(R,P),$=a(L,2);return R=$[0],P=$[1],this.editor.getText(R,P)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(R,P,L){var $=this,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return D.call(this,function(){return $.editor.insertEmbed(R,P,L)},G,R)}},{key:"insertText",value:function(R,P,L,$,G){var M=this,B=void 0,q=U(R,0,L,$,G),H=a(q,4);return R=H[0],B=H[2],G=H[3],D.call(this,function(){return M.editor.insertText(R,P,B)},G,R,P.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(R,P,L){this.clipboard.dangerouslyPasteHTML(R,P,L)}},{key:"removeFormat",value:function(R,P,L){var $=this,G=U(R,P,L),M=a(G,4);return R=M[0],P=M[1],L=M[3],D.call(this,function(){return $.editor.removeFormat(R,P)},L,R)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(R){var P=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return D.call(this,function(){R=new f.default(R);var $=P.getLength(),G=P.editor.deleteText(0,$),M=P.editor.applyDelta(R),B=M.ops[M.ops.length-1];B!=null&&typeof B.insert=="string"&&B.insert[B.insert.length-1]===`
560
+ `&&(P.editor.deleteText(P.getLength()-1,1),M.delete(1));var q=G.compose(M);return q},L)}},{key:"setSelection",value:function(R,P,L){if(R==null)this.selection.setRange(null,P||j.sources.API);else{var $=U(R,P,L),G=a($,4);R=G[0],P=G[1],L=G[3],this.selection.setRange(new b.Range(R,P),L),L!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,L=new f.default().insert(R);return this.setContents(L,P)}},{key:"update",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,P=this.scroll.update(R);return this.selection.update(R),P}},{key:"updateContents",value:function(R){var P=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return D.call(this,function(){return R=new f.default(R),P.editor.applyDelta(R,L)},L,!0)}}]),j}();C.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},C.events=d.default.events,C.sources=d.default.sources,C.version="1.3.7",C.imports={delta:f.default,parchment:m.default,"core/module":v.default,"core/theme":N.default};function F(j,k){if(k=(0,x.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},k),!k.theme||k.theme===C.DEFAULTS.theme)k.theme=N.default;else if(k.theme=C.import("themes/"+k.theme),k.theme==null)throw new Error("Invalid theme "+k.theme+". Did you register it?");var R=(0,x.default)(!0,{},k.theme.DEFAULTS);[R,k].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(G){$.modules[G]===!0&&($.modules[G]={})})});var P=Object.keys(R.modules).concat(Object.keys(k.modules)),L=P.reduce(function($,G){var M=C.import("modules/"+G);return M==null?I.error("Cannot load "+G+" module. Are you sure you registered it?"):$[G]=M.DEFAULTS||{},$},{});return k.modules!=null&&k.modules.toolbar&&k.modules.toolbar.constructor!==Object&&(k.modules.toolbar={container:k.modules.toolbar}),k=(0,x.default)(!0,{},C.DEFAULTS,{modules:L},R,k),["bounds","container","scrollingContainer"].forEach(function($){typeof k[$]=="string"&&(k[$]=document.querySelector(k[$]))}),k.modules=Object.keys(k.modules).reduce(function($,G){return k.modules[G]&&($[G]=k.modules[G]),$},{}),k}function D(j,k,R,P){if(this.options.strict&&!this.isEnabled()&&k===d.default.sources.USER)return new f.default;var L=R==null?null:this.getSelection(),$=this.editor.delta,G=j();if(L!=null&&(R===!0&&(R=L.index),P==null?L=X(L,G,k):P!==0&&(L=X(L,R,P,k)),this.setSelection(L,d.default.sources.SILENT)),G.length()>0){var M,B=[d.default.events.TEXT_CHANGE,G,$,k];if((M=this.emitter).emit.apply(M,[d.default.events.EDITOR_CHANGE].concat(B)),k!==d.default.sources.SILENT){var q;(q=this.emitter).emit.apply(q,B)}}return G}function U(j,k,R,P,L){var $={};return typeof j.index=="number"&&typeof j.length=="number"?typeof k!="number"?(L=P,P=R,R=k,k=j.length,j=j.index):(k=j.length,j=j.index):typeof k!="number"&&(L=P,P=R,R=k,k=0),(typeof R>"u"?"undefined":s(R))==="object"?($=R,L=P):typeof R=="string"&&(P!=null?$[R]=P:L=R),L=L||d.default.sources.API,[j,k,$,L]}function X(j,k,R,P){if(j==null)return null;var L=void 0,$=void 0;if(k instanceof f.default){var G=[j.index,j.index+j.length].map(function(H){return k.transformPosition(H,P!==d.default.sources.USER)}),M=a(G,2);L=M[0],$=M[1]}else{var B=[j.index,j.index+j.length].map(function(H){return H<k||H===k&&P===d.default.sources.USER?H:R>=0?H+R:Math.max(k,H+R)}),q=a(B,2);L=q[0],$=q[1]}return new b.Range(L,$-L)}n.expandConfig=F,n.overload=U,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(m,b){for(var _=0;_<b.length;_++){var y=b[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,b,_){return b&&g(m.prototype,b),_&&g(m,_),m}}(),a=function g(m,b,_){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,b);if(y===void 0){var x=Object.getPrototypeOf(m);return x===null?void 0:g(x,b,_)}else{if("value"in y)return y.value;var O=y.get;return O===void 0?void 0:O.call(_)}},o=i(7),l=h(o),f=i(0),c=h(f);function h(g){return g&&g.__esModule?g:{default:g}}function u(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function d(g,m){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:g}function p(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(g,m):g.__proto__=m)}var v=function(g){p(m,g);function m(){return u(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"formatAt",value:function(_,y,x,O){if(m.compare(this.statics.blotName,x)<0&&c.default.query(x,c.default.Scope.BLOT)){var T=this.isolate(_,y);O&&T.wrap(x,O)}else a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"formatAt",this).call(this,_,y,x,O)}},{key:"optimize",value:function(_){if(a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,_),this.parent instanceof m&&m.compare(this.statics.blotName,this.parent.statics.blotName)>0){var y=this.parent.isolate(this.offset(),this.length());this.moveChildren(y),y.wrap(this)}}}],[{key:"compare",value:function(_,y){var x=m.order.indexOf(_),O=m.order.indexOf(y);return x>=0||O>=0?x-O:_===y?0:_<y?-1:1}}]),m}(c.default.Inline);v.allowedChildren=[v,c.default.Embed,l.default],v.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function f(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var h=function(u){c(d,u);function d(){return l(this,d),f(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default.Text);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(_,y){for(var x=0;x<y.length;x++){var O=y[x];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(_,O.key,O)}}return function(_,y,x){return y&&b(_.prototype,y),x&&b(_,x),_}}(),a=function b(_,y,x){_===null&&(_=Function.prototype);var O=Object.getOwnPropertyDescriptor(_,y);if(O===void 0){var T=Object.getPrototypeOf(_);return T===null?void 0:b(T,y,x)}else{if("value"in O)return O.value;var E=O.get;return E===void 0?void 0:E.call(x)}},o=i(54),l=h(o),f=i(10),c=h(f);function h(b){return b&&b.__esModule?b:{default:b}}function u(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function d(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var v=(0,c.default)("quill:events"),g=["selectionchange","mousedown","mouseup","click"];g.forEach(function(b){document.addEventListener(b,function(){for(var _=arguments.length,y=Array(_),x=0;x<_;x++)y[x]=arguments[x];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(O){if(O.__quill&&O.__quill.emitter){var T;(T=O.__quill.emitter).handleDOM.apply(T,y)}})})});var m=function(b){p(_,b);function _(){u(this,_);var y=d(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return y.listeners={},y.on("error",v.error),y}return s(_,[{key:"emit",value:function(){v.log.apply(v,arguments),a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(x){for(var O=arguments.length,T=Array(O>1?O-1:0),E=1;E<O;E++)T[E-1]=arguments[E];(this.listeners[x.type]||[]).forEach(function(N){var A=N.node,w=N.handler;(x.target===A||A.contains(x.target))&&w.apply(void 0,[x].concat(T))})}},{key:"listenDOM",value:function(x,O,T){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push({node:O,handler:T})}}]),_}(l.default);m.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},m.sources={API:"api",SILENT:"silent",USER:"user"},n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function s(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}var a=function o(l){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,o),this.quill=l,this.options=f};a.DEFAULTS={},n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=["error","warn","log","info"],a="warn";function o(f){if(s.indexOf(f)<=s.indexOf(a)){for(var c,h=arguments.length,u=Array(h>1?h-1:0),d=1;d<h;d++)u[d-1]=arguments[d];(c=console)[f].apply(c,u)}}function l(f){return s.reduce(function(c,h){return c[h]=o.bind(console,h,f),c},{})}o.level=l.level=function(f){a=f},n.default=l},function(r,n,i){var s=Array.prototype.slice,a=i(52),o=i(53),l=r.exports=function(u,d,p){return p||(p={}),u===d?!0:u instanceof Date&&d instanceof Date?u.getTime()===d.getTime():!u||!d||typeof u!="object"&&typeof d!="object"?p.strict?u===d:u==d:h(u,d,p)};function f(u){return u==null}function c(u){return!(!u||typeof u!="object"||typeof u.length!="number"||typeof u.copy!="function"||typeof u.slice!="function"||u.length>0&&typeof u[0]!="number")}function h(u,d,p){var v,g;if(f(u)||f(d)||u.prototype!==d.prototype)return!1;if(o(u))return o(d)?(u=s.call(u),d=s.call(d),l(u,d,p)):!1;if(c(u)){if(!c(d)||u.length!==d.length)return!1;for(v=0;v<u.length;v++)if(u[v]!==d[v])return!1;return!0}try{var m=a(u),b=a(d)}catch{return!1}if(m.length!=b.length)return!1;for(m.sort(),b.sort(),v=m.length-1;v>=0;v--)if(m[v]!=b[v])return!1;for(v=m.length-1;v>=0;v--)if(g=m[v],!l(u[g],d[g],p))return!1;return typeof u==typeof d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),a=function(){function o(l,f,c){c===void 0&&(c={}),this.attrName=l,this.keyName=f;var h=s.Scope.TYPE&s.Scope.ATTRIBUTE;c.scope!=null?this.scope=c.scope&s.Scope.LEVEL|h:this.scope=s.Scope.ATTRIBUTE,c.whitelist!=null&&(this.whitelist=c.whitelist)}return o.keys=function(l){return[].map.call(l.attributes,function(f){return f.name})},o.prototype.add=function(l,f){return this.canAdd(l,f)?(l.setAttribute(this.keyName,f),!0):!1},o.prototype.canAdd=function(l,f){var c=s.query(l,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return c==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},o.prototype.remove=function(l){l.removeAttribute(this.keyName)},o.prototype.value=function(l){var f=l.getAttribute(this.keyName);return this.canAdd(l,f)&&f?f:""},o}();n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var s=function(){function E(N,A){var w=[],S=!0,I=!1,C=void 0;try{for(var F=N[Symbol.iterator](),D;!(S=(D=F.next()).done)&&(w.push(D.value),!(A&&w.length===A));S=!0);}catch(U){I=!0,C=U}finally{try{!S&&F.return&&F.return()}finally{if(I)throw C}}return w}return function(N,A){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return E(N,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function E(N,A){for(var w=0;w<A.length;w++){var S=A[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(N,S.key,S)}}return function(N,A,w){return A&&E(N.prototype,A),w&&E(N,w),N}}(),o=function E(N,A,w){N===null&&(N=Function.prototype);var S=Object.getOwnPropertyDescriptor(N,A);if(S===void 0){var I=Object.getPrototypeOf(N);return I===null?void 0:E(I,A,w)}else{if("value"in S)return S.value;var C=S.get;return C===void 0?void 0:C.call(w)}},l=i(2),f=b(l),c=i(0),h=b(c),u=i(4),d=b(u),p=i(6),v=b(p),g=i(7),m=b(g);function b(E){return E&&E.__esModule?E:{default:E}}function _(E,N){if(!(E instanceof N))throw new TypeError("Cannot call a class as a function")}function y(E,N){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:E}function x(E,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);E.prototype=Object.create(N&&N.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(E,N):E.__proto__=N)}var O=function(E){x(N,E);function N(){return _(this,N),y(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return N}(v.default);O.blotName="code",O.tagName="CODE";var T=function(E){x(N,E);function N(){return _(this,N),y(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return a(N,[{key:"delta",value:function(){var w=this,S=this.domNode.textContent;return S.endsWith(`
561
+ `)&&(S=S.slice(0,-1)),S.split(`
562
+ `).reduce(function(I,C){return I.insert(C).insert(`
563
+ `,w.formats())},new f.default)}},{key:"format",value:function(w,S){if(!(w===this.statics.blotName&&S)){var I=this.descendant(m.default,this.length()-1),C=s(I,1),F=C[0];F!=null&&F.deleteAt(F.length()-1,1),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"format",this).call(this,w,S)}}},{key:"formatAt",value:function(w,S,I,C){if(S!==0&&!(h.default.query(I,h.default.Scope.BLOCK)==null||I===this.statics.blotName&&C===this.statics.formats(this.domNode))){var F=this.newlineIndex(w);if(!(F<0||F>=w+S)){var D=this.newlineIndex(w,!0)+1,U=F-D+1,X=this.isolate(D,U),j=X.next;X.format(I,C),j instanceof N&&j.formatAt(0,w-D+S-U,I,C)}}}},{key:"insertAt",value:function(w,S,I){if(I==null){var C=this.descendant(m.default,w),F=s(C,2),D=F[0],U=F[1];D.insertAt(U,S)}}},{key:"length",value:function(){var w=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
564
+ `)?w:w+1}},{key:"newlineIndex",value:function(w){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(S)return this.domNode.textContent.slice(0,w).lastIndexOf(`
565
+ `);var I=this.domNode.textContent.slice(w).indexOf(`
566
+ `);return I>-1?w+I:-1}},{key:"optimize",value:function(w){this.domNode.textContent.endsWith(`
567
+ `)||this.appendChild(h.default.create("text",`
568
+ `)),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,w);var S=this.next;S!=null&&S.prev===this&&S.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===S.statics.formats(S.domNode)&&(S.optimize(w),S.moveChildren(this),S.remove())}},{key:"replace",value:function(w){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"replace",this).call(this,w),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(S){var I=h.default.find(S);I==null?S.parentNode.removeChild(S):I instanceof h.default.Embed?I.remove():I.unwrap()})}}],[{key:"create",value:function(w){var S=o(N.__proto__||Object.getPrototypeOf(N),"create",this).call(this,w);return S.setAttribute("spellcheck",!1),S}},{key:"formats",value:function(){return!0}}]),N}(d.default);T.blotName="code-block",T.tagName="PRE",T.TAB=" ",n.Code=O,n.default=T},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},a=function(){function j(k,R){var P=[],L=!0,$=!1,G=void 0;try{for(var M=k[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(P.push(B.value),!(R&&P.length===R));L=!0);}catch(q){$=!0,G=q}finally{try{!L&&M.return&&M.return()}finally{if($)throw G}}return P}return function(k,R){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return j(k,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(k,R){for(var P=0;P<R.length;P++){var L=R[P];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}return function(k,R,P){return R&&j(k.prototype,R),P&&j(k,P),k}}(),l=i(2),f=S(l),c=i(20),h=S(c),u=i(0),d=S(u),p=i(13),v=S(p),g=i(24),m=S(g),b=i(4),_=S(b),y=i(16),x=S(y),O=i(21),T=S(O),E=i(11),N=S(E),A=i(3),w=S(A);function S(j){return j&&j.__esModule?j:{default:j}}function I(j,k,R){return k in j?Object.defineProperty(j,k,{value:R,enumerable:!0,configurable:!0,writable:!0}):j[k]=R,j}function C(j,k){if(!(j instanceof k))throw new TypeError("Cannot call a class as a function")}var F=/^[ -~]*$/,D=function(){function j(k){C(this,j),this.scroll=k,this.delta=this.getDelta()}return o(j,[{key:"applyDelta",value:function(R){var P=this,L=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),R=X(R),R.reduce(function(G,M){var B=M.retain||M.delete||M.insert.length||1,q=M.attributes||{};if(M.insert!=null){if(typeof M.insert=="string"){var H=M.insert;H.endsWith(`
569
+ `)&&L&&(L=!1,H=H.slice(0,-1)),G>=$&&!H.endsWith(`
570
+ `)&&(L=!0),P.scroll.insertAt(G,H);var z=P.scroll.line(G),Y=a(z,2),J=Y[0],et=Y[1],at=(0,w.default)({},(0,b.bubbleFormats)(J));if(J instanceof _.default){var lt=J.descendant(d.default.Leaf,et),Nt=a(lt,1),It=Nt[0];at=(0,w.default)(at,(0,b.bubbleFormats)(It))}q=h.default.attributes.diff(at,q)||{}}else if(s(M.insert)==="object"){var V=Object.keys(M.insert)[0];if(V==null)return G;P.scroll.insertAt(G,V,M.insert[V])}$+=B}return Object.keys(q).forEach(function(W){P.scroll.formatAt(G,B,W,q[W])}),G+B},0),R.reduce(function(G,M){return typeof M.delete=="number"?(P.scroll.deleteAt(G,M.delete),G):G+(M.retain||M.insert.length||1)},0),this.scroll.batchEnd(),this.update(R)}},{key:"deleteText",value:function(R,P){return this.scroll.deleteAt(R,P),this.update(new f.default().retain(R).delete(P))}},{key:"formatLine",value:function(R,P){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys($).forEach(function(G){if(!(L.scroll.whitelist!=null&&!L.scroll.whitelist[G])){var M=L.scroll.lines(R,Math.max(P,1)),B=P;M.forEach(function(q){var H=q.length();if(!(q instanceof v.default))q.format(G,$[G]);else{var z=R-q.offset(L.scroll),Y=q.newlineIndex(z+B)-z+1;q.formatAt(z,Y,G,$[G])}B-=H})}}),this.scroll.optimize(),this.update(new f.default().retain(R).retain(P,(0,T.default)($)))}},{key:"formatText",value:function(R,P){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(G){L.scroll.formatAt(R,P,G,$[G])}),this.update(new f.default().retain(R).retain(P,(0,T.default)($)))}},{key:"getContents",value:function(R,P){return this.delta.slice(R,R+P)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(R,P){return R.concat(P.delta())},new f.default)}},{key:"getFormat",value:function(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=[],$=[];P===0?this.scroll.path(R).forEach(function(M){var B=a(M,1),q=B[0];q instanceof _.default?L.push(q):q instanceof d.default.Leaf&&$.push(q)}):(L=this.scroll.lines(R,P),$=this.scroll.descendants(d.default.Leaf,R,P));var G=[L,$].map(function(M){if(M.length===0)return{};for(var B=(0,b.bubbleFormats)(M.shift());Object.keys(B).length>0;){var q=M.shift();if(q==null)return B;B=U((0,b.bubbleFormats)(q),B)}return B});return w.default.apply(w.default,G)}},{key:"getText",value:function(R,P){return this.getContents(R,P).filter(function(L){return typeof L.insert=="string"}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(R,P,L){return this.scroll.insertAt(R,P,L),this.update(new f.default().retain(R).insert(I({},P,L)))}},{key:"insertText",value:function(R,P){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return P=P.replace(/\r\n/g,`
569
571
  `).replace(/\r/g,`
570
- `);return P.insert(I,S.attributes)}return P.push(S)},new d.default)}(A)).reduce(function(C,P){var S=P.retain||P.delete||P.insert.length||1,R=P.attributes||{};if(P.insert!=null){if(typeof P.insert=="string"){var I=P.insert;I.endsWith(`
571
- `)&&k&&(k=!1,I=I.slice(0,-1)),C>=w&&!I.endsWith(`
572
- `)&&(k=!0),N.scroll.insertAt(C,I);var M=N.scroll.line(C),L=u(M,2),j=L[0],q=L[1],G=(0,b.default)({},(0,a.bubbleFormats)(j));if(j instanceof h.default){var z=j.descendant(f.default.Leaf,q),K=u(z,1)[0];G=(0,b.default)(G,(0,a.bubbleFormats)(K))}R=y.default.attributes.diff(G,R)||{}}else if(s(P.insert)==="object"){var F=Object.keys(P.insert)[0];if(F==null)return C;N.scroll.insertAt(C,F,P.insert[F])}w+=S}return Object.keys(R).forEach(function(D){N.scroll.formatAt(C,S,D,R[D])}),C+S},0),A.reduce(function(C,P){return typeof P.delete=="number"?(N.scroll.deleteAt(C,P.delete),C):C+(P.retain||P.insert.length||1)},0),this.scroll.batchEnd(),this.update(A)}},{key:"deleteText",value:function(A,N){return this.scroll.deleteAt(A,N),this.update(new d.default().retain(A).delete(N))}},{key:"formatLine",value:function(A,N){var k=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(w).forEach(function(C){if(k.scroll.whitelist==null||k.scroll.whitelist[C]){var P=k.scroll.lines(A,Math.max(N,1)),S=N;P.forEach(function(R){var I=R.length();if(R instanceof l.default){var M=A-R.offset(k.scroll),L=R.newlineIndex(M+S)-M+1;R.formatAt(M,L,C,w[C])}else R.format(C,w[C]);S-=I})}}),this.scroll.optimize(),this.update(new d.default().retain(A).retain(N,(0,g.default)(w)))}},{key:"formatText",value:function(A,N){var k=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(w).forEach(function(C){k.scroll.formatAt(A,N,C,w[C])}),this.update(new d.default().retain(A).retain(N,(0,g.default)(w)))}},{key:"getContents",value:function(A,N){return this.delta.slice(A,A+N)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(A,N){return A.concat(N.delta())},new d.default)}},{key:"getFormat",value:function(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=[],w=[];N===0?this.scroll.path(A).forEach(function(P){var S=u(P,1)[0];S instanceof h.default?k.push(S):S instanceof f.default.Leaf&&w.push(S)}):(k=this.scroll.lines(A,N),w=this.scroll.descendants(f.default.Leaf,A,N));var C=[k,w].map(function(P){if(P.length===0)return{};for(var S=(0,a.bubbleFormats)(P.shift());Object.keys(S).length>0;){var R=P.shift();if(R==null)return S;S=T((0,a.bubbleFormats)(R),S)}return S});return b.default.apply(b.default,C)}},{key:"getText",value:function(A,N){return this.getContents(A,N).filter(function(k){return typeof k.insert=="string"}).map(function(k){return k.insert}).join("")}},{key:"insertEmbed",value:function(A,N,k){return this.scroll.insertAt(A,N,k),this.update(new d.default().retain(A).insert(function(w,C,P){return C in w?Object.defineProperty(w,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):w[C]=P,w}({},N,k)))}},{key:"insertText",value:function(A,N){var k=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return N=N.replace(/\r\n/g,`
572
+ `),this.scroll.insertAt(R,P),Object.keys($).forEach(function(G){L.scroll.formatAt(R,P.length,G,$[G])}),this.update(new f.default().retain(R).insert(P,(0,T.default)($)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var R=this.scroll.children.head;return R.statics.blotName!==_.default.blotName||R.children.length>1?!1:R.children.head instanceof x.default}},{key:"removeFormat",value:function(R,P){var L=this.getText(R,P),$=this.scroll.line(R+P),G=a($,2),M=G[0],B=G[1],q=0,H=new f.default;M!=null&&(M instanceof v.default?q=M.newlineIndex(B)-B+1:q=M.length()-B,H=M.delta().slice(B,B+q-1).insert(`
573
+ `));var z=this.getContents(R,P+q),Y=z.diff(new f.default().insert(L).concat(H)),J=new f.default().retain(R).concat(Y);return this.applyDelta(J)}},{key:"update",value:function(R){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(P.length===1&&P[0].type==="characterData"&&P[0].target.data.match(F)&&d.default.find(P[0].target)){var G=d.default.find(P[0].target),M=(0,b.bubbleFormats)(G),B=G.offset(this.scroll),q=P[0].oldValue.replace(m.default.CONTENTS,""),H=new f.default().insert(q),z=new f.default().insert(G.value()),Y=new f.default().retain(B).concat(H.diff(z,L));R=Y.reduce(function(J,et){return et.insert?J.insert(et.insert,M):J.push(et)},new f.default),this.delta=$.compose(R)}else this.delta=this.getDelta(),(!R||!(0,N.default)($.compose(R),this.delta))&&(R=$.diff(this.delta,L));return R}}]),j}();function U(j,k){return Object.keys(k).reduce(function(R,P){return j[P]==null||(k[P]===j[P]?R[P]=k[P]:Array.isArray(k[P])?k[P].indexOf(j[P])<0&&(R[P]=k[P].concat([j[P]])):R[P]=[k[P],j[P]]),R},{})}function X(j){return j.reduce(function(k,R){if(R.insert===1){var P=(0,T.default)(R.attributes);return delete P.image,k.insert({image:R.attributes.image},P)}if(R.attributes!=null&&(R.attributes.list===!0||R.attributes.bullet===!0)&&(R=(0,T.default)(R),R.attributes.list?R.attributes.list="ordered":(R.attributes.list="bullet",delete R.attributes.bullet)),typeof R.insert=="string"){var L=R.insert.replace(/\r\n/g,`
573
574
  `).replace(/\r/g,`
574
- `),this.scroll.insertAt(A,N),Object.keys(w).forEach(function(C){k.scroll.formatAt(A,N.length,C,w[C])}),this.update(new d.default().retain(A).insert(N,(0,g.default)(w)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var A=this.scroll.children.head;return A.statics.blotName===h.default.blotName&&!(A.children.length>1)&&A.children.head instanceof m.default}},{key:"removeFormat",value:function(A,N){var k=this.getText(A,N),w=this.scroll.line(A+N),C=u(w,2),P=C[0],S=C[1],R=0,I=new d.default;P!=null&&(R=P instanceof l.default?P.newlineIndex(S)-S+1:P.length()-S,I=P.delta().slice(S,S+R-1).insert(`
575
- `));var M=this.getContents(A,N+R).diff(new d.default().insert(k).concat(I)),L=new d.default().retain(A).concat(M);return this.applyDelta(L)}},{key:"update",value:function(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,w=this.delta;if(N.length===1&&N[0].type==="characterData"&&N[0].target.data.match(x)&&f.default.find(N[0].target)){var C=f.default.find(N[0].target),P=(0,a.bubbleFormats)(C),S=C.offset(this.scroll),R=N[0].oldValue.replace(c.default.CONTENTS,""),I=new d.default().insert(R),M=new d.default().insert(C.value());A=new d.default().retain(S).concat(I.diff(M,k)).reduce(function(L,j){return j.insert?L.insert(j.insert,P):L.push(j)},new d.default),this.delta=w.compose(A)}else this.delta=this.getDelta(),A&&(0,_.default)(w.compose(A),this.delta)||(A=w.diff(this.delta,k));return A}}]),O}();function T(O,A){return Object.keys(A).reduce(function(N,k){return O[k]==null||(A[k]===O[k]?N[k]=A[k]:Array.isArray(A[k])?A[k].indexOf(O[k])<0&&(N[k]=A[k].concat([O[k]])):N[k]=[A[k],O[k]]),N},{})}i.default=v},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.Range=void 0;var s=function(b,E){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return function(x,v){var T=[],O=!0,A=!1,N=void 0;try{for(var k,w=x[Symbol.iterator]();!(O=(k=w.next()).done)&&(T.push(k.value),!v||T.length!==v);O=!0);}catch(C){A=!0,N=C}finally{try{!O&&w.return&&w.return()}finally{if(A)throw N}}return T}(b,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=function(){function b(E,x){for(var v=0;v<x.length;v++){var T=x[v];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,T.key,T)}}return function(E,x,v){return x&&b(E.prototype,x),v&&b(E,v),E}}(),p=l(o(0)),d=l(o(21)),y=l(o(11)),f=l(o(8));function l(b){return b&&b.__esModule?b:{default:b}}function c(b){if(Array.isArray(b)){for(var E=0,x=Array(b.length);E<b.length;E++)x[E]=b[E];return x}return Array.from(b)}function a(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}var h=(0,l(o(10)).default)("quill:selection"),m=function b(E){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;a(this,b),this.index=E,this.length=x},g=function(){function b(E,x){var v=this;a(this,b),this.emitter=x,this.scroll=E,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=p.default.create("cursor",this),this.lastRange=this.savedRange=new m(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){v.mouseDown||setTimeout(v.update.bind(v,f.default.sources.USER),1)}),this.emitter.on(f.default.events.EDITOR_CHANGE,function(T,O){T===f.default.events.TEXT_CHANGE&&O.length()>0&&v.update(f.default.sources.SILENT)}),this.emitter.on(f.default.events.SCROLL_BEFORE_UPDATE,function(){if(v.hasFocus()){var T=v.getNativeRange();T!=null&&T.start.node!==v.cursor.textNode&&v.emitter.once(f.default.events.SCROLL_UPDATE,function(){try{v.setNativeRange(T.start.node,T.start.offset,T.end.node,T.end.offset)}catch{}})}}),this.emitter.on(f.default.events.SCROLL_OPTIMIZE,function(T,O){if(O.range){var A=O.range,N=A.startNode,k=A.startOffset,w=A.endNode,C=A.endOffset;v.setNativeRange(N,k,w,C)}}),this.update(f.default.sources.SILENT)}return u(b,[{key:"handleComposition",value:function(){var E=this;this.root.addEventListener("compositionstart",function(){E.composing=!0}),this.root.addEventListener("compositionend",function(){if(E.composing=!1,E.cursor.parent){var x=E.cursor.restore();if(!x)return;setTimeout(function(){E.setNativeRange(x.startNode,x.startOffset,x.endNode,x.endOffset)},1)}})}},{key:"handleDragging",value:function(){var E=this;this.emitter.listenDOM("mousedown",document.body,function(){E.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){E.mouseDown=!1,E.update(f.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(E,x){if(this.scroll.whitelist==null||this.scroll.whitelist[E]){this.scroll.update();var v=this.getNativeRange();if(v!=null&&v.native.collapsed&&!p.default.query(E,p.default.Scope.BLOCK)){if(v.start.node!==this.cursor.textNode){var T=p.default.find(v.start.node,!1);if(T==null)return;if(T instanceof p.default.Leaf){var O=T.split(v.start.offset);T.parent.insertBefore(this.cursor,O)}else T.insertBefore(this.cursor,v.start.node);this.cursor.attach()}this.cursor.format(E,x),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(E){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=this.scroll.length();E=Math.min(E,v-1),x=Math.min(E+x,v-1)-E;var T=void 0,O=this.scroll.leaf(E),A=s(O,2),N=A[0],k=A[1];if(N==null)return null;var w=N.position(k,!0),C=s(w,2);T=C[0],k=C[1];var P=document.createRange();if(x>0){P.setStart(T,k);var S=this.scroll.leaf(E+x),R=s(S,2);if(N=R[0],k=R[1],N==null)return null;var I=N.position(k,!0),M=s(I,2);return T=M[0],k=M[1],P.setEnd(T,k),P.getBoundingClientRect()}var L="left",j=void 0;return T instanceof Text?(k<T.data.length?(P.setStart(T,k),P.setEnd(T,k+1)):(P.setStart(T,k-1),P.setEnd(T,k),L="right"),j=P.getBoundingClientRect()):(j=N.domNode.getBoundingClientRect(),k>0&&(L="right")),{bottom:j.top+j.height,height:j.height,left:j[L],right:j[L],top:j.top,width:0}}},{key:"getNativeRange",value:function(){var E=document.getSelection();if(E==null||E.rangeCount<=0)return null;var x=E.getRangeAt(0);if(x==null)return null;var v=this.normalizeNative(x);return h.info("getNativeRange",v),v}},{key:"getRange",value:function(){var E=this.getNativeRange();return E==null?[null,null]:[this.normalizedToRange(E),E]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(E){var x=this,v=[[E.start.node,E.start.offset]];E.native.collapsed||v.push([E.end.node,E.end.offset]);var T=v.map(function(N){var k=s(N,2),w=k[0],C=k[1],P=p.default.find(w,!0),S=P.offset(x.scroll);return C===0?S:P instanceof p.default.Container?S+P.length():S+P.index(w,C)}),O=Math.min(Math.max.apply(Math,c(T)),this.scroll.length()-1),A=Math.min.apply(Math,[O].concat(c(T)));return new m(A,O-A)}},{key:"normalizeNative",value:function(E){if(!_(this.root,E.startContainer)||!E.collapsed&&!_(this.root,E.endContainer))return null;var x={start:{node:E.startContainer,offset:E.startOffset},end:{node:E.endContainer,offset:E.endOffset},native:E};return[x.start,x.end].forEach(function(v){for(var T=v.node,O=v.offset;!(T instanceof Text)&&T.childNodes.length>0;)if(T.childNodes.length>O)T=T.childNodes[O],O=0;else{if(T.childNodes.length!==O)break;O=(T=T.lastChild)instanceof Text?T.data.length:T.childNodes.length+1}v.node=T,v.offset=O}),x}},{key:"rangeToNative",value:function(E){var x=this,v=E.collapsed?[E.index]:[E.index,E.index+E.length],T=[],O=this.scroll.length();return v.forEach(function(A,N){A=Math.min(O-1,A);var k,w=x.scroll.leaf(A),C=s(w,2),P=C[0],S=C[1],R=P.position(S,N!==0),I=s(R,2);k=I[0],S=I[1],T.push(k,S)}),T.length<2&&(T=T.concat(T)),T}},{key:"scrollIntoView",value:function(E){var x=this.lastRange;if(x!=null){var v=this.getBounds(x.index,x.length);if(v!=null){var T=this.scroll.length()-1,O=this.scroll.line(Math.min(x.index,T)),A=s(O,1)[0],N=A;if(x.length>0){var k=this.scroll.line(Math.min(x.index+x.length,T));N=s(k,1)[0]}if(A!=null&&N!=null){var w=E.getBoundingClientRect();v.top<w.top?E.scrollTop-=w.top-v.top:v.bottom>w.bottom&&(E.scrollTop+=v.bottom-w.bottom)}}}}},{key:"setNativeRange",value:function(E,x){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E,T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:x,O=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(h.info("setNativeRange",E,x,v,T),E==null||this.root.parentNode!=null&&E.parentNode!=null&&v.parentNode!=null){var A=document.getSelection();if(A!=null)if(E!=null){this.hasFocus()||this.root.focus();var N=(this.getNativeRange()||{}).native;if(N==null||O||E!==N.startContainer||x!==N.startOffset||v!==N.endContainer||T!==N.endOffset){E.tagName=="BR"&&(x=[].indexOf.call(E.parentNode.childNodes,E),E=E.parentNode),v.tagName=="BR"&&(T=[].indexOf.call(v.parentNode.childNodes,v),v=v.parentNode);var k=document.createRange();k.setStart(E,x),k.setEnd(v,T),A.removeAllRanges(),A.addRange(k)}}else A.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(E){var x=arguments.length>1&&arguments[1]!==void 0&&arguments[1],v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;if(typeof x=="string"&&(v=x,x=!1),h.info("setRange",E),E!=null){var T=this.rangeToNative(E);this.setNativeRange.apply(this,c(T).concat([x]))}else this.setNativeRange(null);this.update(v)}},{key:"update",value:function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,x=this.lastRange,v=this.getRange(),T=s(v,2),O=T[0],A=T[1];if(this.lastRange=O,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,y.default)(x,this.lastRange)){var N;!this.composing&&A!=null&&A.native.collapsed&&A.start.node!==this.cursor.textNode&&this.cursor.restore();var k,w=[f.default.events.SELECTION_CHANGE,(0,d.default)(this.lastRange),(0,d.default)(x),E];(N=this.emitter).emit.apply(N,[f.default.events.EDITOR_CHANGE].concat(w)),E!==f.default.sources.SILENT&&(k=this.emitter).emit.apply(k,w)}}}]),b}();function _(b,E){try{E.parentNode}catch{return!1}return E instanceof Text&&(E=E.parentNode),b.contains(E)}i.Range=m,i.default=g},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function y(f,l){for(var c=0;c<l.length;c++){var a=l[c];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(f,a.key,a)}}return function(f,l,c){return l&&y(f.prototype,l),c&&y(f,c),f}}(),u=function y(f,l,c){f===null&&(f=Function.prototype);var a=Object.getOwnPropertyDescriptor(f,l);if(a===void 0){var h=Object.getPrototypeOf(f);return h===null?void 0:y(h,l,c)}if("value"in a)return a.value;var m=a.get;return m!==void 0?m.call(c):void 0},p=function(y){return y&&y.__esModule?y:{default:y}}(o(0)),d=function(y){function f(){return function(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,f),function(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||typeof c!="object"&&typeof c!="function"?l:c}(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return function(l,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(f,y),s(f,[{key:"insertInto",value:function(l,c){l.children.length===0?u(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"insertInto",this).call(this,l,c):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),f}(p.default.Embed);d.blotName="break",d.tagName="BR",i.default=d},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var h in a)a.hasOwnProperty(h)&&(c[h]=a[h])},function(c,a){function h(){this.constructor=c}s(c,a),c.prototype=a===null?Object.create(a):(h.prototype=a.prototype,new h)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(44),d=o(30),y=o(1),f=function(c){function a(h){var m=c.call(this,h)||this;return m.build(),m}return u(a,c),a.prototype.appendChild=function(h){this.insertBefore(h)},a.prototype.attach=function(){c.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},a.prototype.build=function(){var h=this;this.children=new p.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(m){try{var g=l(m);h.insertBefore(g,h.children.head||void 0)}catch(_){if(_ instanceof y.ParchmentError)return;throw _}})},a.prototype.deleteAt=function(h,m){if(h===0&&m===this.length())return this.remove();this.children.forEachAt(h,m,function(g,_,b){g.deleteAt(_,b)})},a.prototype.descendant=function(h,m){var g=this.children.find(m),_=g[0],b=g[1];return h.blotName==null&&h(_)||h.blotName!=null&&_ instanceof h?[_,b]:_ instanceof a?_.descendant(h,b):[null,-1]},a.prototype.descendants=function(h,m,g){m===void 0&&(m=0),g===void 0&&(g=Number.MAX_VALUE);var _=[],b=g;return this.children.forEachAt(m,g,function(E,x,v){(h.blotName==null&&h(E)||h.blotName!=null&&E instanceof h)&&_.push(E),E instanceof a&&(_=_.concat(E.descendants(h,x,b))),b-=v}),_},a.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),c.prototype.detach.call(this)},a.prototype.formatAt=function(h,m,g,_){this.children.forEachAt(h,m,function(b,E,x){b.formatAt(E,x,g,_)})},a.prototype.insertAt=function(h,m,g){var _=this.children.find(h),b=_[0],E=_[1];if(b)b.insertAt(E,m,g);else{var x=g==null?y.create("text",m):y.create(m,g);this.appendChild(x)}},a.prototype.insertBefore=function(h,m){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(g){return h instanceof g}))throw new y.ParchmentError("Cannot insert "+h.statics.blotName+" into "+this.statics.blotName);h.insertInto(this,m)},a.prototype.length=function(){return this.children.reduce(function(h,m){return h+m.length()},0)},a.prototype.moveChildren=function(h,m){this.children.forEach(function(g){h.insertBefore(g,m)})},a.prototype.optimize=function(h){if(c.prototype.optimize.call(this,h),this.children.length===0)if(this.statics.defaultChild!=null){var m=y.create(this.statics.defaultChild);this.appendChild(m),m.optimize(h)}else this.remove()},a.prototype.path=function(h,m){m===void 0&&(m=!1);var g=this.children.find(h,m),_=g[0],b=g[1],E=[[this,h]];return _ instanceof a?E.concat(_.path(b,m)):(_!=null&&E.push([_,b]),E)},a.prototype.removeChild=function(h){this.children.remove(h)},a.prototype.replace=function(h){h instanceof a&&h.moveChildren(this),c.prototype.replace.call(this,h)},a.prototype.split=function(h,m){if(m===void 0&&(m=!1),!m){if(h===0)return this;if(h===this.length())return this.next}var g=this.clone();return this.parent.insertBefore(g,this.next),this.children.forEachAt(h,this.length(),function(_,b,E){_=_.split(b,m),g.appendChild(_)}),g},a.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},a.prototype.update=function(h,m){var g=this,_=[],b=[];h.forEach(function(E){E.target===g.domNode&&E.type==="childList"&&(_.push.apply(_,E.addedNodes),b.push.apply(b,E.removedNodes))}),b.forEach(function(E){if(!(E.parentNode!=null&&E.tagName!=="IFRAME"&&document.body.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var x=y.find(E);x!=null&&(x.domNode.parentNode!=null&&x.domNode.parentNode!==g.domNode||x.detach())}}),_.filter(function(E){return E.parentNode==g.domNode}).sort(function(E,x){return E===x?0:E.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(E){var x=null;E.nextSibling!=null&&(x=y.find(E.nextSibling));var v=l(E);v.next==x&&v.next!=null||(v.parent!=null&&v.parent.removeChild(g),g.insertBefore(v,x||void 0))})},a}(d.default);function l(c){var a=y.find(c);if(a==null)try{a=y.create(c)}catch{a=y.create(y.Scope.INLINE),[].slice.call(c.childNodes).forEach(function(m){a.domNode.appendChild(m)}),c.parentNode&&c.parentNode.replaceChild(a.domNode,c),a.attach()}return a}i.default=f},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var h in a)a.hasOwnProperty(h)&&(c[h]=a[h])},function(c,a){function h(){this.constructor=c}s(c,a),c.prototype=a===null?Object.create(a):(h.prototype=a.prototype,new h)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(12),d=o(31),y=o(17),f=o(1),l=function(c){function a(h){var m=c.call(this,h)||this;return m.attributes=new d.default(m.domNode),m}return u(a,c),a.formats=function(h){return typeof this.tagName=="string"||(Array.isArray(this.tagName)?h.tagName.toLowerCase():void 0)},a.prototype.format=function(h,m){var g=f.query(h);g instanceof p.default?this.attributes.attribute(g,m):m&&(g==null||h===this.statics.blotName&&this.formats()[h]===m||this.replaceWith(h,m))},a.prototype.formats=function(){var h=this.attributes.values(),m=this.statics.formats(this.domNode);return m!=null&&(h[this.statics.blotName]=m),h},a.prototype.replaceWith=function(h,m){var g=c.prototype.replaceWith.call(this,h,m);return this.attributes.copy(g),g},a.prototype.update=function(h,m){var g=this;c.prototype.update.call(this,h,m),h.some(function(_){return _.target===g.domNode&&_.type==="attributes"})&&this.attributes.build()},a.prototype.wrap=function(h,m){var g=c.prototype.wrap.call(this,h,m);return g instanceof a&&g.statics.scope===this.statics.scope&&this.attributes.move(g),g},a}(y.default);i.default=l},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,l){f.__proto__=l}||function(f,l){for(var c in l)l.hasOwnProperty(c)&&(f[c]=l[c])},function(f,l){function c(){this.constructor=f}s(f,l),f.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(30),d=o(1),y=function(f){function l(){return f!==null&&f.apply(this,arguments)||this}return u(l,f),l.value=function(c){return!0},l.prototype.index=function(c,a){return this.domNode===c||this.domNode.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(a,1):-1},l.prototype.position=function(c,a){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return c>0&&(h+=1),[this.parent.domNode,h]},l.prototype.value=function(){var c;return(c={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,c},l.scope=d.Scope.INLINE_BLOT,l}(p.default);i.default=y},function(n,i,o){var s=o(11),u=o(3),p={attributes:{compose:function(y,f,l){typeof y!="object"&&(y={}),typeof f!="object"&&(f={});var c=u(!0,{},f);for(var a in l||(c=Object.keys(c).reduce(function(h,m){return c[m]!=null&&(h[m]=c[m]),h},{})),y)y[a]!==void 0&&f[a]===void 0&&(c[a]=y[a]);return Object.keys(c).length>0?c:void 0},diff:function(y,f){typeof y!="object"&&(y={}),typeof f!="object"&&(f={});var l=Object.keys(y).concat(Object.keys(f)).reduce(function(c,a){return s(y[a],f[a])||(c[a]=f[a]===void 0?null:f[a]),c},{});return Object.keys(l).length>0?l:void 0},transform:function(y,f,l){if(typeof y!="object")return f;if(typeof f=="object"){if(!l)return f;var c=Object.keys(f).reduce(function(a,h){return y[h]===void 0&&(a[h]=f[h]),a},{});return Object.keys(c).length>0?c:void 0}}},iterator:function(y){return new d(y)},length:function(y){return typeof y.delete=="number"?y.delete:typeof y.retain=="number"?y.retain:typeof y.insert=="string"?y.insert.length:1}};function d(y){this.ops=y,this.index=0,this.offset=0}d.prototype.hasNext=function(){return this.peekLength()<1/0},d.prototype.next=function(y){y||(y=1/0);var f=this.ops[this.index];if(f){var l=this.offset,c=p.length(f);if(y>=c-l?(y=c-l,this.index+=1,this.offset=0):this.offset+=y,typeof f.delete=="number")return{delete:y};var a={};return f.attributes&&(a.attributes=f.attributes),typeof f.retain=="number"?a.retain=y:typeof f.insert=="string"?a.insert=f.insert.substr(l,y):a.insert=f.insert,a}return{retain:1/0}},d.prototype.peek=function(){return this.ops[this.index]},d.prototype.peekLength=function(){return this.ops[this.index]?p.length(this.ops[this.index])-this.offset:1/0},d.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},d.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var y=this.offset,f=this.index,l=this.next(),c=this.ops.slice(this.index);return this.offset=y,this.index=f,[l].concat(c)}return[]},n.exports=p},function(n,i){var o=function(){function s(c,a){return a!=null&&c instanceof a}var u,p,d;try{u=Map}catch{u=function(){}}try{p=Set}catch{p=function(){}}try{d=Promise}catch{d=function(){}}function y(c,a,h,m,g){typeof a=="object"&&(h=a.depth,m=a.prototype,g=a.includeNonEnumerable,a=a.circular);var _=[],b=[],E=typeof Buffer<"u";return a===void 0&&(a=!0),h===void 0&&(h=1/0),function x(v,T){if(v===null)return null;if(T===0)return v;var O,A;if(typeof v!="object")return v;if(s(v,u))O=new u;else if(s(v,p))O=new p;else if(s(v,d))O=new d(function(M,L){v.then(function(j){M(x(j,T-1))},function(j){L(x(j,T-1))})});else if(y.__isArray(v))O=[];else if(y.__isRegExp(v))O=new RegExp(v.source,l(v)),v.lastIndex&&(O.lastIndex=v.lastIndex);else if(y.__isDate(v))O=new Date(v.getTime());else{if(E&&Buffer.isBuffer(v))return O=Buffer.allocUnsafe?Buffer.allocUnsafe(v.length):new Buffer(v.length),v.copy(O),O;s(v,Error)?O=Object.create(v):m===void 0?(A=Object.getPrototypeOf(v),O=Object.create(A)):(O=Object.create(m),A=m)}if(a){var N=_.indexOf(v);if(N!=-1)return b[N];_.push(v),b.push(O)}for(var k in s(v,u)&&v.forEach(function(M,L){var j=x(L,T-1),q=x(M,T-1);O.set(j,q)}),s(v,p)&&v.forEach(function(M){var L=x(M,T-1);O.add(L)}),v){var w;A&&(w=Object.getOwnPropertyDescriptor(A,k)),w&&w.set==null||(O[k]=x(v[k],T-1))}if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(v);for(k=0;k<C.length;k++){var P=C[k];(!(R=Object.getOwnPropertyDescriptor(v,P))||R.enumerable||g)&&(O[P]=x(v[P],T-1),R.enumerable||Object.defineProperty(O,P,{enumerable:!1}))}}if(g){var S=Object.getOwnPropertyNames(v);for(k=0;k<S.length;k++){var R,I=S[k];(R=Object.getOwnPropertyDescriptor(v,I))&&R.enumerable||(O[I]=x(v[I],T-1),Object.defineProperty(O,I,{enumerable:!1}))}}return O}(c,h)}function f(c){return Object.prototype.toString.call(c)}function l(c){var a="";return c.global&&(a+="g"),c.ignoreCase&&(a+="i"),c.multiline&&(a+="m"),a}return y.clonePrototype=function(c){if(c===null)return null;var a=function(){};return a.prototype=c,new a},y.__objToStr=f,y.__isDate=function(c){return typeof c=="object"&&f(c)==="[object Date]"},y.__isArray=function(c){return typeof c=="object"&&f(c)==="[object Array]"},y.__isRegExp=function(c){return typeof c=="object"&&f(c)==="[object RegExp]"},y.__getRegExpFlags=l,y}();typeof n=="object"&&n.exports&&(n.exports=o)},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(b,E){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return function(x,v){var T=[],O=!0,A=!1,N=void 0;try{for(var k,w=x[Symbol.iterator]();!(O=(k=w.next()).done)&&(T.push(k.value),!v||T.length!==v);O=!0);}catch(C){A=!0,N=C}finally{try{!O&&w.return&&w.return()}finally{if(A)throw N}}return T}(b,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=function(){function b(E,x){for(var v=0;v<x.length;v++){var T=x[v];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,T.key,T)}}return function(E,x,v){return x&&b(E.prototype,x),v&&b(E,v),E}}(),p=function b(E,x,v){E===null&&(E=Function.prototype);var T=Object.getOwnPropertyDescriptor(E,x);if(T===void 0){var O=Object.getPrototypeOf(E);return O===null?void 0:b(O,x,v)}if("value"in T)return T.value;var A=T.get;return A!==void 0?A.call(v):void 0},d=m(o(0)),y=m(o(8)),f=o(4),l=m(f),c=m(o(16)),a=m(o(13)),h=m(o(25));function m(b){return b&&b.__esModule?b:{default:b}}function g(b){return b instanceof l.default||b instanceof f.BlockEmbed}var _=function(b){function E(x,v){(function(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")})(this,E);var T=function(O,A){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!A||typeof A!="object"&&typeof A!="function"?O:A}(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,x));return T.emitter=v.emitter,Array.isArray(v.whitelist)&&(T.whitelist=v.whitelist.reduce(function(O,A){return O[A]=!0,O},{})),T.domNode.addEventListener("DOMNodeInserted",function(){}),T.optimize(),T.enable(),T}return function(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}(E,b),u(E,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(x,v){var T=this.line(x),O=s(T,2),A=O[0],N=O[1],k=this.line(x+v),w=s(k,1)[0];if(p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"deleteAt",this).call(this,x,v),w!=null&&A!==w&&N>0){if(A instanceof f.BlockEmbed||w instanceof f.BlockEmbed)return void this.optimize();if(A instanceof a.default){var C=A.newlineIndex(A.length(),!0);if(C>-1&&(A=A.split(C+1))===w)return void this.optimize()}else if(w instanceof a.default){var P=w.newlineIndex(0);P>-1&&w.split(P+1)}var S=w.children.head instanceof c.default?null:w.children.head;A.moveChildren(w,S),A.remove()}this.optimize()}},{key:"enable",value:function(){var x=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.domNode.setAttribute("contenteditable",x)}},{key:"formatAt",value:function(x,v,T,O){(this.whitelist==null||this.whitelist[T])&&(p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"formatAt",this).call(this,x,v,T,O),this.optimize())}},{key:"insertAt",value:function(x,v,T){if(T==null||this.whitelist==null||this.whitelist[v]){if(x>=this.length())if(T==null||d.default.query(v,d.default.Scope.BLOCK)==null){var O=d.default.create(this.statics.defaultChild);this.appendChild(O),T==null&&v.endsWith(`
576
- `)&&(v=v.slice(0,-1)),O.insertAt(0,v,T)}else{var A=d.default.create(v,T);this.appendChild(A)}else p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,x,v,T);this.optimize()}}},{key:"insertBefore",value:function(x,v){if(x.statics.scope===d.default.Scope.INLINE_BLOT){var T=d.default.create(this.statics.defaultChild);T.appendChild(x),x=T}p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertBefore",this).call(this,x,v)}},{key:"leaf",value:function(x){return this.path(x).pop()||[null,-1]}},{key:"line",value:function(x){return x===this.length()?this.line(x-1):this.descendant(g,x)}},{key:"lines",value:function(){return function x(v,T,O){var A=[],N=O;return v.children.forEachAt(T,O,function(k,w,C){g(k)?A.push(k):k instanceof d.default.Container&&(A=A.concat(x(k,w,N))),N-=C}),A}(this,arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,x,v),x.length>0&&this.emitter.emit(y.default.events.SCROLL_OPTIMIZE,x,v))}},{key:"path",value:function(x){return p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"path",this).call(this,x).slice(1)}},{key:"update",value:function(x){if(this.batch!==!0){var v=y.default.sources.USER;typeof x=="string"&&(v=x),Array.isArray(x)||(x=this.observer.takeRecords()),x.length>0&&this.emitter.emit(y.default.events.SCROLL_BEFORE_UPDATE,v,x),p(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"update",this).call(this,x.concat([])),x.length>0&&this.emitter.emit(y.default.events.SCROLL_UPDATE,v,x)}}}]),E}(d.default.Scroll);_.blotName="scroll",_.className="ql-editor",_.tagName="DIV",_.defaultChild="block",_.allowedChildren=[l.default,f.BlockEmbed,h.default],i.default=_},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.SHORTKEY=i.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},u=function(S,R){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return function(I,M){var L=[],j=!0,q=!1,G=void 0;try{for(var z,K=I[Symbol.iterator]();!(j=(z=K.next()).done)&&(L.push(z.value),!M||L.length!==M);j=!0);}catch(F){q=!0,G=F}finally{try{!j&&K.return&&K.return()}finally{if(q)throw G}}return L}(S,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")},p=function(){function S(R,I){for(var M=0;M<I.length;M++){var L=I[M];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}return function(R,I,M){return I&&S(R.prototype,I),M&&S(R,M),R}}(),d=_(o(21)),y=_(o(11)),f=_(o(3)),l=_(o(2)),c=_(o(20)),a=_(o(0)),h=_(o(5)),m=_(o(10)),g=_(o(9));function _(S){return S&&S.__esModule?S:{default:S}}function b(S,R,I){return R in S?Object.defineProperty(S,R,{value:I,enumerable:!0,configurable:!0,writable:!0}):S[R]=I,S}var E=(0,m.default)("quill:keyboard"),x=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",v=function(S){function R(I,M){(function(j,q){if(!(j instanceof q))throw new TypeError("Cannot call a class as a function")})(this,R);var L=function(j,q){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!q||typeof q!="object"&&typeof q!="function"?j:q}(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,I,M));return L.bindings={},Object.keys(L.options.bindings).forEach(function(j){(j!=="list autofill"||I.scroll.whitelist==null||I.scroll.whitelist.list)&&L.options.bindings[j]&&L.addBinding(L.options.bindings[j])}),L.addBinding({key:R.keys.ENTER,shiftKey:null},k),L.addBinding({key:R.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(L.addBinding({key:R.keys.BACKSPACE},{collapsed:!0},O),L.addBinding({key:R.keys.DELETE},{collapsed:!0},A)):(L.addBinding({key:R.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},O),L.addBinding({key:R.keys.DELETE},{collapsed:!0,suffix:/^.?$/},A)),L.addBinding({key:R.keys.BACKSPACE},{collapsed:!1},N),L.addBinding({key:R.keys.DELETE},{collapsed:!1},N),L.addBinding({key:R.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},O),L.listen(),L}return function(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(I,M):I.__proto__=M)}(R,S),p(R,null,[{key:"match",value:function(I,M){return M=P(M),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(L){return!!M[L]!==I[L]&&M[L]!==null})&&M.key===(I.which||I.keyCode)}}]),p(R,[{key:"addBinding",value:function(I){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},j=P(I);if(j==null||j.key==null)return E.warn("Attempted to add invalid keyboard binding",j);typeof M=="function"&&(M={handler:M}),typeof L=="function"&&(L={handler:L}),j=(0,f.default)(j,M,L),this.bindings[j.key]=this.bindings[j.key]||[],this.bindings[j.key].push(j)}},{key:"listen",value:function(){var I=this;this.quill.root.addEventListener("keydown",function(M){if(!M.defaultPrevented){var L=M.which||M.keyCode,j=(I.bindings[L]||[]).filter(function(ne){return R.match(M,ne)});if(j.length!==0){var q=I.quill.getSelection();if(q!=null&&I.quill.hasFocus()){var G=I.quill.getLine(q.index),z=u(G,2),K=z[0],F=z[1],D=I.quill.getLeaf(q.index),B=u(D,2),U=B[0],H=B[1],V=q.length===0?[U,H]:I.quill.getLeaf(q.index+q.length),$=u(V,2),Y=$[0],J=$[1],re=U instanceof a.default.Text?U.value().slice(0,H):"",ve=Y instanceof a.default.Text?Y.value().slice(J):"",ce={collapsed:q.length===0,empty:q.length===0&&K.length()<=1,format:I.quill.getFormat(q),offset:F,prefix:re,suffix:ve};j.some(function(ne){if(ne.collapsed!=null&&ne.collapsed!==ce.collapsed||ne.empty!=null&&ne.empty!==ce.empty||ne.offset!=null&&ne.offset!==ce.offset)return!1;if(Array.isArray(ne.format)){if(ne.format.every(function(oe){return ce.format[oe]==null}))return!1}else if(s(ne.format)==="object"&&!Object.keys(ne.format).every(function(oe){return ne.format[oe]===!0?ce.format[oe]!=null:ne.format[oe]===!1?ce.format[oe]==null:(0,y.default)(ne.format[oe],ce.format[oe])}))return!1;return!(ne.prefix!=null&&!ne.prefix.test(ce.prefix)||ne.suffix!=null&&!ne.suffix.test(ce.suffix)||ne.handler.call(I,q,ce)===!0)})&&M.preventDefault()}}}})}}]),R}(g.default);function T(S,R){var I,M=S===v.keys.LEFT?"prefix":"suffix";return b(I={key:S,shiftKey:R,altKey:null},M,/^$/),b(I,"handler",function(L){var j=L.index;S===v.keys.RIGHT&&(j+=L.length+1);var q=this.quill.getLeaf(j);return!(u(q,1)[0]instanceof a.default.Embed&&(S===v.keys.LEFT?R?this.quill.setSelection(L.index-1,L.length+1,h.default.sources.USER):this.quill.setSelection(L.index-1,h.default.sources.USER):R?this.quill.setSelection(L.index,L.length+1,h.default.sources.USER):this.quill.setSelection(L.index+L.length+1,h.default.sources.USER),1))}),I}function O(S,R){if(!(S.index===0||this.quill.getLength()<=1)){var I=this.quill.getLine(S.index),M=u(I,1)[0],L={};if(R.offset===0){var j=this.quill.getLine(S.index-1),q=u(j,1)[0];if(q!=null&&q.length()>1){var G=M.formats(),z=this.quill.getFormat(S.index-1,1);L=c.default.attributes.diff(G,z)||{}}}var K=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(R.prefix)?2:1;this.quill.deleteText(S.index-K,K,h.default.sources.USER),Object.keys(L).length>0&&this.quill.formatLine(S.index-K,K,L,h.default.sources.USER),this.quill.focus()}}function A(S,R){var I=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(R.suffix)?2:1;if(!(S.index>=this.quill.getLength()-I)){var M={},L=0,j=this.quill.getLine(S.index),q=u(j,1)[0];if(R.offset>=q.length()-1){var G=this.quill.getLine(S.index+1),z=u(G,1)[0];if(z){var K=q.formats(),F=this.quill.getFormat(S.index,1);M=c.default.attributes.diff(K,F)||{},L=z.length()}}this.quill.deleteText(S.index,I,h.default.sources.USER),Object.keys(M).length>0&&this.quill.formatLine(S.index+L-1,I,M,h.default.sources.USER)}}function N(S){var R=this.quill.getLines(S),I={};if(R.length>1){var M=R[0].formats(),L=R[R.length-1].formats();I=c.default.attributes.diff(L,M)||{}}this.quill.deleteText(S,h.default.sources.USER),Object.keys(I).length>0&&this.quill.formatLine(S.index,1,I,h.default.sources.USER),this.quill.setSelection(S.index,h.default.sources.SILENT),this.quill.focus()}function k(S,R){var I=this;S.length>0&&this.quill.scroll.deleteAt(S.index,S.length);var M=Object.keys(R.format).reduce(function(L,j){return a.default.query(j,a.default.Scope.BLOCK)&&!Array.isArray(R.format[j])&&(L[j]=R.format[j]),L},{});this.quill.insertText(S.index,`
577
- `,M,h.default.sources.USER),this.quill.setSelection(S.index+1,h.default.sources.SILENT),this.quill.focus(),Object.keys(R.format).forEach(function(L){M[L]==null&&(Array.isArray(R.format[L])||L!=="link"&&I.quill.format(L,R.format[L],h.default.sources.USER))})}function w(S){return{key:v.keys.TAB,shiftKey:!S,format:{"code-block":!0},handler:function(R){var I=a.default.query("code-block"),M=R.index,L=R.length,j=this.quill.scroll.descendant(I,M),q=u(j,2),G=q[0],z=q[1];if(G!=null){var K=this.quill.getIndex(G),F=G.newlineIndex(z,!0)+1,D=G.newlineIndex(K+z+L),B=G.domNode.textContent.slice(F,D).split(`
578
- `);z=0,B.forEach(function(U,H){S?(G.insertAt(F+z,I.TAB),z+=I.TAB.length,H===0?M+=I.TAB.length:L+=I.TAB.length):U.startsWith(I.TAB)&&(G.deleteAt(F+z,I.TAB.length),z-=I.TAB.length,H===0?M-=I.TAB.length:L-=I.TAB.length),z+=U.length+1}),this.quill.update(h.default.sources.USER),this.quill.setSelection(M,L,h.default.sources.SILENT)}}}}function C(S){return{key:S[0].toUpperCase(),shortKey:!0,handler:function(R,I){this.quill.format(S,!I.format[S],h.default.sources.USER)}}}function P(S){if(typeof S=="string"||typeof S=="number")return P({key:S});if((S===void 0?"undefined":s(S))==="object"&&(S=(0,d.default)(S,!1)),typeof S.key=="string")if(v.keys[S.key.toUpperCase()]!=null)S.key=v.keys[S.key.toUpperCase()];else{if(S.key.length!==1)return null;S.key=S.key.toUpperCase().charCodeAt(0)}return S.shortKey&&(S[x]=S.shortKey,delete S.shortKey),S}v.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},v.DEFAULTS={bindings:{bold:C("bold"),italic:C("italic"),underline:C("underline"),indent:{key:v.keys.TAB,format:["blockquote","indent","list"],handler:function(S,R){if(R.collapsed&&R.offset!==0)return!0;this.quill.format("indent","+1",h.default.sources.USER)}},outdent:{key:v.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(S,R){if(R.collapsed&&R.offset!==0)return!0;this.quill.format("indent","-1",h.default.sources.USER)}},"outdent backspace":{key:v.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(S,R){R.format.indent!=null?this.quill.format("indent","-1",h.default.sources.USER):R.format.list!=null&&this.quill.format("list",!1,h.default.sources.USER)}},"indent code-block":w(!0),"outdent code-block":w(!1),"remove tab":{key:v.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(S){this.quill.deleteText(S.index-1,1,h.default.sources.USER)}},tab:{key:v.keys.TAB,handler:function(S){this.quill.history.cutoff();var R=new l.default().retain(S.index).delete(S.length).insert(" ");this.quill.updateContents(R,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(S.index+1,h.default.sources.SILENT)}},"list empty enter":{key:v.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(S,R){this.quill.format("list",!1,h.default.sources.USER),R.format.indent&&this.quill.format("indent",!1,h.default.sources.USER)}},"checklist enter":{key:v.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(S){var R=this.quill.getLine(S.index),I=u(R,2),M=I[0],L=I[1],j=(0,f.default)({},M.formats(),{list:"checked"}),q=new l.default().retain(S.index).insert(`
579
- `,j).retain(M.length()-L-1).retain(1,{list:"unchecked"});this.quill.updateContents(q,h.default.sources.USER),this.quill.setSelection(S.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:v.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(S,R){var I=this.quill.getLine(S.index),M=u(I,2),L=M[0],j=M[1],q=new l.default().retain(S.index).insert(`
580
- `,R.format).retain(L.length()-j-1).retain(1,{header:null});this.quill.updateContents(q,h.default.sources.USER),this.quill.setSelection(S.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(S,R){var I=R.prefix.length,M=this.quill.getLine(S.index),L=u(M,2),j=L[0],q=L[1];if(q>I)return!0;var G=void 0;switch(R.prefix.trim()){case"[]":case"[ ]":G="unchecked";break;case"[x]":G="checked";break;case"-":case"*":G="bullet";break;default:G="ordered"}this.quill.insertText(S.index," ",h.default.sources.USER),this.quill.history.cutoff();var z=new l.default().retain(S.index-q).delete(I+1).retain(j.length()-2-q).retain(1,{list:G});this.quill.updateContents(z,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(S.index-I,h.default.sources.SILENT)}},"code exit":{key:v.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(S){var R=this.quill.getLine(S.index),I=u(R,2),M=I[0],L=I[1],j=new l.default().retain(S.index+M.length()-L-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(j,h.default.sources.USER)}},"embed left":T(v.keys.LEFT,!1),"embed left shift":T(v.keys.LEFT,!0),"embed right":T(v.keys.RIGHT,!1),"embed right shift":T(v.keys.RIGHT,!0)}},i.default=v,i.SHORTKEY=x},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(c,a){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return function(h,m){var g=[],_=!0,b=!1,E=void 0;try{for(var x,v=h[Symbol.iterator]();!(_=(x=v.next()).done)&&(g.push(x.value),!m||g.length!==m);_=!0);}catch(T){b=!0,E=T}finally{try{!_&&v.return&&v.return()}finally{if(b)throw E}}return g}(c,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=function c(a,h,m){a===null&&(a=Function.prototype);var g=Object.getOwnPropertyDescriptor(a,h);if(g===void 0){var _=Object.getPrototypeOf(a);return _===null?void 0:c(_,h,m)}if("value"in g)return g.value;var b=g.get;return b!==void 0?b.call(m):void 0},p=function(){function c(a,h){for(var m=0;m<h.length;m++){var g=h[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(a,g.key,g)}}return function(a,h,m){return h&&c(a.prototype,h),m&&c(a,m),a}}(),d=f(o(0)),y=f(o(7));function f(c){return c&&c.__esModule?c:{default:c}}var l=function(c){function a(h,m){(function(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")})(this,a);var g=function(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||typeof b!="object"&&typeof b!="function"?_:b}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,h));return g.selection=m,g.textNode=document.createTextNode(a.CONTENTS),g.domNode.appendChild(g.textNode),g._length=0,g}return function(h,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);h.prototype=Object.create(m&&m.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(h,m):h.__proto__=m)}(a,c),p(a,null,[{key:"value",value:function(){}}]),p(a,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(h,m){if(this._length!==0)return u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"format",this).call(this,h,m);for(var g=this,_=0;g!=null&&g.statics.scope!==d.default.Scope.BLOCK_BLOT;)_+=g.offset(g.parent),g=g.parent;g!=null&&(this._length=a.CONTENTS.length,g.optimize(),g.formatAt(_,a.CONTENTS.length,h,m),this._length=0)}},{key:"index",value:function(h,m){return h===this.textNode?0:u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"index",this).call(this,h,m)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&this.parent!=null){var h=this.textNode,m=this.selection.getNativeRange(),g=void 0,_=void 0,b=void 0;if(m!=null&&m.start.node===h&&m.end.node===h){var E=[h,m.start.offset,m.end.offset];g=E[0],_=E[1],b=E[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==a.CONTENTS){var x=this.textNode.data.split(a.CONTENTS).join("");this.next instanceof y.default?(g=this.next.domNode,this.next.insertAt(0,x),this.textNode.data=a.CONTENTS):(this.textNode.data=x,this.parent.insertBefore(d.default.create(this.textNode),this),this.textNode=document.createTextNode(a.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),_!=null){var v=[_,b].map(function(O){return Math.max(0,Math.min(g.data.length,O-1))}),T=s(v,2);return _=T[0],b=T[1],{startNode:g,startOffset:_,endNode:g,endOffset:b}}}}},{key:"update",value:function(h,m){var g=this;if(h.some(function(b){return b.type==="characterData"&&b.target===g.textNode})){var _=this.restore();_&&(m.range=_)}}},{key:"value",value:function(){return""}}]),a}(d.default.Embed);l.blotName="cursor",l.className="ql-cursor",l.tagName="span",l.CONTENTS="\uFEFF",i.default=l},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=d(o(0)),u=o(4),p=d(u);function d(f){return f&&f.__esModule?f:{default:f}}var y=function(f){function l(){return function(c,a){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this,l),function(c,a){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||typeof a!="object"&&typeof a!="function"?c:a}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function(c,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof a);c.prototype=Object.create(a&&a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(c,a):c.__proto__=a)}(l,f),l}(s.default.Container);y.allowedChildren=[p.default,u.BlockEmbed,y],i.default=y},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.ColorStyle=i.ColorClass=i.ColorAttributor=void 0;var s=function(){function l(c,a){for(var h=0;h<a.length;h++){var m=a[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,a,h){return a&&l(c.prototype,a),h&&l(c,h),c}}(),u=function l(c,a,h){c===null&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,a);if(m===void 0){var g=Object.getPrototypeOf(c);return g===null?void 0:l(g,a,h)}if("value"in m)return m.value;var _=m.get;return _!==void 0?_.call(h):void 0},p=function(l){return l&&l.__esModule?l:{default:l}}(o(0)),d=function(l){function c(){return function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")}(this,c),function(a,h){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?a:h}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);a.prototype=Object.create(h&&h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(a,h):a.__proto__=h)}(c,l),s(c,[{key:"value",value:function(a){var h=u(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"value",this).call(this,a);return h.startsWith("rgb(")?(h=h.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+h.split(",").map(function(m){return("00"+parseInt(m).toString(16)).slice(-2)}).join("")):h}}]),c}(p.default.Attributor.Style),y=new p.default.Attributor.Class("color","ql-color",{scope:p.default.Scope.INLINE}),f=new d("color","color",{scope:p.default.Scope.INLINE});i.ColorAttributor=d,i.ColorClass=y,i.ColorStyle=f},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.sanitize=i.default=void 0;var s=function(){function f(l,c){for(var a=0;a<c.length;a++){var h=c[a];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}return function(l,c,a){return c&&f(l.prototype,c),a&&f(l,a),l}}(),u=function f(l,c,a){l===null&&(l=Function.prototype);var h=Object.getOwnPropertyDescriptor(l,c);if(h===void 0){var m=Object.getPrototypeOf(l);return m===null?void 0:f(m,c,a)}if("value"in h)return h.value;var g=h.get;return g!==void 0?g.call(a):void 0},p=function(f){return f&&f.__esModule?f:{default:f}}(o(6)),d=function(f){function l(){return function(c,a){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this,l),function(c,a){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||typeof a!="object"&&typeof a!="function"?c:a}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function(c,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof a);c.prototype=Object.create(a&&a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(c,a):c.__proto__=a)}(l,f),s(l,[{key:"format",value:function(c,a){if(c!==this.statics.blotName||!a)return u(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"format",this).call(this,c,a);a=this.constructor.sanitize(a),this.domNode.setAttribute("href",a)}}],[{key:"create",value:function(c){var a=u(l.__proto__||Object.getPrototypeOf(l),"create",this).call(this,c);return c=this.sanitize(c),a.setAttribute("href",c),a.setAttribute("rel","noopener noreferrer"),a.setAttribute("target","_blank"),a}},{key:"formats",value:function(c){return c.getAttribute("href")}},{key:"sanitize",value:function(c){return y(c,this.PROTOCOL_WHITELIST)?c:this.SANITIZED_URL}}]),l}(p.default);function y(f,l){var c=document.createElement("a");c.href=f;var a=c.href.slice(0,c.href.indexOf(":"));return l.indexOf(a)>-1}d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"],i.default=d,i.sanitize=y},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},u=function(){function a(h,m){for(var g=0;g<m.length;g++){var _=m[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(h,_.key,_)}}return function(h,m,g){return m&&a(h.prototype,m),g&&a(h,g),h}}(),p=y(o(23)),d=y(o(107));function y(a){return a&&a.__esModule?a:{default:a}}var f=0;function l(a,h){a.setAttribute(h,a.getAttribute(h)!=="true")}var c=function(){function a(h){var m=this;(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")})(this,a),this.select=h,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){m.togglePicker()}),this.label.addEventListener("keydown",function(g){switch(g.keyCode){case p.default.keys.ENTER:m.togglePicker();break;case p.default.keys.ESCAPE:m.escape(),g.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}return u(a,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),l(this.label,"aria-expanded"),l(this.options,"aria-hidden")}},{key:"buildItem",value:function(h){var m=this,g=document.createElement("span");return g.tabIndex="0",g.setAttribute("role","button"),g.classList.add("ql-picker-item"),h.hasAttribute("value")&&g.setAttribute("data-value",h.getAttribute("value")),h.textContent&&g.setAttribute("data-label",h.textContent),g.addEventListener("click",function(){m.selectItem(g,!0)}),g.addEventListener("keydown",function(_){switch(_.keyCode){case p.default.keys.ENTER:m.selectItem(g,!0),_.preventDefault();break;case p.default.keys.ESCAPE:m.escape(),_.preventDefault()}}),g}},{key:"buildLabel",value:function(){var h=document.createElement("span");return h.classList.add("ql-picker-label"),h.innerHTML=d.default,h.tabIndex="0",h.setAttribute("role","button"),h.setAttribute("aria-expanded","false"),this.container.appendChild(h),h}},{key:"buildOptions",value:function(){var h=this,m=document.createElement("span");m.classList.add("ql-picker-options"),m.setAttribute("aria-hidden","true"),m.tabIndex="-1",m.id="ql-picker-options-"+f,f+=1,this.label.setAttribute("aria-controls",m.id),this.options=m,[].slice.call(this.select.options).forEach(function(g){var _=h.buildItem(g);m.appendChild(_),g.selected===!0&&h.selectItem(_)}),this.container.appendChild(m)}},{key:"buildPicker",value:function(){var h=this;[].slice.call(this.select.attributes).forEach(function(m){h.container.setAttribute(m.name,m.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var h=this;this.close(),setTimeout(function(){return h.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(h){var m=arguments.length>1&&arguments[1]!==void 0&&arguments[1],g=this.container.querySelector(".ql-selected");if(h!==g&&(g!=null&&g.classList.remove("ql-selected"),h!=null&&(h.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(h.parentNode.children,h),h.hasAttribute("data-value")?this.label.setAttribute("data-value",h.getAttribute("data-value")):this.label.removeAttribute("data-value"),h.hasAttribute("data-label")?this.label.setAttribute("data-label",h.getAttribute("data-label")):this.label.removeAttribute("data-label"),m))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var h=void 0;if(this.select.selectedIndex>-1){var m=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];h=this.select.options[this.select.selectedIndex],this.selectItem(m)}else this.selectItem(null);var g=h!=null&&h!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",g)}}]),a}();i.default=c},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=E(o(0)),u=E(o(5)),p=o(4),d=E(p),y=E(o(16)),f=E(o(25)),l=E(o(24)),c=E(o(35)),a=E(o(6)),h=E(o(22)),m=E(o(7)),g=E(o(55)),_=E(o(42)),b=E(o(23));function E(x){return x&&x.__esModule?x:{default:x}}u.default.register({"blots/block":d.default,"blots/block/embed":p.BlockEmbed,"blots/break":y.default,"blots/container":f.default,"blots/cursor":l.default,"blots/embed":c.default,"blots/inline":a.default,"blots/scroll":h.default,"blots/text":m.default,"modules/clipboard":g.default,"modules/history":_.default,"modules/keyboard":b.default}),s.default.register(d.default,y.default,l.default,a.default,h.default,m.default),i.default=u.default},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=o(1),u=function(){function p(d){this.domNode=d,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(p.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),p.create=function(d){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var y;return Array.isArray(this.tagName)?(typeof d=="string"&&(d=d.toUpperCase(),parseInt(d).toString()===d&&(d=parseInt(d))),y=typeof d=="number"?document.createElement(this.tagName[d-1]):this.tagName.indexOf(d)>-1?document.createElement(d):document.createElement(this.tagName[0])):y=document.createElement(this.tagName),this.className&&y.classList.add(this.className),y},p.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},p.prototype.clone=function(){var d=this.domNode.cloneNode(!1);return s.create(d)},p.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},p.prototype.deleteAt=function(d,y){this.isolate(d,y).remove()},p.prototype.formatAt=function(d,y,f,l){var c=this.isolate(d,y);if(s.query(f,s.Scope.BLOT)!=null&&l)c.wrap(f,l);else if(s.query(f,s.Scope.ATTRIBUTE)!=null){var a=s.create(this.statics.scope);c.wrap(a),a.format(f,l)}},p.prototype.insertAt=function(d,y,f){var l=f==null?s.create("text",y):s.create(y,f),c=this.split(d);this.parent.insertBefore(l,c)},p.prototype.insertInto=function(d,y){y===void 0&&(y=null),this.parent!=null&&this.parent.children.remove(this);var f=null;d.children.insertBefore(this,y),y!=null&&(f=y.domNode),this.domNode.parentNode==d.domNode&&this.domNode.nextSibling==f||d.domNode.insertBefore(this.domNode,f),this.parent=d,this.attach()},p.prototype.isolate=function(d,y){var f=this.split(d);return f.split(y),f},p.prototype.length=function(){return 1},p.prototype.offset=function(d){return d===void 0&&(d=this.parent),this.parent==null||this==d?0:this.parent.children.offset(this)+this.parent.offset(d)},p.prototype.optimize=function(d){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},p.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},p.prototype.replace=function(d){d.parent!=null&&(d.parent.insertBefore(this,d.next),d.remove())},p.prototype.replaceWith=function(d,y){var f=typeof d=="string"?s.create(d,y):d;return f.replace(this),f},p.prototype.split=function(d,y){return d===0?this:this.next},p.prototype.update=function(d,y){},p.prototype.wrap=function(d,y){var f=typeof d=="string"?s.create(d,y):d;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},p.blotName="abstract",p}();i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=o(12),u=o(32),p=o(33),d=o(1),y=function(){function f(l){this.attributes={},this.domNode=l,this.build()}return f.prototype.attribute=function(l,c){c?l.add(this.domNode,c)&&(l.value(this.domNode)!=null?this.attributes[l.attrName]=l:delete this.attributes[l.attrName]):(l.remove(this.domNode),delete this.attributes[l.attrName])},f.prototype.build=function(){var l=this;this.attributes={};var c=s.default.keys(this.domNode),a=u.default.keys(this.domNode),h=p.default.keys(this.domNode);c.concat(a).concat(h).forEach(function(m){var g=d.query(m,d.Scope.ATTRIBUTE);g instanceof s.default&&(l.attributes[g.attrName]=g)})},f.prototype.copy=function(l){var c=this;Object.keys(this.attributes).forEach(function(a){var h=c.attributes[a].value(c.domNode);l.format(a,h)})},f.prototype.move=function(l){var c=this;this.copy(l),Object.keys(this.attributes).forEach(function(a){c.attributes[a].remove(c.domNode)}),this.attributes={}},f.prototype.values=function(){var l=this;return Object.keys(this.attributes).reduce(function(c,a){return c[a]=l.attributes[a].value(l.domNode),c},{})},f}();i.default=y},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var l in f)f.hasOwnProperty(l)&&(y[l]=f[l])},function(y,f){function l(){this.constructor=y}s(y,f),y.prototype=f===null?Object.create(f):(l.prototype=f.prototype,new l)});function p(y,f){return(y.getAttribute("class")||"").split(/\s+/).filter(function(l){return l.indexOf(f+"-")===0})}Object.defineProperty(i,"__esModule",{value:!0});var d=function(y){function f(){return y!==null&&y.apply(this,arguments)||this}return u(f,y),f.keys=function(l){return(l.getAttribute("class")||"").split(/\s+/).map(function(c){return c.split("-").slice(0,-1).join("-")})},f.prototype.add=function(l,c){return!!this.canAdd(l,c)&&(this.remove(l),l.classList.add(this.keyName+"-"+c),!0)},f.prototype.remove=function(l){p(l,this.keyName).forEach(function(c){l.classList.remove(c)}),l.classList.length===0&&l.removeAttribute("class")},f.prototype.value=function(l){var c=(p(l,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(l,c)?c:""},f}(o(12).default);i.default=d},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var l in f)f.hasOwnProperty(l)&&(y[l]=f[l])},function(y,f){function l(){this.constructor=y}s(y,f),y.prototype=f===null?Object.create(f):(l.prototype=f.prototype,new l)});function p(y){var f=y.split("-"),l=f.slice(1).map(function(c){return c[0].toUpperCase()+c.slice(1)}).join("");return f[0]+l}Object.defineProperty(i,"__esModule",{value:!0});var d=function(y){function f(){return y!==null&&y.apply(this,arguments)||this}return u(f,y),f.keys=function(l){return(l.getAttribute("style")||"").split(";").map(function(c){return c.split(":")[0].trim()})},f.prototype.add=function(l,c){return!!this.canAdd(l,c)&&(l.style[p(this.keyName)]=c,!0)},f.prototype.remove=function(l){l.style[p(this.keyName)]="",l.getAttribute("style")||l.removeAttribute("style")},f.prototype.value=function(l){var c=l.style[p(this.keyName)];return this.canAdd(l,c)?c:""},f}(o(12).default);i.default=d},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function p(d,y){for(var f=0;f<y.length;f++){var l=y[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}return function(d,y,f){return y&&p(d.prototype,y),f&&p(d,f),d}}(),u=function(){function p(d,y){(function(f,l){if(!(f instanceof l))throw new TypeError("Cannot call a class as a function")})(this,p),this.quill=d,this.options=y,this.modules={}}return s(p,[{key:"init",value:function(){var d=this;Object.keys(this.options.modules).forEach(function(y){d.modules[y]==null&&d.addModule(y)})}},{key:"addModule",value:function(d){var y=this.quill.constructor.import("modules/"+d);return this.modules[d]=new y(this.quill,this.options.modules[d]||{}),this.modules[d]}}]),p}();u.DEFAULTS={modules:{}},u.themes={default:u},i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function c(a,h){for(var m=0;m<h.length;m++){var g=h[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(a,g.key,g)}}return function(a,h,m){return h&&c(a.prototype,h),m&&c(a,m),a}}(),u=function c(a,h,m){a===null&&(a=Function.prototype);var g=Object.getOwnPropertyDescriptor(a,h);if(g===void 0){var _=Object.getPrototypeOf(a);return _===null?void 0:c(_,h,m)}if("value"in g)return g.value;var b=g.get;return b!==void 0?b.call(m):void 0},p=y(o(0)),d=y(o(7));function y(c){return c&&c.__esModule?c:{default:c}}var f="\uFEFF",l=function(c){function a(h){(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")})(this,a);var m=function(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!_||typeof _!="object"&&typeof _!="function"?g:_}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,h));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(g){m.contentNode.appendChild(g)}),m.leftGuard=document.createTextNode(f),m.rightGuard=document.createTextNode(f),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return function(h,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);h.prototype=Object.create(m&&m.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(h,m):h.__proto__=m)}(a,c),s(a,[{key:"index",value:function(h,m){return h===this.leftGuard?0:h===this.rightGuard?1:u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"index",this).call(this,h,m)}},{key:"restore",value:function(h){var m=void 0,g=void 0,_=h.data.split(f).join("");if(h===this.leftGuard)if(this.prev instanceof d.default){var b=this.prev.length();this.prev.insertAt(b,_),m={startNode:this.prev.domNode,startOffset:b+_.length}}else g=document.createTextNode(_),this.parent.insertBefore(p.default.create(g),this),m={startNode:g,startOffset:_.length};else h===this.rightGuard&&(this.next instanceof d.default?(this.next.insertAt(0,_),m={startNode:this.next.domNode,startOffset:_.length}):(g=document.createTextNode(_),this.parent.insertBefore(p.default.create(g),this.next),m={startNode:g,startOffset:_.length}));return h.data=f,m}},{key:"update",value:function(h,m){var g=this;h.forEach(function(_){if(_.type==="characterData"&&(_.target===g.leftGuard||_.target===g.rightGuard)){var b=g.restore(_.target);b&&(m.range=b)}})}}]),a}(p.default.Embed);i.default=l},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.AlignStyle=i.AlignClass=i.AlignAttribute=void 0;var s=function(f){return f&&f.__esModule?f:{default:f}}(o(0)),u={scope:s.default.Scope.BLOCK,whitelist:["right","center","justify"]},p=new s.default.Attributor.Attribute("align","align",u),d=new s.default.Attributor.Class("align","ql-align",u),y=new s.default.Attributor.Style("align","text-align",u);i.AlignAttribute=p,i.AlignClass=d,i.AlignStyle=y},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.BackgroundStyle=i.BackgroundClass=void 0;var s=function(y){return y&&y.__esModule?y:{default:y}}(o(0)),u=o(26),p=new s.default.Attributor.Class("background","ql-bg",{scope:s.default.Scope.INLINE}),d=new u.ColorAttributor("background","background-color",{scope:s.default.Scope.INLINE});i.BackgroundClass=p,i.BackgroundStyle=d},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.DirectionStyle=i.DirectionClass=i.DirectionAttribute=void 0;var s=function(f){return f&&f.__esModule?f:{default:f}}(o(0)),u={scope:s.default.Scope.BLOCK,whitelist:["rtl"]},p=new s.default.Attributor.Attribute("direction","dir",u),d=new s.default.Attributor.Class("direction","ql-direction",u),y=new s.default.Attributor.Style("direction","direction",u);i.DirectionAttribute=p,i.DirectionClass=d,i.DirectionStyle=y},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.FontClass=i.FontStyle=void 0;var s=function(){function c(a,h){for(var m=0;m<h.length;m++){var g=h[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(a,g.key,g)}}return function(a,h,m){return h&&c(a.prototype,h),m&&c(a,m),a}}(),u=function c(a,h,m){a===null&&(a=Function.prototype);var g=Object.getOwnPropertyDescriptor(a,h);if(g===void 0){var _=Object.getPrototypeOf(a);return _===null?void 0:c(_,h,m)}if("value"in g)return g.value;var b=g.get;return b!==void 0?b.call(m):void 0},p=function(c){return c&&c.__esModule?c:{default:c}}(o(0)),d={scope:p.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new p.default.Attributor.Class("font","ql-font",d),f=function(c){function a(){return function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")}(this,a),function(h,m){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||typeof m!="object"&&typeof m!="function"?h:m}(this,(a.__proto__||Object.getPrototypeOf(a)).apply(this,arguments))}return function(h,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);h.prototype=Object.create(m&&m.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(h,m):h.__proto__=m)}(a,c),s(a,[{key:"value",value:function(h){return u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"value",this).call(this,h).replace(/["']/g,"")}}]),a}(p.default.Attributor.Style),l=new f("font","font-family",d);i.FontStyle=l,i.FontClass=y},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.SizeStyle=i.SizeClass=void 0;var s=function(d){return d&&d.__esModule?d:{default:d}}(o(0)),u=new s.default.Attributor.Class("size","ql-size",{scope:s.default.Scope.INLINE,whitelist:["small","large","huge"]}),p=new s.default.Attributor.Style("size","font-size",{scope:s.default.Scope.INLINE,whitelist:["10px","18px","32px"]});i.SizeClass=u,i.SizeStyle=p},function(n,i,o){n.exports={align:{"":o(76),center:o(77),right:o(78),justify:o(79)},background:o(80),blockquote:o(81),bold:o(82),clean:o(83),code:o(58),"code-block":o(58),color:o(84),direction:{"":o(85),rtl:o(86)},float:{center:o(87),full:o(88),left:o(89),right:o(90)},formula:o(91),header:{1:o(92),2:o(93)},italic:o(94),image:o(95),indent:{"+1":o(96),"-1":o(97)},link:o(98),list:{ordered:o(99),bullet:o(100),check:o(101)},script:{sub:o(102),super:o(103)},strike:o(104),underline:o(105),video:o(106)}},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.getLastChangeIndex=i.default=void 0;var s=function(){function l(c,a){for(var h=0;h<a.length;h++){var m=a[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,a,h){return a&&l(c.prototype,a),h&&l(c,h),c}}(),u=d(o(0)),p=d(o(5));function d(l){return l&&l.__esModule?l:{default:l}}var y=function(l){function c(a,h){(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c);var m=function(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!_||typeof _!="object"&&typeof _!="function"?g:_}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,a,h));return m.lastRecorded=0,m.ignoreChange=!1,m.clear(),m.quill.on(p.default.events.EDITOR_CHANGE,function(g,_,b,E){g!==p.default.events.TEXT_CHANGE||m.ignoreChange||(m.options.userOnly&&E!==p.default.sources.USER?m.transform(_):m.record(_,b))}),m.quill.keyboard.addBinding({key:"Z",shortKey:!0},m.undo.bind(m)),m.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},m.redo.bind(m)),/Win/i.test(navigator.platform)&&m.quill.keyboard.addBinding({key:"Y",shortKey:!0},m.redo.bind(m)),m}return function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);a.prototype=Object.create(h&&h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(a,h):a.__proto__=h)}(c,l),s(c,[{key:"change",value:function(a,h){if(this.stack[a].length!==0){var m=this.stack[a].pop();this.stack[h].push(m),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(m[a],p.default.sources.USER),this.ignoreChange=!1;var g=f(m[a]);this.quill.setSelection(g)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(a,h){if(a.ops.length!==0){this.stack.redo=[];var m=this.quill.getContents().diff(h),g=Date.now();if(this.lastRecorded+this.options.delay>g&&this.stack.undo.length>0){var _=this.stack.undo.pop();m=m.compose(_.undo),a=_.redo.compose(a)}else this.lastRecorded=g;this.stack.undo.push({redo:a,undo:m}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(a){this.stack.undo.forEach(function(h){h.undo=a.transform(h.undo,!0),h.redo=a.transform(h.redo,!0)}),this.stack.redo.forEach(function(h){h.undo=a.transform(h.undo,!0),h.redo=a.transform(h.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),c}(d(o(9)).default);function f(l){var c=l.reduce(function(h,m){return h+=m.delete||0},0),a=l.length()-c;return function(h){var m=h.ops[h.ops.length-1];return m!=null&&(m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
581
- `):m.attributes!=null&&Object.keys(m.attributes).some(function(g){return u.default.query(g,u.default.Scope.BLOCK)!=null}))}(l)&&(a-=1),a}y.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},i.default=y,i.getLastChangeIndex=f},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.BaseTooltip=void 0;var s=function(){function C(P,S){for(var R=0;R<S.length;R++){var I=S[R];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(P,I.key,I)}}return function(P,S,R){return S&&C(P.prototype,S),R&&C(P,R),P}}(),u=function C(P,S,R){P===null&&(P=Function.prototype);var I=Object.getOwnPropertyDescriptor(P,S);if(I===void 0){var M=Object.getPrototypeOf(P);return M===null?void 0:C(M,S,R)}if("value"in I)return I.value;var L=I.get;return L!==void 0?L.call(R):void 0},p=g(o(3)),d=g(o(2)),y=g(o(8)),f=g(o(23)),l=g(o(34)),c=g(o(59)),a=g(o(60)),h=g(o(28)),m=g(o(61));function g(C){return C&&C.__esModule?C:{default:C}}function _(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function b(C,P){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!P||typeof P!="object"&&typeof P!="function"?C:P}function E(C,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);C.prototype=Object.create(P&&P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(C,P):C.__proto__=P)}var x=[!1,"center","right","justify"],v=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],T=[!1,"serif","monospace"],O=["1","2","3",!1],A=["small",!1,"large","huge"],N=function(C){function P(S,R){_(this,P);var I=b(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,S,R));return S.emitter.listenDOM("click",document.body,function M(L){if(!document.body.contains(S.root))return document.body.removeEventListener("click",M);I.tooltip==null||I.tooltip.root.contains(L.target)||document.activeElement===I.tooltip.textbox||I.quill.hasFocus()||I.tooltip.hide(),I.pickers!=null&&I.pickers.forEach(function(j){j.container.contains(L.target)||j.close()})}),I}return E(P,C),s(P,[{key:"addModule",value:function(S){var R=u(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"addModule",this).call(this,S);return S==="toolbar"&&this.extendToolbar(R),R}},{key:"buildButtons",value:function(S,R){S.forEach(function(I){(I.getAttribute("class")||"").split(/\s+/).forEach(function(M){if(M.startsWith("ql-")&&(M=M.slice(3),R[M]!=null))if(M==="direction")I.innerHTML=R[M][""]+R[M].rtl;else if(typeof R[M]=="string")I.innerHTML=R[M];else{var L=I.value||"";L!=null&&R[M][L]&&(I.innerHTML=R[M][L])}})})}},{key:"buildPickers",value:function(S,R){var I=this;this.pickers=S.map(function(M){if(M.classList.contains("ql-align"))return M.querySelector("option")==null&&w(M,x),new a.default(M,R.align);if(M.classList.contains("ql-background")||M.classList.contains("ql-color")){var L=M.classList.contains("ql-background")?"background":"color";return M.querySelector("option")==null&&w(M,v,L==="background"?"#ffffff":"#000000"),new c.default(M,R[L])}return M.querySelector("option")==null&&(M.classList.contains("ql-font")?w(M,T):M.classList.contains("ql-header")?w(M,O):M.classList.contains("ql-size")&&w(M,A)),new h.default(M)}),this.quill.on(y.default.events.EDITOR_CHANGE,function(){I.pickers.forEach(function(M){M.update()})})}}]),P}(l.default);N.DEFAULTS=(0,p.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var C=this,P=this.container.querySelector("input.ql-image[type=file]");P==null&&((P=document.createElement("input")).setAttribute("type","file"),P.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),P.classList.add("ql-image"),P.addEventListener("change",function(){if(P.files!=null&&P.files[0]!=null){var S=new FileReader;S.onload=function(R){var I=C.quill.getSelection(!0);C.quill.updateContents(new d.default().retain(I.index).delete(I.length).insert({image:R.target.result}),y.default.sources.USER),C.quill.setSelection(I.index+1,y.default.sources.SILENT),P.value=""},S.readAsDataURL(P.files[0])}}),this.container.appendChild(P)),P.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var k=function(C){function P(S,R){_(this,P);var I=b(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,S,R));return I.textbox=I.root.querySelector('input[type="text"]'),I.listen(),I}return E(P,C),s(P,[{key:"listen",value:function(){var S=this;this.textbox.addEventListener("keydown",function(R){f.default.match(R,"enter")?(S.save(),R.preventDefault()):f.default.match(R,"escape")&&(S.cancel(),R.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),R!=null?this.textbox.value=R:S!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+S)||""),this.root.setAttribute("data-mode",S)}},{key:"restoreFocus",value:function(){var S=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=S}},{key:"save",value:function(){var S=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var R=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",S,y.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",S,y.default.sources.USER)),this.quill.root.scrollTop=R;break;case"video":S=function(L){var j=L.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||L.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return j?(j[1]||"https")+"://www.youtube.com/embed/"+j[2]+"?showinfo=0":(j=L.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(j[1]||"https")+"://player.vimeo.com/video/"+j[2]+"/":L}(S);case"formula":if(!S)break;var I=this.quill.getSelection(!0);if(I!=null){var M=I.index+I.length;this.quill.insertEmbed(M,this.root.getAttribute("data-mode"),S,y.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(M+1," ",y.default.sources.USER),this.quill.setSelection(M+2,y.default.sources.USER)}}this.textbox.value="",this.hide()}}]),P}(m.default);function w(C,P){var S=arguments.length>2&&arguments[2]!==void 0&&arguments[2];P.forEach(function(R){var I=document.createElement("option");R===S?I.setAttribute("selected","selected"):I.setAttribute("value",R),C.appendChild(I)})}i.BaseTooltip=k,i.default=N},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function u(){this.head=this.tail=null,this.length=0}return u.prototype.append=function(){for(var p=[],d=0;d<arguments.length;d++)p[d]=arguments[d];this.insertBefore(p[0],null),p.length>1&&this.append.apply(this,p.slice(1))},u.prototype.contains=function(p){for(var d,y=this.iterator();d=y();)if(d===p)return!0;return!1},u.prototype.insertBefore=function(p,d){p&&(p.next=d,d!=null?(p.prev=d.prev,d.prev!=null&&(d.prev.next=p),d.prev=p,d===this.head&&(this.head=p)):this.tail!=null?(this.tail.next=p,p.prev=this.tail,this.tail=p):(p.prev=null,this.head=this.tail=p),this.length+=1)},u.prototype.offset=function(p){for(var d=0,y=this.head;y!=null;){if(y===p)return d;d+=y.length(),y=y.next}return-1},u.prototype.remove=function(p){this.contains(p)&&(p.prev!=null&&(p.prev.next=p.next),p.next!=null&&(p.next.prev=p.prev),p===this.head&&(this.head=p.next),p===this.tail&&(this.tail=p.prev),this.length-=1)},u.prototype.iterator=function(p){return p===void 0&&(p=this.head),function(){var d=p;return p!=null&&(p=p.next),d}},u.prototype.find=function(p,d){d===void 0&&(d=!1);for(var y,f=this.iterator();y=f();){var l=y.length();if(p<l||d&&p===l&&(y.next==null||y.next.length()!==0))return[y,p];p-=l}return[null,0]},u.prototype.forEach=function(p){for(var d,y=this.iterator();d=y();)p(d)},u.prototype.forEachAt=function(p,d,y){if(!(d<=0))for(var f,l=this.find(p),c=l[0],a=p-l[1],h=this.iterator(c);(f=h())&&a<p+d;){var m=f.length();p>a?y(f,p-a,Math.min(d,a+m-p)):y(f,0,Math.min(m,p+d-a)),a+=m}},u.prototype.map=function(p){return this.reduce(function(d,y){return d.push(p(y)),d},[])},u.prototype.reduce=function(p,d){for(var y,f=this.iterator();y=f();)d=p(d,y);return d},u}();i.default=s},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var a in c)c.hasOwnProperty(a)&&(l[a]=c[a])},function(l,c){function a(){this.constructor=l}s(l,c),l.prototype=c===null?Object.create(c):(a.prototype=c.prototype,new a)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(17),d=o(1),y={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=function(l){function c(a){var h=l.call(this,a)||this;return h.scroll=h,h.observer=new MutationObserver(function(m){h.update(m)}),h.observer.observe(h.domNode,y),h.attach(),h}return u(c,l),c.prototype.detach=function(){l.prototype.detach.call(this),this.observer.disconnect()},c.prototype.deleteAt=function(a,h){this.update(),a===0&&h===this.length()?this.children.forEach(function(m){m.remove()}):l.prototype.deleteAt.call(this,a,h)},c.prototype.formatAt=function(a,h,m,g){this.update(),l.prototype.formatAt.call(this,a,h,m,g)},c.prototype.insertAt=function(a,h,m){this.update(),l.prototype.insertAt.call(this,a,h,m)},c.prototype.optimize=function(a,h){var m=this;a===void 0&&(a=[]),h===void 0&&(h={}),l.prototype.optimize.call(this,h);for(var g=[].slice.call(this.observer.takeRecords());g.length>0;)a.push(g.pop());for(var _=function(v,T){T===void 0&&(T=!0),v!=null&&v!==m&&v.domNode.parentNode!=null&&(v.domNode[d.DATA_KEY].mutations==null&&(v.domNode[d.DATA_KEY].mutations=[]),T&&_(v.parent))},b=function(v){v.domNode[d.DATA_KEY]!=null&&v.domNode[d.DATA_KEY].mutations!=null&&(v instanceof p.default&&v.children.forEach(b),v.optimize(h))},E=a,x=0;E.length>0;x+=1){if(x>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(E.forEach(function(v){var T=d.find(v.target,!0);T!=null&&(T.domNode===v.target&&(v.type==="childList"?(_(d.find(v.previousSibling,!1)),[].forEach.call(v.addedNodes,function(O){var A=d.find(O,!1);_(A,!1),A instanceof p.default&&A.children.forEach(function(N){_(N,!1)})})):v.type==="attributes"&&_(T.prev)),_(T))}),this.children.forEach(b),g=(E=[].slice.call(this.observer.takeRecords())).slice();g.length>0;)a.push(g.pop())}},c.prototype.update=function(a,h){var m=this;h===void 0&&(h={}),(a=a||this.observer.takeRecords()).map(function(g){var _=d.find(g.target,!0);return _==null?null:_.domNode[d.DATA_KEY].mutations==null?(_.domNode[d.DATA_KEY].mutations=[g],_):(_.domNode[d.DATA_KEY].mutations.push(g),null)}).forEach(function(g){g!=null&&g!==m&&g.domNode[d.DATA_KEY]!=null&&g.update(g.domNode[d.DATA_KEY].mutations||[],h)}),this.domNode[d.DATA_KEY].mutations!=null&&l.prototype.update.call(this,this.domNode[d.DATA_KEY].mutations,h),this.optimize(a,h)},c.blotName="scroll",c.defaultChild="block",c.scope=d.Scope.BLOCK_BLOT,c.tagName="DIV",c}(p.default);i.default=f},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,l){f.__proto__=l}||function(f,l){for(var c in l)l.hasOwnProperty(c)&&(f[c]=l[c])},function(f,l){function c(){this.constructor=f}s(f,l),f.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(18),d=o(1),y=function(f){function l(){return f!==null&&f.apply(this,arguments)||this}return u(l,f),l.formats=function(c){if(c.tagName!==l.tagName)return f.formats.call(this,c)},l.prototype.format=function(c,a){var h=this;c!==this.statics.blotName||a?f.prototype.format.call(this,c,a):(this.children.forEach(function(m){m instanceof p.default||(m=m.wrap(l.blotName,!0)),h.attributes.copy(m)}),this.unwrap())},l.prototype.formatAt=function(c,a,h,m){this.formats()[h]!=null||d.query(h,d.Scope.ATTRIBUTE)?this.isolate(c,a).format(h,m):f.prototype.formatAt.call(this,c,a,h,m)},l.prototype.optimize=function(c){f.prototype.optimize.call(this,c);var a=this.formats();if(Object.keys(a).length===0)return this.unwrap();var h=this.next;h instanceof l&&h.prev===this&&function(m,g){if(Object.keys(m).length!==Object.keys(g).length)return!1;for(var _ in m)if(m[_]!==g[_])return!1;return!0}(a,h.formats())&&(h.moveChildren(this),h.remove())},l.blotName="inline",l.scope=d.Scope.INLINE_BLOT,l.tagName="SPAN",l}(p.default);i.default=y},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,l){f.__proto__=l}||function(f,l){for(var c in l)l.hasOwnProperty(c)&&(f[c]=l[c])},function(f,l){function c(){this.constructor=f}s(f,l),f.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(18),d=o(1),y=function(f){function l(){return f!==null&&f.apply(this,arguments)||this}return u(l,f),l.formats=function(c){var a=d.query(l.blotName).tagName;if(c.tagName!==a)return f.formats.call(this,c)},l.prototype.format=function(c,a){d.query(c,d.Scope.BLOCK)!=null&&(c!==this.statics.blotName||a?f.prototype.format.call(this,c,a):this.replaceWith(l.blotName))},l.prototype.formatAt=function(c,a,h,m){d.query(h,d.Scope.BLOCK)!=null?this.format(h,m):f.prototype.formatAt.call(this,c,a,h,m)},l.prototype.insertAt=function(c,a,h){if(h==null||d.query(a,d.Scope.INLINE)!=null)f.prototype.insertAt.call(this,c,a,h);else{var m=this.split(c),g=d.create(a,h);m.parent.insertBefore(g,m)}},l.prototype.update=function(c,a){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,c,a)},l.blotName="block",l.scope=d.Scope.BLOCK_BLOT,l.tagName="P",l}(p.default);i.default=y},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,y){d.__proto__=y}||function(d,y){for(var f in y)y.hasOwnProperty(f)&&(d[f]=y[f])},function(d,y){function f(){this.constructor=d}s(d,y),d.prototype=y===null?Object.create(y):(f.prototype=y.prototype,new f)});Object.defineProperty(i,"__esModule",{value:!0});var p=function(d){function y(){return d!==null&&d.apply(this,arguments)||this}return u(y,d),y.formats=function(f){},y.prototype.format=function(f,l){d.prototype.formatAt.call(this,0,this.length(),f,l)},y.prototype.formatAt=function(f,l,c,a){f===0&&l===this.length()?this.format(c,a):d.prototype.formatAt.call(this,f,l,c,a)},y.prototype.formats=function(){return this.statics.formats(this.domNode)},y}(o(19).default);i.default=p},function(n,i,o){var s,u=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,l){f.__proto__=l}||function(f,l){for(var c in l)l.hasOwnProperty(c)&&(f[c]=l[c])},function(f,l){function c(){this.constructor=f}s(f,l),f.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)});Object.defineProperty(i,"__esModule",{value:!0});var p=o(19),d=o(1),y=function(f){function l(c){var a=f.call(this,c)||this;return a.text=a.statics.value(a.domNode),a}return u(l,f),l.create=function(c){return document.createTextNode(c)},l.value=function(c){var a=c.data;return a.normalize&&(a=a.normalize()),a},l.prototype.deleteAt=function(c,a){this.domNode.data=this.text=this.text.slice(0,c)+this.text.slice(c+a)},l.prototype.index=function(c,a){return this.domNode===c?a:-1},l.prototype.insertAt=function(c,a,h){h==null?(this.text=this.text.slice(0,c)+a+this.text.slice(c),this.domNode.data=this.text):f.prototype.insertAt.call(this,c,a,h)},l.prototype.length=function(){return this.text.length},l.prototype.optimize=function(c){f.prototype.optimize.call(this,c),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof l&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},l.prototype.position=function(c,a){return[this.domNode,c]},l.prototype.split=function(c,a){if(a===void 0&&(a=!1),!a){if(c===0)return this;if(c===this.length())return this.next}var h=d.create(this.domNode.splitText(c));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},l.prototype.update=function(c,a){var h=this;c.some(function(m){return m.type==="characterData"&&m.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},l.prototype.value=function(){return this.text},l.blotName="text",l.scope=d.Scope.INLINE_BLOT,l}(p.default);i.default=y},function(n,i,o){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var u=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(p,d){return arguments.length>1&&!this.contains(p)==!d?d:u.call(this,p)}}String.prototype.startsWith||(String.prototype.startsWith=function(p,d){return d=d||0,this.substr(d,p.length)===p}),String.prototype.endsWith||(String.prototype.endsWith=function(p,d){var y=this.toString();(typeof d!="number"||!isFinite(d)||Math.floor(d)!==d||d>y.length)&&(d=y.length),d-=p.length;var f=y.indexOf(p,d);return f!==-1&&f===d}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(p){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof p!="function")throw new TypeError("predicate must be a function");for(var d,y=Object(this),f=y.length>>>0,l=arguments[1],c=0;c<f;c++)if(d=y[c],p.call(l,d,c,y))return d}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(n,i){var o=-1,s=1,u=0;function p(h,m,g){if(h==m)return h?[[u,h]]:[];(g<0||h.length<g)&&(g=null);var _=y(h,m),b=h.substring(0,_);_=f(h=h.substring(_),m=m.substring(_));var E=h.substring(h.length-_),x=function(v,T){var O;if(!v)return[[s,T]];if(!T)return[[o,v]];var A=v.length>T.length?v:T,N=v.length>T.length?T:v,k=A.indexOf(N);if(k!=-1)return O=[[s,A.substring(0,k)],[u,N],[s,A.substring(k+N.length)]],v.length>T.length&&(O[0][0]=O[2][0]=o),O;if(N.length==1)return[[o,v],[s,T]];var w=function(j,q){var G=j.length>q.length?j:q,z=j.length>q.length?q:j;if(G.length<4||2*z.length<G.length)return null;function K(J,re,ve){for(var ce,ne,oe,Ue,Xe=J.substring(ve,ve+Math.floor(J.length/4)),xe=-1,Le="";(xe=re.indexOf(Xe,xe+1))!=-1;){var $e=y(J.substring(ve),re.substring(xe)),ke=f(J.substring(0,ve),re.substring(0,xe));Le.length<ke+$e&&(Le=re.substring(xe-ke,xe)+re.substring(xe,xe+$e),ce=J.substring(0,ve-ke),ne=J.substring(ve+$e),oe=re.substring(0,xe-ke),Ue=re.substring(xe+$e))}return 2*Le.length>=J.length?[ce,ne,oe,Ue,Le]:null}var F,D,B,U,H,V=K(G,z,Math.ceil(G.length/4)),$=K(G,z,Math.ceil(G.length/2));if(!V&&!$)return null;F=$?V&&V[4].length>$[4].length?V:$:V,j.length>q.length?(D=F[0],B=F[1],U=F[2],H=F[3]):(U=F[0],H=F[1],D=F[2],B=F[3]);var Y=F[4];return[D,B,U,H,Y]}(v,T);if(w){var C=w[0],P=w[1],S=w[2],R=w[3],I=w[4],M=p(C,S),L=p(P,R);return M.concat([[u,I]],L)}return function(j,q){for(var G=j.length,z=q.length,K=Math.ceil((G+z)/2),F=K,D=2*K,B=new Array(D),U=new Array(D),H=0;H<D;H++)B[H]=-1,U[H]=-1;B[F+1]=0,U[F+1]=0;for(var V=G-z,$=V%2!=0,Y=0,J=0,re=0,ve=0,ce=0;ce<K;ce++){for(var ne=-ce+Y;ne<=ce-J;ne+=2){for(var oe=F+ne,Ue=(ke=ne==-ce||ne!=ce&&B[oe-1]<B[oe+1]?B[oe+1]:B[oe-1]+1)-ne;ke<G&&Ue<z&&j.charAt(ke)==q.charAt(Ue);)ke++,Ue++;if(B[oe]=ke,ke>G)J+=2;else if(Ue>z)Y+=2;else if($&&(Le=F+V-ne)>=0&&Le<D&&U[Le]!=-1&&ke>=(xe=G-U[Le]))return d(j,q,ke,Ue)}for(var Xe=-ce+re;Xe<=ce-ve;Xe+=2){for(var xe,Le=F+Xe,$e=(xe=Xe==-ce||Xe!=ce&&U[Le-1]<U[Le+1]?U[Le+1]:U[Le-1]+1)-Xe;xe<G&&$e<z&&j.charAt(G-xe-1)==q.charAt(z-$e-1);)xe++,$e++;if(U[Le]=xe,xe>G)ve+=2;else if($e>z)re+=2;else if(!$){var ke;if((oe=F+V-Xe)>=0&&oe<D&&B[oe]!=-1&&(Ue=F+(ke=B[oe])-oe,ke>=(xe=G-xe)))return d(j,q,ke,Ue)}}}return[[o,j],[s,q]]}(v,T)}(h=h.substring(0,h.length-_),m=m.substring(0,m.length-_));return b&&x.unshift([u,b]),E&&x.push([u,E]),l(x),g!=null&&(x=function(v,T){var O=function(P,S){if(S===0)return[u,P];for(var R=0,I=0;I<P.length;I++){var M=P[I];if(M[0]===o||M[0]===u){var L=R+M[1].length;if(S===L)return[I+1,P];if(S<L){P=P.slice();var j=S-R,q=[M[0],M[1].slice(0,j)],G=[M[0],M[1].slice(j)];return P.splice(I,1,q,G),[I+1,P]}R=L}}throw new Error("cursor_pos is out of bounds!")}(v,T),A=O[1],N=O[0],k=A[N],w=A[N+1];if(k==null||k[0]!==u)return v;if(w!=null&&k[1]+w[1]===w[1]+k[1])return A.splice(N,2,w,k),a(A,N,2);if(w!=null&&w[1].indexOf(k[1])===0){A.splice(N,2,[w[0],k[1]],[0,k[1]]);var C=w[1].slice(k[1].length);return C.length>0&&A.splice(N+2,0,[w[0],C]),a(A,N,3)}return v}(x,g)),x=function(v){for(var T=!1,O=function(w){return w.charCodeAt(0)>=56320&&w.charCodeAt(0)<=57343},A=function(w){return w.charCodeAt(w.length-1)>=55296&&w.charCodeAt(w.length-1)<=56319},N=2;N<v.length;N+=1)v[N-2][0]===u&&A(v[N-2][1])&&v[N-1][0]===o&&O(v[N-1][1])&&v[N][0]===s&&O(v[N][1])&&(T=!0,v[N-1][1]=v[N-2][1].slice(-1)+v[N-1][1],v[N][1]=v[N-2][1].slice(-1)+v[N][1],v[N-2][1]=v[N-2][1].slice(0,-1));if(!T)return v;var k=[];for(N=0;N<v.length;N+=1)v[N][1].length>0&&k.push(v[N]);return k}(x),x}function d(h,m,g,_){var b=h.substring(0,g),E=m.substring(0,_),x=h.substring(g),v=m.substring(_),T=p(b,E),O=p(x,v);return T.concat(O)}function y(h,m){if(!h||!m||h.charAt(0)!=m.charAt(0))return 0;for(var g=0,_=Math.min(h.length,m.length),b=_,E=0;g<b;)h.substring(E,b)==m.substring(E,b)?E=g=b:_=b,b=Math.floor((_-g)/2+g);return b}function f(h,m){if(!h||!m||h.charAt(h.length-1)!=m.charAt(m.length-1))return 0;for(var g=0,_=Math.min(h.length,m.length),b=_,E=0;g<b;)h.substring(h.length-b,h.length-E)==m.substring(m.length-b,m.length-E)?E=g=b:_=b,b=Math.floor((_-g)/2+g);return b}function l(h){h.push([u,""]);for(var m,g=0,_=0,b=0,E="",x="";g<h.length;)switch(h[g][0]){case s:b++,x+=h[g][1],g++;break;case o:_++,E+=h[g][1],g++;break;case u:_+b>1?(_!==0&&b!==0&&((m=y(x,E))!==0&&(g-_-b>0&&h[g-_-b-1][0]==u?h[g-_-b-1][1]+=x.substring(0,m):(h.splice(0,0,[u,x.substring(0,m)]),g++),x=x.substring(m),E=E.substring(m)),(m=f(x,E))!==0&&(h[g][1]=x.substring(x.length-m)+h[g][1],x=x.substring(0,x.length-m),E=E.substring(0,E.length-m))),_===0?h.splice(g-b,_+b,[s,x]):b===0?h.splice(g-_,_+b,[o,E]):h.splice(g-_-b,_+b,[o,E],[s,x]),g=g-_-b+(_?1:0)+(b?1:0)+1):g!==0&&h[g-1][0]==u?(h[g-1][1]+=h[g][1],h.splice(g,1)):g++,b=0,_=0,E="",x=""}h[h.length-1][1]===""&&h.pop();var v=!1;for(g=1;g<h.length-1;)h[g-1][0]==u&&h[g+1][0]==u&&(h[g][1].substring(h[g][1].length-h[g-1][1].length)==h[g-1][1]?(h[g][1]=h[g-1][1]+h[g][1].substring(0,h[g][1].length-h[g-1][1].length),h[g+1][1]=h[g-1][1]+h[g+1][1],h.splice(g-1,1),v=!0):h[g][1].substring(0,h[g+1][1].length)==h[g+1][1]&&(h[g-1][1]+=h[g+1][1],h[g][1]=h[g][1].substring(h[g+1][1].length)+h[g+1][1],h.splice(g+1,1),v=!0)),g++;v&&l(h)}var c=p;function a(h,m,g){for(var _=m+g-1;_>=0&&_>=m-1;_--)if(_+1<h.length){var b=h[_],E=h[_+1];b[0]===E[1]&&h.splice(_,2,[b[0],b[1]+E[1]])}return h}c.INSERT=s,c.DELETE=o,c.EQUAL=u,n.exports=c},function(n,i){function o(s){var u=[];for(var p in s)u.push(p);return u}(n.exports=typeof Object.keys=="function"?Object.keys:o).shim=o},function(n,i){var o=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";function s(p){return Object.prototype.toString.call(p)=="[object Arguments]"}function u(p){return p&&typeof p=="object"&&typeof p.length=="number"&&Object.prototype.hasOwnProperty.call(p,"callee")&&!Object.prototype.propertyIsEnumerable.call(p,"callee")||!1}(i=n.exports=o?s:u).supported=s,i.unsupported=u},function(n,i){var o=Object.prototype.hasOwnProperty,s="~";function u(){}function p(y,f,l){this.fn=y,this.context=f,this.once=l||!1}function d(){this._events=new u,this._eventsCount=0}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(s=!1)),d.prototype.eventNames=function(){var y,f,l=[];if(this._eventsCount===0)return l;for(f in y=this._events)o.call(y,f)&&l.push(s?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(y)):l},d.prototype.listeners=function(y,f){var l=s?s+y:y,c=this._events[l];if(f)return!!c;if(!c)return[];if(c.fn)return[c.fn];for(var a=0,h=c.length,m=new Array(h);a<h;a++)m[a]=c[a].fn;return m},d.prototype.emit=function(y,f,l,c,a,h){var m=s?s+y:y;if(!this._events[m])return!1;var g,_,b=this._events[m],E=arguments.length;if(b.fn){switch(b.once&&this.removeListener(y,b.fn,void 0,!0),E){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,f),!0;case 3:return b.fn.call(b.context,f,l),!0;case 4:return b.fn.call(b.context,f,l,c),!0;case 5:return b.fn.call(b.context,f,l,c,a),!0;case 6:return b.fn.call(b.context,f,l,c,a,h),!0}for(_=1,g=new Array(E-1);_<E;_++)g[_-1]=arguments[_];b.fn.apply(b.context,g)}else{var x,v=b.length;for(_=0;_<v;_++)switch(b[_].once&&this.removeListener(y,b[_].fn,void 0,!0),E){case 1:b[_].fn.call(b[_].context);break;case 2:b[_].fn.call(b[_].context,f);break;case 3:b[_].fn.call(b[_].context,f,l);break;case 4:b[_].fn.call(b[_].context,f,l,c);break;default:if(!g)for(x=1,g=new Array(E-1);x<E;x++)g[x-1]=arguments[x];b[_].fn.apply(b[_].context,g)}}return!0},d.prototype.on=function(y,f,l){var c=new p(f,l||this),a=s?s+y:y;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],c]:this._events[a].push(c):(this._events[a]=c,this._eventsCount++),this},d.prototype.once=function(y,f,l){var c=new p(f,l||this,!0),a=s?s+y:y;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],c]:this._events[a].push(c):(this._events[a]=c,this._eventsCount++),this},d.prototype.removeListener=function(y,f,l,c){var a=s?s+y:y;if(!this._events[a])return this;if(!f)return--this._eventsCount==0?this._events=new u:delete this._events[a],this;var h=this._events[a];if(h.fn)h.fn!==f||c&&!h.once||l&&h.context!==l||(--this._eventsCount==0?this._events=new u:delete this._events[a]);else{for(var m=0,g=[],_=h.length;m<_;m++)(h[m].fn!==f||c&&!h[m].once||l&&h[m].context!==l)&&g.push(h[m]);g.length?this._events[a]=g.length===1?g[0]:g:--this._eventsCount==0?this._events=new u:delete this._events[a]}return this},d.prototype.removeAllListeners=function(y){var f;return y?(f=s?s+y:y,this._events[f]&&(--this._eventsCount==0?this._events=new u:delete this._events[f])):(this._events=new u,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prototype.setMaxListeners=function(){return this},d.prefixed=s,d.EventEmitter=d,n!==void 0&&(n.exports=d)},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.matchText=i.matchSpacing=i.matchNewline=i.matchBlot=i.matchAttributor=i.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u=function(F,D){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return function(B,U){var H=[],V=!0,$=!1,Y=void 0;try{for(var J,re=B[Symbol.iterator]();!(V=(J=re.next()).done)&&(H.push(J.value),!U||H.length!==U);V=!0);}catch(ve){$=!0,Y=ve}finally{try{!V&&re.return&&re.return()}finally{if($)throw Y}}return H}(F,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")},p=function(){function F(D,B){for(var U=0;U<B.length;U++){var H=B[U];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(D,H.key,H)}}return function(D,B,U){return B&&F(D.prototype,B),U&&F(D,U),D}}(),d=v(o(3)),y=v(o(2)),f=v(o(0)),l=v(o(5)),c=v(o(10)),a=v(o(9)),h=o(36),m=o(37),g=v(o(13)),_=o(26),b=o(38),E=o(39),x=o(40);function v(F){return F&&F.__esModule?F:{default:F}}function T(F,D,B){return D in F?Object.defineProperty(F,D,{value:B,enumerable:!0,configurable:!0,writable:!0}):F[D]=B,F}var O=(0,c.default)("quill:clipboard"),A="__ql-matcher",N=[[Node.TEXT_NODE,K],[Node.TEXT_NODE,G],["br",function(F,D){return R(D,`
582
- `)||D.insert(`
583
- `),D}],[Node.ELEMENT_NODE,G],[Node.ELEMENT_NODE,q],[Node.ELEMENT_NODE,z],[Node.ELEMENT_NODE,j],[Node.ELEMENT_NODE,function(F,D){var B={},U=F.style||{};return U.fontStyle&&S(F).fontStyle==="italic"&&(B.italic=!0),U.fontWeight&&(S(F).fontWeight.startsWith("bold")||parseInt(S(F).fontWeight)>=700)&&(B.bold=!0),Object.keys(B).length>0&&(D=P(D,B)),parseFloat(U.textIndent||0)>0&&(D=new y.default().insert(" ").concat(D)),D}],["li",function(F,D){var B=f.default.query(F);if(B==null||B.blotName!=="list-item"||!R(D,`
584
- `))return D;for(var U=-1,H=F.parentNode;!H.classList.contains("ql-clipboard");)(f.default.query(H)||{}).blotName==="list"&&(U+=1),H=H.parentNode;return U<=0?D:D.compose(new y.default().retain(D.length()-1).retain(1,{indent:U}))}],["b",L.bind(L,"bold")],["i",L.bind(L,"italic")],["style",function(){return new y.default}]],k=[h.AlignAttribute,b.DirectionAttribute].reduce(function(F,D){return F[D.keyName]=D,F},{}),w=[h.AlignStyle,m.BackgroundStyle,_.ColorStyle,b.DirectionStyle,E.FontStyle,x.SizeStyle].reduce(function(F,D){return F[D.keyName]=D,F},{}),C=function(F){function D(B,U){(function(V,$){if(!(V instanceof $))throw new TypeError("Cannot call a class as a function")})(this,D);var H=function(V,$){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!$||typeof $!="object"&&typeof $!="function"?V:$}(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,B,U));return H.quill.root.addEventListener("paste",H.onPaste.bind(H)),H.container=H.quill.addContainer("ql-clipboard"),H.container.setAttribute("contenteditable",!0),H.container.setAttribute("tabindex",-1),H.matchers=[],N.concat(H.options.matchers).forEach(function(V){var $=u(V,2),Y=$[0],J=$[1];(U.matchVisual||J!==z)&&H.addMatcher(Y,J)}),H}return function(B,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);B.prototype=Object.create(U&&U.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(B,U):B.__proto__=U)}(D,F),p(D,[{key:"addMatcher",value:function(B,U){this.matchers.push([B,U])}},{key:"convert",value:function(B){if(typeof B=="string")return this.container.innerHTML=B.replace(/\>\r?\n +\</g,"><"),this.convert();var U=this.quill.getFormat(this.quill.selection.savedRange.index);if(U[g.default.blotName]){var H=this.container.innerText;return this.container.innerHTML="",new y.default().insert(H,T({},g.default.blotName,U[g.default.blotName]))}var V=this.prepareMatching(),$=u(V,2),Y=$[0],J=$[1],re=M(this.container,Y,J);return R(re,`
585
- `)&&re.ops[re.ops.length-1].attributes==null&&(re=re.compose(new y.default().retain(re.length()-1).delete(1))),O.log("convert",this.container.innerHTML,re),this.container.innerHTML="",re}},{key:"dangerouslyPasteHTML",value:function(B,U){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.default.sources.API;if(typeof B=="string")this.quill.setContents(this.convert(B),U),this.quill.setSelection(0,l.default.sources.SILENT);else{var V=this.convert(U);this.quill.updateContents(new y.default().retain(B).concat(V),H),this.quill.setSelection(B+V.length(),l.default.sources.SILENT)}}},{key:"onPaste",value:function(B){var U=this;if(!B.defaultPrevented&&this.quill.isEnabled()){var H=this.quill.getSelection(),V=new y.default().retain(H.index),$=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout(function(){V=V.concat(U.convert()).delete(H.length),U.quill.updateContents(V,l.default.sources.USER),U.quill.setSelection(V.length()-H.length,l.default.sources.SILENT),U.quill.scrollingContainer.scrollTop=$,U.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var B=this,U=[],H=[];return this.matchers.forEach(function(V){var $=u(V,2),Y=$[0],J=$[1];switch(Y){case Node.TEXT_NODE:H.push(J);break;case Node.ELEMENT_NODE:U.push(J);break;default:[].forEach.call(B.container.querySelectorAll(Y),function(re){re[A]=re[A]||[],re[A].push(J)})}}),[U,H]}}]),D}(a.default);function P(F,D,B){return(D===void 0?"undefined":s(D))==="object"?Object.keys(D).reduce(function(U,H){return P(U,H,D[H])},F):F.reduce(function(U,H){return H.attributes&&H.attributes[D]?U.push(H):U.insert(H.insert,(0,d.default)({},T({},D,B),H.attributes))},new y.default)}function S(F){if(F.nodeType!==Node.ELEMENT_NODE)return{};var D="__ql-computed-style";return F[D]||(F[D]=window.getComputedStyle(F))}function R(F,D){for(var B="",U=F.ops.length-1;U>=0&&B.length<D.length;--U){var H=F.ops[U];if(typeof H.insert!="string")break;B=H.insert+B}return B.slice(-1*D.length)===D}function I(F){if(F.childNodes.length===0)return!1;var D=S(F);return["block","list-item"].indexOf(D.display)>-1}function M(F,D,B){return F.nodeType===F.TEXT_NODE?B.reduce(function(U,H){return H(F,U)},new y.default):F.nodeType===F.ELEMENT_NODE?[].reduce.call(F.childNodes||[],function(U,H){var V=M(H,D,B);return H.nodeType===F.ELEMENT_NODE&&(V=D.reduce(function($,Y){return Y(H,$)},V),V=(H[A]||[]).reduce(function($,Y){return Y(H,$)},V)),U.concat(V)},new y.default):new y.default}function L(F,D,B){return P(B,F,!0)}function j(F,D){var B=f.default.Attributor.Attribute.keys(F),U=f.default.Attributor.Class.keys(F),H=f.default.Attributor.Style.keys(F),V={};return B.concat(U).concat(H).forEach(function($){var Y=f.default.query($,f.default.Scope.ATTRIBUTE);Y!=null&&(V[Y.attrName]=Y.value(F),V[Y.attrName])||((Y=k[$])==null||Y.attrName!==$&&Y.keyName!==$||(V[Y.attrName]=Y.value(F)||void 0),(Y=w[$])==null||Y.attrName!==$&&Y.keyName!==$||(Y=w[$],V[Y.attrName]=Y.value(F)||void 0))}),Object.keys(V).length>0&&(D=P(D,V)),D}function q(F,D){var B=f.default.query(F);if(B==null)return D;if(B.prototype instanceof f.default.Embed){var U={},H=B.value(F);H!=null&&(U[B.blotName]=H,D=new y.default().insert(U,B.formats(F)))}else typeof B.formats=="function"&&(D=P(D,B.blotName,B.formats(F)));return D}function G(F,D){return R(D,`
586
- `)||(I(F)||D.length()>0&&F.nextSibling&&I(F.nextSibling))&&D.insert(`
587
- `),D}function z(F,D){if(I(F)&&F.nextElementSibling!=null&&!R(D,`
588
-
589
- `)){var B=F.offsetHeight+parseFloat(S(F).marginTop)+parseFloat(S(F).marginBottom);F.nextElementSibling.offsetTop>F.offsetTop+1.5*B&&D.insert(`
590
- `)}return D}function K(F,D){var B=F.data;if(F.parentNode.tagName==="O:P")return D.insert(B.trim());if(B.trim().length===0&&F.parentNode.classList.contains("ql-clipboard"))return D;if(!S(F.parentNode).whiteSpace.startsWith("pre")){var U=function(H,V){return(V=V.replace(/[^\u00a0]/g,"")).length<1&&H?" ":V};B=(B=B.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,U.bind(U,!0)),(F.previousSibling==null&&I(F.parentNode)||F.previousSibling!=null&&I(F.previousSibling))&&(B=B.replace(/^\s+/,U.bind(U,!1))),(F.nextSibling==null&&I(F.parentNode)||F.nextSibling!=null&&I(F.nextSibling))&&(B=B.replace(/\s+$/,U.bind(U,!1)))}return D.insert(B)}C.DEFAULTS={matchers:[],matchVisual:!0},i.default=C,i.matchAttributor=j,i.matchBlot=q,i.matchNewline=G,i.matchSpacing=z,i.matchText=K},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function y(f,l){for(var c=0;c<l.length;c++){var a=l[c];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(f,a.key,a)}}return function(f,l,c){return l&&y(f.prototype,l),c&&y(f,c),f}}(),u=function y(f,l,c){f===null&&(f=Function.prototype);var a=Object.getOwnPropertyDescriptor(f,l);if(a===void 0){var h=Object.getPrototypeOf(f);return h===null?void 0:y(h,l,c)}if("value"in a)return a.value;var m=a.get;return m!==void 0?m.call(c):void 0},p=function(y){return y&&y.__esModule?y:{default:y}}(o(6)),d=function(y){function f(){return function(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,f),function(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||typeof c!="object"&&typeof c!="function"?l:c}(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return function(l,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(f,y),s(f,[{key:"optimize",value:function(l){u(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"optimize",this).call(this,l),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return u(f.__proto__||Object.getPrototypeOf(f),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),f}(p.default);d.blotName="bold",d.tagName=["STRONG","B"],i.default=d},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.addControls=i.default=void 0;var s=function(b,E){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return function(x,v){var T=[],O=!0,A=!1,N=void 0;try{for(var k,w=x[Symbol.iterator]();!(O=(k=w.next()).done)&&(T.push(k.value),!v||T.length!==v);O=!0);}catch(C){A=!0,N=C}finally{try{!O&&w.return&&w.return()}finally{if(A)throw N}}return T}(b,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=function(){function b(E,x){for(var v=0;v<x.length;v++){var T=x[v];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,T.key,T)}}return function(E,x,v){return x&&b(E.prototype,x),v&&b(E,v),E}}(),p=c(o(2)),d=c(o(0)),y=c(o(5)),f=c(o(10)),l=c(o(9));function c(b){return b&&b.__esModule?b:{default:b}}function a(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!E||typeof E!="object"&&typeof E!="function"?b:E}var h=(0,f.default)("quill:toolbar"),m=function(b){function E(x,v){(function(N,k){if(!(N instanceof k))throw new TypeError("Cannot call a class as a function")})(this,E);var T,O=a(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,x,v));if(Array.isArray(O.options.container)){var A=document.createElement("div");_(A,O.options.container),x.container.parentNode.insertBefore(A,x.container),O.container=A}else typeof O.options.container=="string"?O.container=document.querySelector(O.options.container):O.container=O.options.container;return O.container instanceof HTMLElement?(O.container.classList.add("ql-toolbar"),O.controls=[],O.handlers={},Object.keys(O.options.handlers).forEach(function(N){O.addHandler(N,O.options.handlers[N])}),[].forEach.call(O.container.querySelectorAll("button, select"),function(N){O.attach(N)}),O.quill.on(y.default.events.EDITOR_CHANGE,function(N,k){N===y.default.events.SELECTION_CHANGE&&O.update(k)}),O.quill.on(y.default.events.SCROLL_OPTIMIZE,function(){var N=O.quill.selection.getRange(),k=s(N,1)[0];O.update(k)}),O):(T=h.error("Container required for toolbar",O.options),a(O,T))}return function(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}(E,b),u(E,[{key:"addHandler",value:function(x,v){this.handlers[x]=v}},{key:"attach",value:function(x){var v=this,T=[].find.call(x.classList,function(A){return A.indexOf("ql-")===0});if(T){if(T=T.slice(3),x.tagName==="BUTTON"&&x.setAttribute("type","button"),this.handlers[T]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[T]==null)return void h.warn("ignoring attaching to disabled format",T,x);if(d.default.query(T)==null)return void h.warn("ignoring attaching to nonexistent format",T,x)}var O=x.tagName==="SELECT"?"change":"click";x.addEventListener(O,function(A){var N=void 0;if(x.tagName==="SELECT"){if(x.selectedIndex<0)return;var k=x.options[x.selectedIndex];N=!k.hasAttribute("selected")&&(k.value||!1)}else N=!x.classList.contains("ql-active")&&(x.value||!x.hasAttribute("value")),A.preventDefault();v.quill.focus();var w=v.quill.selection.getRange(),C=s(w,1)[0];if(v.handlers[T]!=null)v.handlers[T].call(v,N);else if(d.default.query(T).prototype instanceof d.default.Embed){if(!(N=prompt("Enter "+T)))return;v.quill.updateContents(new p.default().retain(C.index).delete(C.length).insert(function(P,S,R){return S in P?Object.defineProperty(P,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):P[S]=R,P}({},T,N)),y.default.sources.USER)}else v.quill.format(T,N,y.default.sources.USER);v.update(C)}),this.controls.push([T,x])}}},{key:"update",value:function(x){var v=x==null?{}:this.quill.getFormat(x);this.controls.forEach(function(T){var O=s(T,2),A=O[0],N=O[1];if(N.tagName==="SELECT"){var k=void 0;if(x==null)k=null;else if(v[A]==null)k=N.querySelector("option[selected]");else if(!Array.isArray(v[A])){var w=v[A];typeof w=="string"&&(w=w.replace(/\"/g,'\\"')),k=N.querySelector('option[value="'+w+'"]')}k==null?(N.value="",N.selectedIndex=-1):k.selected=!0}else if(x==null)N.classList.remove("ql-active");else if(N.hasAttribute("value")){var C=v[A]===N.getAttribute("value")||v[A]!=null&&v[A].toString()===N.getAttribute("value")||v[A]==null&&!N.getAttribute("value");N.classList.toggle("ql-active",C)}else N.classList.toggle("ql-active",v[A]!=null)})}}]),E}(l.default);function g(b,E,x){var v=document.createElement("button");v.setAttribute("type","button"),v.classList.add("ql-"+E),x!=null&&(v.value=x),b.appendChild(v)}function _(b,E){Array.isArray(E[0])||(E=[E]),E.forEach(function(x){var v=document.createElement("span");v.classList.add("ql-formats"),x.forEach(function(T){if(typeof T=="string")g(v,T);else{var O=Object.keys(T)[0],A=T[O];Array.isArray(A)?function(N,k,w){var C=document.createElement("select");C.classList.add("ql-"+k),w.forEach(function(P){var S=document.createElement("option");P!==!1?S.setAttribute("value",P):S.setAttribute("selected","selected"),C.appendChild(S)}),N.appendChild(C)}(v,O,A):g(v,O,A)}}),b.appendChild(v)})}m.DEFAULTS={},m.DEFAULTS={container:null,handlers:{clean:function(){var b=this,E=this.quill.getSelection();if(E!=null)if(E.length==0){var x=this.quill.getFormat();Object.keys(x).forEach(function(v){d.default.query(v,d.default.Scope.INLINE)!=null&&b.quill.format(v,!1)})}else this.quill.removeFormat(E,y.default.sources.USER)},direction:function(b){var E=this.quill.getFormat().align;b==="rtl"&&E==null?this.quill.format("align","right",y.default.sources.USER):b||E!=="right"||this.quill.format("align",!1,y.default.sources.USER),this.quill.format("direction",b,y.default.sources.USER)},indent:function(b){var E=this.quill.getSelection(),x=this.quill.getFormat(E),v=parseInt(x.indent||0);if(b==="+1"||b==="-1"){var T=b==="+1"?1:-1;x.direction==="rtl"&&(T*=-1),this.quill.format("indent",v+T,y.default.sources.USER)}},link:function(b){b===!0&&(b=prompt("Enter link URL:")),this.quill.format("link",b,y.default.sources.USER)},list:function(b){var E=this.quill.getSelection(),x=this.quill.getFormat(E);b==="check"?x.list==="checked"||x.list==="unchecked"?this.quill.format("list",!1,y.default.sources.USER):this.quill.format("list","unchecked",y.default.sources.USER):this.quill.format("list",b,y.default.sources.USER)}}},i.default=m,i.addControls=_},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function y(f,l){for(var c=0;c<l.length;c++){var a=l[c];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(f,a.key,a)}}return function(f,l,c){return l&&y(f.prototype,l),c&&y(f,c),f}}(),u=function y(f,l,c){f===null&&(f=Function.prototype);var a=Object.getOwnPropertyDescriptor(f,l);if(a===void 0){var h=Object.getPrototypeOf(f);return h===null?void 0:y(h,l,c)}if("value"in a)return a.value;var m=a.get;return m!==void 0?m.call(c):void 0},p=function(y){return y&&y.__esModule?y:{default:y}}(o(28)),d=function(y){function f(l,c){(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f);var a=function(h,m){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||typeof m!="object"&&typeof m!="function"?h:m}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,l));return a.label.innerHTML=c,a.container.classList.add("ql-color-picker"),[].slice.call(a.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(h){h.classList.add("ql-primary")}),a}return function(l,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(f,y),s(f,[{key:"buildItem",value:function(l){var c=u(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"buildItem",this).call(this,l);return c.style.backgroundColor=l.getAttribute("value")||"",c}},{key:"selectItem",value:function(l,c){u(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"selectItem",this).call(this,l,c);var a=this.label.querySelector(".ql-color-label"),h=l&&l.getAttribute("data-value")||"";a&&(a.tagName==="line"?a.style.stroke=h:a.style.fill=h)}}]),f}(p.default);i.default=d},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function y(f,l){for(var c=0;c<l.length;c++){var a=l[c];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(f,a.key,a)}}return function(f,l,c){return l&&y(f.prototype,l),c&&y(f,c),f}}(),u=function y(f,l,c){f===null&&(f=Function.prototype);var a=Object.getOwnPropertyDescriptor(f,l);if(a===void 0){var h=Object.getPrototypeOf(f);return h===null?void 0:y(h,l,c)}if("value"in a)return a.value;var m=a.get;return m!==void 0?m.call(c):void 0},p=function(y){return y&&y.__esModule?y:{default:y}}(o(28)),d=function(y){function f(l,c){(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f);var a=function(h,m){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!m||typeof m!="object"&&typeof m!="function"?h:m}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,l));return a.container.classList.add("ql-icon-picker"),[].forEach.call(a.container.querySelectorAll(".ql-picker-item"),function(h){h.innerHTML=c[h.getAttribute("data-value")||""]}),a.defaultItem=a.container.querySelector(".ql-selected"),a.selectItem(a.defaultItem),a}return function(l,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(f,y),s(f,[{key:"selectItem",value:function(l,c){u(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"selectItem",this).call(this,l,c),l=l||this.defaultItem,this.label.innerHTML=l.innerHTML}}]),f}(p.default);i.default=d},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function p(d,y){for(var f=0;f<y.length;f++){var l=y[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}return function(d,y,f){return y&&p(d.prototype,y),f&&p(d,f),d}}(),u=function(){function p(d,y){var f=this;(function(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")})(this,p),this.quill=d,this.boundsContainer=y||document.body,this.root=d.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){f.root.style.marginTop=-1*f.quill.root.scrollTop+"px"}),this.hide()}return s(p,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(d){var y=d.left+d.width/2-this.root.offsetWidth/2,f=d.bottom+this.quill.root.scrollTop;this.root.style.left=y+"px",this.root.style.top=f+"px",this.root.classList.remove("ql-flip");var l=this.boundsContainer.getBoundingClientRect(),c=this.root.getBoundingClientRect(),a=0;if(c.right>l.right&&(a=l.right-c.right,this.root.style.left=y+a+"px"),c.left<l.left&&(a=l.left-c.left,this.root.style.left=y+a+"px"),c.bottom>l.bottom){var h=c.bottom-c.top,m=d.bottom-d.top+h;this.root.style.top=f-m+"px",this.root.classList.add("ql-flip")}return a}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),p}();i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(T,O){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return function(A,N){var k=[],w=!0,C=!1,P=void 0;try{for(var S,R=A[Symbol.iterator]();!(w=(S=R.next()).done)&&(k.push(S.value),!N||k.length!==N);w=!0);}catch(I){C=!0,P=I}finally{try{!w&&R.return&&R.return()}finally{if(C)throw P}}return k}(T,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=function T(O,A,N){O===null&&(O=Function.prototype);var k=Object.getOwnPropertyDescriptor(O,A);if(k===void 0){var w=Object.getPrototypeOf(O);return w===null?void 0:T(w,A,N)}if("value"in k)return k.value;var C=k.get;return C!==void 0?C.call(N):void 0},p=function(){function T(O,A){for(var N=0;N<A.length;N++){var k=A[N];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(O,k.key,k)}}return function(O,A,N){return A&&T(O.prototype,A),N&&T(O,N),O}}(),d=m(o(3)),y=m(o(8)),f=o(43),l=m(f),c=m(o(27)),a=o(15),h=m(o(41));function m(T){return T&&T.__esModule?T:{default:T}}function g(T,O){if(!(T instanceof O))throw new TypeError("Cannot call a class as a function")}function _(T,O){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!O||typeof O!="object"&&typeof O!="function"?T:O}function b(T,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);T.prototype=Object.create(O&&O.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(T,O):T.__proto__=O)}var E=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],x=function(T){function O(A,N){g(this,O),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=E);var k=_(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,A,N));return k.quill.container.classList.add("ql-snow"),k}return b(O,T),p(O,[{key:"extendToolbar",value:function(A){A.container.classList.add("ql-snow"),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),h.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),h.default),this.tooltip=new v(this.quill,this.options.bounds),A.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(N,k){A.handlers.link.call(A,!k.format.link)})}}]),O}(l.default);x.DEFAULTS=(0,d.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){if(T){var O=this.quill.getSelection();if(O==null||O.length==0)return;var A=this.quill.getText(O);/^\S+@\S+\.\S+$/.test(A)&&A.indexOf("mailto:")!==0&&(A="mailto:"+A),this.quill.theme.tooltip.edit("link",A)}else this.quill.format("link",!1)}}}}});var v=function(T){function O(A,N){g(this,O);var k=_(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,A,N));return k.preview=k.root.querySelector("a.ql-preview"),k}return b(O,T),p(O,[{key:"listen",value:function(){var A=this;u(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(N){A.root.classList.contains("ql-editing")?A.save():A.edit("link",A.preview.textContent),N.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(N){if(A.linkRange!=null){var k=A.linkRange;A.restoreFocus(),A.quill.formatText(k,"link",!1,y.default.sources.USER),delete A.linkRange}N.preventDefault(),A.hide()}),this.quill.on(y.default.events.SELECTION_CHANGE,function(N,k,w){if(N!=null){if(N.length===0&&w===y.default.sources.USER){var C=A.quill.scroll.descendant(c.default,N.index),P=s(C,2),S=P[0],R=P[1];if(S!=null){A.linkRange=new a.Range(N.index-R,S.length());var I=c.default.formats(S.domNode);return A.preview.textContent=I,A.preview.setAttribute("href",I),A.show(),void A.position(A.quill.getBounds(A.linkRange))}}else delete A.linkRange;A.hide()}})}},{key:"show",value:function(){u(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),O}(f.BaseTooltip);v.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),i.default=x},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=G(o(29)),u=o(36),p=o(38),d=o(64),y=G(o(65)),f=G(o(66)),l=o(67),c=G(l),a=o(37),h=o(26),m=o(39),g=o(40),_=G(o(56)),b=G(o(68)),E=G(o(27)),x=G(o(69)),v=G(o(70)),T=G(o(71)),O=G(o(72)),A=G(o(73)),N=o(13),k=G(N),w=G(o(74)),C=G(o(75)),P=G(o(57)),S=G(o(41)),R=G(o(28)),I=G(o(59)),M=G(o(60)),L=G(o(61)),j=G(o(108)),q=G(o(62));function G(z){return z&&z.__esModule?z:{default:z}}s.default.register({"attributors/attribute/direction":p.DirectionAttribute,"attributors/class/align":u.AlignClass,"attributors/class/background":a.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":p.DirectionClass,"attributors/class/font":m.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":u.AlignStyle,"attributors/style/background":a.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":p.DirectionStyle,"attributors/style/font":m.FontStyle,"attributors/style/size":g.SizeStyle},!0),s.default.register({"formats/align":u.AlignClass,"formats/direction":p.DirectionClass,"formats/indent":d.IndentClass,"formats/background":a.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":m.FontClass,"formats/size":g.SizeClass,"formats/blockquote":y.default,"formats/code-block":k.default,"formats/header":f.default,"formats/list":c.default,"formats/bold":_.default,"formats/code":N.Code,"formats/italic":b.default,"formats/link":E.default,"formats/script":x.default,"formats/strike":v.default,"formats/underline":T.default,"formats/image":O.default,"formats/video":A.default,"formats/list/item":l.ListItem,"modules/formula":w.default,"modules/syntax":C.default,"modules/toolbar":P.default,"themes/bubble":j.default,"themes/snow":q.default,"ui/icons":S.default,"ui/picker":R.default,"ui/icon-picker":M.default,"ui/color-picker":I.default,"ui/tooltip":L.default},!0),i.default=s.default},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.IndentClass=void 0;var s=function(){function f(l,c){for(var a=0;a<c.length;a++){var h=c[a];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}return function(l,c,a){return c&&f(l.prototype,c),a&&f(l,a),l}}(),u=function f(l,c,a){l===null&&(l=Function.prototype);var h=Object.getOwnPropertyDescriptor(l,c);if(h===void 0){var m=Object.getPrototypeOf(l);return m===null?void 0:f(m,c,a)}if("value"in h)return h.value;var g=h.get;return g!==void 0?g.call(a):void 0},p=function(f){return f&&f.__esModule?f:{default:f}}(o(0)),d=function(f){function l(){return function(c,a){if(!(c instanceof a))throw new TypeError("Cannot call a class as a function")}(this,l),function(c,a){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||typeof a!="object"&&typeof a!="function"?c:a}(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return function(c,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof a);c.prototype=Object.create(a&&a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(c,a):c.__proto__=a)}(l,f),s(l,[{key:"add",value:function(c,a){if(a==="+1"||a==="-1"){var h=this.value(c)||0;a=a==="+1"?h+1:h-1}return a===0?(this.remove(c),!0):u(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"add",this).call(this,c,a)}},{key:"canAdd",value:function(c,a){return u(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"canAdd",this).call(this,c,a)||u(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"canAdd",this).call(this,c,parseInt(a))}},{key:"value",value:function(c){return parseInt(u(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",this).call(this,c))||void 0}}]),l}(p.default.Attributor.Class),y=new d("indent","ql-indent",{scope:p.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});i.IndentClass=y},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(p){return p&&p.__esModule?p:{default:p}}(o(4)),u=function(p){function d(){return function(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}(this,d),function(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||typeof f!="object"&&typeof f!="function"?y:f}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return function(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}(d,p),d}(s.default);u.blotName="blockquote",u.tagName="blockquote",i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function d(y,f){for(var l=0;l<f.length;l++){var c=f[l];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(y,c.key,c)}}return function(y,f,l){return f&&d(y.prototype,f),l&&d(y,l),y}}(),u=function(d){return d&&d.__esModule?d:{default:d}}(o(4)),p=function(d){function y(){return function(f,l){if(!(f instanceof l))throw new TypeError("Cannot call a class as a function")}(this,y),function(f,l){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||typeof l!="object"&&typeof l!="function"?f:l}(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return function(f,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);f.prototype=Object.create(l&&l.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(f,l):f.__proto__=l)}(y,d),s(y,null,[{key:"formats",value:function(f){return this.tagName.indexOf(f.tagName)+1}}]),y}(u.default);p.blotName="header",p.tagName=["H1","H2","H3","H4","H5","H6"],i.default=p},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.ListItem=void 0;var s=function(){function g(_,b){for(var E=0;E<b.length;E++){var x=b[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,b,E){return b&&g(_.prototype,b),E&&g(_,E),_}}(),u=function g(_,b,E){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,b);if(x===void 0){var v=Object.getPrototypeOf(_);return v===null?void 0:g(v,b,E)}if("value"in x)return x.value;var T=x.get;return T!==void 0?T.call(E):void 0},p=f(o(0)),d=f(o(4)),y=f(o(25));function f(g){return g&&g.__esModule?g:{default:g}}function l(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function c(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!_||typeof _!="object"&&typeof _!="function"?g:_}function a(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(g,_):g.__proto__=_)}var h=function(g){function _(){return l(this,_),c(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,g),s(_,[{key:"format",value:function(b,E){b!==m.blotName||E?u(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,b,E):this.replaceWith(p.default.create(this.statics.scope))}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():u(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(b,E){return this.parent.isolate(this.offset(this.parent),this.length()),b===this.parent.statics.blotName?(this.parent.replaceWith(b,E),this):(this.parent.unwrap(),u(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,b,E))}}],[{key:"formats",value:function(b){return b.tagName===this.tagName?void 0:u(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,b)}}]),_}(d.default);h.blotName="list-item",h.tagName="LI";var m=function(g){function _(b){l(this,_);var E=c(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,b)),x=function(v){if(v.target.parentNode===b){var T=E.statics.formats(b),O=p.default.find(v.target);T==="checked"?O.format("list","unchecked"):T==="unchecked"&&O.format("list","checked")}};return b.addEventListener("touchstart",x),b.addEventListener("mousedown",x),E}return a(_,g),s(_,null,[{key:"create",value:function(b){var E=b==="ordered"?"OL":"UL",x=u(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,E);return b!=="checked"&&b!=="unchecked"||x.setAttribute("data-checked",b==="checked"),x}},{key:"formats",value:function(b){return b.tagName==="OL"?"ordered":b.tagName==="UL"?b.hasAttribute("data-checked")?b.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet":void 0}}]),s(_,[{key:"format",value:function(b,E){this.children.length>0&&this.children.tail.format(b,E)}},{key:"formats",value:function(){return function(b,E,x){return E in b?Object.defineProperty(b,E,{value:x,enumerable:!0,configurable:!0,writable:!0}):b[E]=x,b}({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(b,E){if(b instanceof h)u(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,b,E);else{var x=E==null?this.length():E.offset(this),v=this.split(x);v.parent.insertBefore(b,v)}}},{key:"optimize",value:function(b){u(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,b);var E=this.next;E!=null&&E.prev===this&&E.statics.blotName===this.statics.blotName&&E.domNode.tagName===this.domNode.tagName&&E.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(E.moveChildren(this),E.remove())}},{key:"replace",value:function(b){if(b.statics.blotName!==this.statics.blotName){var E=p.default.create(this.statics.defaultChild);b.moveChildren(E),this.appendChild(E)}u(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,b)}}]),_}(y.default);m.blotName="list",m.scope=p.default.Scope.BLOCK_BLOT,m.tagName=["OL","UL"],m.defaultChild="list-item",m.allowedChildren=[h],i.ListItem=h,i.default=m},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(p){return p&&p.__esModule?p:{default:p}}(o(56)),u=function(p){function d(){return function(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}(this,d),function(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||typeof f!="object"&&typeof f!="function"?y:f}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return function(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}(d,p),d}(s.default);u.blotName="italic",u.tagName=["EM","I"],i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function y(f,l){for(var c=0;c<l.length;c++){var a=l[c];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(f,a.key,a)}}return function(f,l,c){return l&&y(f.prototype,l),c&&y(f,c),f}}(),u=function y(f,l,c){f===null&&(f=Function.prototype);var a=Object.getOwnPropertyDescriptor(f,l);if(a===void 0){var h=Object.getPrototypeOf(f);return h===null?void 0:y(h,l,c)}if("value"in a)return a.value;var m=a.get;return m!==void 0?m.call(c):void 0},p=function(y){return y&&y.__esModule?y:{default:y}}(o(6)),d=function(y){function f(){return function(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}(this,f),function(l,c){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||typeof c!="object"&&typeof c!="function"?l:c}(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return function(l,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);l.prototype=Object.create(c&&c.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(l,c):l.__proto__=c)}(f,y),s(f,null,[{key:"create",value:function(l){return l==="super"?document.createElement("sup"):l==="sub"?document.createElement("sub"):u(f.__proto__||Object.getPrototypeOf(f),"create",this).call(this,l)}},{key:"formats",value:function(l){return l.tagName==="SUB"?"sub":l.tagName==="SUP"?"super":void 0}}]),f}(p.default);d.blotName="script",d.tagName=["SUB","SUP"],i.default=d},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(p){return p&&p.__esModule?p:{default:p}}(o(6)),u=function(p){function d(){return function(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}(this,d),function(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||typeof f!="object"&&typeof f!="function"?y:f}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return function(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}(d,p),d}(s.default);u.blotName="strike",u.tagName="S",i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(p){return p&&p.__esModule?p:{default:p}}(o(6)),u=function(p){function d(){return function(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}(this,d),function(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||typeof f!="object"&&typeof f!="function"?y:f}(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return function(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}(d,p),d}(s.default);u.blotName="underline",u.tagName="U",i.default=u},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function l(c,a){for(var h=0;h<a.length;h++){var m=a[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,a,h){return a&&l(c.prototype,a),h&&l(c,h),c}}(),u=function l(c,a,h){c===null&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,a);if(m===void 0){var g=Object.getPrototypeOf(c);return g===null?void 0:l(g,a,h)}if("value"in m)return m.value;var _=m.get;return _!==void 0?_.call(h):void 0},p=function(l){return l&&l.__esModule?l:{default:l}}(o(0)),d=o(27),y=["alt","height","width"],f=function(l){function c(){return function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")}(this,c),function(a,h){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?a:h}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);a.prototype=Object.create(h&&h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(a,h):a.__proto__=h)}(c,l),s(c,[{key:"format",value:function(a,h){y.indexOf(a)>-1?h?this.domNode.setAttribute(a,h):this.domNode.removeAttribute(a):u(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"format",this).call(this,a,h)}}],[{key:"create",value:function(a){var h=u(c.__proto__||Object.getPrototypeOf(c),"create",this).call(this,a);return typeof a=="string"&&h.setAttribute("src",this.sanitize(a)),h}},{key:"formats",value:function(a){return y.reduce(function(h,m){return a.hasAttribute(m)&&(h[m]=a.getAttribute(m)),h},{})}},{key:"match",value:function(a){return/\.(jpe?g|gif|png)$/.test(a)||/^data:image\/.+;base64/.test(a)}},{key:"sanitize",value:function(a){return(0,d.sanitize)(a,["http","https","data"])?a:"//:0"}},{key:"value",value:function(a){return a.getAttribute("src")}}]),c}(p.default.Embed);f.blotName="image",f.tagName="IMG",i.default=f},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function l(c,a){for(var h=0;h<a.length;h++){var m=a[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}return function(c,a,h){return a&&l(c.prototype,a),h&&l(c,h),c}}(),u=function l(c,a,h){c===null&&(c=Function.prototype);var m=Object.getOwnPropertyDescriptor(c,a);if(m===void 0){var g=Object.getPrototypeOf(c);return g===null?void 0:l(g,a,h)}if("value"in m)return m.value;var _=m.get;return _!==void 0?_.call(h):void 0},p=o(4),d=function(l){return l&&l.__esModule?l:{default:l}}(o(27)),y=["height","width"],f=function(l){function c(){return function(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")}(this,c),function(a,h){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?a:h}(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);a.prototype=Object.create(h&&h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(a,h):a.__proto__=h)}(c,l),s(c,[{key:"format",value:function(a,h){y.indexOf(a)>-1?h?this.domNode.setAttribute(a,h):this.domNode.removeAttribute(a):u(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"format",this).call(this,a,h)}}],[{key:"create",value:function(a){var h=u(c.__proto__||Object.getPrototypeOf(c),"create",this).call(this,a);return h.setAttribute("frameborder","0"),h.setAttribute("allowfullscreen",!0),h.setAttribute("src",this.sanitize(a)),h}},{key:"formats",value:function(a){return y.reduce(function(h,m){return a.hasAttribute(m)&&(h[m]=a.getAttribute(m)),h},{})}},{key:"sanitize",value:function(a){return d.default.sanitize(a)}},{key:"value",value:function(a){return a.getAttribute("src")}}]),c}(p.BlockEmbed);f.blotName="video",f.className="ql-video",f.tagName="IFRAME",i.default=f},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.FormulaBlot=void 0;var s=function(){function g(_,b){for(var E=0;E<b.length;E++){var x=b[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,b,E){return b&&g(_.prototype,b),E&&g(_,E),_}}(),u=function g(_,b,E){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,b);if(x===void 0){var v=Object.getPrototypeOf(_);return v===null?void 0:g(v,b,E)}if("value"in x)return x.value;var T=x.get;return T!==void 0?T.call(E):void 0},p=f(o(35)),d=f(o(5)),y=f(o(9));function f(g){return g&&g.__esModule?g:{default:g}}function l(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function c(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!_||typeof _!="object"&&typeof _!="function"?g:_}function a(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(g,_):g.__proto__=_)}var h=function(g){function _(){return l(this,_),c(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,g),s(_,null,[{key:"create",value:function(b){var E=u(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,b);return typeof b=="string"&&(window.katex.render(b,E,{throwOnError:!1,errorColor:"#f00"}),E.setAttribute("data-value",b)),E}},{key:"value",value:function(b){return b.getAttribute("data-value")}}]),_}(p.default);h.blotName="formula",h.className="ql-formula",h.tagName="SPAN";var m=function(g){function _(){l(this,_);var b=c(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return b}return a(_,g),s(_,null,[{key:"register",value:function(){d.default.register(h,!0)}}]),_}(y.default);i.FormulaBlot=h,i.default=m},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.CodeToken=i.CodeBlock=void 0;var s=function(){function _(b,E){for(var x=0;x<E.length;x++){var v=E[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,v.key,v)}}return function(b,E,x){return E&&_(b.prototype,E),x&&_(b,x),b}}(),u=function _(b,E,x){b===null&&(b=Function.prototype);var v=Object.getOwnPropertyDescriptor(b,E);if(v===void 0){var T=Object.getPrototypeOf(b);return T===null?void 0:_(T,E,x)}if("value"in v)return v.value;var O=v.get;return O!==void 0?O.call(x):void 0},p=f(o(0)),d=f(o(5)),y=f(o(9));function f(_){return _&&_.__esModule?_:{default:_}}function l(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function c(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||typeof b!="object"&&typeof b!="function"?_:b}function a(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var h=function(_){function b(){return l(this,b),c(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,_),s(b,[{key:"replaceWith",value:function(E){this.domNode.textContent=this.domNode.textContent,this.attach(),u(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"replaceWith",this).call(this,E)}},{key:"highlight",value:function(E){var x=this.domNode.textContent;this.cachedText!==x&&((x.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=E(x),this.domNode.normalize(),this.attach()),this.cachedText=x)}}]),b}(f(o(13)).default);h.className="ql-syntax";var m=new p.default.Attributor.Class("token","hljs",{scope:p.default.Scope.INLINE}),g=function(_){function b(E,x){l(this,b);var v=c(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,E,x));if(typeof v.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var T=null;return v.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(T),T=setTimeout(function(){v.highlight(),T=null},v.options.interval)}),v.highlight(),v}return a(b,_),s(b,null,[{key:"register",value:function(){d.default.register(m,!0),d.default.register(h,!0)}}]),s(b,[{key:"highlight",value:function(){var E=this;if(!this.quill.selection.composing){this.quill.update(d.default.sources.USER);var x=this.quill.getSelection();this.quill.scroll.descendants(h).forEach(function(v){v.highlight(E.options.highlight)}),this.quill.update(d.default.sources.SILENT),x!=null&&this.quill.setSelection(x,d.default.sources.SILENT)}}}]),b}(y.default);g.DEFAULTS={highlight:window.hljs==null?null:function(_){return window.hljs.highlightAuto(_).value},interval:1e3},i.CodeBlock=h,i.CodeToken=m,i.default=g},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(n,i){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(n,i){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(n,i){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(n,i){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(n,i){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(n,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.BubbleTooltip=void 0;var s=function x(v,T,O){v===null&&(v=Function.prototype);var A=Object.getOwnPropertyDescriptor(v,T);if(A===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:x(N,T,O)}if("value"in A)return A.value;var k=A.get;return k!==void 0?k.call(O):void 0},u=function(){function x(v,T){for(var O=0;O<T.length;O++){var A=T[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,T,O){return T&&x(v.prototype,T),O&&x(v,O),v}}(),p=a(o(3)),d=a(o(8)),y=o(43),f=a(y),l=o(15),c=a(o(41));function a(x){return x&&x.__esModule?x:{default:x}}function h(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function m(x,v){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!v||typeof v!="object"&&typeof v!="function"?x:v}function g(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}var _=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],b=function(x){function v(T,O){h(this,v),O.modules.toolbar!=null&&O.modules.toolbar.container==null&&(O.modules.toolbar.container=_);var A=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,T,O));return A.quill.container.classList.add("ql-bubble"),A}return g(v,x),u(v,[{key:"extendToolbar",value:function(T){this.tooltip=new E(this.quill,this.options.bounds),this.tooltip.root.appendChild(T.container),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),c.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),c.default)}}]),v}(f.default);b.DEFAULTS=(0,p.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(x){x?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var E=function(x){function v(T,O){h(this,v);var A=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,T,O));return A.quill.on(d.default.events.EDITOR_CHANGE,function(N,k,w,C){if(N===d.default.events.SELECTION_CHANGE)if(k!=null&&k.length>0&&C===d.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var P=A.quill.getLines(k.index,k.length);if(P.length===1)A.position(A.quill.getBounds(k));else{var S=P[P.length-1],R=A.quill.getIndex(S),I=Math.min(S.length()-1,k.index+k.length-R),M=A.quill.getBounds(new l.Range(R,I));A.position(M)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return g(v,x),u(v,[{key:"listen",value:function(){var T=this;s(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){T.root.classList.remove("ql-editing")}),this.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var O=T.quill.getSelection();O!=null&&T.position(T.quill.getBounds(O))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var O=s(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"position",this).call(this,T),A=this.root.querySelector(".ql-tooltip-arrow");if(A.style.marginLeft="",O===0)return O;A.style.marginLeft=-1*O-A.offsetWidth/2+"px"}}]),v}(y.BaseTooltip);E.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),i.BubbleTooltip=E,i.default=b},function(n,i,o){n.exports=o(63)}]).default},t.exports=r()})(Qu);const N0=nr(Qu.exports),k0=le.withFilters(le.Container,{blur:Qe.filters.BlurFilter,adjust:Fo,matrix:Qe.filters.ColorMatrixFilter}),C0=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],R0={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1};var Ju=(t=>(t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t))(Ju||{}),ec=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(ec||{});Ae.Animations=Ju,Ae.BlendModes=ec,Ae.Events=mt,Ae.GsapPixieContext=Ar,Ae.GsapPixieContextProvider=({children:t})=>{const[e,r]=X.useState(!1),n=X.useRef(),i=X.useRef(),o=X.useRef(.001);X.useLayoutEffect(()=>(i.current=ct.context(()=>{n.current&&n.current.progress(0).kill(),n.current=ct.timeline({paused:!0,defaults:{duration:0}})}),()=>i.current.revert()),[]);const s=X.useCallback(()=>{let c=n.current.time();o.current=c},[]);X.useEffect(()=>{const c=n.current;c.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){c.pause(),s()}).eventCallback("onUpdate",function(){s()}).eventCallback("onPause",function(){s()}).eventCallback("onResume",function(){s()}).eventCallback("onComplete",function(){c.pause(),c.revert(),ti(mt.STOP),ti(mt.COMPLETE),s()})},[]);const u=X.useCallback(()=>{n.current.revert()},[]),p=X.useCallback(()=>{n.current.restart()},[]),d=X.useCallback(()=>{const c=n.current;c.repeat(1),c.restart()},[]),y=X.useCallback(c=>{n.current.seek(c)},[]),f=X.useCallback(()=>{n.current.seek(4)},[]),l=X.useCallback(()=>{const c=n.current;return c?c.totalDuration():0},[]);return on(mt.DRAGGING_START,()=>{r(!0)}),on(mt.DRAGGING_END,()=>{r(!1)}),ie.jsx(Ar.Provider,{value:{gsapCtx:i,tl:n,handlePlay:()=>{n.current.resume(),ti(mt.RESUME)},handlePause:()=>{n.current.pause(),ti(mt.PAUSE)},handleReset:u,handleSeek:y,handleSeekTest:f,handleRestart:p,handleRepeat:d,playerTimeRef:o,isDragging:e,getTimelineDuration:l},children:t})},Ae.PixiAnimatedSprite=Zu,Ae.PixiAudioSprite=t=>{const[,e]=Q.useState(!1),r=X.useRef({isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1});console.log("allProps",t);const n=X.useRef(null),i=X.useRef(null),{tl:o,playerTimeRef:s}=X.useContext(Ar),{uniqueId:u,src:p,startAt:d,endAt:y,mute:f,speed:l}=t,c=Q.useRef(null);on(mt.PAUSE,()=>{var b;console.log("pause event"),n.current&&((b=c.current)==null||b.pause(),r.current.isPlaying=!1)});const a=b=>{var E;n.current&&(console.log("audio gsapOnStart",b),s.current>=b&&s.current<=y&&((E=c.current)==null||E.play({volume:f?0:1,start:b,end:y,speed:l||1}),r.current.isPlaying=!0,r.current.completed=!1))},h=()=>{var b;n.current&&(console.log("audio gsapOnStart",d),(b=c.current)==null||b.stop(),r.current.isPlaying=!1,r.current.completed=!0)},m=b=>{var E,x,v;!n.current||r.current.isPlaying||r.current.completed||(console.log("audio gsapOnUpdate",b),(E=c.current)==null||E.refresh(),(x=c.current)==null||x.refreshPaused(),(v=c.current)==null||v.resume(),r.current.isPlaying=!0)},g=()=>{};X.useEffect(()=>{let b=ct.context(()=>{});if(n.current&&o.current){const E={duration:Number(y)-Number(d),onStart:a,onComplete:h,onStartParams:[d],onCompleteParams:[],onInterrupt:g,onUpdate:m,onUpdateParams:[]};b=ct.context(()=>{o.current.to(n.current,{alpha:1,duration:.01},d).from(i.current,{...E},d).to(n.current,{alpha:0,duration:.1},Number(y)-.1)})}return()=>b.revert()},[d,y]),Q.useEffect(()=>{n.current&&e(!0)},[]),Q.useEffect(()=>{n.current&&c.current&&(console.log("soundref",c.current),r.current.mute=f,r.current.speed=l,console.log("containerAudio",c.current.volume),c.current.volume=f?0:1)},[f,l]);const _=Q.useCallback((b,E)=>{c.current=E,r.current.loaded=!0},[]);return Q.useEffect(()=>(Ke(p)||(c.current=sc.Sound.from({url:p,preload:!0,singleInstance:!0,loaded:_})),()=>{}),[u,p,_]),ie.jsx(le.Container,{ref:n})},Ae.PixiGifSprite=t=>{const[e,r]=Q.useState([]),[,n]=Q.useState(0),[i,o]=Q.useState([]),[,s]=X.useState(0),[,u]=X.useState(!1),[p,d]=X.useState(!1),[,y]=X.useState(!1),[f,l]=(c={autoPlay:!1},X.useReducer(Ku,c,_0));var c;const a=Q.useRef(null),h=X.useRef(null),m=X.useRef(null),g=X.useRef(null),_=X.useRef(null),b=X.useRef(null),E=X.useRef(S0),x=X.useRef(t.initialAlpha),{tl:v}=X.useContext(Ar),{frames:T,delays:O,loaded:A}=f,{uniqueId:N,src:k,startAt:w,endAt:C,locked:P,loop:S,transformation:{width:R=0,height:I=0,x:M,y:L,rotation:j=0,scale:q,animation:G,colorCorrection:z,effect:K},pointerdown:F,pointerup:D,mousedown:B,mouseup:U,pointerover:H,mouseover:V,mouseout:$,pointerout:Y,applyTransformer:J,onAnchorTransformationEnd:re}=t,{contrast:ve=1,saturation:ce=1,exposure:ne=1,blurRadius:oe=0,alpha:Ue=1}=z||{},Xe={brightness:ne,contrast:ve,saturation:ce,alpha:Ue},xe=le.useApp();T0(k,l),on(mt.PAUSE,he=>{console.log("pause event",he),h.current&&(h.current.stop(),E.current.isPlaying=!1)});const Le=Q.useCallback(he=>{console.log("changeEnd",he),re&&re(he)},[]);Q.useEffect(()=>{if(!Ke(T)){const he=d0(T,vt=>{const{data:Oe,width:Ai,height:Oi}=vt,I0=new Uint8Array(Oe);return Qe.Texture.fromBuffer(I0,Ai,Oi)}),Ft=he.map((vt,Oe)=>({texture:vt,time:O[Oe]}));r(he),o(Ft);let Dr=0;O.forEach(vt=>{Dr+=10*vt}),n(Dr)}},[T,O]);const $e=he=>{h.current&&(h.current.gotoAndPlay(he||0),E.current.isPlaying=!0)},ke=()=>{h.current&&(h.current.stop(),E.current.isPlaying=!1)},_s=()=>{h.current&&(h.current.stop(),E.current.isPlaying=!1)},te=()=>{h.current&&!E.current.isPlaying&&(h.current.play(),E.current.isPlaying=!0)},Ge=he=>{x.current=he.alpha},Fr=he=>{x.current=he.alpha};X.useEffect(()=>{let he=ct.context(()=>{});if(m.current&&v.current){const Ft={duration:Number(C)-Number(w),onStart:$e,onComplete:ke,onStartParams:[w],onCompleteParams:[],onInterrupt:_s,onUpdate:te,onUpdateParams:[]},Dr={onStart:Ge,onStartParams:[{alpha:1}]},vt={onComplete:Fr,onCompleteParams:[{alpha:0}]},Oe=Uo(G||"None");he=ct.context(()=>{var Ai,Oi;v.current.to(m.current,{alpha:1,duration:.01,...Dr},w).from(m.current,{...Ft},w).to(m.current,{alpha:0,duration:.1,...vt},Number(C)-.09),Ke(Oe.from)?Ke(Oe.to)?Ke(Oe.fromTo)||v.current.fromTo(m.current,(Ai=Oe.fromTo)==null?void 0:Ai.from,(Oi=Oe.fromTo)==null?void 0:Oi.to,w):v.current.to(m.current,{alpha:1,duration:.2,...Oe.to},w):v.current.from(m.current,{...Oe.from},w)})}return()=>he.revert()},[G,w,C]);const Br=Q.useCallback(()=>{d(!0)},[]);xe.ticker.add(he=>{a.current&&(a.current.rotation+=.01*he,a.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,2*Math.PI*.6,!1))});const Ze=Q.useCallback(he=>{he.clear()},[]);return ie.jsxs(le.Container,{ref:g,children:[ie.jsx(le.Container,{ref:m,alpha:x.current,position:[M,L],pivot:[M,L],width:R,height:I,children:ie.jsxs(le.Container,{ref:_,children:[!A&&ie.jsx(le.Container,{anchor:.5,position:[R/2,I/2],children:ie.jsx(le.Graphics,{x:M,y:L,ref:a,draw:Ze})}),e&&e.length>0&&ie.jsx(A0,{scale:1,blur:{blur:oe,quality:4},adjust:Xe,apply:({matrix:he})=>{K==="BlackAndWhite"?he.desaturate():K==="Sepia"?he.sepia():K==="RetroVintage"||K==="NightVision"?he.negative():K==="Normal"&&he.reset()},matrix:{enabled:!0,matrix:O0},children:ie.jsx(Zu,{x:M,y:L,width:R,height:I,rotation:j,animationSpeed:1,loop:S,textures:i,onComplete:()=>{u(!0)},onFrameChange:he=>s(he),anchor:.5,...!P&&!p&&{interactive:!0,buttonMode:!0,pointerdown:F,pointerover:H,pointerout:Y,pointerup:D,mousedown:B,mouseup:U,mouseover:V,mouseout:$},forwardRef:h,scale:q})})]})}),J&&ie.jsx(Bo,{pixiTransformerRef:b,imageRef:m,isMounted:A,transformCommit:Le,transformChange:Br,mouseoverEvent:y,uniqueId:N})]})},Ae.PixiImageSprite=Nd,Ae.PixiSvgPathSprite=t=>{const[e,r]=Q.useState(null),n=X.useRef(null),i=X.useRef(null),o=X.useRef(null),{path:s,transformation:{x:u,y:p,width:d,height:y,anchor:f,fill:l,stroke:c="none",strokeWidth:a=0},pointerdown:h,pointerup:m}=t,g=le.useApp();return Q.useEffect(()=>{const _=pp(s).scale(5).translate(0,0).toString(),b=new Qd(`<svg xmlns="http://www.w3.org/2000/svg" width="${d}" height="${y}">
591
- <path stroke="${c}" stroke-width="${a}" fill="${l}" d="${_}">
592
- </path>
593
- </svg>`),E=g.renderer.generateTexture(b);return r(E),()=>{}},[g,s,c,a,l]),ie.jsx(ni,{...t,children:ie.jsx(le.Container,{ref:i,children:ie.jsx(le.Container,{ref:o,children:e&&ie.jsx(le.Sprite,{texture:e,width:d,height:y,anchor:f,ref:n,x:u,y:p,interactive:!0,pointerdown:h,pointerup:m})})})})},Ae.PixiTextSprite=t=>{const[e,r]=X.useState(!1);console.log("allProps",t);const n=X.useRef(null),i=X.useRef(null),o=X.useRef(null),s=X.useRef(null),u=X.useRef(16),p=X.useRef(null),{uniqueId:d,text:y,disabled:f,transformation:l,onTextUpdate:c,pointerdown:a}=t,{scale:h=[1,1],x:m,y:g,rotation:_=1,fontFamily:b="Arial",fontWeight:E="normal",fontStyle:x="normal",fontSize:v=16,fill:T="black",stroke:O,strokeThickness:A,blurRadius:N=0,blurEnabled:k=!1,dropShadowColor:w=null,wordWrapWidth:C=5e7,leading:P=0,letterSpacing:S}=l;Q.useEffect(()=>{u.current=Number(v)},[v]);const R=["italic","oblique"].includes(x)?x:void 0,I=["bold","lighter","100","200","300"].includes(E)?E:void 0,M=Number(S)>0?S:void 0,L=Q.useMemo(()=>new Qe.TextStyle({fontFamily:b,fontSize:v,fill:T||"white",stroke:O,strokeThickness:A,...R&&{fontStyle:R},...I&&{fontWeight:I},...M&&{letterSpacing:M},...k&&{dropShadow:!0,dropShadowBlur:Number(N),dropShadowColor:(w==null?void 0:w.toString())||"black",dropShadowDistance:0},wordWrap:!0,breakWords:!0,wordWrapWidth:C||500,leading:P||0}),[k,N,T,b,v,P,R,I,M,w,O,A,C]);return Q.useEffect(()=>{p.current={...l}},[l]),Q.useEffect(()=>{if(e&&o.current){let q=document.getElementById("note-editor");if(q){q.style.position="absolute",q.style.zIndex="10",q.style.left=m+"px",q.style.top=g+"px",q.style.backgroundColor="var(--chakra-color-darkShark)",q.style.transform="scale(1.5)",q.style.width="300px",q.style.height="100px",q.style.color="#fff",q.style.fontSize="20px",q.style.border="1px solid #CBCEE0";var j=new N0("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}}}},placeholder:"Compose your text here...",theme:"snow"});j.on("text-change",function(){(G=>{c&&c({text:G,uniqueId:d,droptype:"titles"})})(j.root.innerText)}),j.setText(y),j.focus(),j.off("text-change",()=>{console.log("removed")}),j.hasFocus()||(q.style.display="none")}}},[m,g,e]),ie.jsx(ni,{...t,children:ie.jsxs(le.Container,{ref:n,children:[e&&ie.jsx(le.Container,{ref:o}),ie.jsx(le.Container,{alpha:e?0:1,ref:s,children:ie.jsx(le.Text,{style:L,x:m,y:g,rotation:_,anchor:.5,text:y,...!e&&!f&&{interactive:!0,buttonMode:!0,pointerdown:a},ref:i,scale:h})})]})})},Ae.PixiVideoSprite=t=>{const[e,r]=Q.useState(!1),[,n]=X.useState(!1),[,i]=Q.useState({isWaiting:!1,isStalled:!1}),[o,s]=Q.useState(),[u,p]=X.useState(!1),d=X.useRef(null),y=X.useRef(null),f=X.useRef(null),l=X.useRef(null),c=X.useRef(null),a=X.useRef(null),h=X.useRef(R0),m=X.useRef(t.initialAlpha),{tl:g,playerTimeRef:_,isDragging:b}=X.useContext(Ar),{uniqueId:E,mute:x=!1,locked:v=!1,src:T,startAt:O,endAt:A,frameStartAt:N,frameEndAt:k,transformation:{x:w,y:C,width:P,height:S,scale:R,rotation:I,animation:M,colorCorrection:L,effect:j},pointerdown:q,pointerup:G,mousedown:z,mouseup:K,pointerover:F,mouseover:D,mouseout:B,applyTransformer:U,onAnchorTransformationEnd:H}=t,V=T||"",{contrast:$=1,saturation:Y=1,exposure:J=1,blurRadius:re=0,alpha:ve=1}=L||{},ce={brightness:J,contrast:$,saturation:Y,alpha:ve},ne=Q.useCallback(()=>{p(!0)},[]),oe=Q.useCallback(te=>{console.log("changeEnd",te),H&&(console.log("running onAnchorTransformationEnd"),H(te))},[]),Ue=Q.useMemo(()=>{const te=document.createElement("video");return te.src=T,te.crossOrigin="Anonymus",te.autoplay=!1,te.currentTime=1e-4,te},[T]);on(mt.PAUSE,te=>{if(console.log("pause event",te),a.current){const Ge=a.current;Ge.currentTime>0&&!Ge.paused&&!Ge.ended&&Ge.readyState>Ge.HAVE_CURRENT_DATA&&a.current.pause(),h.current.isPlaying=!1}}),Q.useEffect(()=>{console.log("current",a.current,b),a.current&&(b?(a.current.pause(),h.current.isPlaying=!1,h.current.isDragging=!0):h.current.isDragging=!1)},[b]);const Xe=te=>{a.current&&(console.log("video gsapOnStart",_.current,b),_.current>=te&&_.current<=A&&!b&&(a.current.currentTime=Number(N)||Number(te),a.current.play(),h.current.isPlaying=!0))},xe=()=>{if(console.log("onComplete triggered"),a.current){const te=a.current;te.currentTime>0&&!te.paused&&!te.ended&&te.readyState>te.HAVE_CURRENT_DATA&&a.current.pause(),h.current.isPlaying=!1}},Le=()=>{},$e=()=>{if(a.current){Math.abs(a.current.currentTime-_.current);const te=a.current,Ge=te.currentTime>0&&!te.paused&&!te.ended&&te.readyState>te.HAVE_CURRENT_DATA;h.current.isDragging?(console.log("video updating",_.current),a.current.currentTime=_.current,a.current.play(),setTimeout(()=>{h.current.isPlaying=!1,a.current&&a.current.pause()},55),h.current.isPlaying=!1):h.current.isPlaying||(Ge||a.current.play(),h.current.isPlaying=!0)}},ke=te=>{m.current=te.alpha},_s=te=>{m.current=te.alpha};return X.useEffect(()=>{let te=ct.context(()=>{});if(y.current&&g.current){const Ge={duration:Number(A)-Number(O),onStart:Xe,onComplete:xe,onStartParams:[O],onCompleteParams:[],onInterrupt:Le,onUpdate:$e,onUpdateParams:[]},Fr={onStart:ke,onStartParams:[{alpha:1}]},Br={onComplete:_s,onCompleteParams:[{alpha:0}]},Ze=Uo(M||"None");te=ct.context(()=>{var he,Ft;g.current.to(y.current,{alpha:1,duration:.01,...Fr},O).from(y.current,{...Ge},O).to(y.current,{alpha:0,duration:.1,...Br},Number(A)-.09),Ke(Ze.from)?Ke(Ze.to)?Ke(Ze.fromTo)||g.current.fromTo(y.current,(he=Ze.fromTo)==null?void 0:he.from,(Ft=Ze.fromTo)==null?void 0:Ft.to,O):g.current.to(y.current,{alpha:1,duration:.2,...Ze.to},O):g.current.from(y.current,{...Ze.from},O)})}return()=>te.revert()},[M,O,A]),Q.useEffect(()=>{y.current&&r(!0)},[]),Q.useEffect(()=>{a.current&&(a.current.muted=x)},[x]),Q.useEffect(()=>{if(a.current){const te=a.current;te.currentTime>0&&!te.paused&&!te.ended&&te.readyState>te.HAVE_CURRENT_DATA&&(u||b)&&(a.current.pause(),h.current.isPlaying=!1)}},[u,b]),Q.useEffect(()=>{const te=Math.round(100*(Number(N)+Number.EPSILON))/100,Ge=function(){a.current&&(a.current.currentTime=te)},Fr=function(){if(a.current){const Oe=a.current;Oe.currentTime>0&&!Oe.paused&&!Oe.ended&&Oe.readyState>Oe.HAVE_CURRENT_DATA&&a.current.pause()}i({isWaiting:!1,isStalled:!1})},Br=function(){a.current&&a.current.pause(),i({isWaiting:!0,isStalled:!1})},Ze=function(){i({isWaiting:!1,isStalled:!1})},he=function(){i({isWaiting:!1,isStalled:!0})},Ft=Math.round(100*(Number(N)+Number.EPSILON))/100,Dr=Math.round(100*(Number(k)+Number.EPSILON))/100,vt=`${V}#t=${Ft},${Dr}`;return console.log("urlTimestap",vt),Qe.Texture.fromLoader(Ue,vt,E,{pixiIdPrefix:E,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(Oe=>{Oe&&(s(Oe),console.log(Oe.baseTexture.resource.source),a.current=Oe.baseTexture.resource.source,a.current.id=E,a.current.addEventListener("loadedmetadata",Ge),a.current.addEventListener("ended",Fr),a.current.addEventListener("loadstart",Br),a.current.addEventListener("canplaythrough",Ze),a.current.addEventListener("stalled",he))}),()=>{a.current.removeEventListener("loadedmetadata",Ge),a.current.removeEventListener("ended",Fr),a.current.removeEventListener("loadstart",Br),a.current.removeEventListener("canplaythrough",Ze),a.current.removeEventListener("stalled",he)}},[V,E,N,k,Ue]),ie.jsxs(le.Container,{ref:f,children:[ie.jsx(le.Container,{ref:y,alpha:m.current,position:[w,C],pivot:[w,C],width:P,height:S,children:ie.jsx(k0,{scale:1,blur:{blur:re,quality:4},adjust:ce,apply:({matrix:te})=>{j==="BlackAndWhite"?te.desaturate():j==="Sepia"?te.sepia():j==="RetroVintage"||j==="NightVision"?te.negative():j==="Normal"&&te.reset()},matrix:{enabled:!0,matrix:C0},children:ie.jsx(le.Container,{ref:l,children:o&&ie.jsx(le.Sprite,{texture:o,width:P,height:S,anchor:.5,x:w,y:C,...!v&&!u&&{interactive:!0,buttonMode:!0,pointerdown:q,pointerover:F,pointerout:B,mousedown:z,mouseover:D,mouseout:B,mouseup:K,pointerup:G},ref:d,scale:R,rotation:I})})})}),U&&ie.jsx(Bo,{pixiTransformerRef:c,imageRef:y,isMounted:e,transformCommit:oe,transformChange:ne,mouseoverEvent:n,uniqueId:E})]})},Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
575
+ `);return k.insert(L,R.attributes)}return k.push(R)},new f.default)}n.default=D},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var s=function(){function E(N,A){var w=[],S=!0,I=!1,C=void 0;try{for(var F=N[Symbol.iterator](),D;!(S=(D=F.next()).done)&&(w.push(D.value),!(A&&w.length===A));S=!0);}catch(U){I=!0,C=U}finally{try{!S&&F.return&&F.return()}finally{if(I)throw C}}return w}return function(N,A){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return E(N,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function E(N,A){for(var w=0;w<A.length;w++){var S=A[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(N,S.key,S)}}return function(N,A,w){return A&&E(N.prototype,A),w&&E(N,w),N}}(),o=i(0),l=m(o),f=i(21),c=m(f),h=i(11),u=m(h),d=i(8),p=m(d),v=i(10),g=m(v);function m(E){return E&&E.__esModule?E:{default:E}}function b(E){if(Array.isArray(E)){for(var N=0,A=Array(E.length);N<E.length;N++)A[N]=E[N];return A}else return Array.from(E)}function _(E,N){if(!(E instanceof N))throw new TypeError("Cannot call a class as a function")}var y=(0,g.default)("quill:selection"),x=function E(N){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_(this,E),this.index=N,this.length=A},O=function(){function E(N,A){var w=this;_(this,E),this.emitter=A,this.scroll=N,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=l.default.create("cursor",this),this.lastRange=this.savedRange=new x(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){w.mouseDown||setTimeout(w.update.bind(w,p.default.sources.USER),1)}),this.emitter.on(p.default.events.EDITOR_CHANGE,function(S,I){S===p.default.events.TEXT_CHANGE&&I.length()>0&&w.update(p.default.sources.SILENT)}),this.emitter.on(p.default.events.SCROLL_BEFORE_UPDATE,function(){if(w.hasFocus()){var S=w.getNativeRange();S!=null&&S.start.node!==w.cursor.textNode&&w.emitter.once(p.default.events.SCROLL_UPDATE,function(){try{w.setNativeRange(S.start.node,S.start.offset,S.end.node,S.end.offset)}catch{}})}}),this.emitter.on(p.default.events.SCROLL_OPTIMIZE,function(S,I){if(I.range){var C=I.range,F=C.startNode,D=C.startOffset,U=C.endNode,X=C.endOffset;w.setNativeRange(F,D,U,X)}}),this.update(p.default.sources.SILENT)}return a(E,[{key:"handleComposition",value:function(){var A=this;this.root.addEventListener("compositionstart",function(){A.composing=!0}),this.root.addEventListener("compositionend",function(){if(A.composing=!1,A.cursor.parent){var w=A.cursor.restore();if(!w)return;setTimeout(function(){A.setNativeRange(w.startNode,w.startOffset,w.endNode,w.endOffset)},1)}})}},{key:"handleDragging",value:function(){var A=this;this.emitter.listenDOM("mousedown",document.body,function(){A.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){A.mouseDown=!1,A.update(p.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(A,w){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var S=this.getNativeRange();if(!(S==null||!S.native.collapsed||l.default.query(A,l.default.Scope.BLOCK))){if(S.start.node!==this.cursor.textNode){var I=l.default.find(S.start.node,!1);if(I==null)return;if(I instanceof l.default.Leaf){var C=I.split(S.start.offset);I.parent.insertBefore(this.cursor,C)}else I.insertBefore(this.cursor,S.start.node);this.cursor.attach()}this.cursor.format(A,w),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=this.scroll.length();A=Math.min(A,S-1),w=Math.min(A+w,S-1)-A;var I=void 0,C=this.scroll.leaf(A),F=s(C,2),D=F[0],U=F[1];if(D==null)return null;var X=D.position(U,!0),j=s(X,2);I=j[0],U=j[1];var k=document.createRange();if(w>0){k.setStart(I,U);var R=this.scroll.leaf(A+w),P=s(R,2);if(D=P[0],U=P[1],D==null)return null;var L=D.position(U,!0),$=s(L,2);return I=$[0],U=$[1],k.setEnd(I,U),k.getBoundingClientRect()}else{var G="left",M=void 0;return I instanceof Text?(U<I.data.length?(k.setStart(I,U),k.setEnd(I,U+1)):(k.setStart(I,U-1),k.setEnd(I,U),G="right"),M=k.getBoundingClientRect()):(M=D.domNode.getBoundingClientRect(),U>0&&(G="right")),{bottom:M.top+M.height,height:M.height,left:M[G],right:M[G],top:M.top,width:0}}}},{key:"getNativeRange",value:function(){var A=document.getSelection();if(A==null||A.rangeCount<=0)return null;var w=A.getRangeAt(0);if(w==null)return null;var S=this.normalizeNative(w);return y.info("getNativeRange",S),S}},{key:"getRange",value:function(){var A=this.getNativeRange();if(A==null)return[null,null];var w=this.normalizedToRange(A);return[w,A]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(A){var w=this,S=[[A.start.node,A.start.offset]];A.native.collapsed||S.push([A.end.node,A.end.offset]);var I=S.map(function(D){var U=s(D,2),X=U[0],j=U[1],k=l.default.find(X,!0),R=k.offset(w.scroll);return j===0?R:k instanceof l.default.Container?R+k.length():R+k.index(X,j)}),C=Math.min(Math.max.apply(Math,b(I)),this.scroll.length()-1),F=Math.min.apply(Math,[C].concat(b(I)));return new x(F,C-F)}},{key:"normalizeNative",value:function(A){if(!T(this.root,A.startContainer)||!A.collapsed&&!T(this.root,A.endContainer))return null;var w={start:{node:A.startContainer,offset:A.startOffset},end:{node:A.endContainer,offset:A.endOffset},native:A};return[w.start,w.end].forEach(function(S){for(var I=S.node,C=S.offset;!(I instanceof Text)&&I.childNodes.length>0;)if(I.childNodes.length>C)I=I.childNodes[C],C=0;else if(I.childNodes.length===C)I=I.lastChild,C=I instanceof Text?I.data.length:I.childNodes.length+1;else break;S.node=I,S.offset=C}),w}},{key:"rangeToNative",value:function(A){var w=this,S=A.collapsed?[A.index]:[A.index,A.index+A.length],I=[],C=this.scroll.length();return S.forEach(function(F,D){F=Math.min(C-1,F);var U=void 0,X=w.scroll.leaf(F),j=s(X,2),k=j[0],R=j[1],P=k.position(R,D!==0),L=s(P,2);U=L[0],R=L[1],I.push(U,R)}),I.length<2&&(I=I.concat(I)),I}},{key:"scrollIntoView",value:function(A){var w=this.lastRange;if(w!=null){var S=this.getBounds(w.index,w.length);if(S!=null){var I=this.scroll.length()-1,C=this.scroll.line(Math.min(w.index,I)),F=s(C,1),D=F[0],U=D;if(w.length>0){var X=this.scroll.line(Math.min(w.index+w.length,I)),j=s(X,1);U=j[0]}if(!(D==null||U==null)){var k=A.getBoundingClientRect();S.top<k.top?A.scrollTop-=k.top-S.top:S.bottom>k.bottom&&(A.scrollTop+=S.bottom-k.bottom)}}}}},{key:"setNativeRange",value:function(A,w){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A,I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:w,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(y.info("setNativeRange",A,w,S,I),!(A!=null&&(this.root.parentNode==null||A.parentNode==null||S.parentNode==null))){var F=document.getSelection();if(F!=null)if(A!=null){this.hasFocus()||this.root.focus();var D=(this.getNativeRange()||{}).native;if(D==null||C||A!==D.startContainer||w!==D.startOffset||S!==D.endContainer||I!==D.endOffset){A.tagName=="BR"&&(w=[].indexOf.call(A.parentNode.childNodes,A),A=A.parentNode),S.tagName=="BR"&&(I=[].indexOf.call(S.parentNode.childNodes,S),S=S.parentNode);var U=document.createRange();U.setStart(A,w),U.setEnd(S,I),F.removeAllRanges(),F.addRange(U)}}else F.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(A){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;if(typeof w=="string"&&(S=w,w=!1),y.info("setRange",A),A!=null){var I=this.rangeToNative(A);this.setNativeRange.apply(this,b(I).concat([w]))}else this.setNativeRange(null);this.update(S)}},{key:"update",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,w=this.lastRange,S=this.getRange(),I=s(S,2),C=I[0],F=I[1];if(this.lastRange=C,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,u.default)(w,this.lastRange)){var D;!this.composing&&F!=null&&F.native.collapsed&&F.start.node!==this.cursor.textNode&&this.cursor.restore();var U=[p.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(w),A];if((D=this.emitter).emit.apply(D,[p.default.events.EDITOR_CHANGE].concat(U)),A!==p.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,U)}}}}]),E}();function T(E,N){try{N.parentNode}catch{return!1}return N instanceof Text&&(N=N.parentNode),E.contains(N)}n.Range=x,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var m=0;m<g.length;m++){var b=g[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,m){return g&&p(v.prototype,g),m&&p(v,m),v}}(),a=function p(v,g,m){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,m)}else{if("value"in b)return b.value;var y=b.get;return y===void 0?void 0:y.call(m)}},o=i(0),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),h(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"insertInto",value:function(m,b){m.children.length===0?a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertInto",this).call(this,m,b):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),v}(l.default.Embed);d.blotName="break",d.tagName="BR",n.default=d},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){h(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(44),o=i(30),l=i(1),f=function(h){s(u,h);function u(d){var p=h.call(this,d)||this;return p.build(),p}return u.prototype.appendChild=function(d){this.insertBefore(d)},u.prototype.attach=function(){h.prototype.attach.call(this),this.children.forEach(function(d){d.attach()})},u.prototype.build=function(){var d=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(p){try{var v=c(p);d.insertBefore(v,d.children.head||void 0)}catch(g){if(g instanceof l.ParchmentError)return;throw g}})},u.prototype.deleteAt=function(d,p){if(d===0&&p===this.length())return this.remove();this.children.forEachAt(d,p,function(v,g,m){v.deleteAt(g,m)})},u.prototype.descendant=function(d,p){var v=this.children.find(p),g=v[0],m=v[1];return d.blotName==null&&d(g)||d.blotName!=null&&g instanceof d?[g,m]:g instanceof u?g.descendant(d,m):[null,-1]},u.prototype.descendants=function(d,p,v){p===void 0&&(p=0),v===void 0&&(v=Number.MAX_VALUE);var g=[],m=v;return this.children.forEachAt(p,v,function(b,_,y){(d.blotName==null&&d(b)||d.blotName!=null&&b instanceof d)&&g.push(b),b instanceof u&&(g=g.concat(b.descendants(d,_,m))),m-=y}),g},u.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),h.prototype.detach.call(this)},u.prototype.formatAt=function(d,p,v,g){this.children.forEachAt(d,p,function(m,b,_){m.formatAt(b,_,v,g)})},u.prototype.insertAt=function(d,p,v){var g=this.children.find(d),m=g[0],b=g[1];if(m)m.insertAt(b,p,v);else{var _=v==null?l.create("text",p):l.create(p,v);this.appendChild(_)}},u.prototype.insertBefore=function(d,p){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(v){return d instanceof v}))throw new l.ParchmentError("Cannot insert "+d.statics.blotName+" into "+this.statics.blotName);d.insertInto(this,p)},u.prototype.length=function(){return this.children.reduce(function(d,p){return d+p.length()},0)},u.prototype.moveChildren=function(d,p){this.children.forEach(function(v){d.insertBefore(v,p)})},u.prototype.optimize=function(d){if(h.prototype.optimize.call(this,d),this.children.length===0)if(this.statics.defaultChild!=null){var p=l.create(this.statics.defaultChild);this.appendChild(p),p.optimize(d)}else this.remove()},u.prototype.path=function(d,p){p===void 0&&(p=!1);var v=this.children.find(d,p),g=v[0],m=v[1],b=[[this,d]];return g instanceof u?b.concat(g.path(m,p)):(g!=null&&b.push([g,m]),b)},u.prototype.removeChild=function(d){this.children.remove(d)},u.prototype.replace=function(d){d instanceof u&&d.moveChildren(this),h.prototype.replace.call(this,d)},u.prototype.split=function(d,p){if(p===void 0&&(p=!1),!p){if(d===0)return this;if(d===this.length())return this.next}var v=this.clone();return this.parent.insertBefore(v,this.next),this.children.forEachAt(d,this.length(),function(g,m,b){g=g.split(m,p),v.appendChild(g)}),v},u.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},u.prototype.update=function(d,p){var v=this,g=[],m=[];d.forEach(function(b){b.target===v.domNode&&b.type==="childList"&&(g.push.apply(g,b.addedNodes),m.push.apply(m,b.removedNodes))}),m.forEach(function(b){if(!(b.parentNode!=null&&b.tagName!=="IFRAME"&&document.body.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var _=l.find(b);_!=null&&(_.domNode.parentNode==null||_.domNode.parentNode===v.domNode)&&_.detach()}}),g.filter(function(b){return b.parentNode==v.domNode}).sort(function(b,_){return b===_?0:b.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(b){var _=null;b.nextSibling!=null&&(_=l.find(b.nextSibling));var y=c(b);(y.next!=_||y.next==null)&&(y.parent!=null&&y.parent.removeChild(v),v.insertBefore(y,_||void 0))})},u}(o.default);function c(h){var u=l.find(h);if(u==null)try{u=l.create(h)}catch{u=l.create(l.Scope.INLINE),[].slice.call(h.childNodes).forEach(function(p){u.domNode.appendChild(p)}),h.parentNode&&h.parentNode.replaceChild(u.domNode,h),u.attach()}return u}n.default=f},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){h(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(31),l=i(17),f=i(1),c=function(h){s(u,h);function u(d){var p=h.call(this,d)||this;return p.attributes=new o.default(p.domNode),p}return u.formats=function(d){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()},u.prototype.format=function(d,p){var v=f.query(d);v instanceof a.default?this.attributes.attribute(v,p):p&&v!=null&&(d!==this.statics.blotName||this.formats()[d]!==p)&&this.replaceWith(d,p)},u.prototype.formats=function(){var d=this.attributes.values(),p=this.statics.formats(this.domNode);return p!=null&&(d[this.statics.blotName]=p),d},u.prototype.replaceWith=function(d,p){var v=h.prototype.replaceWith.call(this,d,p);return this.attributes.copy(v),v},u.prototype.update=function(d,p){var v=this;h.prototype.update.call(this,d,p),d.some(function(g){return g.target===v.domNode&&g.type==="attributes"})&&this.attributes.build()},u.prototype.wrap=function(d,p){var v=h.prototype.wrap.call(this,d,p);return v instanceof u&&v.statics.scope===this.statics.scope&&this.attributes.move(v),v},u}(l.default);n.default=c},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var u in h)h.hasOwnProperty(u)&&(c[u]=h[u])};return function(c,h){f(c,h);function u(){this.constructor=c}c.prototype=h===null?Object.create(h):(u.prototype=h.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(30),o=i(1),l=function(f){s(c,f);function c(){return f!==null&&f.apply(this,arguments)||this}return c.value=function(h){return!0},c.prototype.index=function(h,u){return this.domNode===h||this.domNode.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(u,1):-1},c.prototype.position=function(h,u){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return h>0&&(d+=1),[this.parent.domNode,d]},c.prototype.value=function(){var h;return h={},h[this.statics.blotName]=this.statics.value(this.domNode)||!0,h},c.scope=o.Scope.INLINE_BLOT,c}(a.default);n.default=l},function(r,n,i){var s=i(11),a=i(3),o={attributes:{compose:function(f,c,h){typeof f!="object"&&(f={}),typeof c!="object"&&(c={});var u=a(!0,{},c);h||(u=Object.keys(u).reduce(function(p,v){return u[v]!=null&&(p[v]=u[v]),p},{}));for(var d in f)f[d]!==void 0&&c[d]===void 0&&(u[d]=f[d]);return Object.keys(u).length>0?u:void 0},diff:function(f,c){typeof f!="object"&&(f={}),typeof c!="object"&&(c={});var h=Object.keys(f).concat(Object.keys(c)).reduce(function(u,d){return s(f[d],c[d])||(u[d]=c[d]===void 0?null:c[d]),u},{});return Object.keys(h).length>0?h:void 0},transform:function(f,c,h){if(typeof f!="object")return c;if(typeof c=="object"){if(!h)return c;var u=Object.keys(c).reduce(function(d,p){return f[p]===void 0&&(d[p]=c[p]),d},{});return Object.keys(u).length>0?u:void 0}}},iterator:function(f){return new l(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function l(f){this.ops=f,this.index=0,this.offset=0}l.prototype.hasNext=function(){return this.peekLength()<1/0},l.prototype.next=function(f){f||(f=1/0);var c=this.ops[this.index];if(c){var h=this.offset,u=o.length(c);if(f>=u-h?(f=u-h,this.index+=1,this.offset=0):this.offset+=f,typeof c.delete=="number")return{delete:f};var d={};return c.attributes&&(d.attributes=c.attributes),typeof c.retain=="number"?d.retain=f:typeof c.insert=="string"?d.insert=c.insert.substr(h,f):d.insert=c.insert,d}else return{retain:1/0}},l.prototype.peek=function(){return this.ops[this.index]},l.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},l.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},l.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,c=this.index,h=this.next(),u=this.ops.slice(this.index);return this.offset=f,this.index=c,[h].concat(u)}else return[]},r.exports=o},function(r,n){var i=function(){function s(v,g){return g!=null&&v instanceof g}var a;try{a=Map}catch{a=function(){}}var o;try{o=Set}catch{o=function(){}}var l;try{l=Promise}catch{l=function(){}}function f(v,g,m,b,_){typeof g=="object"&&(m=g.depth,b=g.prototype,_=g.includeNonEnumerable,g=g.circular);var y=[],x=[],O=typeof Buffer<"u";typeof g>"u"&&(g=!0),typeof m>"u"&&(m=1/0);function T(E,N){if(E===null)return null;if(N===0)return E;var A,w;if(typeof E!="object")return E;if(s(E,a))A=new a;else if(s(E,o))A=new o;else if(s(E,l))A=new l(function(k,R){E.then(function(P){k(T(P,N-1))},function(P){R(T(P,N-1))})});else if(f.__isArray(E))A=[];else if(f.__isRegExp(E))A=new RegExp(E.source,p(E)),E.lastIndex&&(A.lastIndex=E.lastIndex);else if(f.__isDate(E))A=new Date(E.getTime());else{if(O&&Buffer.isBuffer(E))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(E.length):A=new Buffer(E.length),E.copy(A),A;s(E,Error)?A=Object.create(E):typeof b>"u"?(w=Object.getPrototypeOf(E),A=Object.create(w)):(A=Object.create(b),w=b)}if(g){var S=y.indexOf(E);if(S!=-1)return x[S];y.push(E),x.push(A)}s(E,a)&&E.forEach(function(k,R){var P=T(R,N-1),L=T(k,N-1);A.set(P,L)}),s(E,o)&&E.forEach(function(k){var R=T(k,N-1);A.add(R)});for(var I in E){var C;w&&(C=Object.getOwnPropertyDescriptor(w,I)),!(C&&C.set==null)&&(A[I]=T(E[I],N-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(E),I=0;I<F.length;I++){var D=F[I],U=Object.getOwnPropertyDescriptor(E,D);U&&!U.enumerable&&!_||(A[D]=T(E[D],N-1),U.enumerable||Object.defineProperty(A,D,{enumerable:!1}))}if(_)for(var X=Object.getOwnPropertyNames(E),I=0;I<X.length;I++){var j=X[I],U=Object.getOwnPropertyDescriptor(E,j);U&&U.enumerable||(A[j]=T(E[j],N-1),Object.defineProperty(A,j,{enumerable:!1}))}return A}return T(v,m)}f.clonePrototype=function(g){if(g===null)return null;var m=function(){};return m.prototype=g,new m};function c(v){return Object.prototype.toString.call(v)}f.__objToStr=c;function h(v){return typeof v=="object"&&c(v)==="[object Date]"}f.__isDate=h;function u(v){return typeof v=="object"&&c(v)==="[object Array]"}f.__isArray=u;function d(v){return typeof v=="object"&&c(v)==="[object RegExp]"}f.__isRegExp=d;function p(v){var g="";return v.global&&(g+="g"),v.ignoreCase&&(g+="i"),v.multiline&&(g+="m"),g}return f.__getRegExpFlags=p,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function A(w,S){var I=[],C=!0,F=!1,D=void 0;try{for(var U=w[Symbol.iterator](),X;!(C=(X=U.next()).done)&&(I.push(X.value),!(S&&I.length===S));C=!0);}catch(j){F=!0,D=j}finally{try{!C&&U.return&&U.return()}finally{if(F)throw D}}return I}return function(w,S){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return A(w,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function A(w,S){for(var I=0;I<S.length;I++){var C=S[I];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(w,C.key,C)}}return function(w,S,I){return S&&A(w.prototype,S),I&&A(w,I),w}}(),o=function A(w,S,I){w===null&&(w=Function.prototype);var C=Object.getOwnPropertyDescriptor(w,S);if(C===void 0){var F=Object.getPrototypeOf(w);return F===null?void 0:A(F,S,I)}else{if("value"in C)return C.value;var D=C.get;return D===void 0?void 0:D.call(I)}},l=i(0),f=y(l),c=i(8),h=y(c),u=i(4),d=y(u),p=i(16),v=y(p),g=i(13),m=y(g),b=i(25),_=y(b);function y(A){return A&&A.__esModule?A:{default:A}}function x(A,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}function O(A,w){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:A}function T(A,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);A.prototype=Object.create(w&&w.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(A,w):A.__proto__=w)}function E(A){return A instanceof d.default||A instanceof u.BlockEmbed}var N=function(A){T(w,A);function w(S,I){x(this,w);var C=O(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,S));return C.emitter=I.emitter,Array.isArray(I.whitelist)&&(C.whitelist=I.whitelist.reduce(function(F,D){return F[D]=!0,F},{})),C.domNode.addEventListener("DOMNodeInserted",function(){}),C.optimize(),C.enable(),C}return a(w,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(I,C){var F=this.line(I),D=s(F,2),U=D[0],X=D[1],j=this.line(I+C),k=s(j,1),R=k[0];if(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"deleteAt",this).call(this,I,C),R!=null&&U!==R&&X>0){if(U instanceof u.BlockEmbed||R instanceof u.BlockEmbed){this.optimize();return}if(U instanceof m.default){var P=U.newlineIndex(U.length(),!0);if(P>-1&&(U=U.split(P+1),U===R)){this.optimize();return}}else if(R instanceof m.default){var L=R.newlineIndex(0);L>-1&&R.split(L+1)}var $=R.children.head instanceof v.default?null:R.children.head;U.moveChildren(R,$),U.remove()}this.optimize()}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",I)}},{key:"formatAt",value:function(I,C,F,D){this.whitelist!=null&&!this.whitelist[F]||(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"formatAt",this).call(this,I,C,F,D),this.optimize())}},{key:"insertAt",value:function(I,C,F){if(!(F!=null&&this.whitelist!=null&&!this.whitelist[C])){if(I>=this.length())if(F==null||f.default.query(C,f.default.Scope.BLOCK)==null){var D=f.default.create(this.statics.defaultChild);this.appendChild(D),F==null&&C.endsWith(`
576
+ `)&&(C=C.slice(0,-1)),D.insertAt(0,C,F)}else{var U=f.default.create(C,F);this.appendChild(U)}else o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertAt",this).call(this,I,C,F);this.optimize()}}},{key:"insertBefore",value:function(I,C){if(I.statics.scope===f.default.Scope.INLINE_BLOT){var F=f.default.create(this.statics.defaultChild);F.appendChild(I),I=F}o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertBefore",this).call(this,I,C)}},{key:"leaf",value:function(I){return this.path(I).pop()||[null,-1]}},{key:"line",value:function(I){return I===this.length()?this.line(I-1):this.descendant(E,I)}},{key:"lines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,F=function D(U,X,j){var k=[],R=j;return U.children.forEachAt(X,j,function(P,L,$){E(P)?k.push(P):P instanceof f.default.Container&&(k=k.concat(D(P,L,R))),R-=$}),k};return F(this,I,C)}},{key:"optimize",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,I,C),I.length>0&&this.emitter.emit(h.default.events.SCROLL_OPTIMIZE,I,C))}},{key:"path",value:function(I){return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"path",this).call(this,I).slice(1)}},{key:"update",value:function(I){if(this.batch!==!0){var C=h.default.sources.USER;typeof I=="string"&&(C=I),Array.isArray(I)||(I=this.observer.takeRecords()),I.length>0&&this.emitter.emit(h.default.events.SCROLL_BEFORE_UPDATE,C,I),o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"update",this).call(this,I.concat([])),I.length>0&&this.emitter.emit(h.default.events.SCROLL_UPDATE,C,I)}}}]),w}(f.default.Scroll);N.blotName="scroll",N.className="ql-editor",N.tagName="DIV",N.defaultChild="block",N.allowedChildren=[d.default,u.BlockEmbed,_.default],n.default=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},a=function(){function M(B,q){var H=[],z=!0,Y=!1,J=void 0;try{for(var et=B[Symbol.iterator](),at;!(z=(at=et.next()).done)&&(H.push(at.value),!(q&&H.length===q));z=!0);}catch(lt){Y=!0,J=lt}finally{try{!z&&et.return&&et.return()}finally{if(Y)throw J}}return H}return function(B,q){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return M(B,q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function M(B,q){for(var H=0;H<q.length;H++){var z=q[H];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(B,z.key,z)}}return function(B,q,H){return q&&M(B.prototype,q),H&&M(B,H),B}}(),l=i(21),f=A(l),c=i(11),h=A(c),u=i(3),d=A(u),p=i(2),v=A(p),g=i(20),m=A(g),b=i(0),_=A(b),y=i(5),x=A(y),O=i(10),T=A(O),E=i(9),N=A(E);function A(M){return M&&M.__esModule?M:{default:M}}function w(M,B,q){return B in M?Object.defineProperty(M,B,{value:q,enumerable:!0,configurable:!0,writable:!0}):M[B]=q,M}function S(M,B){if(!(M instanceof B))throw new TypeError("Cannot call a class as a function")}function I(M,B){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:M}function C(M,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);M.prototype=Object.create(B&&B.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(M,B):M.__proto__=B)}var F=(0,T.default)("quill:keyboard"),D=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",U=function(M){C(B,M),o(B,null,[{key:"match",value:function(H,z){return z=G(z),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Y){return!!z[Y]!==H[Y]&&z[Y]!==null})?!1:z.key===(H.which||H.keyCode)}}]);function B(q,H){S(this,B);var z=I(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,q,H));return z.bindings={},Object.keys(z.options.bindings).forEach(function(Y){Y==="list autofill"&&q.scroll.whitelist!=null&&!q.scroll.whitelist.list||z.options.bindings[Y]&&z.addBinding(z.options.bindings[Y])}),z.addBinding({key:B.keys.ENTER,shiftKey:null},P),z.addBinding({key:B.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(z.addBinding({key:B.keys.BACKSPACE},{collapsed:!0},j),z.addBinding({key:B.keys.DELETE},{collapsed:!0},k)):(z.addBinding({key:B.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),z.addBinding({key:B.keys.DELETE},{collapsed:!0,suffix:/^.?$/},k)),z.addBinding({key:B.keys.BACKSPACE},{collapsed:!1},R),z.addBinding({key:B.keys.DELETE},{collapsed:!1},R),z.addBinding({key:B.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),z.listen(),z}return o(B,[{key:"addBinding",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},J=G(H);if(J==null||J.key==null)return F.warn("Attempted to add invalid keyboard binding",J);typeof z=="function"&&(z={handler:z}),typeof Y=="function"&&(Y={handler:Y}),J=(0,d.default)(J,z,Y),this.bindings[J.key]=this.bindings[J.key]||[],this.bindings[J.key].push(J)}},{key:"listen",value:function(){var H=this;this.quill.root.addEventListener("keydown",function(z){if(!z.defaultPrevented){var Y=z.which||z.keyCode,J=(H.bindings[Y]||[]).filter(function(gt){return B.match(z,gt)});if(J.length!==0){var et=H.quill.getSelection();if(!(et==null||!H.quill.hasFocus())){var at=H.quill.getLine(et.index),lt=a(at,2),Nt=lt[0],It=lt[1],V=H.quill.getLeaf(et.index),W=a(V,2),Z=W[0],tt=W[1],K=et.length===0?[Z,tt]:H.quill.getLeaf(et.index+et.length),ft=a(K,2),ct=ft[0],ht=ft[1],nt=Z instanceof _.default.Text?Z.value().slice(0,tt):"",St=ct instanceof _.default.Text?ct.value().slice(ht):"",Et={collapsed:et.length===0,empty:et.length===0&&Nt.length()<=1,format:H.quill.getFormat(et),offset:It,prefix:nt,suffix:St},De=J.some(function(gt){if(gt.collapsed!=null&&gt.collapsed!==Et.collapsed||gt.empty!=null&&gt.empty!==Et.empty||gt.offset!=null&&gt.offset!==Et.offset)return!1;if(Array.isArray(gt.format)){if(gt.format.every(function(ut){return Et.format[ut]==null}))return!1}else if(s(gt.format)==="object"&&!Object.keys(gt.format).every(function(ut){return gt.format[ut]===!0?Et.format[ut]!=null:gt.format[ut]===!1?Et.format[ut]==null:(0,h.default)(gt.format[ut],Et.format[ut])}))return!1;return gt.prefix!=null&&!gt.prefix.test(Et.prefix)||gt.suffix!=null&&!gt.suffix.test(Et.suffix)?!1:gt.handler.call(H,et,Et)!==!0});De&&z.preventDefault()}}}})}}]),B}(N.default);U.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},U.DEFAULTS={bindings:{bold:$("bold"),italic:$("italic"),underline:$("underline"),indent:{key:U.keys.TAB,format:["blockquote","indent","list"],handler:function(B,q){if(q.collapsed&&q.offset!==0)return!0;this.quill.format("indent","+1",x.default.sources.USER)}},outdent:{key:U.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(B,q){if(q.collapsed&&q.offset!==0)return!0;this.quill.format("indent","-1",x.default.sources.USER)}},"outdent backspace":{key:U.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(B,q){q.format.indent!=null?this.quill.format("indent","-1",x.default.sources.USER):q.format.list!=null&&this.quill.format("list",!1,x.default.sources.USER)}},"indent code-block":L(!0),"outdent code-block":L(!1),"remove tab":{key:U.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(B){this.quill.deleteText(B.index-1,1,x.default.sources.USER)}},tab:{key:U.keys.TAB,handler:function(B){this.quill.history.cutoff();var q=new v.default().retain(B.index).delete(B.length).insert(" ");this.quill.updateContents(q,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index+1,x.default.sources.SILENT)}},"list empty enter":{key:U.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(B,q){this.quill.format("list",!1,x.default.sources.USER),q.format.indent&&this.quill.format("indent",!1,x.default.sources.USER)}},"checklist enter":{key:U.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(B){var q=this.quill.getLine(B.index),H=a(q,2),z=H[0],Y=H[1],J=(0,d.default)({},z.formats(),{list:"checked"}),et=new v.default().retain(B.index).insert(`
577
+ `,J).retain(z.length()-Y-1).retain(1,{list:"unchecked"});this.quill.updateContents(et,x.default.sources.USER),this.quill.setSelection(B.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:U.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(B,q){var H=this.quill.getLine(B.index),z=a(H,2),Y=z[0],J=z[1],et=new v.default().retain(B.index).insert(`
578
+ `,q.format).retain(Y.length()-J-1).retain(1,{header:null});this.quill.updateContents(et,x.default.sources.USER),this.quill.setSelection(B.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(B,q){var H=q.prefix.length,z=this.quill.getLine(B.index),Y=a(z,2),J=Y[0],et=Y[1];if(et>H)return!0;var at=void 0;switch(q.prefix.trim()){case"[]":case"[ ]":at="unchecked";break;case"[x]":at="checked";break;case"-":case"*":at="bullet";break;default:at="ordered"}this.quill.insertText(B.index," ",x.default.sources.USER),this.quill.history.cutoff();var lt=new v.default().retain(B.index-et).delete(H+1).retain(J.length()-2-et).retain(1,{list:at});this.quill.updateContents(lt,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index-H,x.default.sources.SILENT)}},"code exit":{key:U.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(B){var q=this.quill.getLine(B.index),H=a(q,2),z=H[0],Y=H[1],J=new v.default().retain(B.index+z.length()-Y-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(J,x.default.sources.USER)}},"embed left":X(U.keys.LEFT,!1),"embed left shift":X(U.keys.LEFT,!0),"embed right":X(U.keys.RIGHT,!1),"embed right shift":X(U.keys.RIGHT,!0)}};function X(M,B){var q,H=M===U.keys.LEFT?"prefix":"suffix";return q={key:M,shiftKey:B,altKey:null},w(q,H,/^$/),w(q,"handler",function(Y){var J=Y.index;M===U.keys.RIGHT&&(J+=Y.length+1);var et=this.quill.getLeaf(J),at=a(et,1),lt=at[0];return lt instanceof _.default.Embed?(M===U.keys.LEFT?B?this.quill.setSelection(Y.index-1,Y.length+1,x.default.sources.USER):this.quill.setSelection(Y.index-1,x.default.sources.USER):B?this.quill.setSelection(Y.index,Y.length+1,x.default.sources.USER):this.quill.setSelection(Y.index+Y.length+1,x.default.sources.USER),!1):!0}),q}function j(M,B){if(!(M.index===0||this.quill.getLength()<=1)){var q=this.quill.getLine(M.index),H=a(q,1),z=H[0],Y={};if(B.offset===0){var J=this.quill.getLine(M.index-1),et=a(J,1),at=et[0];if(at!=null&&at.length()>1){var lt=z.formats(),Nt=this.quill.getFormat(M.index-1,1);Y=m.default.attributes.diff(lt,Nt)||{}}}var It=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(B.prefix)?2:1;this.quill.deleteText(M.index-It,It,x.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine(M.index-It,It,Y,x.default.sources.USER),this.quill.focus()}}function k(M,B){var q=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(B.suffix)?2:1;if(!(M.index>=this.quill.getLength()-q)){var H={},z=0,Y=this.quill.getLine(M.index),J=a(Y,1),et=J[0];if(B.offset>=et.length()-1){var at=this.quill.getLine(M.index+1),lt=a(at,1),Nt=lt[0];if(Nt){var It=et.formats(),V=this.quill.getFormat(M.index,1);H=m.default.attributes.diff(It,V)||{},z=Nt.length()}}this.quill.deleteText(M.index,q,x.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(M.index+z-1,q,H,x.default.sources.USER)}}function R(M){var B=this.quill.getLines(M),q={};if(B.length>1){var H=B[0].formats(),z=B[B.length-1].formats();q=m.default.attributes.diff(z,H)||{}}this.quill.deleteText(M,x.default.sources.USER),Object.keys(q).length>0&&this.quill.formatLine(M.index,1,q,x.default.sources.USER),this.quill.setSelection(M.index,x.default.sources.SILENT),this.quill.focus()}function P(M,B){var q=this;M.length>0&&this.quill.scroll.deleteAt(M.index,M.length);var H=Object.keys(B.format).reduce(function(z,Y){return _.default.query(Y,_.default.Scope.BLOCK)&&!Array.isArray(B.format[Y])&&(z[Y]=B.format[Y]),z},{});this.quill.insertText(M.index,`
579
+ `,H,x.default.sources.USER),this.quill.setSelection(M.index+1,x.default.sources.SILENT),this.quill.focus(),Object.keys(B.format).forEach(function(z){H[z]==null&&(Array.isArray(B.format[z])||z!=="link"&&q.quill.format(z,B.format[z],x.default.sources.USER))})}function L(M){return{key:U.keys.TAB,shiftKey:!M,format:{"code-block":!0},handler:function(q){var H=_.default.query("code-block"),z=q.index,Y=q.length,J=this.quill.scroll.descendant(H,z),et=a(J,2),at=et[0],lt=et[1];if(at!=null){var Nt=this.quill.getIndex(at),It=at.newlineIndex(lt,!0)+1,V=at.newlineIndex(Nt+lt+Y),W=at.domNode.textContent.slice(It,V).split(`
580
+ `);lt=0,W.forEach(function(Z,tt){M?(at.insertAt(It+lt,H.TAB),lt+=H.TAB.length,tt===0?z+=H.TAB.length:Y+=H.TAB.length):Z.startsWith(H.TAB)&&(at.deleteAt(It+lt,H.TAB.length),lt-=H.TAB.length,tt===0?z-=H.TAB.length:Y-=H.TAB.length),lt+=Z.length+1}),this.quill.update(x.default.sources.USER),this.quill.setSelection(z,Y,x.default.sources.SILENT)}}}}function $(M){return{key:M[0].toUpperCase(),shortKey:!0,handler:function(q,H){this.quill.format(M,!H.format[M],x.default.sources.USER)}}}function G(M){if(typeof M=="string"||typeof M=="number")return G({key:M});if((typeof M>"u"?"undefined":s(M))==="object"&&(M=(0,f.default)(M,!1)),typeof M.key=="string")if(U.keys[M.key.toUpperCase()]!=null)M.key=U.keys[M.key.toUpperCase()];else if(M.key.length===1)M.key=M.key.toUpperCase().charCodeAt(0);else return null;return M.shortKey&&(M[D]=M.shortKey,delete M.shortKey),M}n.default=U,n.SHORTKEY=D},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function m(b,_){var y=[],x=!0,O=!1,T=void 0;try{for(var E=b[Symbol.iterator](),N;!(x=(N=E.next()).done)&&(y.push(N.value),!(_&&y.length===_));x=!0);}catch(A){O=!0,T=A}finally{try{!x&&E.return&&E.return()}finally{if(O)throw T}}return y}return function(b,_){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return m(b,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function m(b,_,y){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var O=Object.getPrototypeOf(b);return O===null?void 0:m(O,_,y)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(y)}},o=function(){function m(b,_){for(var y=0;y<_.length;y++){var x=_[y];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,y){return _&&m(b.prototype,_),y&&m(b,y),b}}(),l=i(0),f=u(l),c=i(7),h=u(c);function u(m){return m&&m.__esModule?m:{default:m}}function d(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}function p(m,b){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:m}function v(m,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);m.prototype=Object.create(b&&b.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b)}var g=function(m){v(b,m),o(b,null,[{key:"value",value:function(){}}]);function b(_,y){d(this,b);var x=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return x.selection=y,x.textNode=document.createTextNode(b.CONTENTS),x.domNode.appendChild(x.textNode),x._length=0,x}return o(b,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(y,x){if(this._length!==0)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,y,x);for(var O=this,T=0;O!=null&&O.statics.scope!==f.default.Scope.BLOCK_BLOT;)T+=O.offset(O.parent),O=O.parent;O!=null&&(this._length=b.CONTENTS.length,O.optimize(),O.formatAt(T,b.CONTENTS.length,y,x),this._length=0)}},{key:"index",value:function(y,x){return y===this.textNode?0:a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,y,x)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var y=this.textNode,x=this.selection.getNativeRange(),O=void 0,T=void 0,E=void 0;if(x!=null&&x.start.node===y&&x.end.node===y){var N=[y,x.start.offset,x.end.offset];O=N[0],T=N[1],E=N[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==b.CONTENTS){var A=this.textNode.data.split(b.CONTENTS).join("");this.next instanceof h.default?(O=this.next.domNode,this.next.insertAt(0,A),this.textNode.data=b.CONTENTS):(this.textNode.data=A,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(b.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),T!=null){var w=[T,E].map(function(I){return Math.max(0,Math.min(O.data.length,I-1))}),S=s(w,2);return T=S[0],E=S[1],{startNode:O,startOffset:T,endNode:O,endOffset:E}}}}},{key:"update",value:function(y,x){var O=this;if(y.some(function(E){return E.type==="characterData"&&E.target===O.textNode})){var T=this.restore();T&&(x.range=T)}}},{key:"value",value:function(){return""}}]),b}(f.default.Embed);g.blotName="cursor",g.className="ql-cursor",g.tagName="span",g.CONTENTS="\uFEFF",n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=f(s),o=i(4),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),h(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default.Container);d.allowedChildren=[l.default,o.BlockEmbed,d],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var s=function(){function g(m,b){for(var _=0;_<b.length;_++){var y=b[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,b,_){return b&&g(m.prototype,b),_&&g(m,_),m}}(),a=function g(m,b,_){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,b);if(y===void 0){var x=Object.getPrototypeOf(m);return x===null?void 0:g(x,b,_)}else{if("value"in y)return y.value;var O=y.get;return O===void 0?void 0:O.call(_)}},o=i(0),l=f(o);function f(g){return g&&g.__esModule?g:{default:g}}function c(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function h(g,m){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:g}function u(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(g,m):g.__proto__=m)}var d=function(g){u(m,g);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"value",value:function(_){var y=a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,_);return y.startsWith("rgb(")?(y=y.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+y.split(",").map(function(x){return("00"+parseInt(x).toString(16)).slice(-2)}).join("")):y}}]),m}(l.default.Attributor.Style),p=new l.default.Attributor.Class("color","ql-color",{scope:l.default.Scope.INLINE}),v=new d("color","color",{scope:l.default.Scope.INLINE});n.ColorAttributor=d,n.ColorClass=p,n.ColorStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var s=function(){function v(g,m){for(var b=0;b<m.length;b++){var _=m[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,m,b){return m&&v(g.prototype,m),b&&v(g,b),g}}(),a=function v(g,m,b){g===null&&(g=Function.prototype);var _=Object.getOwnPropertyDescriptor(g,m);if(_===void 0){var y=Object.getPrototypeOf(g);return y===null?void 0:v(y,m,b)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(b)}},o=i(6),l=f(o);function f(v){return v&&v.__esModule?v:{default:v}}function c(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function h(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function u(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var d=function(v){u(g,v);function g(){return c(this,g),h(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"format",value:function(b,_){if(b!==this.statics.blotName||!_)return a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,b,_);_=this.constructor.sanitize(_),this.domNode.setAttribute("href",_)}}],[{key:"create",value:function(b){var _=a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,b);return b=this.sanitize(b),_.setAttribute("href",b),_.setAttribute("rel","noopener noreferrer"),_.setAttribute("target","_blank"),_}},{key:"formats",value:function(b){return b.getAttribute("href")}},{key:"sanitize",value:function(b){return p(b,this.PROTOCOL_WHITELIST)?b:this.SANITIZED_URL}}]),g}(l.default);d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function p(v,g){var m=document.createElement("a");m.href=v;var b=m.href.slice(0,m.href.indexOf(":"));return g.indexOf(b)>-1}n.default=d,n.sanitize=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},a=function(){function g(m,b){for(var _=0;_<b.length;_++){var y=b[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,b,_){return b&&g(m.prototype,b),_&&g(m,_),m}}(),o=i(23),l=h(o),f=i(107),c=h(f);function h(g){return g&&g.__esModule?g:{default:g}}function u(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}var d=0;function p(g,m){g.setAttribute(m,g.getAttribute(m)!=="true")}var v=function(){function g(m){var b=this;u(this,g),this.select=m,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){b.togglePicker()}),this.label.addEventListener("keydown",function(_){switch(_.keyCode){case l.default.keys.ENTER:b.togglePicker();break;case l.default.keys.ESCAPE:b.escape(),_.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(g,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),p(this.label,"aria-expanded"),p(this.options,"aria-hidden")}},{key:"buildItem",value:function(b){var _=this,y=document.createElement("span");return y.tabIndex="0",y.setAttribute("role","button"),y.classList.add("ql-picker-item"),b.hasAttribute("value")&&y.setAttribute("data-value",b.getAttribute("value")),b.textContent&&y.setAttribute("data-label",b.textContent),y.addEventListener("click",function(){_.selectItem(y,!0)}),y.addEventListener("keydown",function(x){switch(x.keyCode){case l.default.keys.ENTER:_.selectItem(y,!0),x.preventDefault();break;case l.default.keys.ESCAPE:_.escape(),x.preventDefault();break}}),y}},{key:"buildLabel",value:function(){var b=document.createElement("span");return b.classList.add("ql-picker-label"),b.innerHTML=c.default,b.tabIndex="0",b.setAttribute("role","button"),b.setAttribute("aria-expanded","false"),this.container.appendChild(b),b}},{key:"buildOptions",value:function(){var b=this,_=document.createElement("span");_.classList.add("ql-picker-options"),_.setAttribute("aria-hidden","true"),_.tabIndex="-1",_.id="ql-picker-options-"+d,d+=1,this.label.setAttribute("aria-controls",_.id),this.options=_,[].slice.call(this.select.options).forEach(function(y){var x=b.buildItem(y);_.appendChild(x),y.selected===!0&&b.selectItem(x)}),this.container.appendChild(_)}},{key:"buildPicker",value:function(){var b=this;[].slice.call(this.select.attributes).forEach(function(_){b.container.setAttribute(_.name,_.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var b=this;this.close(),setTimeout(function(){return b.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(b){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=this.container.querySelector(".ql-selected");if(b!==y&&(y!=null&&y.classList.remove("ql-selected"),b!=null&&(b.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(b.parentNode.children,b),b.hasAttribute("data-value")?this.label.setAttribute("data-value",b.getAttribute("data-value")):this.label.removeAttribute("data-value"),b.hasAttribute("data-label")?this.label.setAttribute("data-label",b.getAttribute("data-label")):this.label.removeAttribute("data-label"),_))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var x=document.createEvent("Event");x.initEvent("change",!0,!0),this.select.dispatchEvent(x)}this.close()}}},{key:"update",value:function(){var b=void 0;if(this.select.selectedIndex>-1){var _=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];b=this.select.options[this.select.selectedIndex],this.selectItem(_)}else this.selectItem(null);var y=b!=null&&b!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",y)}}]),g}();n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),a=F(s),o=i(5),l=F(o),f=i(4),c=F(f),h=i(16),u=F(h),d=i(25),p=F(d),v=i(24),g=F(v),m=i(35),b=F(m),_=i(6),y=F(_),x=i(22),O=F(x),T=i(7),E=F(T),N=i(55),A=F(N),w=i(42),S=F(w),I=i(23),C=F(I);function F(D){return D&&D.__esModule?D:{default:D}}l.default.register({"blots/block":c.default,"blots/block/embed":f.BlockEmbed,"blots/break":u.default,"blots/container":p.default,"blots/cursor":g.default,"blots/embed":b.default,"blots/inline":y.default,"blots/scroll":O.default,"blots/text":E.default,"modules/clipboard":A.default,"modules/history":S.default,"modules/keyboard":C.default}),a.default.register(c.default,u.default,g.default,y.default,O.default,E.default),n.default=l.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),a=function(){function o(l){this.domNode=l,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(l){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof l=="string"&&(l=l.toUpperCase(),parseInt(l).toString()===l&&(l=parseInt(l))),typeof l=="number"?f=document.createElement(this.tagName[l-1]):this.tagName.indexOf(l)>-1?f=document.createElement(l):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},o.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var l=this.domNode.cloneNode(!1);return s.create(l)},o.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},o.prototype.deleteAt=function(l,f){var c=this.isolate(l,f);c.remove()},o.prototype.formatAt=function(l,f,c,h){var u=this.isolate(l,f);if(s.query(c,s.Scope.BLOT)!=null&&h)u.wrap(c,h);else if(s.query(c,s.Scope.ATTRIBUTE)!=null){var d=s.create(this.statics.scope);u.wrap(d),d.format(c,h)}},o.prototype.insertAt=function(l,f,c){var h=c==null?s.create("text",f):s.create(f,c),u=this.split(l);this.parent.insertBefore(h,u)},o.prototype.insertInto=function(l,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var c=null;l.children.insertBefore(this,f),f!=null&&(c=f.domNode),(this.domNode.parentNode!=l.domNode||this.domNode.nextSibling!=c)&&l.domNode.insertBefore(this.domNode,c),this.parent=l,this.attach()},o.prototype.isolate=function(l,f){var c=this.split(l);return c.split(f),c},o.prototype.length=function(){return 1},o.prototype.offset=function(l){return l===void 0&&(l=this.parent),this.parent==null||this==l?0:this.parent.children.offset(this)+this.parent.offset(l)},o.prototype.optimize=function(l){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},o.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(l){l.parent!=null&&(l.parent.insertBefore(this,l.next),l.remove())},o.prototype.replaceWith=function(l,f){var c=typeof l=="string"?s.create(l,f):l;return c.replace(this),c},o.prototype.split=function(l,f){return l===0?this:this.next},o.prototype.update=function(l,f){},o.prototype.wrap=function(l,f){var c=typeof l=="string"?s.create(l,f):l;return this.parent!=null&&this.parent.insertBefore(c,this.next),c.appendChild(this),c},o.blotName="abstract",o}();n.default=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(12),a=i(32),o=i(33),l=i(1),f=function(){function c(h){this.attributes={},this.domNode=h,this.build()}return c.prototype.attribute=function(h,u){u?h.add(this.domNode,u)&&(h.value(this.domNode)!=null?this.attributes[h.attrName]=h:delete this.attributes[h.attrName]):(h.remove(this.domNode),delete this.attributes[h.attrName])},c.prototype.build=function(){var h=this;this.attributes={};var u=s.default.keys(this.domNode),d=a.default.keys(this.domNode),p=o.default.keys(this.domNode);u.concat(d).concat(p).forEach(function(v){var g=l.query(v,l.Scope.ATTRIBUTE);g instanceof s.default&&(h.attributes[g.attrName]=g)})},c.prototype.copy=function(h){var u=this;Object.keys(this.attributes).forEach(function(d){var p=u.attributes[d].value(u.domNode);h.format(d,p)})},c.prototype.move=function(h){var u=this;this.copy(h),Object.keys(this.attributes).forEach(function(d){u.attributes[d].remove(u.domNode)}),this.attributes={}},c.prototype.values=function(){var h=this;return Object.keys(this.attributes).reduce(function(u,d){return u[d]=h.attributes[d].value(h.domNode),u},{})},c}();n.default=f},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var u in h)h.hasOwnProperty(u)&&(c[u]=h[u])};return function(c,h){f(c,h);function u(){this.constructor=c}c.prototype=h===null?Object.create(h):(u.prototype=h.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(f,c){var h=f.getAttribute("class")||"";return h.split(/\s+/).filter(function(u){return u.indexOf(c+"-")===0})}var l=function(f){s(c,f);function c(){return f!==null&&f.apply(this,arguments)||this}return c.keys=function(h){return(h.getAttribute("class")||"").split(/\s+/).map(function(u){return u.split("-").slice(0,-1).join("-")})},c.prototype.add=function(h,u){return this.canAdd(h,u)?(this.remove(h),h.classList.add(this.keyName+"-"+u),!0):!1},c.prototype.remove=function(h){var u=o(h,this.keyName);u.forEach(function(d){h.classList.remove(d)}),h.classList.length===0&&h.removeAttribute("class")},c.prototype.value=function(h){var u=o(h,this.keyName)[0]||"",d=u.slice(this.keyName.length+1);return this.canAdd(h,d)?d:""},c}(a.default);n.default=l},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var u in h)h.hasOwnProperty(u)&&(c[u]=h[u])};return function(c,h){f(c,h);function u(){this.constructor=c}c.prototype=h===null?Object.create(h):(u.prototype=h.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(f){var c=f.split("-"),h=c.slice(1).map(function(u){return u[0].toUpperCase()+u.slice(1)}).join("");return c[0]+h}var l=function(f){s(c,f);function c(){return f!==null&&f.apply(this,arguments)||this}return c.keys=function(h){return(h.getAttribute("style")||"").split(";").map(function(u){var d=u.split(":");return d[0].trim()})},c.prototype.add=function(h,u){return this.canAdd(h,u)?(h.style[o(this.keyName)]=u,!0):!1},c.prototype.remove=function(h){h.style[o(this.keyName)]="",h.getAttribute("style")||h.removeAttribute("style")},c.prototype.value=function(h){var u=h.style[o(this.keyName)];return this.canAdd(h,u)?u:""},c}(a.default);n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(f,c){for(var h=0;h<c.length;h++){var u=c[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,c,h){return c&&l(f.prototype,c),h&&l(f,h),f}}();function a(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(f,c){a(this,l),this.quill=f,this.options=c,this.modules={}}return s(l,[{key:"init",value:function(){var c=this;Object.keys(this.options.modules).forEach(function(h){c.modules[h]==null&&c.addModule(h)})}},{key:"addModule",value:function(c){var h=this.quill.constructor.import("modules/"+c);return this.modules[c]=new h(this.quill,this.options.modules[c]||{}),this.modules[c]}}]),l}();o.DEFAULTS={modules:{}},o.themes={default:o},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function m(b,_){for(var y=0;y<_.length;y++){var x=_[y];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,y){return _&&m(b.prototype,_),y&&m(b,y),b}}(),a=function m(b,_,y){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var O=Object.getPrototypeOf(b);return O===null?void 0:m(O,_,y)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(y)}},o=i(0),l=h(o),f=i(7),c=h(f);function h(m){return m&&m.__esModule?m:{default:m}}function u(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}function d(m,b){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:m}function p(m,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);m.prototype=Object.create(b&&b.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b)}var v="\uFEFF",g=function(m){p(b,m);function b(_){u(this,b);var y=d(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return y.contentNode=document.createElement("span"),y.contentNode.setAttribute("contenteditable",!1),[].slice.call(y.domNode.childNodes).forEach(function(x){y.contentNode.appendChild(x)}),y.leftGuard=document.createTextNode(v),y.rightGuard=document.createTextNode(v),y.domNode.appendChild(y.leftGuard),y.domNode.appendChild(y.contentNode),y.domNode.appendChild(y.rightGuard),y}return s(b,[{key:"index",value:function(y,x){return y===this.leftGuard?0:y===this.rightGuard?1:a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,y,x)}},{key:"restore",value:function(y){var x=void 0,O=void 0,T=y.data.split(v).join("");if(y===this.leftGuard)if(this.prev instanceof c.default){var E=this.prev.length();this.prev.insertAt(E,T),x={startNode:this.prev.domNode,startOffset:E+T.length}}else O=document.createTextNode(T),this.parent.insertBefore(l.default.create(O),this),x={startNode:O,startOffset:T.length};else y===this.rightGuard&&(this.next instanceof c.default?(this.next.insertAt(0,T),x={startNode:this.next.domNode,startOffset:T.length}):(O=document.createTextNode(T),this.parent.insertBefore(l.default.create(O),this.next),x={startNode:O,startOffset:T.length}));return y.data=v,x}},{key:"update",value:function(y,x){var O=this;y.forEach(function(T){if(T.type==="characterData"&&(T.target===O.leftGuard||T.target===O.rightGuard)){var E=O.restore(T.target);E&&(x.range=E)}})}}]),b}(l.default.Embed);n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var s=i(0),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}var l={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new a.default.Attributor.Attribute("align","align",l),c=new a.default.Attributor.Class("align","ql-align",l),h=new a.default.Attributor.Style("align","text-align",l);n.AlignAttribute=f,n.AlignClass=c,n.AlignStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var s=i(0),a=l(s),o=i(26);function l(h){return h&&h.__esModule?h:{default:h}}var f=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),c=new o.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var s=i(0),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}var l={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},f=new a.default.Attributor.Attribute("direction","dir",l),c=new a.default.Attributor.Class("direction","ql-direction",l),h=new a.default.Attributor.Style("direction","direction",l);n.DirectionAttribute=f,n.DirectionClass=c,n.DirectionStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var s=function(){function m(b,_){for(var y=0;y<_.length;y++){var x=_[y];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,y){return _&&m(b.prototype,_),y&&m(b,y),b}}(),a=function m(b,_,y){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var O=Object.getPrototypeOf(b);return O===null?void 0:m(O,_,y)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(y)}},o=i(0),l=f(o);function f(m){return m&&m.__esModule?m:{default:m}}function c(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}function h(m,b){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:m}function u(m,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);m.prototype=Object.create(b&&b.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b)}var d={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},p=new l.default.Attributor.Class("font","ql-font",d),v=function(m){u(b,m);function b(){return c(this,b),h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"value",value:function(y){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,y).replace(/["']/g,"")}}]),b}(l.default.Attributor.Style),g=new v("font","font-family",d);n.FontStyle=g,n.FontClass=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var s=i(0),a=o(s);function o(c){return c&&c.__esModule?c:{default:c}}var l=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=l,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var s=function(){function _(y,x){for(var O=0;O<x.length;O++){var T=x[O];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(y,T.key,T)}}return function(y,x,O){return x&&_(y.prototype,x),O&&_(y,O),y}}(),a=i(0),o=u(a),l=i(5),f=u(l),c=i(9),h=u(c);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function p(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function v(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var g=function(_){v(y,_);function y(x,O){d(this,y);var T=p(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,x,O));return T.lastRecorded=0,T.ignoreChange=!1,T.clear(),T.quill.on(f.default.events.EDITOR_CHANGE,function(E,N,A,w){E!==f.default.events.TEXT_CHANGE||T.ignoreChange||(!T.options.userOnly||w===f.default.sources.USER?T.record(N,A):T.transform(N))}),T.quill.keyboard.addBinding({key:"Z",shortKey:!0},T.undo.bind(T)),T.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},T.redo.bind(T)),/Win/i.test(navigator.platform)&&T.quill.keyboard.addBinding({key:"Y",shortKey:!0},T.redo.bind(T)),T}return s(y,[{key:"change",value:function(O,T){if(this.stack[O].length!==0){var E=this.stack[O].pop();this.stack[T].push(E),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(E[O],f.default.sources.USER),this.ignoreChange=!1;var N=b(E[O]);this.quill.setSelection(N)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(O,T){if(O.ops.length!==0){this.stack.redo=[];var E=this.quill.getContents().diff(T),N=Date.now();if(this.lastRecorded+this.options.delay>N&&this.stack.undo.length>0){var A=this.stack.undo.pop();E=E.compose(A.undo),O=A.redo.compose(O)}else this.lastRecorded=N;this.stack.undo.push({redo:O,undo:E}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(O){this.stack.undo.forEach(function(T){T.undo=O.transform(T.undo,!0),T.redo=O.transform(T.redo,!0)}),this.stack.redo.forEach(function(T){T.undo=O.transform(T.undo,!0),T.redo=O.transform(T.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),y}(h.default);g.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function m(_){var y=_.ops[_.ops.length-1];return y==null?!1:y.insert!=null?typeof y.insert=="string"&&y.insert.endsWith(`
581
+ `):y.attributes!=null?Object.keys(y.attributes).some(function(x){return o.default.query(x,o.default.Scope.BLOCK)!=null}):!1}function b(_){var y=_.reduce(function(O,T){return O+=T.delete||0,O},0),x=_.length()-y;return m(_)&&(x-=1),x}n.default=g,n.getLastChangeIndex=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var s=function(){function P(L,$){for(var G=0;G<$.length;G++){var M=$[G];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(L,M.key,M)}}return function(L,$,G){return $&&P(L.prototype,$),G&&P(L,G),L}}(),a=function P(L,$,G){L===null&&(L=Function.prototype);var M=Object.getOwnPropertyDescriptor(L,$);if(M===void 0){var B=Object.getPrototypeOf(L);return B===null?void 0:P(B,$,G)}else{if("value"in M)return M.value;var q=M.get;return q===void 0?void 0:q.call(G)}},o=i(3),l=N(o),f=i(2),c=N(f),h=i(8),u=N(h),d=i(23),p=N(d),v=i(34),g=N(v),m=i(59),b=N(m),_=i(60),y=N(_),x=i(28),O=N(x),T=i(61),E=N(T);function N(P){return P&&P.__esModule?P:{default:P}}function A(P,L){if(!(P instanceof L))throw new TypeError("Cannot call a class as a function")}function w(P,L){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:P}function S(P,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);P.prototype=Object.create(L&&L.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(P,L):P.__proto__=L)}var I=[!1,"center","right","justify"],C=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],F=[!1,"serif","monospace"],D=["1","2","3",!1],U=["small",!1,"large","huge"],X=function(P){S(L,P);function L($,G){A(this,L);var M=w(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,$,G)),B=function q(H){if(!document.body.contains($.root))return document.body.removeEventListener("click",q);M.tooltip!=null&&!M.tooltip.root.contains(H.target)&&document.activeElement!==M.tooltip.textbox&&!M.quill.hasFocus()&&M.tooltip.hide(),M.pickers!=null&&M.pickers.forEach(function(z){z.container.contains(H.target)||z.close()})};return $.emitter.listenDOM("click",document.body,B),M}return s(L,[{key:"addModule",value:function(G){var M=a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"addModule",this).call(this,G);return G==="toolbar"&&this.extendToolbar(M),M}},{key:"buildButtons",value:function(G,M){G.forEach(function(B){var q=B.getAttribute("class")||"";q.split(/\s+/).forEach(function(H){if(H.startsWith("ql-")&&(H=H.slice(3),M[H]!=null))if(H==="direction")B.innerHTML=M[H][""]+M[H].rtl;else if(typeof M[H]=="string")B.innerHTML=M[H];else{var z=B.value||"";z!=null&&M[H][z]&&(B.innerHTML=M[H][z])}})})}},{key:"buildPickers",value:function(G,M){var B=this;this.pickers=G.map(function(H){if(H.classList.contains("ql-align"))return H.querySelector("option")==null&&R(H,I),new y.default(H,M.align);if(H.classList.contains("ql-background")||H.classList.contains("ql-color")){var z=H.classList.contains("ql-background")?"background":"color";return H.querySelector("option")==null&&R(H,C,z==="background"?"#ffffff":"#000000"),new b.default(H,M[z])}else return H.querySelector("option")==null&&(H.classList.contains("ql-font")?R(H,F):H.classList.contains("ql-header")?R(H,D):H.classList.contains("ql-size")&&R(H,U)),new O.default(H)});var q=function(){B.pickers.forEach(function(z){z.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,q)}}]),L}(g.default);X.DEFAULTS=(0,l.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var L=this,$=this.container.querySelector("input.ql-image[type=file]");$==null&&($=document.createElement("input"),$.setAttribute("type","file"),$.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),$.classList.add("ql-image"),$.addEventListener("change",function(){if($.files!=null&&$.files[0]!=null){var G=new FileReader;G.onload=function(M){var B=L.quill.getSelection(!0);L.quill.updateContents(new c.default().retain(B.index).delete(B.length).insert({image:M.target.result}),u.default.sources.USER),L.quill.setSelection(B.index+1,u.default.sources.SILENT),$.value=""},G.readAsDataURL($.files[0])}}),this.container.appendChild($)),$.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var j=function(P){S(L,P);function L($,G){A(this,L);var M=w(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,$,G));return M.textbox=M.root.querySelector('input[type="text"]'),M.listen(),M}return s(L,[{key:"listen",value:function(){var G=this;this.textbox.addEventListener("keydown",function(M){p.default.match(M,"enter")?(G.save(),M.preventDefault()):p.default.match(M,"escape")&&(G.cancel(),M.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),M!=null?this.textbox.value=M:G!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+G)||""),this.root.setAttribute("data-mode",G)}},{key:"restoreFocus",value:function(){var G=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=G}},{key:"save",value:function(){var G=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var M=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",G,u.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",G,u.default.sources.USER)),this.quill.root.scrollTop=M;break}case"video":G=k(G);case"formula":{if(!G)break;var B=this.quill.getSelection(!0);if(B!=null){var q=B.index+B.length;this.quill.insertEmbed(q,this.root.getAttribute("data-mode"),G,u.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(q+1," ",u.default.sources.USER),this.quill.setSelection(q+2,u.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),L}(E.default);function k(P){var L=P.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||P.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return L?(L[1]||"https")+"://www.youtube.com/embed/"+L[2]+"?showinfo=0":(L=P.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(L[1]||"https")+"://player.vimeo.com/video/"+L[2]+"/":P}function R(P,L){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;L.forEach(function(G){var M=document.createElement("option");G===$?M.setAttribute("selected","selected"):M.setAttribute("value",G),P.appendChild(M)})}n.BaseTooltip=j,n.default=X},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];this.insertBefore(o[0],null),o.length>1&&this.append.apply(this,o.slice(1))},a.prototype.contains=function(o){for(var l,f=this.iterator();l=f();)if(l===o)return!0;return!1},a.prototype.insertBefore=function(o,l){o&&(o.next=l,l!=null?(o.prev=l.prev,l.prev!=null&&(l.prev.next=o),l.prev=o,l===this.head&&(this.head=o)):this.tail!=null?(this.tail.next=o,o.prev=this.tail,this.tail=o):(o.prev=null,this.head=this.tail=o),this.length+=1)},a.prototype.offset=function(o){for(var l=0,f=this.head;f!=null;){if(f===o)return l;l+=f.length(),f=f.next}return-1},a.prototype.remove=function(o){this.contains(o)&&(o.prev!=null&&(o.prev.next=o.next),o.next!=null&&(o.next.prev=o.prev),o===this.head&&(this.head=o.next),o===this.tail&&(this.tail=o.prev),this.length-=1)},a.prototype.iterator=function(o){return o===void 0&&(o=this.head),function(){var l=o;return o!=null&&(o=o.next),l}},a.prototype.find=function(o,l){l===void 0&&(l=!1);for(var f,c=this.iterator();f=c();){var h=f.length();if(o<h||l&&o===h&&(f.next==null||f.next.length()!==0))return[f,o];o-=h}return[null,0]},a.prototype.forEach=function(o){for(var l,f=this.iterator();l=f();)o(l)},a.prototype.forEachAt=function(o,l,f){if(!(l<=0))for(var c=this.find(o),h=c[0],u=c[1],d,p=o-u,v=this.iterator(h);(d=v())&&p<o+l;){var g=d.length();o>p?f(d,o-p,Math.min(l,p+g-o)):f(d,0,Math.min(g,o+l-p)),p+=g}},a.prototype.map=function(o){return this.reduce(function(l,f){return l.push(o(f)),l},[])},a.prototype.reduce=function(o,l){for(var f,c=this.iterator();f=c();)l=o(l,f);return l},a}();n.default=s},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){h(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,c=function(h){s(u,h);function u(d){var p=h.call(this,d)||this;return p.scroll=p,p.observer=new MutationObserver(function(v){p.update(v)}),p.observer.observe(p.domNode,l),p.attach(),p}return u.prototype.detach=function(){h.prototype.detach.call(this),this.observer.disconnect()},u.prototype.deleteAt=function(d,p){this.update(),d===0&&p===this.length()?this.children.forEach(function(v){v.remove()}):h.prototype.deleteAt.call(this,d,p)},u.prototype.formatAt=function(d,p,v,g){this.update(),h.prototype.formatAt.call(this,d,p,v,g)},u.prototype.insertAt=function(d,p,v){this.update(),h.prototype.insertAt.call(this,d,p,v)},u.prototype.optimize=function(d,p){var v=this;d===void 0&&(d=[]),p===void 0&&(p={}),h.prototype.optimize.call(this,p);for(var g=[].slice.call(this.observer.takeRecords());g.length>0;)d.push(g.pop());for(var m=function(x,O){O===void 0&&(O=!0),!(x==null||x===v)&&x.domNode.parentNode!=null&&(x.domNode[o.DATA_KEY].mutations==null&&(x.domNode[o.DATA_KEY].mutations=[]),O&&m(x.parent))},b=function(x){x.domNode[o.DATA_KEY]==null||x.domNode[o.DATA_KEY].mutations==null||(x instanceof a.default&&x.children.forEach(b),x.optimize(p))},_=d,y=0;_.length>0;y+=1){if(y>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(_.forEach(function(x){var O=o.find(x.target,!0);O!=null&&(O.domNode===x.target&&(x.type==="childList"?(m(o.find(x.previousSibling,!1)),[].forEach.call(x.addedNodes,function(T){var E=o.find(T,!1);m(E,!1),E instanceof a.default&&E.children.forEach(function(N){m(N,!1)})})):x.type==="attributes"&&m(O.prev)),m(O))}),this.children.forEach(b),_=[].slice.call(this.observer.takeRecords()),g=_.slice();g.length>0;)d.push(g.pop())}},u.prototype.update=function(d,p){var v=this;p===void 0&&(p={}),d=d||this.observer.takeRecords(),d.map(function(g){var m=o.find(g.target,!0);return m==null?null:m.domNode[o.DATA_KEY].mutations==null?(m.domNode[o.DATA_KEY].mutations=[g],m):(m.domNode[o.DATA_KEY].mutations.push(g),null)}).forEach(function(g){g==null||g===v||g.domNode[o.DATA_KEY]==null||g.update(g.domNode[o.DATA_KEY].mutations||[],p)}),this.domNode[o.DATA_KEY].mutations!=null&&h.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,p),this.optimize(d,p)},u.blotName="scroll",u.defaultChild="block",u.scope=o.Scope.BLOCK_BLOT,u.tagName="DIV",u}(a.default);n.default=c},function(r,n,i){var s=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,u){h.__proto__=u}||function(h,u){for(var d in u)u.hasOwnProperty(d)&&(h[d]=u[d])};return function(h,u){c(h,u);function d(){this.constructor=h}h.prototype=u===null?Object.create(u):(d.prototype=u.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1);function l(c,h){if(Object.keys(c).length!==Object.keys(h).length)return!1;for(var u in c)if(c[u]!==h[u])return!1;return!0}var f=function(c){s(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.formats=function(u){if(u.tagName!==h.tagName)return c.formats.call(this,u)},h.prototype.format=function(u,d){var p=this;u===this.statics.blotName&&!d?(this.children.forEach(function(v){v instanceof a.default||(v=v.wrap(h.blotName,!0)),p.attributes.copy(v)}),this.unwrap()):c.prototype.format.call(this,u,d)},h.prototype.formatAt=function(u,d,p,v){if(this.formats()[p]!=null||o.query(p,o.Scope.ATTRIBUTE)){var g=this.isolate(u,d);g.format(p,v)}else c.prototype.formatAt.call(this,u,d,p,v)},h.prototype.optimize=function(u){c.prototype.optimize.call(this,u);var d=this.formats();if(Object.keys(d).length===0)return this.unwrap();var p=this.next;p instanceof h&&p.prev===this&&l(d,p.formats())&&(p.moveChildren(this),p.remove())},h.blotName="inline",h.scope=o.Scope.INLINE_BLOT,h.tagName="SPAN",h}(a.default);n.default=f},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var u in h)h.hasOwnProperty(u)&&(c[u]=h[u])};return function(c,h){f(c,h);function u(){this.constructor=c}c.prototype=h===null?Object.create(h):(u.prototype=h.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1),l=function(f){s(c,f);function c(){return f!==null&&f.apply(this,arguments)||this}return c.formats=function(h){var u=o.query(c.blotName).tagName;if(h.tagName!==u)return f.formats.call(this,h)},c.prototype.format=function(h,u){o.query(h,o.Scope.BLOCK)!=null&&(h===this.statics.blotName&&!u?this.replaceWith(c.blotName):f.prototype.format.call(this,h,u))},c.prototype.formatAt=function(h,u,d,p){o.query(d,o.Scope.BLOCK)!=null?this.format(d,p):f.prototype.formatAt.call(this,h,u,d,p)},c.prototype.insertAt=function(h,u,d){if(d==null||o.query(u,o.Scope.INLINE)!=null)f.prototype.insertAt.call(this,h,u,d);else{var p=this.split(h),v=o.create(u,d);p.parent.insertBefore(v,p)}},c.prototype.update=function(h,u){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,h,u)},c.blotName="block",c.scope=o.Scope.BLOCK_BLOT,c.tagName="P",c}(a.default);n.default=l},function(r,n,i){var s=this&&this.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,c){f.__proto__=c}||function(f,c){for(var h in c)c.hasOwnProperty(h)&&(f[h]=c[h])};return function(f,c){l(f,c);function h(){this.constructor=f}f.prototype=c===null?Object.create(c):(h.prototype=c.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=function(l){s(f,l);function f(){return l!==null&&l.apply(this,arguments)||this}return f.formats=function(c){},f.prototype.format=function(c,h){l.prototype.formatAt.call(this,0,this.length(),c,h)},f.prototype.formatAt=function(c,h,u,d){c===0&&h===this.length()?this.format(u,d):l.prototype.formatAt.call(this,c,h,u,d)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(a.default);n.default=o},function(r,n,i){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var u in h)h.hasOwnProperty(u)&&(c[u]=h[u])};return function(c,h){f(c,h);function u(){this.constructor=c}c.prototype=h===null?Object.create(h):(u.prototype=h.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=i(1),l=function(f){s(c,f);function c(h){var u=f.call(this,h)||this;return u.text=u.statics.value(u.domNode),u}return c.create=function(h){return document.createTextNode(h)},c.value=function(h){var u=h.data;return u.normalize&&(u=u.normalize()),u},c.prototype.deleteAt=function(h,u){this.domNode.data=this.text=this.text.slice(0,h)+this.text.slice(h+u)},c.prototype.index=function(h,u){return this.domNode===h?u:-1},c.prototype.insertAt=function(h,u,d){d==null?(this.text=this.text.slice(0,h)+u+this.text.slice(h),this.domNode.data=this.text):f.prototype.insertAt.call(this,h,u,d)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(h){f.prototype.optimize.call(this,h),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof c&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},c.prototype.position=function(h,u){return[this.domNode,h]},c.prototype.split=function(h,u){if(u===void 0&&(u=!1),!u){if(h===0)return this;if(h===this.length())return this.next}var d=o.create(this.domNode.splitText(h));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},c.prototype.update=function(h,u){var d=this;h.some(function(p){return p.type==="characterData"&&p.target===d.domNode})&&(this.text=this.statics.value(this.domNode))},c.prototype.value=function(){return this.text},c.blotName="text",c.scope=o.Scope.INLINE_BLOT,c}(a.default);n.default=l},function(r,n,i){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(o,l){return arguments.length>1&&!this.contains(o)==!l?l:a.call(this,o)}}String.prototype.startsWith||(String.prototype.startsWith=function(o,l){return l=l||0,this.substr(l,o.length)===o}),String.prototype.endsWith||(String.prototype.endsWith=function(o,l){var f=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>f.length)&&(l=f.length),l-=o.length;var c=f.indexOf(o,l);return c!==-1&&c===l}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(l){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof l!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),c=f.length>>>0,h=arguments[1],u,d=0;d<c;d++)if(u=f[d],l.call(h,u,d,f))return u}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,s=1,a=0;function o(y,x,O){if(y==x)return y?[[a,y]]:[];(O<0||y.length<O)&&(O=null);var T=h(y,x),E=y.substring(0,T);y=y.substring(T),x=x.substring(T),T=u(y,x);var N=y.substring(y.length-T);y=y.substring(0,y.length-T),x=x.substring(0,x.length-T);var A=l(y,x);return E&&A.unshift([a,E]),N&&A.push([a,N]),p(A),O!=null&&(A=m(A,O)),A=b(A),A}function l(y,x){var O;if(!y)return[[s,x]];if(!x)return[[i,y]];var T=y.length>x.length?y:x,E=y.length>x.length?x:y,N=T.indexOf(E);if(N!=-1)return O=[[s,T.substring(0,N)],[a,E],[s,T.substring(N+E.length)]],y.length>x.length&&(O[0][0]=O[2][0]=i),O;if(E.length==1)return[[i,y],[s,x]];var A=d(y,x);if(A){var w=A[0],S=A[1],I=A[2],C=A[3],F=A[4],D=o(w,I),U=o(S,C);return D.concat([[a,F]],U)}return f(y,x)}function f(y,x){for(var O=y.length,T=x.length,E=Math.ceil((O+T)/2),N=E,A=2*E,w=new Array(A),S=new Array(A),I=0;I<A;I++)w[I]=-1,S[I]=-1;w[N+1]=0,S[N+1]=0;for(var C=O-T,F=C%2!=0,D=0,U=0,X=0,j=0,k=0;k<E;k++){for(var R=-k+D;R<=k-U;R+=2){var P=N+R,L;R==-k||R!=k&&w[P-1]<w[P+1]?L=w[P+1]:L=w[P-1]+1;for(var $=L-R;L<O&&$<T&&y.charAt(L)==x.charAt($);)L++,$++;if(w[P]=L,L>O)U+=2;else if($>T)D+=2;else if(F){var G=N+C-R;if(G>=0&&G<A&&S[G]!=-1){var M=O-S[G];if(L>=M)return c(y,x,L,$)}}}for(var B=-k+X;B<=k-j;B+=2){var G=N+B,M;B==-k||B!=k&&S[G-1]<S[G+1]?M=S[G+1]:M=S[G-1]+1;for(var q=M-B;M<O&&q<T&&y.charAt(O-M-1)==x.charAt(T-q-1);)M++,q++;if(S[G]=M,M>O)j+=2;else if(q>T)X+=2;else if(!F){var P=N+C-B;if(P>=0&&P<A&&w[P]!=-1){var L=w[P],$=N+L-P;if(M=O-M,L>=M)return c(y,x,L,$)}}}}return[[i,y],[s,x]]}function c(y,x,O,T){var E=y.substring(0,O),N=x.substring(0,T),A=y.substring(O),w=x.substring(T),S=o(E,N),I=o(A,w);return S.concat(I)}function h(y,x){if(!y||!x||y.charAt(0)!=x.charAt(0))return 0;for(var O=0,T=Math.min(y.length,x.length),E=T,N=0;O<E;)y.substring(N,E)==x.substring(N,E)?(O=E,N=O):T=E,E=Math.floor((T-O)/2+O);return E}function u(y,x){if(!y||!x||y.charAt(y.length-1)!=x.charAt(x.length-1))return 0;for(var O=0,T=Math.min(y.length,x.length),E=T,N=0;O<E;)y.substring(y.length-E,y.length-N)==x.substring(x.length-E,x.length-N)?(O=E,N=O):T=E,E=Math.floor((T-O)/2+O);return E}function d(y,x){var O=y.length>x.length?y:x,T=y.length>x.length?x:y;if(O.length<4||T.length*2<O.length)return null;function E(U,X,j){for(var k=U.substring(j,j+Math.floor(U.length/4)),R=-1,P="",L,$,G,M;(R=X.indexOf(k,R+1))!=-1;){var B=h(U.substring(j),X.substring(R)),q=u(U.substring(0,j),X.substring(0,R));P.length<q+B&&(P=X.substring(R-q,R)+X.substring(R,R+B),L=U.substring(0,j-q),$=U.substring(j+B),G=X.substring(0,R-q),M=X.substring(R+B))}return P.length*2>=U.length?[L,$,G,M,P]:null}var N=E(O,T,Math.ceil(O.length/4)),A=E(O,T,Math.ceil(O.length/2)),w;if(!N&&!A)return null;A?N?w=N[4].length>A[4].length?N:A:w=A:w=N;var S,I,C,F;y.length>x.length?(S=w[0],I=w[1],C=w[2],F=w[3]):(C=w[0],F=w[1],S=w[2],I=w[3]);var D=w[4];return[S,I,C,F,D]}function p(y){y.push([a,""]);for(var x=0,O=0,T=0,E="",N="",A;x<y.length;)switch(y[x][0]){case s:T++,N+=y[x][1],x++;break;case i:O++,E+=y[x][1],x++;break;case a:O+T>1?(O!==0&&T!==0&&(A=h(N,E),A!==0&&(x-O-T>0&&y[x-O-T-1][0]==a?y[x-O-T-1][1]+=N.substring(0,A):(y.splice(0,0,[a,N.substring(0,A)]),x++),N=N.substring(A),E=E.substring(A)),A=u(N,E),A!==0&&(y[x][1]=N.substring(N.length-A)+y[x][1],N=N.substring(0,N.length-A),E=E.substring(0,E.length-A))),O===0?y.splice(x-T,O+T,[s,N]):T===0?y.splice(x-O,O+T,[i,E]):y.splice(x-O-T,O+T,[i,E],[s,N]),x=x-O-T+(O?1:0)+(T?1:0)+1):x!==0&&y[x-1][0]==a?(y[x-1][1]+=y[x][1],y.splice(x,1)):x++,T=0,O=0,E="",N="";break}y[y.length-1][1]===""&&y.pop();var w=!1;for(x=1;x<y.length-1;)y[x-1][0]==a&&y[x+1][0]==a&&(y[x][1].substring(y[x][1].length-y[x-1][1].length)==y[x-1][1]?(y[x][1]=y[x-1][1]+y[x][1].substring(0,y[x][1].length-y[x-1][1].length),y[x+1][1]=y[x-1][1]+y[x+1][1],y.splice(x-1,1),w=!0):y[x][1].substring(0,y[x+1][1].length)==y[x+1][1]&&(y[x-1][1]+=y[x+1][1],y[x][1]=y[x][1].substring(y[x+1][1].length)+y[x+1][1],y.splice(x+1,1),w=!0)),x++;w&&p(y)}var v=o;v.INSERT=s,v.DELETE=i,v.EQUAL=a,r.exports=v;function g(y,x){if(x===0)return[a,y];for(var O=0,T=0;T<y.length;T++){var E=y[T];if(E[0]===i||E[0]===a){var N=O+E[1].length;if(x===N)return[T+1,y];if(x<N){y=y.slice();var A=x-O,w=[E[0],E[1].slice(0,A)],S=[E[0],E[1].slice(A)];return y.splice(T,1,w,S),[T+1,y]}else O=N}}throw new Error("cursor_pos is out of bounds!")}function m(y,x){var O=g(y,x),T=O[1],E=O[0],N=T[E],A=T[E+1];if(N==null)return y;if(N[0]!==a)return y;if(A!=null&&N[1]+A[1]===A[1]+N[1])return T.splice(E,2,A,N),_(T,E,2);if(A!=null&&A[1].indexOf(N[1])===0){T.splice(E,2,[A[0],N[1]],[0,N[1]]);var w=A[1].slice(N[1].length);return w.length>0&&T.splice(E+2,0,[A[0],w]),_(T,E,3)}else return y}function b(y){for(var x=!1,O=function(A){return A.charCodeAt(0)>=56320&&A.charCodeAt(0)<=57343},T=function(A){return A.charCodeAt(A.length-1)>=55296&&A.charCodeAt(A.length-1)<=56319},E=2;E<y.length;E+=1)y[E-2][0]===a&&T(y[E-2][1])&&y[E-1][0]===i&&O(y[E-1][1])&&y[E][0]===s&&O(y[E][1])&&(x=!0,y[E-1][1]=y[E-2][1].slice(-1)+y[E-1][1],y[E][1]=y[E-2][1].slice(-1)+y[E][1],y[E-2][1]=y[E-2][1].slice(0,-1));if(!x)return y;for(var N=[],E=0;E<y.length;E+=1)y[E][1].length>0&&N.push(y[E]);return N}function _(y,x,O){for(var T=x+O-1;T>=0&&T>=x-1;T--)if(T+1<y.length){var E=y[T],N=y[T+1];E[0]===N[1]&&y.splice(T,2,[E[0],E[1]+N[1]])}return y}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(s){var a=[];for(var o in s)a.push(o);return a}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?s:a,n.supported=s;function s(o){return Object.prototype.toString.call(o)=="[object Arguments]"}n.unsupported=a;function a(o){return o&&typeof o=="object"&&typeof o.length=="number"&&Object.prototype.hasOwnProperty.call(o,"callee")&&!Object.prototype.propertyIsEnumerable.call(o,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,s="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(s=!1));function o(f,c,h){this.fn=f,this.context=c,this.once=h||!1}function l(){this._events=new a,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)i.call(h,u)&&c.push(s?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},l.prototype.listeners=function(c,h){var u=s?s+c:c,d=this._events[u];if(h)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var p=0,v=d.length,g=new Array(v);p<v;p++)g[p]=d[p].fn;return g},l.prototype.emit=function(c,h,u,d,p,v){var g=s?s+c:c;if(!this._events[g])return!1;var m=this._events[g],b=arguments.length,_,y;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),b){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,h),!0;case 3:return m.fn.call(m.context,h,u),!0;case 4:return m.fn.call(m.context,h,u,d),!0;case 5:return m.fn.call(m.context,h,u,d,p),!0;case 6:return m.fn.call(m.context,h,u,d,p,v),!0}for(y=1,_=new Array(b-1);y<b;y++)_[y-1]=arguments[y];m.fn.apply(m.context,_)}else{var x=m.length,O;for(y=0;y<x;y++)switch(m[y].once&&this.removeListener(c,m[y].fn,void 0,!0),b){case 1:m[y].fn.call(m[y].context);break;case 2:m[y].fn.call(m[y].context,h);break;case 3:m[y].fn.call(m[y].context,h,u);break;case 4:m[y].fn.call(m[y].context,h,u,d);break;default:if(!_)for(O=1,_=new Array(b-1);O<b;O++)_[O-1]=arguments[O];m[y].fn.apply(m[y].context,_)}}return!0},l.prototype.on=function(c,h,u){var d=new o(h,u||this),p=s?s+c:c;return this._events[p]?this._events[p].fn?this._events[p]=[this._events[p],d]:this._events[p].push(d):(this._events[p]=d,this._eventsCount++),this},l.prototype.once=function(c,h,u){var d=new o(h,u||this,!0),p=s?s+c:c;return this._events[p]?this._events[p].fn?this._events[p]=[this._events[p],d]:this._events[p].push(d):(this._events[p]=d,this._eventsCount++),this},l.prototype.removeListener=function(c,h,u,d){var p=s?s+c:c;if(!this._events[p])return this;if(!h)return--this._eventsCount===0?this._events=new a:delete this._events[p],this;var v=this._events[p];if(v.fn)v.fn===h&&(!d||v.once)&&(!u||v.context===u)&&(--this._eventsCount===0?this._events=new a:delete this._events[p]);else{for(var g=0,m=[],b=v.length;g<b;g++)(v[g].fn!==h||d&&!v[g].once||u&&v[g].context!==u)&&m.push(v[g]);m.length?this._events[p]=m.length===1?m[0]:m:--this._eventsCount===0?this._events=new a:delete this._events[p]}return this},l.prototype.removeAllListeners=function(c){var h;return c?(h=s?s+c:c,this._events[h]&&(--this._eventsCount===0?this._events=new a:delete this._events[h])):(this._events=new a,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prototype.setMaxListeners=function(){return this},l.prefixed=s,l.EventEmitter=l,typeof r<"u"&&(r.exports=l)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},a=function(){function V(W,Z){var tt=[],K=!0,ft=!1,ct=void 0;try{for(var ht=W[Symbol.iterator](),nt;!(K=(nt=ht.next()).done)&&(tt.push(nt.value),!(Z&&tt.length===Z));K=!0);}catch(St){ft=!0,ct=St}finally{try{!K&&ht.return&&ht.return()}finally{if(ft)throw ct}}return tt}return function(W,Z){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return V(W,Z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function V(W,Z){for(var tt=0;tt<Z.length;tt++){var K=Z[tt];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(W,K.key,K)}}return function(W,Z,tt){return Z&&V(W.prototype,Z),tt&&V(W,tt),W}}(),l=i(3),f=S(l),c=i(2),h=S(c),u=i(0),d=S(u),p=i(5),v=S(p),g=i(10),m=S(g),b=i(9),_=S(b),y=i(36),x=i(37),O=i(13),T=S(O),E=i(26),N=i(38),A=i(39),w=i(40);function S(V){return V&&V.__esModule?V:{default:V}}function I(V,W,Z){return W in V?Object.defineProperty(V,W,{value:Z,enumerable:!0,configurable:!0,writable:!0}):V[W]=Z,V}function C(V,W){if(!(V instanceof W))throw new TypeError("Cannot call a class as a function")}function F(V,W){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W&&(typeof W=="object"||typeof W=="function")?W:V}function D(V,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof W);V.prototype=Object.create(W&&W.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),W&&(Object.setPrototypeOf?Object.setPrototypeOf(V,W):V.__proto__=W)}var U=(0,m.default)("quill:clipboard"),X="__ql-matcher",j=[[Node.TEXT_NODE,It],[Node.TEXT_NODE,at],["br",Y],[Node.ELEMENT_NODE,at],[Node.ELEMENT_NODE,z],[Node.ELEMENT_NODE,lt],[Node.ELEMENT_NODE,H],[Node.ELEMENT_NODE,Nt],["li",et],["b",q.bind(q,"bold")],["i",q.bind(q,"italic")],["style",J]],k=[y.AlignAttribute,N.DirectionAttribute].reduce(function(V,W){return V[W.keyName]=W,V},{}),R=[y.AlignStyle,x.BackgroundStyle,E.ColorStyle,N.DirectionStyle,A.FontStyle,w.SizeStyle].reduce(function(V,W){return V[W.keyName]=W,V},{}),P=function(V){D(W,V);function W(Z,tt){C(this,W);var K=F(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,Z,tt));return K.quill.root.addEventListener("paste",K.onPaste.bind(K)),K.container=K.quill.addContainer("ql-clipboard"),K.container.setAttribute("contenteditable",!0),K.container.setAttribute("tabindex",-1),K.matchers=[],j.concat(K.options.matchers).forEach(function(ft){var ct=a(ft,2),ht=ct[0],nt=ct[1];!tt.matchVisual&&nt===lt||K.addMatcher(ht,nt)}),K}return o(W,[{key:"addMatcher",value:function(tt,K){this.matchers.push([tt,K])}},{key:"convert",value:function(tt){if(typeof tt=="string")return this.container.innerHTML=tt.replace(/\>\r?\n +\</g,"><"),this.convert();var K=this.quill.getFormat(this.quill.selection.savedRange.index);if(K[T.default.blotName]){var ft=this.container.innerText;return this.container.innerHTML="",new h.default().insert(ft,I({},T.default.blotName,K[T.default.blotName]))}var ct=this.prepareMatching(),ht=a(ct,2),nt=ht[0],St=ht[1],Et=B(this.container,nt,St);return G(Et,`
582
+ `)&&Et.ops[Et.ops.length-1].attributes==null&&(Et=Et.compose(new h.default().retain(Et.length()-1).delete(1))),U.log("convert",this.container.innerHTML,Et),this.container.innerHTML="",Et}},{key:"dangerouslyPasteHTML",value:function(tt,K){var ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof tt=="string")this.quill.setContents(this.convert(tt),K),this.quill.setSelection(0,v.default.sources.SILENT);else{var ct=this.convert(K);this.quill.updateContents(new h.default().retain(tt).concat(ct),ft),this.quill.setSelection(tt+ct.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(tt){var K=this;if(!(tt.defaultPrevented||!this.quill.isEnabled())){var ft=this.quill.getSelection(),ct=new h.default().retain(ft.index),ht=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(v.default.sources.SILENT),setTimeout(function(){ct=ct.concat(K.convert()).delete(ft.length),K.quill.updateContents(ct,v.default.sources.USER),K.quill.setSelection(ct.length()-ft.length,v.default.sources.SILENT),K.quill.scrollingContainer.scrollTop=ht,K.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var tt=this,K=[],ft=[];return this.matchers.forEach(function(ct){var ht=a(ct,2),nt=ht[0],St=ht[1];switch(nt){case Node.TEXT_NODE:ft.push(St);break;case Node.ELEMENT_NODE:K.push(St);break;default:[].forEach.call(tt.container.querySelectorAll(nt),function(Et){Et[X]=Et[X]||[],Et[X].push(St)});break}}),[K,ft]}}]),W}(_.default);P.DEFAULTS={matchers:[],matchVisual:!0};function L(V,W,Z){return(typeof W>"u"?"undefined":s(W))==="object"?Object.keys(W).reduce(function(tt,K){return L(tt,K,W[K])},V):V.reduce(function(tt,K){return K.attributes&&K.attributes[W]?tt.push(K):tt.insert(K.insert,(0,f.default)({},I({},W,Z),K.attributes))},new h.default)}function $(V){if(V.nodeType!==Node.ELEMENT_NODE)return{};var W="__ql-computed-style";return V[W]||(V[W]=window.getComputedStyle(V))}function G(V,W){for(var Z="",tt=V.ops.length-1;tt>=0&&Z.length<W.length;--tt){var K=V.ops[tt];if(typeof K.insert!="string")break;Z=K.insert+Z}return Z.slice(-1*W.length)===W}function M(V){if(V.childNodes.length===0)return!1;var W=$(V);return["block","list-item"].indexOf(W.display)>-1}function B(V,W,Z){return V.nodeType===V.TEXT_NODE?Z.reduce(function(tt,K){return K(V,tt)},new h.default):V.nodeType===V.ELEMENT_NODE?[].reduce.call(V.childNodes||[],function(tt,K){var ft=B(K,W,Z);return K.nodeType===V.ELEMENT_NODE&&(ft=W.reduce(function(ct,ht){return ht(K,ct)},ft),ft=(K[X]||[]).reduce(function(ct,ht){return ht(K,ct)},ft)),tt.concat(ft)},new h.default):new h.default}function q(V,W,Z){return L(Z,V,!0)}function H(V,W){var Z=d.default.Attributor.Attribute.keys(V),tt=d.default.Attributor.Class.keys(V),K=d.default.Attributor.Style.keys(V),ft={};return Z.concat(tt).concat(K).forEach(function(ct){var ht=d.default.query(ct,d.default.Scope.ATTRIBUTE);ht!=null&&(ft[ht.attrName]=ht.value(V),ft[ht.attrName])||(ht=k[ct],ht!=null&&(ht.attrName===ct||ht.keyName===ct)&&(ft[ht.attrName]=ht.value(V)||void 0),ht=R[ct],ht!=null&&(ht.attrName===ct||ht.keyName===ct)&&(ht=R[ct],ft[ht.attrName]=ht.value(V)||void 0))}),Object.keys(ft).length>0&&(W=L(W,ft)),W}function z(V,W){var Z=d.default.query(V);if(Z==null)return W;if(Z.prototype instanceof d.default.Embed){var tt={},K=Z.value(V);K!=null&&(tt[Z.blotName]=K,W=new h.default().insert(tt,Z.formats(V)))}else typeof Z.formats=="function"&&(W=L(W,Z.blotName,Z.formats(V)));return W}function Y(V,W){return G(W,`
583
+ `)||W.insert(`
584
+ `),W}function J(){return new h.default}function et(V,W){var Z=d.default.query(V);if(Z==null||Z.blotName!=="list-item"||!G(W,`
585
+ `))return W;for(var tt=-1,K=V.parentNode;!K.classList.contains("ql-clipboard");)(d.default.query(K)||{}).blotName==="list"&&(tt+=1),K=K.parentNode;return tt<=0?W:W.compose(new h.default().retain(W.length()-1).retain(1,{indent:tt}))}function at(V,W){return G(W,`
586
+ `)||(M(V)||W.length()>0&&V.nextSibling&&M(V.nextSibling))&&W.insert(`
587
+ `),W}function lt(V,W){if(M(V)&&V.nextElementSibling!=null&&!G(W,`
588
+
589
+ `)){var Z=V.offsetHeight+parseFloat($(V).marginTop)+parseFloat($(V).marginBottom);V.nextElementSibling.offsetTop>V.offsetTop+Z*1.5&&W.insert(`
590
+ `)}return W}function Nt(V,W){var Z={},tt=V.style||{};return tt.fontStyle&&$(V).fontStyle==="italic"&&(Z.italic=!0),tt.fontWeight&&($(V).fontWeight.startsWith("bold")||parseInt($(V).fontWeight)>=700)&&(Z.bold=!0),Object.keys(Z).length>0&&(W=L(W,Z)),parseFloat(tt.textIndent||0)>0&&(W=new h.default().insert(" ").concat(W)),W}function It(V,W){var Z=V.data;if(V.parentNode.tagName==="O:P")return W.insert(Z.trim());if(Z.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return W;if(!$(V.parentNode).whiteSpace.startsWith("pre")){var tt=function(ft,ct){return ct=ct.replace(/[^\u00a0]/g,""),ct.length<1&&ft?" ":ct};Z=Z.replace(/\r\n/g," ").replace(/\n/g," "),Z=Z.replace(/\s\s+/g,tt.bind(tt,!0)),(V.previousSibling==null&&M(V.parentNode)||V.previousSibling!=null&&M(V.previousSibling))&&(Z=Z.replace(/^\s+/,tt.bind(tt,!1))),(V.nextSibling==null&&M(V.parentNode)||V.nextSibling!=null&&M(V.nextSibling))&&(Z=Z.replace(/\s+$/,tt.bind(tt,!1)))}return W.insert(Z)}n.default=P,n.matchAttributor=H,n.matchBlot=z,n.matchNewline=at,n.matchSpacing=lt,n.matchText=It},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var m=0;m<g.length;m++){var b=g[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,m){return g&&p(v.prototype,g),m&&p(v,m),v}}(),a=function p(v,g,m){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,m)}else{if("value"in b)return b.value;var y=b.get;return y===void 0?void 0:y.call(m)}},o=i(6),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),h(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"optimize",value:function(m){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,m),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),v}(l.default);d.blotName="bold",d.tagName=["STRONG","B"],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var s=function(){function w(S,I){var C=[],F=!0,D=!1,U=void 0;try{for(var X=S[Symbol.iterator](),j;!(F=(j=X.next()).done)&&(C.push(j.value),!(I&&C.length===I));F=!0);}catch(k){D=!0,U=k}finally{try{!F&&X.return&&X.return()}finally{if(D)throw U}}return C}return function(S,I){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return w(S,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function w(S,I){for(var C=0;C<I.length;C++){var F=I[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(S,F.key,F)}}return function(S,I,C){return I&&w(S.prototype,I),C&&w(S,C),S}}(),o=i(2),l=m(o),f=i(0),c=m(f),h=i(5),u=m(h),d=i(10),p=m(d),v=i(9),g=m(v);function m(w){return w&&w.__esModule?w:{default:w}}function b(w,S,I){return S in w?Object.defineProperty(w,S,{value:I,enumerable:!0,configurable:!0,writable:!0}):w[S]=I,w}function _(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function y(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function x(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var O=(0,p.default)("quill:toolbar"),T=function(w){x(S,w);function S(I,C){_(this,S);var F=y(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,I,C));if(Array.isArray(F.options.container)){var D=document.createElement("div");N(D,F.options.container),I.container.parentNode.insertBefore(D,I.container),F.container=D}else typeof F.options.container=="string"?F.container=document.querySelector(F.options.container):F.container=F.options.container;if(!(F.container instanceof HTMLElement)){var U;return U=O.error("Container required for toolbar",F.options),y(F,U)}return F.container.classList.add("ql-toolbar"),F.controls=[],F.handlers={},Object.keys(F.options.handlers).forEach(function(X){F.addHandler(X,F.options.handlers[X])}),[].forEach.call(F.container.querySelectorAll("button, select"),function(X){F.attach(X)}),F.quill.on(u.default.events.EDITOR_CHANGE,function(X,j){X===u.default.events.SELECTION_CHANGE&&F.update(j)}),F.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var X=F.quill.selection.getRange(),j=s(X,1),k=j[0];F.update(k)}),F}return a(S,[{key:"addHandler",value:function(C,F){this.handlers[C]=F}},{key:"attach",value:function(C){var F=this,D=[].find.call(C.classList,function(X){return X.indexOf("ql-")===0});if(D){if(D=D.slice(3),C.tagName==="BUTTON"&&C.setAttribute("type","button"),this.handlers[D]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[D]==null){O.warn("ignoring attaching to disabled format",D,C);return}if(c.default.query(D)==null){O.warn("ignoring attaching to nonexistent format",D,C);return}}var U=C.tagName==="SELECT"?"change":"click";C.addEventListener(U,function(X){var j=void 0;if(C.tagName==="SELECT"){if(C.selectedIndex<0)return;var k=C.options[C.selectedIndex];k.hasAttribute("selected")?j=!1:j=k.value||!1}else C.classList.contains("ql-active")?j=!1:j=C.value||!C.hasAttribute("value"),X.preventDefault();F.quill.focus();var R=F.quill.selection.getRange(),P=s(R,1),L=P[0];if(F.handlers[D]!=null)F.handlers[D].call(F,j);else if(c.default.query(D).prototype instanceof c.default.Embed){if(j=prompt("Enter "+D),!j)return;F.quill.updateContents(new l.default().retain(L.index).delete(L.length).insert(b({},D,j)),u.default.sources.USER)}else F.quill.format(D,j,u.default.sources.USER);F.update(L)}),this.controls.push([D,C])}}},{key:"update",value:function(C){var F=C==null?{}:this.quill.getFormat(C);this.controls.forEach(function(D){var U=s(D,2),X=U[0],j=U[1];if(j.tagName==="SELECT"){var k=void 0;if(C==null)k=null;else if(F[X]==null)k=j.querySelector("option[selected]");else if(!Array.isArray(F[X])){var R=F[X];typeof R=="string"&&(R=R.replace(/\"/g,'\\"')),k=j.querySelector('option[value="'+R+'"]')}k==null?(j.value="",j.selectedIndex=-1):k.selected=!0}else if(C==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var P=F[X]===j.getAttribute("value")||F[X]!=null&&F[X].toString()===j.getAttribute("value")||F[X]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",P)}else j.classList.toggle("ql-active",F[X]!=null)})}}]),S}(g.default);T.DEFAULTS={};function E(w,S,I){var C=document.createElement("button");C.setAttribute("type","button"),C.classList.add("ql-"+S),I!=null&&(C.value=I),w.appendChild(C)}function N(w,S){Array.isArray(S[0])||(S=[S]),S.forEach(function(I){var C=document.createElement("span");C.classList.add("ql-formats"),I.forEach(function(F){if(typeof F=="string")E(C,F);else{var D=Object.keys(F)[0],U=F[D];Array.isArray(U)?A(C,D,U):E(C,D,U)}}),w.appendChild(C)})}function A(w,S,I){var C=document.createElement("select");C.classList.add("ql-"+S),I.forEach(function(F){var D=document.createElement("option");F!==!1?D.setAttribute("value",F):D.setAttribute("selected","selected"),C.appendChild(D)}),w.appendChild(C)}T.DEFAULTS={container:null,handlers:{clean:function(){var S=this,I=this.quill.getSelection();if(I!=null)if(I.length==0){var C=this.quill.getFormat();Object.keys(C).forEach(function(F){c.default.query(F,c.default.Scope.INLINE)!=null&&S.quill.format(F,!1)})}else this.quill.removeFormat(I,u.default.sources.USER)},direction:function(S){var I=this.quill.getFormat().align;S==="rtl"&&I==null?this.quill.format("align","right",u.default.sources.USER):!S&&I==="right"&&this.quill.format("align",!1,u.default.sources.USER),this.quill.format("direction",S,u.default.sources.USER)},indent:function(S){var I=this.quill.getSelection(),C=this.quill.getFormat(I),F=parseInt(C.indent||0);if(S==="+1"||S==="-1"){var D=S==="+1"?1:-1;C.direction==="rtl"&&(D*=-1),this.quill.format("indent",F+D,u.default.sources.USER)}},link:function(S){S===!0&&(S=prompt("Enter link URL:")),this.quill.format("link",S,u.default.sources.USER)},list:function(S){var I=this.quill.getSelection(),C=this.quill.getFormat(I);S==="check"?C.list==="checked"||C.list==="unchecked"?this.quill.format("list",!1,u.default.sources.USER):this.quill.format("list","unchecked",u.default.sources.USER):this.quill.format("list",S,u.default.sources.USER)}}},n.default=T,n.addControls=N},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var m=0;m<g.length;m++){var b=g[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,m){return g&&p(v.prototype,g),m&&p(v,m),v}}(),a=function p(v,g,m){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,m)}else{if("value"in b)return b.value;var y=b.get;return y===void 0?void 0:y.call(m)}},o=i(28),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(g,m){c(this,v);var b=h(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return b.label.innerHTML=m,b.container.classList.add("ql-color-picker"),[].slice.call(b.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(_){_.classList.add("ql-primary")}),b}return s(v,[{key:"buildItem",value:function(m){var b=a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"buildItem",this).call(this,m);return b.style.backgroundColor=m.getAttribute("value")||"",b}},{key:"selectItem",value:function(m,b){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,m,b);var _=this.label.querySelector(".ql-color-label"),y=m&&m.getAttribute("data-value")||"";_&&(_.tagName==="line"?_.style.stroke=y:_.style.fill=y)}}]),v}(l.default);n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var m=0;m<g.length;m++){var b=g[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,m){return g&&p(v.prototype,g),m&&p(v,m),v}}(),a=function p(v,g,m){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,m)}else{if("value"in b)return b.value;var y=b.get;return y===void 0?void 0:y.call(m)}},o=i(28),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(g,m){c(this,v);var b=h(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return b.container.classList.add("ql-icon-picker"),[].forEach.call(b.container.querySelectorAll(".ql-picker-item"),function(_){_.innerHTML=m[_.getAttribute("data-value")||""]}),b.defaultItem=b.container.querySelector(".ql-selected"),b.selectItem(b.defaultItem),b}return s(v,[{key:"selectItem",value:function(m,b){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,m,b),m=m||this.defaultItem,this.label.innerHTML=m.innerHTML}}]),v}(l.default);n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(f,c){for(var h=0;h<c.length;h++){var u=c[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,c,h){return c&&l(f.prototype,c),h&&l(f,h),f}}();function a(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(f,c){var h=this;a(this,l),this.quill=f,this.boundsContainer=c||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){h.root.style.marginTop=-1*h.quill.root.scrollTop+"px"}),this.hide()}return s(l,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(c){var h=c.left+c.width/2-this.root.offsetWidth/2,u=c.bottom+this.quill.root.scrollTop;this.root.style.left=h+"px",this.root.style.top=u+"px",this.root.classList.remove("ql-flip");var d=this.boundsContainer.getBoundingClientRect(),p=this.root.getBoundingClientRect(),v=0;if(p.right>d.right&&(v=d.right-p.right,this.root.style.left=h+v+"px"),p.left<d.left&&(v=d.left-p.left,this.root.style.left=h+v+"px"),p.bottom>d.bottom){var g=p.bottom-p.top,m=c.bottom-c.top+g;this.root.style.top=u-m+"px",this.root.classList.add("ql-flip")}return v}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function A(w,S){var I=[],C=!0,F=!1,D=void 0;try{for(var U=w[Symbol.iterator](),X;!(C=(X=U.next()).done)&&(I.push(X.value),!(S&&I.length===S));C=!0);}catch(j){F=!0,D=j}finally{try{!C&&U.return&&U.return()}finally{if(F)throw D}}return I}return function(w,S){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return A(w,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function A(w,S,I){w===null&&(w=Function.prototype);var C=Object.getOwnPropertyDescriptor(w,S);if(C===void 0){var F=Object.getPrototypeOf(w);return F===null?void 0:A(F,S,I)}else{if("value"in C)return C.value;var D=C.get;return D===void 0?void 0:D.call(I)}},o=function(){function A(w,S){for(var I=0;I<S.length;I++){var C=S[I];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(w,C.key,C)}}return function(w,S,I){return S&&A(w.prototype,S),I&&A(w,I),w}}(),l=i(3),f=_(l),c=i(8),h=_(c),u=i(43),d=_(u),p=i(27),v=_(p),g=i(15),m=i(41),b=_(m);function _(A){return A&&A.__esModule?A:{default:A}}function y(A,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}function x(A,w){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:A}function O(A,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);A.prototype=Object.create(w&&w.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(A,w):A.__proto__=w)}var T=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],E=function(A){O(w,A);function w(S,I){y(this,w),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=T);var C=x(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,S,I));return C.quill.container.classList.add("ql-snow"),C}return o(w,[{key:"extendToolbar",value:function(I){I.container.classList.add("ql-snow"),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),b.default),this.tooltip=new N(this.quill,this.options.bounds),I.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(C,F){I.handlers.link.call(I,!F.format.link)})}}]),w}(d.default);E.DEFAULTS=(0,f.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(w){if(w){var S=this.quill.getSelection();if(S==null||S.length==0)return;var I=this.quill.getText(S);/^\S+@\S+\.\S+$/.test(I)&&I.indexOf("mailto:")!==0&&(I="mailto:"+I);var C=this.quill.theme.tooltip;C.edit("link",I)}else this.quill.format("link",!1)}}}}});var N=function(A){O(w,A);function w(S,I){y(this,w);var C=x(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,S,I));return C.preview=C.root.querySelector("a.ql-preview"),C}return o(w,[{key:"listen",value:function(){var I=this;a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(C){I.root.classList.contains("ql-editing")?I.save():I.edit("link",I.preview.textContent),C.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(C){if(I.linkRange!=null){var F=I.linkRange;I.restoreFocus(),I.quill.formatText(F,"link",!1,h.default.sources.USER),delete I.linkRange}C.preventDefault(),I.hide()}),this.quill.on(h.default.events.SELECTION_CHANGE,function(C,F,D){if(C!=null){if(C.length===0&&D===h.default.sources.USER){var U=I.quill.scroll.descendant(v.default,C.index),X=s(U,2),j=X[0],k=X[1];if(j!=null){I.linkRange=new g.Range(C.index-k,j.length());var R=v.default.formats(j.domNode);I.preview.textContent=R,I.preview.setAttribute("href",R),I.show(),I.position(I.quill.getBounds(I.linkRange));return}}else delete I.linkRange;I.hide()}})}},{key:"show",value:function(){a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),w}(u.BaseTooltip);N.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(29),a=K(s),o=i(36),l=i(38),f=i(64),c=i(65),h=K(c),u=i(66),d=K(u),p=i(67),v=K(p),g=i(37),m=i(26),b=i(39),_=i(40),y=i(56),x=K(y),O=i(68),T=K(O),E=i(27),N=K(E),A=i(69),w=K(A),S=i(70),I=K(S),C=i(71),F=K(C),D=i(72),U=K(D),X=i(73),j=K(X),k=i(13),R=K(k),P=i(74),L=K(P),$=i(75),G=K($),M=i(57),B=K(M),q=i(41),H=K(q),z=i(28),Y=K(z),J=i(59),et=K(J),at=i(60),lt=K(at),Nt=i(61),It=K(Nt),V=i(108),W=K(V),Z=i(62),tt=K(Z);function K(ft){return ft&&ft.__esModule?ft:{default:ft}}a.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":g.BackgroundClass,"attributors/class/color":m.ColorClass,"attributors/class/direction":l.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":_.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":g.BackgroundStyle,"attributors/style/color":m.ColorStyle,"attributors/style/direction":l.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":_.SizeStyle},!0),a.default.register({"formats/align":o.AlignClass,"formats/direction":l.DirectionClass,"formats/indent":f.IndentClass,"formats/background":g.BackgroundStyle,"formats/color":m.ColorStyle,"formats/font":b.FontClass,"formats/size":_.SizeClass,"formats/blockquote":h.default,"formats/code-block":R.default,"formats/header":d.default,"formats/list":v.default,"formats/bold":x.default,"formats/code":k.Code,"formats/italic":T.default,"formats/link":N.default,"formats/script":w.default,"formats/strike":I.default,"formats/underline":F.default,"formats/image":U.default,"formats/video":j.default,"formats/list/item":p.ListItem,"modules/formula":L.default,"modules/syntax":G.default,"modules/toolbar":B.default,"themes/bubble":W.default,"themes/snow":tt.default,"ui/icons":H.default,"ui/picker":Y.default,"ui/icon-picker":lt.default,"ui/color-picker":et.default,"ui/tooltip":It.default},!0),n.default=a.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var s=function(){function v(g,m){for(var b=0;b<m.length;b++){var _=m[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,m,b){return m&&v(g.prototype,m),b&&v(g,b),g}}(),a=function v(g,m,b){g===null&&(g=Function.prototype);var _=Object.getOwnPropertyDescriptor(g,m);if(_===void 0){var y=Object.getPrototypeOf(g);return y===null?void 0:v(y,m,b)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(b)}},o=i(0),l=f(o);function f(v){return v&&v.__esModule?v:{default:v}}function c(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function h(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function u(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var d=function(v){u(g,v);function g(){return c(this,g),h(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"add",value:function(b,_){if(_==="+1"||_==="-1"){var y=this.value(b)||0;_=_==="+1"?y+1:y-1}return _===0?(this.remove(b),!0):a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"add",this).call(this,b,_)}},{key:"canAdd",value:function(b,_){return a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,b,_)||a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,b,parseInt(_))}},{key:"value",value:function(b){return parseInt(a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,b))||void 0}}]),g}(l.default.Attributor.Class),p=new d("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(4),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function f(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var h=function(u){c(d,u);function d(){return l(this,d),f(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);h.blotName="blockquote",h.tagName="blockquote",n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function d(p,v){for(var g=0;g<v.length;g++){var m=v[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,v,g){return v&&d(p.prototype,v),g&&d(p,g),p}}(),a=i(4),o=l(a);function l(d){return d&&d.__esModule?d:{default:d}}function f(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")}function c(d,p){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:d}function h(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);d.prototype=Object.create(p&&p.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(d,p):d.__proto__=p)}var u=function(d){h(p,d);function p(){return f(this,p),c(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return s(p,null,[{key:"formats",value:function(g){return this.tagName.indexOf(g.tagName)+1}}]),p}(o.default);u.blotName="header",u.tagName=["H1","H2","H3","H4","H5","H6"],n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var s=function(){function y(x,O){for(var T=0;T<O.length;T++){var E=O[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,O,T){return O&&y(x.prototype,O),T&&y(x,T),x}}(),a=function y(x,O,T){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,O);if(E===void 0){var N=Object.getPrototypeOf(x);return N===null?void 0:y(N,O,T)}else{if("value"in E)return E.value;var A=E.get;return A===void 0?void 0:A.call(T)}},o=i(0),l=d(o),f=i(4),c=d(f),h=i(25),u=d(h);function d(y){return y&&y.__esModule?y:{default:y}}function p(y,x,O){return x in y?Object.defineProperty(y,x,{value:O,enumerable:!0,configurable:!0,writable:!0}):y[x]=O,y}function v(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function g(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function m(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var b=function(y){m(x,y);function x(){return v(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(T,E){T===_.blotName&&!E?this.replaceWith(l.default.create(this.statics.scope)):a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,T,E)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(T,E){return this.parent.isolate(this.offset(this.parent),this.length()),T===this.parent.statics.blotName?(this.parent.replaceWith(T,E),this):(this.parent.unwrap(),a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,T,E))}}],[{key:"formats",value:function(T){return T.tagName===this.tagName?void 0:a(x.__proto__||Object.getPrototypeOf(x),"formats",this).call(this,T)}}]),x}(c.default);b.blotName="list-item",b.tagName="LI";var _=function(y){m(x,y),s(x,null,[{key:"create",value:function(T){var E=T==="ordered"?"OL":"UL",N=a(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,E);return(T==="checked"||T==="unchecked")&&N.setAttribute("data-checked",T==="checked"),N}},{key:"formats",value:function(T){if(T.tagName==="OL")return"ordered";if(T.tagName==="UL")return T.hasAttribute("data-checked")?T.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function x(O){v(this,x);var T=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,O)),E=function(A){if(A.target.parentNode===O){var w=T.statics.formats(O),S=l.default.find(A.target);w==="checked"?S.format("list","unchecked"):w==="unchecked"&&S.format("list","checked")}};return O.addEventListener("touchstart",E),O.addEventListener("mousedown",E),T}return s(x,[{key:"format",value:function(T,E){this.children.length>0&&this.children.tail.format(T,E)}},{key:"formats",value:function(){return p({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,E){if(T instanceof b)a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,T,E);else{var N=E==null?this.length():E.offset(this),A=this.split(N);A.parent.insertBefore(T,A)}}},{key:"optimize",value:function(T){a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,T);var E=this.next;E!=null&&E.prev===this&&E.statics.blotName===this.statics.blotName&&E.domNode.tagName===this.domNode.tagName&&E.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(E.moveChildren(this),E.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var E=l.default.create(this.statics.defaultChild);T.moveChildren(E),this.appendChild(E)}a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,T)}}]),x}(u.default);_.blotName="list",_.scope=l.default.Scope.BLOCK_BLOT,_.tagName=["OL","UL"],_.defaultChild="list-item",_.allowedChildren=[b],n.ListItem=b,n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(56),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function f(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var h=function(u){c(d,u);function d(){return l(this,d),f(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);h.blotName="italic",h.tagName=["EM","I"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var m=0;m<g.length;m++){var b=g[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,m){return g&&p(v.prototype,g),m&&p(v,m),v}}(),a=function p(v,g,m){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:p(_,g,m)}else{if("value"in b)return b.value;var y=b.get;return y===void 0?void 0:y.call(m)}},o=i(6),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function h(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function u(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var d=function(p){u(v,p);function v(){return c(this,v),h(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,null,[{key:"create",value:function(m){return m==="super"?document.createElement("sup"):m==="sub"?document.createElement("sub"):a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,m)}},{key:"formats",value:function(m){if(m.tagName==="SUB")return"sub";if(m.tagName==="SUP")return"super"}}]),v}(l.default);d.blotName="script",d.tagName=["SUB","SUP"],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function f(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var h=function(u){c(d,u);function d(){return l(this,d),f(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);h.blotName="strike",h.tagName="S",n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),a=o(s);function o(u){return u&&u.__esModule?u:{default:u}}function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}function f(u,d){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:u}function c(u,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);u.prototype=Object.create(d&&d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(u,d):u.__proto__=d)}var h=function(u){c(d,u);function d(){return l(this,d),f(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);h.blotName="underline",h.tagName="U",n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(m,b){for(var _=0;_<b.length;_++){var y=b[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,b,_){return b&&g(m.prototype,b),_&&g(m,_),m}}(),a=function g(m,b,_){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,b);if(y===void 0){var x=Object.getPrototypeOf(m);return x===null?void 0:g(x,b,_)}else{if("value"in y)return y.value;var O=y.get;return O===void 0?void 0:O.call(_)}},o=i(0),l=c(o),f=i(27);function c(g){return g&&g.__esModule?g:{default:g}}function h(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function u(g,m){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:g}function d(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(g,m):g.__proto__=m)}var p=["alt","height","width"],v=function(g){d(m,g);function m(){return h(this,m),u(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"format",value:function(_,y){p.indexOf(_)>-1?y?this.domNode.setAttribute(_,y):this.domNode.removeAttribute(_):a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,_,y)}}],[{key:"create",value:function(_){var y=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,_);return typeof _=="string"&&y.setAttribute("src",this.sanitize(_)),y}},{key:"formats",value:function(_){return p.reduce(function(y,x){return _.hasAttribute(x)&&(y[x]=_.getAttribute(x)),y},{})}},{key:"match",value:function(_){return/\.(jpe?g|gif|png)$/.test(_)||/^data:image\/.+;base64/.test(_)}},{key:"sanitize",value:function(_){return(0,f.sanitize)(_,["http","https","data"])?_:"//:0"}},{key:"value",value:function(_){return _.getAttribute("src")}}]),m}(l.default.Embed);v.blotName="image",v.tagName="IMG",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(m,b){for(var _=0;_<b.length;_++){var y=b[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,b,_){return b&&g(m.prototype,b),_&&g(m,_),m}}(),a=function g(m,b,_){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,b);if(y===void 0){var x=Object.getPrototypeOf(m);return x===null?void 0:g(x,b,_)}else{if("value"in y)return y.value;var O=y.get;return O===void 0?void 0:O.call(_)}},o=i(4),l=i(27),f=c(l);function c(g){return g&&g.__esModule?g:{default:g}}function h(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function u(g,m){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:g}function d(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(g,m):g.__proto__=m)}var p=["height","width"],v=function(g){d(m,g);function m(){return h(this,m),u(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"format",value:function(_,y){p.indexOf(_)>-1?y?this.domNode.setAttribute(_,y):this.domNode.removeAttribute(_):a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,_,y)}}],[{key:"create",value:function(_){var y=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,_);return y.setAttribute("frameborder","0"),y.setAttribute("allowfullscreen",!0),y.setAttribute("src",this.sanitize(_)),y}},{key:"formats",value:function(_){return p.reduce(function(y,x){return _.hasAttribute(x)&&(y[x]=_.getAttribute(x)),y},{})}},{key:"sanitize",value:function(_){return f.default.sanitize(_)}},{key:"value",value:function(_){return _.getAttribute("src")}}]),m}(o.BlockEmbed);v.blotName="video",v.className="ql-video",v.tagName="IFRAME",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var s=function(){function _(y,x){for(var O=0;O<x.length;O++){var T=x[O];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(y,T.key,T)}}return function(y,x,O){return x&&_(y.prototype,x),O&&_(y,O),y}}(),a=function _(y,x,O){y===null&&(y=Function.prototype);var T=Object.getOwnPropertyDescriptor(y,x);if(T===void 0){var E=Object.getPrototypeOf(y);return E===null?void 0:_(E,x,O)}else{if("value"in T)return T.value;var N=T.get;return N===void 0?void 0:N.call(O)}},o=i(35),l=d(o),f=i(5),c=d(f),h=i(9),u=d(h);function d(_){return _&&_.__esModule?_:{default:_}}function p(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function v(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function g(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var m=function(_){g(y,_);function y(){return p(this,y),v(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,null,[{key:"create",value:function(O){var T=a(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,O);return typeof O=="string"&&(window.katex.render(O,T,{throwOnError:!1,errorColor:"#f00"}),T.setAttribute("data-value",O)),T}},{key:"value",value:function(O){return O.getAttribute("data-value")}}]),y}(l.default);m.blotName="formula",m.className="ql-formula",m.tagName="SPAN";var b=function(_){g(y,_),s(y,null,[{key:"register",value:function(){c.default.register(m,!0)}}]);function y(){p(this,y);var x=v(this,(y.__proto__||Object.getPrototypeOf(y)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return x}return y}(u.default);n.FormulaBlot=m,n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var s=function(){function O(T,E){for(var N=0;N<E.length;N++){var A=E[N];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(T,A.key,A)}}return function(T,E,N){return E&&O(T.prototype,E),N&&O(T,N),T}}(),a=function O(T,E,N){T===null&&(T=Function.prototype);var A=Object.getOwnPropertyDescriptor(T,E);if(A===void 0){var w=Object.getPrototypeOf(T);return w===null?void 0:O(w,E,N)}else{if("value"in A)return A.value;var S=A.get;return S===void 0?void 0:S.call(N)}},o=i(0),l=v(o),f=i(5),c=v(f),h=i(9),u=v(h),d=i(13),p=v(d);function v(O){return O&&O.__esModule?O:{default:O}}function g(O,T){if(!(O instanceof T))throw new TypeError("Cannot call a class as a function")}function m(O,T){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:O}function b(O,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);O.prototype=Object.create(T&&T.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(O,T):O.__proto__=T)}var _=function(O){b(T,O);function T(){return g(this,T),m(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return s(T,[{key:"replaceWith",value:function(N){this.domNode.textContent=this.domNode.textContent,this.attach(),a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replaceWith",this).call(this,N)}},{key:"highlight",value:function(N){var A=this.domNode.textContent;this.cachedText!==A&&((A.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=N(A),this.domNode.normalize(),this.attach()),this.cachedText=A)}}]),T}(p.default);_.className="ql-syntax";var y=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),x=function(O){b(T,O),s(T,null,[{key:"register",value:function(){c.default.register(y,!0),c.default.register(_,!0)}}]);function T(E,N){g(this,T);var A=m(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,E,N));if(typeof A.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var w=null;return A.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(w),w=setTimeout(function(){A.highlight(),w=null},A.options.interval)}),A.highlight(),A}return s(T,[{key:"highlight",value:function(){var N=this;if(!this.quill.selection.composing){this.quill.update(c.default.sources.USER);var A=this.quill.getSelection();this.quill.scroll.descendants(_).forEach(function(w){w.highlight(N.options.highlight)}),this.quill.update(c.default.sources.SILENT),A!=null&&this.quill.setSelection(A,c.default.sources.SILENT)}}}]),T}(u.default);x.DEFAULTS={highlight:function(){return window.hljs==null?null:function(O){var T=window.hljs.highlightAuto(O);return T.value}}(),interval:1e3},n.CodeBlock=_,n.CodeToken=y,n.default=x},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var s=function T(E,N,A){E===null&&(E=Function.prototype);var w=Object.getOwnPropertyDescriptor(E,N);if(w===void 0){var S=Object.getPrototypeOf(E);return S===null?void 0:T(S,N,A)}else{if("value"in w)return w.value;var I=w.get;return I===void 0?void 0:I.call(A)}},a=function(){function T(E,N){for(var A=0;A<N.length;A++){var w=N[A];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(E,w.key,w)}}return function(E,N,A){return N&&T(E.prototype,N),A&&T(E,A),E}}(),o=i(3),l=g(o),f=i(8),c=g(f),h=i(43),u=g(h),d=i(15),p=i(41),v=g(p);function g(T){return T&&T.__esModule?T:{default:T}}function m(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}function b(T,E){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:T}function _(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);T.prototype=Object.create(E&&E.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(T,E):T.__proto__=E)}var y=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],x=function(T){_(E,T);function E(N,A){m(this,E),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=y);var w=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,N,A));return w.quill.container.classList.add("ql-bubble"),w}return a(E,[{key:"extendToolbar",value:function(A){this.tooltip=new O(this.quill,this.options.bounds),this.tooltip.root.appendChild(A.container),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),v.default)}}]),E}(u.default);x.DEFAULTS=(0,l.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(E){E?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var O=function(T){_(E,T);function E(N,A){m(this,E);var w=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,N,A));return w.quill.on(c.default.events.EDITOR_CHANGE,function(S,I,C,F){if(S===c.default.events.SELECTION_CHANGE)if(I!=null&&I.length>0&&F===c.default.sources.USER){w.show(),w.root.style.left="0px",w.root.style.width="",w.root.style.width=w.root.offsetWidth+"px";var D=w.quill.getLines(I.index,I.length);if(D.length===1)w.position(w.quill.getBounds(I));else{var U=D[D.length-1],X=w.quill.getIndex(U),j=Math.min(U.length()-1,I.index+I.length-X),k=w.quill.getBounds(new d.Range(X,j));w.position(k)}}else document.activeElement!==w.textbox&&w.quill.hasFocus()&&w.hide()}),w}return a(E,[{key:"listen",value:function(){var A=this;s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){A.root.classList.remove("ql-editing")}),this.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!A.root.classList.contains("ql-hidden")){var w=A.quill.getSelection();w!=null&&A.position(A.quill.getBounds(w))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(A){var w=s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"position",this).call(this,A),S=this.root.querySelector(".ql-tooltip-arrow");if(S.style.marginLeft="",w===0)return w;S.style.marginLeft=-1*w-S.offsetWidth/2+"px"}}]),E}(h.BaseTooltip);O.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=O,n.default=x},function(r,n,i){r.exports=i(63)}]).default})})(of);var NT=of.exports;const CT=ir(NT),GT="",PT=e=>{const[t,r]=Q.useState(!1);console.log("allProps",e);const n=Q.useRef(null),i=Q.useRef(null),s=Q.useRef(null),a=Q.useRef(null),o=Q.useRef(16),l=Q.useRef(null),{uniqueId:f,text:c,disabled:h,transformation:u,onTextUpdate:d,pointerdown:p}=e,{scale:v=[1,1],x:g,y:m,rotation:b=1,fontFamily:_="Arial",fontWeight:y="normal",fontStyle:x="normal",fontSize:O=16,fill:T="black",stroke:E,strokeThickness:N,blurRadius:A=0,blurEnabled:w=!1,dropShadowColor:S=null,wordWrapWidth:I=5e7,leading:C=0,letterSpacing:F}=u;st.useEffect(()=>{o.current=Number(O)},[O]);const D=["italic","oblique"].includes(x)?x:void 0,U=["bold","lighter","100","200","300"].includes(y)?y:void 0,X=Number(F)>0?F:void 0,j=st.useMemo(()=>new te.TextStyle({fontFamily:_,fontSize:O,fill:T||"white",stroke:E,strokeThickness:N,...D&&{fontStyle:D},...U&&{fontWeight:U},...X&&{letterSpacing:X},...w&&{dropShadow:!0,dropShadowBlur:Number(A),dropShadowColor:(S==null?void 0:S.toString())||"black",dropShadowDistance:0},wordWrap:!0,breakWords:!0,wordWrapWidth:I||500,leading:C||0}),[w,A,T,_,O,C,D,U,X,S,E,N,I]);st.useEffect(()=>{l.current={...u}},[u]);const k=R=>{d&&d({text:R,uniqueId:f,droptype:"titles"})};return st.useEffect(()=>{if(t&&s.current){let P=document.getElementById("note-editor");if(P){P.style.position="absolute",P.style.zIndex="10",P.style.left=g+"px",P.style.top=m+"px",P.style.backgroundColor="var(--chakra-color-darkShark)",P.style.transform="scale(1.5)",P.style.width="300px",P.style.height="100px",P.style.color="#fff",P.style.fontSize="20px",P.style.border="1px solid #CBCEE0";const L={esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}};var R=new CT("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{...L}}},placeholder:"Compose your text here...",theme:"snow"});R.on("text-change",function(){k(R.root.innerText)}),R.setText(c),R.focus(),R.off("text-change",()=>{console.log("removed")}),R.hasFocus()||(P.style.display="none")}}},[g,m,t]),dt.jsx(oi,{...e,children:dt.jsxs(yt.Container,{ref:n,children:[t&&dt.jsx(yt.Container,{ref:s}),dt.jsx(yt.Container,{alpha:t?0:1,ref:a,children:dt.jsx(yt.Text,{style:j,x:g,y:m,rotation:b,anchor:.5,text:c,...!t&&!h&&{interactive:!0,buttonMode:!0,pointerdown:p},ref:i,scale:v})})]})})},kT=yt.withFilters(yt.Container,{blur:te.filters.BlurFilter,adjust:Gs,matrix:te.filters.ColorMatrixFilter}),MT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],LT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},FT=e=>{const[t,r]=st.useState(!1),[,n]=Q.useState(!1),[,i]=st.useState({isWaiting:!1,isStalled:!1}),[s,a]=st.useState(),[o,l]=Q.useState(!1),f=Q.useRef(null),c=Q.useRef(null),h=Q.useRef(null),u=Q.useRef(null),d=Q.useRef(null),p=Q.useRef(null),v=Q.useRef(LT),g=Q.useRef(e.initialAlpha),{tl:m,playerTimeRef:b,isDragging:_}=Q.useContext(Sr),{uniqueId:y,mute:x=!1,locked:O=!1,src:T,startAt:E,endAt:N,frameStartAt:A,frameEndAt:w,transformation:{x:S,y:I,width:C,height:F,scale:D,rotation:U,animation:X,colorCorrection:j,effect:k},pointerdown:R,pointerup:P,mousedown:L,mouseup:$,pointerover:G,mouseover:M,mouseout:B,applyTransformer:q,onAnchorTransformationEnd:H}=e,z=T||"",{contrast:Y=1,saturation:J=1,exposure:et=1,blurRadius:at=0,alpha:lt=1}=j||{},Nt={brightness:et,contrast:Y,saturation:J,alpha:lt},It=st.useCallback(()=>{l(!0)},[]),V=st.useCallback(nt=>{console.log("changeEnd",nt),H&&(console.log("running onAnchorTransformationEnd"),H(nt))},[]),W=st.useMemo(()=>{const nt=document.createElement("video");return nt.src=T,nt.crossOrigin="Anonymus",nt.autoplay=!1,nt.currentTime=1e-4,nt},[T]);nn(ge.PAUSE,nt=>{if(console.log("pause event",nt),p.current){const St=p.current;St.currentTime>0&&!St.paused&&!St.ended&&St.readyState>St.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}}),st.useEffect(()=>{console.log("current",p.current,_),p.current&&(_?(p.current.pause(),v.current.isPlaying=!1,v.current.isDragging=!0):v.current.isDragging=!1)},[_]);const Z=nt=>{p.current&&(console.log("video gsapOnStart",b.current,_),b.current>=nt&&b.current<=N&&!_&&(p.current.currentTime=Number(A)||Number(nt),p.current.play(),v.current.isPlaying=!0))},tt=()=>{if(console.log("onComplete triggered"),p.current){const nt=p.current;nt.currentTime>0&&!nt.paused&&!nt.ended&&nt.readyState>nt.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}},K=()=>{},ft=()=>{if(p.current){Math.abs(p.current.currentTime-b.current);const nt=p.current,St=nt.currentTime>0&&!nt.paused&&!nt.ended&&nt.readyState>nt.HAVE_CURRENT_DATA;v.current.isDragging?(console.log("video updating",b.current),p.current.currentTime=b.current,p.current.play(),setTimeout(()=>{v.current.isPlaying=!1,p.current&&p.current.pause()},55),v.current.isPlaying=!1):v.current.isPlaying||(St||p.current.play(),v.current.isPlaying=!0)}},ct=nt=>{g.current=nt.alpha},ht=nt=>{g.current=nt.alpha};return Q.useEffect(()=>{let nt=he.context(()=>{});if(c.current&&m.current){const St={duration:Number(N)-Number(E),onStart:Z,onComplete:tt,onStartParams:[E],onCompleteParams:[],onInterrupt:K,onUpdate:ft,onUpdateParams:[]},Et={onStart:ct,onStartParams:[{alpha:1}]},De={onComplete:ht,onCompleteParams:[{alpha:0}]},gt=Vs(X||"None");nt=he.context(()=>{var ut,je;m.current.to(c.current,{alpha:1,duration:.01,...Et},E).from(c.current,{...St},E).to(c.current,{alpha:0,duration:.1,...De},Number(N)-.09),Jt(gt.from)?Jt(gt.to)?Jt(gt.fromTo)||m.current.fromTo(c.current,(ut=gt.fromTo)==null?void 0:ut.from,(je=gt.fromTo)==null?void 0:je.to,E):m.current.to(c.current,{alpha:1,duration:.2,...gt.to},E):m.current.from(c.current,{...gt.from},E)})}return()=>nt.revert()},[X,E,N]),st.useEffect(()=>{c.current&&r(!0)},[]),st.useEffect(()=>{p.current&&(p.current.muted=x)},[x]),st.useEffect(()=>{if(p.current){const nt=p.current;nt.currentTime>0&&!nt.paused&&!nt.ended&&nt.readyState>nt.HAVE_CURRENT_DATA&&(o||_)&&(p.current.pause(),v.current.isPlaying=!1)}},[o,_]),st.useEffect(()=>{const nt=Math.round((Number(A)+Number.EPSILON)*100)/100,St=function(){p.current&&(p.current.currentTime=nt)},Et=function(){if(p.current){const Lt=p.current;Lt.currentTime>0&&!Lt.paused&&!Lt.ended&&Lt.readyState>Lt.HAVE_CURRENT_DATA&&p.current.pause()}i({isWaiting:!1,isStalled:!1})},De=function(){p.current&&p.current.pause(),i({isWaiting:!0,isStalled:!1})},gt=function(){i({isWaiting:!1,isStalled:!1})},ut=function(){i({isWaiting:!1,isStalled:!0})},je=Math.round((Number(A)+Number.EPSILON)*100)/100,Ur=Math.round((Number(w)+Number.EPSILON)*100)/100,_e=`${z}#t=${je},${Ur}`;return console.log("urlTimestap",_e),te.Texture.fromLoader(W,_e,y,{pixiIdPrefix:y,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(Lt=>{Lt&&(a(Lt),console.log(Lt.baseTexture.resource.source),p.current=Lt.baseTexture.resource.source,p.current.id=y,p.current.addEventListener("loadedmetadata",St),p.current.addEventListener("ended",Et),p.current.addEventListener("loadstart",De),p.current.addEventListener("canplaythrough",gt),p.current.addEventListener("stalled",ut))}),()=>{p.current.removeEventListener("loadedmetadata",St),p.current.removeEventListener("ended",Et),p.current.removeEventListener("loadstart",De),p.current.removeEventListener("canplaythrough",gt),p.current.removeEventListener("stalled",ut)}},[z,y,A,w,W]),dt.jsxs(yt.Container,{ref:h,children:[dt.jsx(yt.Container,{ref:c,alpha:g.current,position:[S,I],pivot:[S,I],width:C,height:F,children:dt.jsx(kT,{scale:1,blur:{blur:at,quality:4},adjust:Nt,apply:({matrix:nt})=>{k==="BlackAndWhite"?nt.desaturate():k==="Sepia"?nt.sepia():k==="RetroVintage"||k==="NightVision"?nt.negative():k==="Normal"&&nt.reset()},matrix:{enabled:!0,matrix:MT},children:dt.jsx(yt.Container,{ref:u,children:s&&dt.jsx(yt.Sprite,{texture:s,width:C,height:F,anchor:.5,x:S,y:I,...!O&&!o&&{interactive:!0,buttonMode:!0,pointerdown:R,pointerover:G,pointerout:B,mousedown:L,mouseover:M,mouseout:B,mouseup:$,pointerup:P},ref:f,scale:D,rotation:U})})})}),q&&dt.jsx(qs,{pixiTransformerRef:d,imageRef:c,isMounted:t,transformCommit:V,transformChange:It,mouseoverEvent:n,uniqueId:y})]})};var lf=(e=>(e.FADE_IN="FADE_IN",e.FADE_OUT="FADE_OUT",e.FADE_IN_OUT="FADE_IN_OUT",e.SLIDE_IN_LEFT="SLIDE_IN_LEFT",e.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",e.SLIDE_IN_TOP="SLIDE_IN_TOP",e.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",e.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",e.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",e.SLIDE_OUT_TOP="SLIDE_OUT_TOP",e.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",e.ZOOM_IN="ZOOM_IN",e.ZOOM_OUT="ZOOM_OUT",e.ZOOM_IN_OUT="ZOOM_IN_OUT",e.BOUNCE_IN="BOUNCE_IN",e.BOUNCE_OUT="BOUNCE_OUT",e.BOUNCE_IN_OUT="BOUNCE_IN_OUT",e.ELASTIC_IN="ELASTIC_IN",e.ELASTIC_OUT="ELASTIC_OUT",e.ELASTIC_IN_OUT="ELASTIC_IN_OUT",e.BACK_IN="BACK_IN",e.BACK_OUT="BACK_OUT",e.BACK_IN_OUT="BACK_IN_OUT",e.CIRCULAR_IN="CIRCULAR_IN",e.CIRCULAR_OUT="CIRCULAR_OUT",e.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",e.EXPO_IN="EXPO_IN",e.EXPO_OUT="EXPO_OUT",e.EXPO_IN_OUT="EXPO_IN_OUT",e.SINE_IN="SINE_IN",e.SINE_OUT="SINE_OUT",e.SINE_IN_OUT="SINE_IN_OUT",e.BOUNCE="BOUNCE",e.ELASTIC="ELASTIC",e.BACK="BACK",e.CIRCULAR="CIRCULAR",e.EXPO="EXPO",e.SINE="SINE",e))(lf||{}),uf=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e))(uf||{});Ct.Animations=lf,Ct.BlendModes=uf,Ct.Events=ge,Ct.GsapPixieContext=Sr,Ct.GsapPixieContextProvider=Cp,Ct.PixiAnimatedSprite=af,Ct.PixiAudioSprite=$g,Ct.PixiGifSprite=RT,Ct.PixiImageSprite=Im,Ct.PixiSvgPathSprite=jg,Ct.PixiTextSprite=PT,Ct.PixiVideoSprite=FT,Object.defineProperty(Ct,Symbol.toStringTag,{value:"Module"})});