reacthub-pixitweenjs 0.2.30 → 0.2.32

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.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(kt,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("react"),require("@pixi/react"),require("gsap"),require("pixi.js"),require("@pixi/sound")):typeof define=="function"&&define.amd?define(["exports","react","@pixi/react","gsap","pixi.js","@pixi/sound"],J):(kt=typeof globalThis<"u"?globalThis:kt||self,J(kt["reacthub-pixitweenjs"]={},kt.React,kt.PIXIReact,kt.gsap,kt.PIXI,kt.PIXI.sound))})(this,function(kt,J,yt,ye,$h,qh){"use strict";function La(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 ot=La(J),ne=La($h);var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function or(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Hh(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 Fa={exports:{}},gn={};/**
1
+ (function(Rt,J){typeof exports=="object"&&typeof module<"u"?J(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"],J):(Rt=typeof globalThis<"u"?globalThis:Rt||self,J(Rt["reacthub-pixitweenjs"]={},Rt.React,Rt.PIXIReact,Rt.gsap,Rt.PIXI,Rt.reacthubReactBindings,Rt.PIXI.sound))})(this,function(Rt,J,vt,pe,ff,cf,hf){"use strict";function ga(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 at=ga(J),ee=ga(ff);var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function df(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 ba={exports:{}},cn={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,24 +6,24 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var zh=J,Vh=Symbol.for("react.element"),Xh=Symbol.for("react.fragment"),Wh=Object.prototype.hasOwnProperty,Yh=zh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Kh={key:!0,ref:!0,__self:!0,__source:!0};function Ba(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)Wh.call(t,n)&&!Kh.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:Vh,type:e,key:s,ref:a,props:i,_owner:Yh.current}}gn.Fragment=Xh,gn.jsx=Ba,gn.jsxs=Ba,Fa.exports=gn;var ft=Fa.exports,$e=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))($e||{}),Da=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(Da||{}),Di=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(Di||{}),ut=(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))(ut||{}),Pe=(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))(Pe||{}),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||{}),lr=(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))(lr||{}),mt=(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))(mt||{}),Ui=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(Ui||{}),we=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(we||{}),$r=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))($r||{}),qe=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(qe||{}),Me=(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))(Me||{}),He=(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))(He||{}),ji=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(ji||{}),Jt=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(Jt||{}),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||{}),Dt=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(Dt||{}),ve=(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))(ve||{});const vt={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 Gi=/iPhone/i,Ua=/iPod/i,ja=/iPad/i,Ga=/\biOS-universal(?:.+)Mac\b/i,$i=/\bAndroid(?:.+)Mobile\b/i,$a=/Android/i,ur=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,bn=/Silk/i,Ee=/Windows Phone/i,qa=/\bWindows(?:.+)ARM\b/i,Ha=/BlackBerry/i,za=/BB10/i,Va=/Opera Mini/i,Xa=/\b(CriOS|Chrome)(?:.+)Mobile/i,Wa=/Mobile(?:.+)Firefox\b/i,Ya=function(e){return typeof e<"u"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream>"u"};function Zh(e){return function(t){return t.test(e)}}function Ka(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=Zh(r),s={apple:{phone:i(Gi)&&!i(Ee),ipod:i(Ua),tablet:!i(Gi)&&(i(ja)||Ya(t))&&!i(Ee),universal:i(Ga),device:(i(Gi)||i(Ua)||i(ja)||i(Ga)||Ya(t))&&!i(Ee)},amazon:{phone:i(ur),tablet:!i(ur)&&i(bn),device:i(ur)||i(bn)},android:{phone:!i(Ee)&&i(ur)||!i(Ee)&&i($i),tablet:!i(Ee)&&!i(ur)&&!i($i)&&(i(bn)||i($a)),device:!i(Ee)&&(i(ur)||i(bn)||i($i)||i($a))||i(/\bokhttp\b/i)},windows:{phone:i(Ee),tablet:i(qa),device:i(Ee)||i(qa)},other:{blackberry:i(Ha),blackberry10:i(za),opera:i(Va),firefox:i(Wa),chrome:i(Xa),device:i(Ha)||i(za)||i(Va)||i(Wa)||i(Xa)},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 hr=(Ka.default??Ka)(globalThis.navigator);vt.RETINA_PREFIX=/@([0-9\.]+)x/,vt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Za={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,h,c){this.fn=l,this.context=h,this.once=c||!1}function s(l,h,c,f,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,f||l,u),p=r?r+h:h;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,h){--l._eventsCount===0?l._events=new n:delete l._events[h]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],c,f;if(this._eventsCount===0)return h;for(f in c=this._events)t.call(c,f)&&h.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(c)):h},o.prototype.listeners=function(h){var c=r?r+h:h,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var u=0,d=f.length,p=new Array(d);u<d;u++)p[u]=f[u].fn;return p},o.prototype.listenerCount=function(h){var c=r?r+h:h,f=this._events[c];return f?f.fn?1:f.length:0},o.prototype.emit=function(h,c,f,u,d,p){var v=r?r+h:h;if(!this._events[v])return!1;var g=this._events[v],y=arguments.length,b,_;if(g.fn){switch(g.once&&this.removeListener(h,g.fn,void 0,!0),y){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,f),!0;case 4:return g.fn.call(g.context,c,f,u),!0;case 5:return g.fn.call(g.context,c,f,u,d),!0;case 6:return g.fn.call(g.context,c,f,u,d,p),!0}for(_=1,b=new Array(y-1);_<y;_++)b[_-1]=arguments[_];g.fn.apply(g.context,b)}else{var m=g.length,x;for(_=0;_<m;_++)switch(g[_].once&&this.removeListener(h,g[_].fn,void 0,!0),y){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,f);break;case 4:g[_].fn.call(g[_].context,c,f,u);break;default:if(!b)for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];g[_].fn.apply(g[_].context,b)}}return!0},o.prototype.on=function(h,c,f){return s(this,h,c,f,!1)},o.prototype.once=function(h,c,f){return s(this,h,c,f,!0)},o.prototype.removeListener=function(h,c,f,u){var d=r?r+h:h;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)&&(!f||p.context===f)&&a(this,d);else{for(var v=0,g=[],y=p.length;v<y;v++)(p[v].fn!==c||u&&!p[v].once||f&&p[v].context!==f)&&g.push(p[v]);g.length?this._events[d]=g.length===1?g[0]:g:a(this,d)}return this},o.prototype.removeAllListeners=function(h){var c;return h?(c=r?r+h:h,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})(Za);var Qh=Za.exports;const _n=or(Qh);var qi={exports:{}};qi.exports=xn,qi.exports.default=xn;function xn(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,s=Qa(e,0,i,r,!0),a=[];if(!s||s.next===s.prev)return a;var o,l,h,c,f,u,d;if(n&&(s=nc(e,t,s,r)),e.length>80*r){o=h=e[0],l=c=e[1];for(var p=r;p<i;p+=r)f=e[p],u=e[p+1],f<o&&(o=f),u<l&&(l=u),f>h&&(h=f),u>c&&(c=u);d=Math.max(h-o,c-l),d=d!==0?32767/d:0}return qr(s,a,r,o,l,d,0),a}function Qa(e,t,r,n,i){var s,a;if(i===Vi(e,t,r,n)>0)for(s=t;s<r;s+=n)a=eo(s,e[s],e[s+1],a);else for(s=r-n;s>=t;s-=n)a=eo(s,e[s],e[s+1],a);return a&&wn(a,a.next)&&(zr(a),a=a.next),a}function ze(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(wn(r,r.next)||Pt(r.prev,r,r.next)===0)){if(zr(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function qr(e,t,r,n,i,s,a){if(e){!a&&s&&lc(e,n,i,s);for(var o=e,l,h;e.prev!==e.next;){if(l=e.prev,h=e.next,s?tc(e,n,i,s):Jh(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(h.i/r|0),zr(e),e=h.next,o=h.next;continue}if(e=h,e===o){a?a===1?(e=ec(ze(e),t,r),qr(e,t,r,n,i,s,2)):a===2&&rc(e,t,r,n,i,s):qr(ze(e),t,r,n,i,s,1);break}}}}function Jh(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,h=n.y,c=i<s?i<a?i:a:s<a?s:a,f=o<l?o<h?o:h:l<h?l:h,u=i>s?i>a?i:a:s>a?s:a,d=o>l?o>h?o:h:l>h?l:h,p=n.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=f&&p.y<=d&&cr(i,o,s,l,a,h,p.x,p.y)&&Pt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function tc(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,h=a.x,c=i.y,f=s.y,u=a.y,d=o<l?o<h?o:h:l<h?l:h,p=c<f?c<u?c:u:f<u?f:u,v=o>l?o>h?o:h:l>h?l:h,g=c>f?c>u?c:u:f>u?f:u,y=Hi(d,p,t,r,n),b=Hi(v,g,t,r,n),_=e.prevZ,m=e.nextZ;_&&_.z>=y&&m&&m.z<=b;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&cr(o,c,l,f,h,u,_.x,_.y)&&Pt(_.prev,_,_.next)>=0||(_=_.prevZ,m.x>=d&&m.x<=v&&m.y>=p&&m.y<=g&&m!==i&&m!==a&&cr(o,c,l,f,h,u,m.x,m.y)&&Pt(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;_&&_.z>=y;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&cr(o,c,l,f,h,u,_.x,_.y)&&Pt(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;m&&m.z<=b;){if(m.x>=d&&m.x<=v&&m.y>=p&&m.y<=g&&m!==i&&m!==a&&cr(o,c,l,f,h,u,m.x,m.y)&&Pt(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function ec(e,t,r){var n=e;do{var i=n.prev,s=n.next.next;!wn(i,s)&&Ja(i,n,n.next,s)&&Hr(i,s)&&Hr(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),zr(n),zr(n.next),n=e=s),n=n.next}while(n!==e);return ze(n)}function rc(e,t,r,n,i,s){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&cc(a,o)){var l=to(a,o);a=ze(a,a.next),l=ze(l,l.next),qr(a,t,r,n,i,s,0),qr(l,t,r,n,i,s,0);return}o=o.next}a=a.next}while(a!==e)}function nc(e,t,r,n){var i=[],s,a,o,l,h;for(s=0,a=t.length;s<a;s++)o=t[s]*n,l=s<a-1?t[s+1]*n:e.length,h=Qa(e,o,l,n,!1),h===h.next&&(h.steiner=!0),i.push(hc(h));for(i.sort(ic),s=0;s<i.length;s++)r=sc(i[s],r);return r}function ic(e,t){return e.x-t.x}function sc(e,t){var r=ac(e,t);if(!r)return t;var n=to(r,e);return ze(n,n.next),ze(r,r.next)}function ac(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,h=a.x,c=a.y,f=1/0,u;r=a;do n>=r.x&&r.x>=h&&n!==r.x&&cr(i<c?n:s,i,h,c,i<c?s:n,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(n-r.x),Hr(r,e)&&(u<f||u===f&&(r.x>a.x||r.x===a.x&&oc(a,r)))&&(a=r,f=u)),r=r.next;while(r!==l);return a}function oc(e,t){return Pt(e.prev,e,t.prev)<0&&Pt(t.next,e,e.next)<0}function lc(e,t,r,n){var i=e;do i.z===0&&(i.z=Hi(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,uc(i)}function uc(e){var t,r,n,i,s,a,o,l,h=1;do{for(r=e,e=null,s=null,a=0;r;){for(a++,n=r,o=0,t=0;t<h&&(o++,n=n.nextZ,!!n);t++);for(l=h;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,h*=2}while(a>1);return e}function Hi(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 hc(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 cr(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 cc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!fc(e,t)&&(Hr(e,t)&&Hr(t,e)&&dc(e,t)&&(Pt(e.prev,e,t.prev)||Pt(e,t.prev,t))||wn(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 wn(e,t){return e.x===t.x&&e.y===t.y}function Ja(e,t,r,n){var i=Tn(Pt(e,t,r)),s=Tn(Pt(e,t,n)),a=Tn(Pt(r,n,e)),o=Tn(Pt(r,n,t));return!!(i!==s&&a!==o||i===0&&En(e,r,t)||s===0&&En(e,n,t)||a===0&&En(r,e,n)||o===0&&En(r,t,n))}function En(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 Tn(e){return e>0?1:e<0?-1:0}function fc(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&&Ja(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Hr(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 dc(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 to(e,t){var r=new zi(e.i,e.x,e.y),n=new zi(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 eo(e,t,r,n){var i=new zi(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 zr(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 zi(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}xn.deviation=function(e,t,r,n){var i=t&&t.length,s=i?t[0]*r:e.length,a=Math.abs(Vi(e,0,s,r));if(i)for(var o=0,l=t.length;o<l;o++){var h=t[o]*r,c=o<l-1?t[o+1]*r:e.length;a-=Math.abs(Vi(e,h,c,r))}var f=0;for(o=0;o<n.length;o+=3){var u=n[o]*r,d=n[o+1]*r,p=n[o+2]*r;f+=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&&f===0?0:Math.abs((f-a)/a)};function Vi(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}xn.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 pc=qi.exports;const yc=or(pc);var An={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */An.exports,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof ke=="object"&&ke;(s.global===s||s.window===s||s.self===s)&&(r=s);var a,o=2147483647,l=36,h=1,c=26,f=38,u=700,d=72,p=128,v="-",g=/^xn--/,y=/[^\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"},m=l-h,x=Math.floor,S=String.fromCharCode,w;function E(k){throw new RangeError(_[k])}function N(k,I){for(var P=k.length,L=[];P--;)L[P]=I(k[P]);return L}function A(k,I){var P=k.split("@"),L="";P.length>1&&(L=P[0]+"@",k=P[1]),k=k.replace(b,".");var G=k.split("."),$=N(G,I).join(".");return L+$}function T(k){for(var I=[],P=0,L=k.length,G,$;P<L;)G=k.charCodeAt(P++),G>=55296&&G<=56319&&P<L?($=k.charCodeAt(P++),($&64512)==56320?I.push(((G&1023)<<10)+($&1023)+65536):(I.push(G),P--)):I.push(G);return I}function O(k){return N(k,function(I){var P="";return I>65535&&(I-=65536,P+=S(I>>>10&1023|55296),I=56320|I&1023),P+=S(I),P}).join("")}function R(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function C(k,I){return k+22+75*(k<26)-((I!=0)<<5)}function F(k,I,P){var L=0;for(k=P?x(k/u):k>>1,k+=x(k/I);k>m*c>>1;L+=l)k=x(k/m);return x(L+(m+1)*k/(k+f))}function U(k){var I=[],P=k.length,L,G=0,$=p,M=d,B,q,H,X,K,et,it,lt,ht;for(B=k.lastIndexOf(v),B<0&&(B=0),q=0;q<B;++q)k.charCodeAt(q)>=128&&E("not-basic"),I.push(k.charCodeAt(q));for(H=B>0?B+1:0;H<P;){for(X=G,K=1,et=l;H>=P&&E("invalid-input"),it=R(k.charCodeAt(H++)),(it>=l||it>x((o-G)/K))&&E("overflow"),G+=it*K,lt=et<=M?h:et>=M+c?c:et-M,!(it<lt);et+=l)ht=l-lt,K>x(o/ht)&&E("overflow"),K*=ht;L=I.length+1,M=F(G-X,L,X==0),x(G/L)>o-$&&E("overflow"),$+=x(G/L),G%=L,I.splice(G++,0,$)}return O(I)}function D(k){var I,P,L,G,$,M,B,q,H,X,K,et=[],it,lt,ht,Ct;for(k=T(k),it=k.length,I=p,P=0,$=d,M=0;M<it;++M)K=k[M],K<128&&et.push(S(K));for(L=G=et.length,G&&et.push(v);L<it;){for(B=o,M=0;M<it;++M)K=k[M],K>=I&&K<B&&(B=K);for(lt=L+1,B-I>x((o-P)/lt)&&E("overflow"),P+=(B-I)*lt,I=B,M=0;M<it;++M)if(K=k[M],K<I&&++P>o&&E("overflow"),K==I){for(q=P,H=l;X=H<=$?h:H>=$+c?c:H-$,!(q<X);H+=l)Ct=q-X,ht=l-X,et.push(S(C(X+Ct%ht,0))),q=x(Ct/ht);et.push(S(C(q,0))),$=F(P,lt,L==G),P=0,++L}++P,++I}return et.join("")}function z(k){return A(k,function(I){return g.test(I)?U(I.slice(4).toLowerCase()):I})}function j(k){return A(k,function(I){return y.test(I)?"xn--"+D(I):I})}if(a={version:"1.4.1",ucs2:{decode:T,encode:O},decode:U,encode:D,toASCII:j,toUnicode:z},n&&i)if(e.exports==n)i.exports=a;else for(w in a)a.hasOwnProperty(w)&&(n[w]=a[w]);else r.punycode=a})(ke)}(An,An.exports);var vc=An.exports,mc=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},ro=typeof Symbol<"u"&&Symbol,gc=mc,bc=function(){return typeof ro!="function"||typeof Symbol!="function"||typeof ro("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:gc()},no={foo:{}},_c=Object,xc=function(){return{__proto__:no}.foo===no.foo&&!({__proto__:null}instanceof _c)},wc="Function.prototype.bind called on incompatible ",Xi=Array.prototype.slice,Ec=Object.prototype.toString,Tc="[object Function]",Ac=function(t){var r=this;if(typeof r!="function"||Ec.call(r)!==Tc)throw new TypeError(wc+r);for(var n=Xi.call(arguments,1),i,s=function(){if(this instanceof i){var c=r.apply(this,n.concat(Xi.call(arguments)));return Object(c)===c?c:this}else return r.apply(t,n.concat(Xi.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 h=function(){};h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},Sc=Ac,Wi=Function.prototype.bind||Sc,Oc=Wi,Rc=Oc.call(Function.call,Object.prototype.hasOwnProperty),dt,fr=SyntaxError,io=Function,dr=TypeError,Yi=function(e){try{return io('"use strict"; return ('+e+").constructor;")()}catch{}},Ve=Object.getOwnPropertyDescriptor;if(Ve)try{Ve({},"")}catch{Ve=null}var Ki=function(){throw new dr},Ic=Ve?function(){try{return arguments.callee,Ki}catch{try{return Ve(arguments,"callee").get}catch{return Ki}}}():Ki,pr=bc(),Nc=xc(),jt=Object.getPrototypeOf||(Nc?function(e){return e.__proto__}:null),yr={},Cc=typeof Uint8Array>"u"||!jt?dt:jt(Uint8Array),Xe={"%AggregateError%":typeof AggregateError>"u"?dt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?dt:ArrayBuffer,"%ArrayIteratorPrototype%":pr&&jt?jt([][Symbol.iterator]()):dt,"%AsyncFromSyncIteratorPrototype%":dt,"%AsyncFunction%":yr,"%AsyncGenerator%":yr,"%AsyncGeneratorFunction%":yr,"%AsyncIteratorPrototype%":yr,"%Atomics%":typeof Atomics>"u"?dt:Atomics,"%BigInt%":typeof BigInt>"u"?dt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?dt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?dt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?dt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?dt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?dt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?dt:FinalizationRegistry,"%Function%":io,"%GeneratorFunction%":yr,"%Int8Array%":typeof Int8Array>"u"?dt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?dt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?dt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":pr&&jt?jt(jt([][Symbol.iterator]())):dt,"%JSON%":typeof JSON=="object"?JSON:dt,"%Map%":typeof Map>"u"?dt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!pr||!jt?dt:jt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?dt:Promise,"%Proxy%":typeof Proxy>"u"?dt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?dt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?dt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!pr||!jt?dt:jt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?dt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":pr&&jt?jt(""[Symbol.iterator]()):dt,"%Symbol%":pr?Symbol:dt,"%SyntaxError%":fr,"%ThrowTypeError%":Ic,"%TypedArray%":Cc,"%TypeError%":dr,"%Uint8Array%":typeof Uint8Array>"u"?dt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?dt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?dt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?dt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?dt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?dt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?dt:WeakSet};if(jt)try{null.error}catch(e){var kc=jt(jt(e));Xe["%Error.prototype%"]=kc}var Pc=function e(t){var r;if(t==="%AsyncFunction%")r=Yi("async function () {}");else if(t==="%GeneratorFunction%")r=Yi("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Yi("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&jt&&(r=jt(i.prototype))}return Xe[t]=r,r},so={"%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"]},Vr=Wi,Sn=Rc,Mc=Vr.call(Function.call,Array.prototype.concat),Lc=Vr.call(Function.apply,Array.prototype.splice),ao=Vr.call(Function.call,String.prototype.replace),On=Vr.call(Function.call,String.prototype.slice),Fc=Vr.call(Function.call,RegExp.prototype.exec),Bc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Dc=/\\(\\)?/g,Uc=function(t){var r=On(t,0,1),n=On(t,-1);if(r==="%"&&n!=="%")throw new fr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new fr("invalid intrinsic syntax, expected opening `%`");var i=[];return ao(t,Bc,function(s,a,o,l){i[i.length]=o?ao(l,Dc,"$1"):a||s}),i},jc=function(t,r){var n=t,i;if(Sn(so,n)&&(i=so[n],n="%"+i[0]+"%"),Sn(Xe,n)){var s=Xe[n];if(s===yr&&(s=Pc(n)),typeof s>"u"&&!r)throw new dr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new fr("intrinsic "+t+" does not exist!")},Zi=function(t,r){if(typeof t!="string"||t.length===0)throw new dr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new dr('"allowMissing" argument must be a boolean');if(Fc(/^%?[^%]*%?$/,t)===null)throw new fr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Uc(t),i=n.length>0?n[0]:"",s=jc("%"+i+"%",r),a=s.name,o=s.value,l=!1,h=s.alias;h&&(i=h[0],Lc(n,Mc([0,1],h)));for(var c=1,f=!0;c<n.length;c+=1){var u=n[c],d=On(u,0,1),p=On(u,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new fr("property names with quotes must have matching quotes");if((u==="constructor"||!f)&&(l=!0),i+="."+u,a="%"+i+"%",Sn(Xe,a))o=Xe[a];else if(o!=null){if(!(u in o)){if(!r)throw new dr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ve&&c+1>=n.length){var v=Ve(o,u);f=!!v,f&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[u]}else f=Sn(o,u),o=o[u];f&&!l&&(Xe[a]=o)}}return o},oo={exports:{}};(function(e){var t=Wi,r=Zi,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(f){var u=s(t,i,arguments);if(a&&o){var d=a(u,"length");d.configurable&&o(u,"length",{value:1+l(0,f.length-(arguments.length-1))})}return u};var h=function(){return s(t,n,arguments)};o?o(e.exports,"apply",{value:h}):e.exports.apply=h})(oo);var Gc=oo.exports,lo=Zi,uo=Gc,$c=uo(lo("String.prototype.indexOf")),qc=function(t,r){var n=lo(t,!!r);return typeof n=="function"&&$c(t,".prototype.")>-1?uo(n):n};const Hc=Hh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Qi=typeof Map=="function"&&Map.prototype,Ji=Object.getOwnPropertyDescriptor&&Qi?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Rn=Qi&&Ji&&typeof Ji.get=="function"?Ji.get:null,ho=Qi&&Map.prototype.forEach,ts=typeof Set=="function"&&Set.prototype,es=Object.getOwnPropertyDescriptor&&ts?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,In=ts&&es&&typeof es.get=="function"?es.get:null,co=ts&&Set.prototype.forEach,zc=typeof WeakMap=="function"&&WeakMap.prototype,Xr=zc?WeakMap.prototype.has:null,Vc=typeof WeakSet=="function"&&WeakSet.prototype,Wr=Vc?WeakSet.prototype.has:null,Xc=typeof WeakRef=="function"&&WeakRef.prototype,fo=Xc?WeakRef.prototype.deref:null,Wc=Boolean.prototype.valueOf,Yc=Object.prototype.toString,Kc=Function.prototype.toString,Zc=String.prototype.match,rs=String.prototype.slice,Le=String.prototype.replace,Qc=String.prototype.toUpperCase,po=String.prototype.toLowerCase,yo=RegExp.prototype.test,vo=Array.prototype.concat,me=Array.prototype.join,Jc=Array.prototype.slice,mo=Math.floor,ns=typeof BigInt=="function"?BigInt.prototype.valueOf:null,is=Object.getOwnPropertySymbols,ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,vr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===vr||"symbol")?Symbol.toStringTag:null,go=Object.prototype.propertyIsEnumerable,bo=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function _o(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||yo.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-mo(-e):mo(e);if(n!==e){var i=String(n),s=rs.call(t,i.length+1);return Le.call(i,r,"$&_")+"."+Le.call(Le.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Le.call(t,r,"$&_")}var as=Hc,xo=as.custom,wo=Ao(xo)?xo:null,tf=function e(t,r,n,i){var s=r||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(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=Fe(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(Fe(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(Fe(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 Oo(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return o?_o(t,l):l}if(typeof t=="bigint"){var h=String(t)+"n";return o?_o(t,h):h}var c=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof t=="object")return os(t)?"[Array]":"[Object]";var f=bf(s,n);if(typeof i>"u")i=[];else if(So(i,t)>=0)return"[Circular]";function u(R,C,F){if(C&&(i=Jc.call(i),i.push(C)),F){var U={depth:s.depth};return Fe(s,"quoteStyle")&&(U.quoteStyle=s.quoteStyle),e(R,U,n+1,i)}return e(R,s,n+1,i)}if(typeof t=="function"&&!To(t)){var d=hf(t),p=Nn(t,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+me.call(p,", ")+" }":"")}if(Ao(t)){var v=vr?Le.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ss.call(t);return typeof t=="object"&&!vr?Yr(v):v}if(vf(t)){for(var g="<"+po.call(String(t.nodeName)),y=t.attributes||[],b=0;b<y.length;b++)g+=" "+y[b].name+"="+Eo(ef(y[b].value),"double",s);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+po.call(String(t.nodeName))+">",g}if(os(t)){if(t.length===0)return"[]";var _=Nn(t,u);return f&&!gf(_)?"["+us(_,f)+"]":"[ "+me.call(_,", ")+" ]"}if(nf(t)){var m=Nn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!go.call(t,"cause")?"{ ["+String(t)+"] "+me.call(vo.call("[cause]: "+u(t.cause),m),", ")+" }":m.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+me.call(m,", ")+" }"}if(typeof t=="object"&&a){if(wo&&typeof t[wo]=="function"&&as)return as(t,{depth:c-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(cf(t)){var x=[];return ho&&ho.call(t,function(R,C){x.push(u(C,t,!0)+" => "+u(R,t))}),Ro("Map",Rn.call(t),x,f)}if(pf(t)){var S=[];return co&&co.call(t,function(R){S.push(u(R,t))}),Ro("Set",In.call(t),S,f)}if(ff(t))return ls("WeakMap");if(yf(t))return ls("WeakSet");if(df(t))return ls("WeakRef");if(af(t))return Yr(u(Number(t)));if(lf(t))return Yr(u(ns.call(t)));if(of(t))return Yr(Wc.call(t));if(sf(t))return Yr(u(String(t)));if(!rf(t)&&!To(t)){var w=Nn(t,u),E=bo?bo(t)===Object.prototype:t instanceof Object||t.constructor===Object,N=t instanceof Object?"":"null prototype",A=!E&&Vt&&Object(t)===t&&Vt in t?rs.call(Be(t),8,-1):N?"Object":"",T=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",O=T+(A||N?"["+me.call(vo.call([],A||[],N||[]),": ")+"] ":"");return w.length===0?O+"{}":f?O+"{"+us(w,f)+"}":O+"{ "+me.call(w,", ")+" }"}return String(t)};function Eo(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function ef(e){return Le.call(String(e),/"/g,"&quot;")}function os(e){return Be(e)==="[object Array]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function rf(e){return Be(e)==="[object Date]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function To(e){return Be(e)==="[object RegExp]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function nf(e){return Be(e)==="[object Error]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function sf(e){return Be(e)==="[object String]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function af(e){return Be(e)==="[object Number]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function of(e){return Be(e)==="[object Boolean]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Ao(e){if(vr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!ss)return!1;try{return ss.call(e),!0}catch{}return!1}function lf(e){if(!e||typeof e!="object"||!ns)return!1;try{return ns.call(e),!0}catch{}return!1}var uf=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,t){return uf.call(e,t)}function Be(e){return Yc.call(e)}function hf(e){if(e.name)return e.name;var t=Zc.call(Kc.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function So(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 cf(e){if(!Rn||!e||typeof e!="object")return!1;try{Rn.call(e);try{In.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function ff(e){if(!Xr||!e||typeof e!="object")return!1;try{Xr.call(e,Xr);try{Wr.call(e,Wr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function df(e){if(!fo||!e||typeof e!="object")return!1;try{return fo.call(e),!0}catch{}return!1}function pf(e){if(!In||!e||typeof e!="object")return!1;try{In.call(e);try{Rn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function yf(e){if(!Wr||!e||typeof e!="object")return!1;try{Wr.call(e,Wr);try{Xr.call(e,Xr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function vf(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Oo(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Oo(rs.call(e,0,t.maxStringLength),t)+n}var i=Le.call(Le.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,mf);return Eo(i,"single",t)}function mf(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":"")+Qc.call(t.toString(16))}function Yr(e){return"Object("+e+")"}function ls(e){return e+" { ? }"}function Ro(e,t,r,n){var i=n?us(r,n):me.call(r,", ");return e+" ("+t+") {"+i+"}"}function gf(e){for(var t=0;t<e.length;t++)if(So(e[t],`
10
- `)>=0)return!1;return!0}function bf(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=me.call(Array(e.indent+1)," ");else return null;return{base:r,prev:me.call(Array(t+1),r)}}function us(e,t){if(e.length===0)return"";var r=`
11
- `+t.prev+t.base;return r+me.call(e,","+r)+`
12
- `+t.prev}function Nn(e,t){var r=os(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Fe(e,i)?t(e[i],e):""}var s=typeof is=="function"?is(e):[],a;if(vr){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var l in e)Fe(e,l)&&(r&&String(Number(l))===l&&l<e.length||vr&&a["$"+l]instanceof Symbol||(yo.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof is=="function")for(var h=0;h<s.length;h++)go.call(e,s[h])&&n.push("["+t(s[h])+"]: "+t(e[s[h]],e));return n}var hs=Zi,mr=qc,_f=tf,xf=hs("%TypeError%"),Cn=hs("%WeakMap%",!0),kn=hs("%Map%",!0),wf=mr("WeakMap.prototype.get",!0),Ef=mr("WeakMap.prototype.set",!0),Tf=mr("WeakMap.prototype.has",!0),Af=mr("Map.prototype.get",!0),Sf=mr("Map.prototype.set",!0),Of=mr("Map.prototype.has",!0),cs=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},Rf=function(e,t){var r=cs(e,t);return r&&r.value},If=function(e,t,r){var n=cs(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},Nf=function(e,t){return!!cs(e,t)},Cf=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new xf("Side channel does not contain "+_f(s))},get:function(s){if(Cn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return wf(t,s)}else if(kn){if(r)return Af(r,s)}else if(n)return Rf(n,s)},has:function(s){if(Cn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Tf(t,s)}else if(kn){if(r)return Of(r,s)}else if(n)return Nf(n,s);return!1},set:function(s,a){Cn&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Cn),Ef(t,s,a)):kn?(r||(r=new kn),Sf(r,s,a)):(n||(n={key:{},next:null}),If(n,s,a))}};return i},kf=String.prototype.replace,Pf=/%20/g,fs={RFC1738:"RFC1738",RFC3986:"RFC3986"},ds={default:fs.RFC3986,formatters:{RFC1738:function(e){return kf.call(e,Pf,"+")},RFC3986:function(e){return String(e)}},RFC1738:fs.RFC1738,RFC3986:fs.RFC3986},Mf=ds,ps=Object.prototype.hasOwnProperty,We=Array.isArray,ge=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Lf=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(We(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},Io=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},Ff=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(We(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!ps.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 We(t)&&!We(r)&&(i=Io(t,n)),We(t)&&We(r)?(r.forEach(function(s,a){if(ps.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 ps.call(s,a)?s[a]=e(s[a],o,n):s[a]=o,s},i)},Bf=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},Df=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}},Uf=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 h=a.charCodeAt(l);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===Mf.RFC1738&&(h===40||h===41)){o+=a.charAt(l);continue}if(h<128){o=o+ge[h];continue}if(h<2048){o=o+(ge[192|h>>6]+ge[128|h&63]);continue}if(h<55296||h>=57344){o=o+(ge[224|h>>12]+ge[128|h>>6&63]+ge[128|h&63]);continue}l+=1,h=65536+((h&1023)<<10|a.charCodeAt(l)&1023),o+=ge[240|h>>18]+ge[128|h>>12&63]+ge[128|h>>6&63]+ge[128|h&63]}return o},jf=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 h=o[l],c=a[h];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:a,prop:h}),n.push(c))}return Lf(r),t},Gf=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},$f=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},qf=function(t,r){return[].concat(t,r)},Hf=function(t,r){if(We(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},No={arrayToObject:Io,assign:Bf,combine:qf,compact:jf,decode:Df,encode:Uf,isBuffer:$f,isRegExp:Gf,maybeMap:Hf,merge:Ff},Co=Cf,Pn=No,Kr=ds,zf=Object.prototype.hasOwnProperty,ko={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Te=Array.isArray,Vf=Array.prototype.push,Po=function(e,t){Vf.apply(e,Te(t)?t:[t])},Xf=Date.prototype.toISOString,Mo=Kr.default,Xt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Pn.encode,encodeValuesOnly:!1,format:Mo,formatter:Kr.formatters[Mo],indices:!1,serializeDate:function(t){return Xf.call(t)},skipNulls:!1,strictNullHandling:!1},Wf=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},ys={},Yf=function e(t,r,n,i,s,a,o,l,h,c,f,u,d,p,v,g){for(var y=t,b=g,_=0,m=!1;(b=b.get(ys))!==void 0&&!m;){var x=b.get(t);if(_+=1,typeof x<"u"){if(x===_)throw new RangeError("Cyclic object value");m=!0}typeof b.get(ys)>"u"&&(_=0)}if(typeof l=="function"?y=l(r,y):y instanceof Date?y=f(y):n==="comma"&&Te(y)&&(y=Pn.maybeMap(y,function(U){return U instanceof Date?f(U):U})),y===null){if(s)return o&&!p?o(r,Xt.encoder,v,"key",u):r;y=""}if(Wf(y)||Pn.isBuffer(y)){if(o){var S=p?r:o(r,Xt.encoder,v,"key",u);return[d(S)+"="+d(o(y,Xt.encoder,v,"value",u))]}return[d(r)+"="+d(String(y))]}var w=[];if(typeof y>"u")return w;var E;if(n==="comma"&&Te(y))p&&o&&(y=Pn.maybeMap(y,o)),E=[{value:y.length>0?y.join(",")||null:void 0}];else if(Te(l))E=l;else{var N=Object.keys(y);E=h?N.sort(h):N}for(var A=i&&Te(y)&&y.length===1?r+"[]":r,T=0;T<E.length;++T){var O=E[T],R=typeof O=="object"&&typeof O.value<"u"?O.value:y[O];if(!(a&&R===null)){var C=Te(y)?typeof n=="function"?n(A,O):A:A+(c?"."+O:"["+O+"]");g.set(t,_);var F=Co();F.set(ys,g),Po(w,e(R,C,n,i,s,a,n==="comma"&&p&&Te(y)?null:o,l,h,c,f,u,d,p,v,F))}}return w},Kf=function(t){if(!t)return Xt;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||Xt.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=Kr.default;if(typeof t.format<"u"){if(!zf.call(Kr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=Kr.formatters[n],s=Xt.filter;return(typeof t.filter=="function"||Te(t.filter))&&(s=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Xt.addQueryPrefix,allowDots:typeof t.allowDots>"u"?Xt.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Xt.charsetSentinel,delimiter:typeof t.delimiter>"u"?Xt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Xt.encode,encoder:typeof t.encoder=="function"?t.encoder:Xt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Xt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Xt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Xt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Xt.strictNullHandling}},Zf=function(e,t){var r=e,n=Kf(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 ko?o=t.arrayFormat:t&&"indices"in t?o=t.indices?"indices":"repeat":o="indices";var l=ko[o];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=l==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=Co(),f=0;f<i.length;++f){var u=i[f];n.skipNulls&&r[u]===null||Po(a,Yf(r[u],u,l,h,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:""},gr=No,vs=Object.prototype.hasOwnProperty,Qf=Array.isArray,Gt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:gr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Jf=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Lo=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},td="utf8=%26%2310003%3B",ed="utf8=%E2%9C%93",rd=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,h=r.charset;if(r.charsetSentinel)for(l=0;l<a.length;++l)a[l].indexOf("utf8=")===0&&(a[l]===ed?h="utf-8":a[l]===td&&(h="iso-8859-1"),o=l,l=a.length);for(l=0;l<a.length;++l)if(l!==o){var c=a[l],f=c.indexOf("]="),u=f===-1?c.indexOf("="):f+1,d,p;u===-1?(d=r.decoder(c,Gt.decoder,h,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(c.slice(0,u),Gt.decoder,h,"key"),p=gr.maybeMap(Lo(c.slice(u+1),r),function(v){return r.decoder(v,Gt.decoder,h,"value")})),p&&r.interpretNumericEntities&&h==="iso-8859-1"&&(p=Jf(p)),c.indexOf("[]=")>-1&&(p=Qf(p)?[p]:p),vs.call(n,d)?n[d]=gr.combine(n[d],p):n[d]=p}return n},nd=function(e,t,r,n){for(var i=n?t:Lo(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,h=parseInt(l,10);!r.parseArrays&&l===""?a={0:i}:!isNaN(h)&&o!==l&&String(h)===l&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[],a[h]=i):l!=="__proto__"&&(a[l]=i)}i=a}return i},id=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),h=l?s.slice(0,l.index):s,c=[];if(h){if(!n.plainObjects&&vs.call(Object.prototype,h)&&!n.allowPrototypes)return;c.push(h)}for(var f=0;n.depth>0&&(l=o.exec(s))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&vs.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),nd(c,r,n,i)}},sd=function(t){if(!t)return Gt;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"?Gt.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Gt.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Gt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Gt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Gt.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Gt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Gt.comma,decoder:typeof t.decoder=="function"?t.decoder:Gt.decoder,delimiter:typeof t.delimiter=="string"||gr.isRegExp(t.delimiter)?t.delimiter:Gt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Gt.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Gt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Gt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Gt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Gt.strictNullHandling}},ad=function(e,t){var r=sd(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?rd(e,r):e,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),a=0;a<s.length;++a){var o=s[a],l=id(o,n[o],r,typeof e=="string");i=gr.merge(i,l,r)}return r.allowSparse===!0?i:gr.compact(i)},od=Zf,ld=ad,ud=ds,hd={formats:ud,parse:ld,stringify:od},cd=vc;function ie(){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 fd=/^([a-z0-9.+-]+:)/i,dd=/:[0-9]*$/,pd=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,yd=["<",">",'"',"`"," ","\r",`
13
- `," "],vd=["{","}","|","\\","^","`"].concat(yd),ms=["'"].concat(vd),Fo=["%","/","?",";","#"].concat(ms),Bo=["/","?","#"],md=255,Do=/^[+a-z0-9A-Z_-]{0,63}$/,gd=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,bd={javascript:!0,"javascript:":!0},gs={javascript:!0,"javascript:":!0},br={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},bs=hd;function Mn(e,t,r){if(e&&typeof e=="object"&&e instanceof ie)return e;var n=new ie;return n.parse(e,t,r),n}ie.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=pd.exec(o);if(l)return this.path=o,this.href=o,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=bs.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=fd.exec(o);if(h){h=h[0];var c=h.toLowerCase();this.protocol=c,o=o.substr(h.length)}if(r||h||o.match(/^\/\/[^@/]+@[^@/]+/)){var f=o.substr(0,2)==="//";f&&!(h&&gs[h])&&(o=o.substr(2),this.slashes=!0)}if(!gs[h]&&(f||h&&!br[h])){for(var u=-1,d=0;d<Bo.length;d++){var p=o.indexOf(Bo[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<Fo.length;d++){var p=o.indexOf(Fo[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 y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y)for(var b=this.hostname.split(/\./),d=0,_=b.length;d<_;d++){var m=b[d];if(m&&!m.match(Do)){for(var x="",S=0,w=m.length;S<w;S++)m.charCodeAt(S)>127?x+="x":x+=m[S];if(!x.match(Do)){var E=b.slice(0,d),N=b.slice(d+1),A=m.match(gd);A&&(E.push(A[1]),N.unshift(A[2])),N.length&&(o="/"+N.join(".")+o),this.hostname=E.join(".");break}}}this.hostname.length>md?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=cd.toASCII(this.hostname));var T=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+T,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!bd[c])for(var d=0,_=ms.length;d<_;d++){var R=ms[d];if(o.indexOf(R)!==-1){var C=encodeURIComponent(R);C===R&&(C=escape(R)),o=o.split(R).join(C)}}var F=o.indexOf("#");F!==-1&&(this.hash=o.substr(F),o=o.slice(0,F));var U=o.indexOf("?");if(U!==-1?(this.search=o.substr(U),this.query=o.substr(U+1),t&&(this.query=bs.parse(this.query)),o=o.slice(0,U)):t&&(this.search="",this.query={}),o&&(this.pathname=o),br[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var T=this.pathname||"",D=this.search||"";this.path=T+D}return this.href=this.format(),this};function _d(e){return typeof e=="string"&&(e=Mn(e)),e instanceof ie?e.format():ie.prototype.format.call(e)}ie.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=bs.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||br[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 xd(e,t){return Mn(e,!1,!0).resolve(t)}ie.prototype.resolve=function(e){return this.resolveObject(Mn(e,!1,!0)).format()},ie.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new ie;t.parse(e,!1,!0),e=t}for(var r=new ie,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 br[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(!br[e.protocol]){for(var h=Object.keys(e),c=0;c<h.length;c++){var f=h[c];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!gs[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,y=g,b=r.pathname&&r.pathname.split("/")||[],_=e.pathname&&e.pathname.split("/")||[],m=r.protocol&&!br[r.protocol];if(m&&(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(m){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 S=b.slice(-1)[0],w=(r.host||e.host||b.length>1)&&(S==="."||S==="..")||S==="",E=0,N=b.length;N>=0;N--)S=b[N],S==="."?b.splice(N,1):S===".."?(b.splice(N,1),E++):E&&(b.splice(N,1),E--);if(!g&&!y)for(;E--;E)b.unshift("..");g&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),w&&b.join("/").substr(-1)!=="/"&&b.push("");var A=b[0]===""||b[0]&&b[0].charAt(0)==="/";if(m){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},ie.prototype.parseHost=function(){var e=this.host,t=dd.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 wd=Mn,Ed=xd,Td=_d;const Ad={parse:wd,format:Td,resolve:Ed},Uo={};function xt(e,t,r=3){if(Uo[t])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
9
+ */var pf=J,vf=Symbol.for("react.element"),yf=Symbol.for("react.fragment"),mf=Object.prototype.hasOwnProperty,gf=pf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bf={key:!0,ref:!0,__self:!0,__source:!0};function _a(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)mf.call(t,n)&&!bf.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:vf,type:e,key:s,ref:a,props:i,_owner:gf.current}}cn.Fragment=yf,cn.jsx=_a,cn.jsxs=_a,ba.exports=cn;var ct=ba.exports,je=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))(je||{}),xa=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(xa||{}),Ei=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(Ei||{}),lt=(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))(lt||{}),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||{}),ir=(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))(ir||{}),yt=(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))(yt||{}),Ti=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(Ti||{}),xe=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(xe||{}),Br=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(Br||{}),$e=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))($e||{}),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||{}),Ge=(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))(Ge||{}),wi=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(wi||{}),Qt=(e=>(e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp",e))(Qt||{}),Bt=(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))(Bt||{}),Ft=(e=>(e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH",e))(Ft||{}),ve=(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))(ve||{});const pt={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 Ai=/iPhone/i,Ea=/iPod/i,Ta=/iPad/i,wa=/\biOS-universal(?:.+)Mac\b/i,Si=/\bAndroid(?:.+)Mobile\b/i,Aa=/Android/i,sr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,hn=/Silk/i,Ee=/Windows Phone/i,Sa=/\bWindows(?:.+)ARM\b/i,Oa=/BlackBerry/i,Ia=/BB10/i,Na=/Opera Mini/i,Ra=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ca=/Mobile(?:.+)Firefox\b/i,Pa=function(e){return typeof e<"u"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream>"u"};function _f(e){return function(t){return t.test(e)}}function ka(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=_f(r),s={apple:{phone:i(Ai)&&!i(Ee),ipod:i(Ea),tablet:!i(Ai)&&(i(Ta)||Pa(t))&&!i(Ee),universal:i(wa),device:(i(Ai)||i(Ea)||i(Ta)||i(wa)||Pa(t))&&!i(Ee)},amazon:{phone:i(sr),tablet:!i(sr)&&i(hn),device:i(sr)||i(hn)},android:{phone:!i(Ee)&&i(sr)||!i(Ee)&&i(Si),tablet:!i(Ee)&&!i(sr)&&!i(Si)&&(i(hn)||i(Aa)),device:!i(Ee)&&(i(sr)||i(hn)||i(Si)||i(Aa))||i(/\bokhttp\b/i)},windows:{phone:i(Ee),tablet:i(Sa),device:i(Ee)||i(Sa)},other:{blackberry:i(Oa),blackberry10:i(Ia),opera:i(Na),firefox:i(Ca),chrome:i(Ra),device:i(Oa)||i(Ia)||i(Na)||i(Ca)||i(Ra)},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 ar=(ka.default??ka)(globalThis.navigator);pt.RETINA_PREFIX=/@([0-9\.]+)x/,pt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ma={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 m=r?r+f:f;if(!this._events[m])return!1;var b=this._events[m],v=arguments.length,g,_;if(b.fn){switch(b.once&&this.removeListener(f,b.fn,void 0,!0),v){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,c),!0;case 3:return b.fn.call(b.context,c,h),!0;case 4:return b.fn.call(b.context,c,h,u),!0;case 5:return b.fn.call(b.context,c,h,u,d),!0;case 6:return b.fn.call(b.context,c,h,u,d,p),!0}for(_=1,g=new Array(v-1);_<v;_++)g[_-1]=arguments[_];b.fn.apply(b.context,g)}else{var y=b.length,x;for(_=0;_<y;_++)switch(b[_].once&&this.removeListener(f,b[_].fn,void 0,!0),v){case 1:b[_].fn.call(b[_].context);break;case 2:b[_].fn.call(b[_].context,c);break;case 3:b[_].fn.call(b[_].context,c,h);break;case 4:b[_].fn.call(b[_].context,c,h,u);break;default:if(!g)for(x=1,g=new Array(v-1);x<v;x++)g[x-1]=arguments[x];b[_].fn.apply(b[_].context,g)}}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 m=0,b=[],v=p.length;m<v;m++)(p[m].fn!==c||u&&!p[m].once||h&&p[m].context!==h)&&b.push(p[m]);b.length?this._events[d]=b.length===1?b[0]:b: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})(Ma);var xf=Ma.exports;const dn=nr(xf);var Oi={exports:{}};Oi.exports=pn,Oi.exports.default=pn;function pn(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,s=La(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=Sf(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 Ur(s,a,r,o,l,d,0),a}function La(e,t,r,n,i){var s,a;if(i===Ri(e,t,r,n)>0)for(s=t;s<r;s+=n)a=Ua(s,e[s],e[s+1],a);else for(s=r-n;s>=t;s-=n)a=Ua(s,e[s],e[s+1],a);return a&&vn(a,a.next)&&(jr(a),a=a.next),a}function qe(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(vn(r,r.next)||Ct(r.prev,r,r.next)===0)){if(jr(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function Ur(e,t,r,n,i,s,a){if(e){!a&&s&&Cf(e,n,i,s);for(var o=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,s?Tf(e,n,i,s):Ef(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),jr(e),e=f.next,o=f.next;continue}if(e=f,e===o){a?a===1?(e=wf(qe(e),t,r),Ur(e,t,r,n,i,s,2)):a===2&&Af(e,t,r,n,i,s):Ur(qe(e),t,r,n,i,s,1);break}}}}function Ef(e){var t=e.prev,r=e,n=e.next;if(Ct(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&&or(i,o,s,l,a,f,p.x,p.y)&&Ct(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Tf(e,t,r,n){var i=e.prev,s=e,a=e.next;if(Ct(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,m=o>l?o>f?o:f:l>f?l:f,b=c>h?c>u?c:u:h>u?h:u,v=Ii(d,p,t,r,n),g=Ii(m,b,t,r,n),_=e.prevZ,y=e.nextZ;_&&_.z>=v&&y&&y.z<=g;){if(_.x>=d&&_.x<=m&&_.y>=p&&_.y<=b&&_!==i&&_!==a&&or(o,c,l,h,f,u,_.x,_.y)&&Ct(_.prev,_,_.next)>=0||(_=_.prevZ,y.x>=d&&y.x<=m&&y.y>=p&&y.y<=b&&y!==i&&y!==a&&or(o,c,l,h,f,u,y.x,y.y)&&Ct(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;_&&_.z>=v;){if(_.x>=d&&_.x<=m&&_.y>=p&&_.y<=b&&_!==i&&_!==a&&or(o,c,l,h,f,u,_.x,_.y)&&Ct(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=g;){if(y.x>=d&&y.x<=m&&y.y>=p&&y.y<=b&&y!==i&&y!==a&&or(o,c,l,h,f,u,y.x,y.y)&&Ct(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function wf(e,t,r){var n=e;do{var i=n.prev,s=n.next.next;!vn(i,s)&&Fa(i,n,n.next,s)&&Dr(i,s)&&Dr(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),jr(n),jr(n.next),n=e=s),n=n.next}while(n!==e);return qe(n)}function Af(e,t,r,n,i,s){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&Mf(a,o)){var l=Ba(a,o);a=qe(a,a.next),l=qe(l,l.next),Ur(a,t,r,n,i,s,0),Ur(l,t,r,n,i,s,0);return}o=o.next}a=a.next}while(a!==e)}function Sf(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=La(e,o,l,n,!1),f===f.next&&(f.steiner=!0),i.push(kf(f));for(i.sort(Of),s=0;s<i.length;s++)r=If(i[s],r);return r}function Of(e,t){return e.x-t.x}function If(e,t){var r=Nf(e,t);if(!r)return t;var n=Ba(r,e);return qe(n,n.next),qe(r,r.next)}function Nf(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&&or(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),Dr(r,e)&&(u<h||u===h&&(r.x>a.x||r.x===a.x&&Rf(a,r)))&&(a=r,h=u)),r=r.next;while(r!==l);return a}function Rf(e,t){return Ct(e.prev,e,t.prev)<0&&Ct(t.next,e,e.next)<0}function Cf(e,t,r,n){var i=e;do i.z===0&&(i.z=Ii(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,Pf(i)}function Pf(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 Ii(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 kf(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 or(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 Mf(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Lf(e,t)&&(Dr(e,t)&&Dr(t,e)&&Ff(e,t)&&(Ct(e.prev,e,t.prev)||Ct(e,t.prev,t))||vn(e,t)&&Ct(e.prev,e,e.next)>0&&Ct(t.prev,t,t.next)>0)}function Ct(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function vn(e,t){return e.x===t.x&&e.y===t.y}function Fa(e,t,r,n){var i=mn(Ct(e,t,r)),s=mn(Ct(e,t,n)),a=mn(Ct(r,n,e)),o=mn(Ct(r,n,t));return!!(i!==s&&a!==o||i===0&&yn(e,r,t)||s===0&&yn(e,n,t)||a===0&&yn(r,e,n)||o===0&&yn(r,t,n))}function yn(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 mn(e){return e>0?1:e<0?-1:0}function Lf(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&&Fa(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Dr(e,t){return Ct(e.prev,e,e.next)<0?Ct(e,t,e.next)>=0&&Ct(e,e.prev,t)>=0:Ct(e,t,e.prev)<0||Ct(e,e.next,t)<0}function Ff(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 Ba(e,t){var r=new Ni(e.i,e.x,e.y),n=new Ni(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 Ua(e,t,r,n){var i=new Ni(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 jr(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 Ni(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}pn.deviation=function(e,t,r,n){var i=t&&t.length,s=i?t[0]*r:e.length,a=Math.abs(Ri(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(Ri(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 Ri(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}pn.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 Bf=Oi.exports;const Uf=nr(Bf);var gn={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */gn.exports,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof Re=="object"&&Re;(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,m="-",b=/^xn--/,v=/[^\x20-\x7E]/,g=/[\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,E;function T(P){throw new RangeError(_[P])}function R(P,N){for(var k=P.length,L=[];k--;)L[k]=N(P[k]);return L}function A(P,N){var k=P.split("@"),L="";k.length>1&&(L=k[0]+"@",P=k[1]),P=P.replace(g,".");var $=P.split("."),G=R($,N).join(".");return L+G}function w(P){for(var N=[],k=0,L=P.length,$,G;k<L;)$=P.charCodeAt(k++),$>=55296&&$<=56319&&k<L?(G=P.charCodeAt(k++),(G&64512)==56320?N.push((($&1023)<<10)+(G&1023)+65536):(N.push($),k--)):N.push($);return N}function S(P){return R(P,function(N){var k="";return N>65535&&(N-=65536,k+=O(N>>>10&1023|55296),N=56320|N&1023),k+=O(N),k}).join("")}function I(P){return P-48<10?P-22:P-65<26?P-65:P-97<26?P-97:l}function C(P,N){return P+22+75*(P<26)-((N!=0)<<5)}function F(P,N,k){var L=0;for(P=k?x(P/u):P>>1,P+=x(P/N);P>y*c>>1;L+=l)P=x(P/y);return x(L+(y+1)*P/(P+h))}function D(P){var N=[],k=P.length,L,$=0,G=p,M=d,B,q,H,X,K,et,nt,ot,ut;for(B=P.lastIndexOf(m),B<0&&(B=0),q=0;q<B;++q)P.charCodeAt(q)>=128&&T("not-basic"),N.push(P.charCodeAt(q));for(H=B>0?B+1:0;H<k;){for(X=$,K=1,et=l;H>=k&&T("invalid-input"),nt=I(P.charCodeAt(H++)),(nt>=l||nt>x((o-$)/K))&&T("overflow"),$+=nt*K,ot=et<=M?f:et>=M+c?c:et-M,!(nt<ot);et+=l)ut=l-ot,K>x(o/ut)&&T("overflow"),K*=ut;L=N.length+1,M=F($-X,L,X==0),x($/L)>o-G&&T("overflow"),G+=x($/L),$%=L,N.splice($++,0,G)}return S(N)}function U(P){var N,k,L,$,G,M,B,q,H,X,K,et=[],nt,ot,ut,Nt;for(P=w(P),nt=P.length,N=p,k=0,G=d,M=0;M<nt;++M)K=P[M],K<128&&et.push(O(K));for(L=$=et.length,$&&et.push(m);L<nt;){for(B=o,M=0;M<nt;++M)K=P[M],K>=N&&K<B&&(B=K);for(ot=L+1,B-N>x((o-k)/ot)&&T("overflow"),k+=(B-N)*ot,N=B,M=0;M<nt;++M)if(K=P[M],K<N&&++k>o&&T("overflow"),K==N){for(q=k,H=l;X=H<=G?f:H>=G+c?c:H-G,!(q<X);H+=l)Nt=q-X,ut=l-X,et.push(O(C(X+Nt%ut,0))),q=x(Nt/ut);et.push(O(C(q,0))),G=F(k,ot,L==$),k=0,++L}++k,++N}return et.join("")}function V(P){return A(P,function(N){return b.test(N)?D(N.slice(4).toLowerCase()):N})}function j(P){return A(P,function(N){return v.test(N)?"xn--"+U(N):N})}if(a={version:"1.4.1",ucs2:{decode:w,encode:S},decode:D,encode:U,toASCII:j,toUnicode:V},n&&i)if(e.exports==n)i.exports=a;else for(E in a)a.hasOwnProperty(E)&&(n[E]=a[E]);else r.punycode=a})(Re)}(gn,gn.exports);var Df=gn.exports,jf=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},Da=typeof Symbol<"u"&&Symbol,$f=jf,Gf=function(){return typeof Da!="function"||typeof Symbol!="function"||typeof Da("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:$f()},ja={foo:{}},qf=Object,Hf=function(){return{__proto__:ja}.foo===ja.foo&&!({__proto__:null}instanceof qf)},Vf="Function.prototype.bind called on incompatible ",Ci=Array.prototype.slice,zf=Object.prototype.toString,Xf="[object Function]",Wf=function(t){var r=this;if(typeof r!="function"||zf.call(r)!==Xf)throw new TypeError(Vf+r);for(var n=Ci.call(arguments,1),i,s=function(){if(this instanceof i){var c=r.apply(this,n.concat(Ci.call(arguments)));return Object(c)===c?c:this}else return r.apply(t,n.concat(Ci.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},Yf=Wf,Pi=Function.prototype.bind||Yf,Kf=Pi,Zf=Kf.call(Function.call,Object.prototype.hasOwnProperty),ht,lr=SyntaxError,$a=Function,ur=TypeError,ki=function(e){try{return $a('"use strict"; return ('+e+").constructor;")()}catch{}},He=Object.getOwnPropertyDescriptor;if(He)try{He({},"")}catch{He=null}var Mi=function(){throw new ur},Qf=He?function(){try{return arguments.callee,Mi}catch{try{return He(arguments,"callee").get}catch{return Mi}}}():Mi,fr=Gf(),Jf=Hf(),Ut=Object.getPrototypeOf||(Jf?function(e){return e.__proto__}:null),cr={},tc=typeof Uint8Array>"u"||!Ut?ht:Ut(Uint8Array),Ve={"%AggregateError%":typeof AggregateError>"u"?ht:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ht:ArrayBuffer,"%ArrayIteratorPrototype%":fr&&Ut?Ut([][Symbol.iterator]()):ht,"%AsyncFromSyncIteratorPrototype%":ht,"%AsyncFunction%":cr,"%AsyncGenerator%":cr,"%AsyncGeneratorFunction%":cr,"%AsyncIteratorPrototype%":cr,"%Atomics%":typeof Atomics>"u"?ht:Atomics,"%BigInt%":typeof BigInt>"u"?ht:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ht:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ht:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ht:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ht:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ht:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ht:FinalizationRegistry,"%Function%":$a,"%GeneratorFunction%":cr,"%Int8Array%":typeof Int8Array>"u"?ht:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ht:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ht:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":fr&&Ut?Ut(Ut([][Symbol.iterator]())):ht,"%JSON%":typeof JSON=="object"?JSON:ht,"%Map%":typeof Map>"u"?ht:Map,"%MapIteratorPrototype%":typeof Map>"u"||!fr||!Ut?ht:Ut(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ht:Promise,"%Proxy%":typeof Proxy>"u"?ht:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ht:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ht:Set,"%SetIteratorPrototype%":typeof Set>"u"||!fr||!Ut?ht:Ut(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ht:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":fr&&Ut?Ut(""[Symbol.iterator]()):ht,"%Symbol%":fr?Symbol:ht,"%SyntaxError%":lr,"%ThrowTypeError%":Qf,"%TypedArray%":tc,"%TypeError%":ur,"%Uint8Array%":typeof Uint8Array>"u"?ht:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ht:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ht:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ht:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ht:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ht:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ht:WeakSet};if(Ut)try{null.error}catch(e){var ec=Ut(Ut(e));Ve["%Error.prototype%"]=ec}var rc=function e(t){var r;if(t==="%AsyncFunction%")r=ki("async function () {}");else if(t==="%GeneratorFunction%")r=ki("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ki("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Ut&&(r=Ut(i.prototype))}return Ve[t]=r,r},Ga={"%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"]},$r=Pi,bn=Zf,nc=$r.call(Function.call,Array.prototype.concat),ic=$r.call(Function.apply,Array.prototype.splice),qa=$r.call(Function.call,String.prototype.replace),_n=$r.call(Function.call,String.prototype.slice),sc=$r.call(Function.call,RegExp.prototype.exec),ac=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,oc=/\\(\\)?/g,lc=function(t){var r=_n(t,0,1),n=_n(t,-1);if(r==="%"&&n!=="%")throw new lr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new lr("invalid intrinsic syntax, expected opening `%`");var i=[];return qa(t,ac,function(s,a,o,l){i[i.length]=o?qa(l,oc,"$1"):a||s}),i},uc=function(t,r){var n=t,i;if(bn(Ga,n)&&(i=Ga[n],n="%"+i[0]+"%"),bn(Ve,n)){var s=Ve[n];if(s===cr&&(s=rc(n)),typeof s>"u"&&!r)throw new ur("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new lr("intrinsic "+t+" does not exist!")},Li=function(t,r){if(typeof t!="string"||t.length===0)throw new ur("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ur('"allowMissing" argument must be a boolean');if(sc(/^%?[^%]*%?$/,t)===null)throw new lr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=lc(t),i=n.length>0?n[0]:"",s=uc("%"+i+"%",r),a=s.name,o=s.value,l=!1,f=s.alias;f&&(i=f[0],ic(n,nc([0,1],f)));for(var c=1,h=!0;c<n.length;c+=1){var u=n[c],d=_n(u,0,1),p=_n(u,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new lr("property names with quotes must have matching quotes");if((u==="constructor"||!h)&&(l=!0),i+="."+u,a="%"+i+"%",bn(Ve,a))o=Ve[a];else if(o!=null){if(!(u in o)){if(!r)throw new ur("base intrinsic for "+t+" exists, but the property is not available.");return}if(He&&c+1>=n.length){var m=He(o,u);h=!!m,h&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[u]}else h=bn(o,u),o=o[u];h&&!l&&(Ve[a]=o)}}return o},Ha={exports:{}};(function(e){var t=Pi,r=Li,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})(Ha);var fc=Ha.exports,Va=Li,za=fc,cc=za(Va("String.prototype.indexOf")),hc=function(t,r){var n=Va(t,!!r);return typeof n=="function"&&cc(t,".prototype.")>-1?za(n):n};const dc=df(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Fi=typeof Map=="function"&&Map.prototype,Bi=Object.getOwnPropertyDescriptor&&Fi?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,xn=Fi&&Bi&&typeof Bi.get=="function"?Bi.get:null,Xa=Fi&&Map.prototype.forEach,Ui=typeof Set=="function"&&Set.prototype,Di=Object.getOwnPropertyDescriptor&&Ui?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,En=Ui&&Di&&typeof Di.get=="function"?Di.get:null,Wa=Ui&&Set.prototype.forEach,pc=typeof WeakMap=="function"&&WeakMap.prototype,Gr=pc?WeakMap.prototype.has:null,vc=typeof WeakSet=="function"&&WeakSet.prototype,qr=vc?WeakSet.prototype.has:null,yc=typeof WeakRef=="function"&&WeakRef.prototype,Ya=yc?WeakRef.prototype.deref:null,mc=Boolean.prototype.valueOf,gc=Object.prototype.toString,bc=Function.prototype.toString,_c=String.prototype.match,ji=String.prototype.slice,ke=String.prototype.replace,xc=String.prototype.toUpperCase,Ka=String.prototype.toLowerCase,Za=RegExp.prototype.test,Qa=Array.prototype.concat,ye=Array.prototype.join,Ec=Array.prototype.slice,Ja=Math.floor,$i=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Gi=Object.getOwnPropertySymbols,qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hr||"symbol")?Symbol.toStringTag:null,to=Object.prototype.propertyIsEnumerable,eo=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function ro(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Za.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-Ja(-e):Ja(e);if(n!==e){var i=String(n),s=ji.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 Hi=dc,no=Hi.custom,io=oo(no)?no:null,Tc=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 uo(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return o?ro(t,l):l}if(typeof t=="bigint"){var f=String(t)+"n";return o?ro(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 Vi(t)?"[Array]":"[Object]";var h=$c(s,n);if(typeof i>"u")i=[];else if(lo(i,t)>=0)return"[Circular]";function u(I,C,F){if(C&&(i=Ec.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"&&!ao(t)){var d=Pc(t),p=Tn(t,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+ye.call(p,", ")+" }":"")}if(oo(t)){var m=hr?ke.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):qi.call(t);return typeof t=="object"&&!hr?Hr(m):m}if(Uc(t)){for(var b="<"+Ka.call(String(t.nodeName)),v=t.attributes||[],g=0;g<v.length;g++)b+=" "+v[g].name+"="+so(wc(v[g].value),"double",s);return b+=">",t.childNodes&&t.childNodes.length&&(b+="..."),b+="</"+Ka.call(String(t.nodeName))+">",b}if(Vi(t)){if(t.length===0)return"[]";var _=Tn(t,u);return h&&!jc(_)?"["+Xi(_,h)+"]":"[ "+ye.call(_,", ")+" ]"}if(Sc(t)){var y=Tn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!to.call(t,"cause")?"{ ["+String(t)+"] "+ye.call(Qa.call("[cause]: "+u(t.cause),y),", ")+" }":y.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ye.call(y,", ")+" }"}if(typeof t=="object"&&a){if(io&&typeof t[io]=="function"&&Hi)return Hi(t,{depth:c-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(kc(t)){var x=[];return Xa&&Xa.call(t,function(I,C){x.push(u(C,t,!0)+" => "+u(I,t))}),fo("Map",xn.call(t),x,h)}if(Fc(t)){var O=[];return Wa&&Wa.call(t,function(I){O.push(u(I,t))}),fo("Set",En.call(t),O,h)}if(Mc(t))return zi("WeakMap");if(Bc(t))return zi("WeakSet");if(Lc(t))return zi("WeakRef");if(Ic(t))return Hr(u(Number(t)));if(Rc(t))return Hr(u($i.call(t)));if(Nc(t))return Hr(mc.call(t));if(Oc(t))return Hr(u(String(t)));if(!Ac(t)&&!ao(t)){var E=Tn(t,u),T=eo?eo(t)===Object.prototype:t instanceof Object||t.constructor===Object,R=t instanceof Object?"":"null prototype",A=!T&&Vt&&Object(t)===t&&Vt in t?ji.call(Le(t),8,-1):R?"Object":"",w=T||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",S=w+(A||R?"["+ye.call(Qa.call([],A||[],R||[]),": ")+"] ":"");return E.length===0?S+"{}":h?S+"{"+Xi(E,h)+"}":S+"{ "+ye.call(E,", ")+" }"}return String(t)};function so(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function wc(e){return ke.call(String(e),/"/g,"&quot;")}function Vi(e){return Le(e)==="[object Array]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Ac(e){return Le(e)==="[object Date]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function ao(e){return Le(e)==="[object RegExp]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Sc(e){return Le(e)==="[object Error]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Oc(e){return Le(e)==="[object String]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Ic(e){return Le(e)==="[object Number]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Nc(e){return Le(e)==="[object Boolean]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function oo(e){if(hr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!qi)return!1;try{return qi.call(e),!0}catch{}return!1}function Rc(e){if(!e||typeof e!="object"||!$i)return!1;try{return $i.call(e),!0}catch{}return!1}var Cc=Object.prototype.hasOwnProperty||function(e){return e in this};function Me(e,t){return Cc.call(e,t)}function Le(e){return gc.call(e)}function Pc(e){if(e.name)return e.name;var t=_c.call(bc.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function lo(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 kc(e){if(!xn||!e||typeof e!="object")return!1;try{xn.call(e);try{En.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Mc(e){if(!Gr||!e||typeof e!="object")return!1;try{Gr.call(e,Gr);try{qr.call(e,qr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Lc(e){if(!Ya||!e||typeof e!="object")return!1;try{return Ya.call(e),!0}catch{}return!1}function Fc(e){if(!En||!e||typeof e!="object")return!1;try{En.call(e);try{xn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function Bc(e){if(!qr||!e||typeof e!="object")return!1;try{qr.call(e,qr);try{Gr.call(e,Gr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Uc(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function uo(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return uo(ji.call(e,0,t.maxStringLength),t)+n}var i=ke.call(ke.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Dc);return so(i,"single",t)}function Dc(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":"")+xc.call(t.toString(16))}function Hr(e){return"Object("+e+")"}function zi(e){return e+" { ? }"}function fo(e,t,r,n){var i=n?Xi(r,n):ye.call(r,", ");return e+" ("+t+") {"+i+"}"}function jc(e){for(var t=0;t<e.length;t++)if(lo(e[t],`
10
+ `)>=0)return!1;return!0}function $c(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=ye.call(Array(e.indent+1)," ");else return null;return{base:r,prev:ye.call(Array(t+1),r)}}function Xi(e,t){if(e.length===0)return"";var r=`
11
+ `+t.prev+t.base;return r+ye.call(e,","+r)+`
12
+ `+t.prev}function Tn(e,t){var r=Vi(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 Gi=="function"?Gi(e):[],a;if(hr){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||hr&&a["$"+l]instanceof Symbol||(Za.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof Gi=="function")for(var f=0;f<s.length;f++)to.call(e,s[f])&&n.push("["+t(s[f])+"]: "+t(e[s[f]],e));return n}var Wi=Li,dr=hc,Gc=Tc,qc=Wi("%TypeError%"),wn=Wi("%WeakMap%",!0),An=Wi("%Map%",!0),Hc=dr("WeakMap.prototype.get",!0),Vc=dr("WeakMap.prototype.set",!0),zc=dr("WeakMap.prototype.has",!0),Xc=dr("Map.prototype.get",!0),Wc=dr("Map.prototype.set",!0),Yc=dr("Map.prototype.has",!0),Yi=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},Kc=function(e,t){var r=Yi(e,t);return r&&r.value},Zc=function(e,t,r){var n=Yi(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},Qc=function(e,t){return!!Yi(e,t)},Jc=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new qc("Side channel does not contain "+Gc(s))},get:function(s){if(wn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Hc(t,s)}else if(An){if(r)return Xc(r,s)}else if(n)return Kc(n,s)},has:function(s){if(wn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return zc(t,s)}else if(An){if(r)return Yc(r,s)}else if(n)return Qc(n,s);return!1},set:function(s,a){wn&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new wn),Vc(t,s,a)):An?(r||(r=new An),Wc(r,s,a)):(n||(n={key:{},next:null}),Zc(n,s,a))}};return i},th=String.prototype.replace,eh=/%20/g,Ki={RFC1738:"RFC1738",RFC3986:"RFC3986"},Zi={default:Ki.RFC3986,formatters:{RFC1738:function(e){return th.call(e,eh,"+")},RFC3986:function(e){return String(e)}},RFC1738:Ki.RFC1738,RFC3986:Ki.RFC3986},rh=Zi,Qi=Object.prototype.hasOwnProperty,ze=Array.isArray,me=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),nh=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(ze(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},co=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},ih=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(ze(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Qi.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 ze(t)&&!ze(r)&&(i=co(t,n)),ze(t)&&ze(r)?(r.forEach(function(s,a){if(Qi.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 Qi.call(s,a)?s[a]=e(s[a],o,n):s[a]=o,s},i)},sh=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},ah=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}},oh=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===rh.RFC1738&&(f===40||f===41)){o+=a.charAt(l);continue}if(f<128){o=o+me[f];continue}if(f<2048){o=o+(me[192|f>>6]+me[128|f&63]);continue}if(f<55296||f>=57344){o=o+(me[224|f>>12]+me[128|f>>6&63]+me[128|f&63]);continue}l+=1,f=65536+((f&1023)<<10|a.charCodeAt(l)&1023),o+=me[240|f>>18]+me[128|f>>12&63]+me[128|f>>6&63]+me[128|f&63]}return o},lh=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 nh(r),t},uh=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},fh=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},ch=function(t,r){return[].concat(t,r)},hh=function(t,r){if(ze(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},ho={arrayToObject:co,assign:sh,combine:ch,compact:lh,decode:ah,encode:oh,isBuffer:fh,isRegExp:uh,maybeMap:hh,merge:ih},po=Jc,Sn=ho,Vr=Zi,dh=Object.prototype.hasOwnProperty,vo={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Te=Array.isArray,ph=Array.prototype.push,yo=function(e,t){ph.apply(e,Te(t)?t:[t])},vh=Date.prototype.toISOString,mo=Vr.default,zt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sn.encode,encodeValuesOnly:!1,format:mo,formatter:Vr.formatters[mo],indices:!1,serializeDate:function(t){return vh.call(t)},skipNulls:!1,strictNullHandling:!1},yh=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Ji={},mh=function e(t,r,n,i,s,a,o,l,f,c,h,u,d,p,m,b){for(var v=t,g=b,_=0,y=!1;(g=g.get(Ji))!==void 0&&!y;){var x=g.get(t);if(_+=1,typeof x<"u"){if(x===_)throw new RangeError("Cyclic object value");y=!0}typeof g.get(Ji)>"u"&&(_=0)}if(typeof l=="function"?v=l(r,v):v instanceof Date?v=h(v):n==="comma"&&Te(v)&&(v=Sn.maybeMap(v,function(D){return D instanceof Date?h(D):D})),v===null){if(s)return o&&!p?o(r,zt.encoder,m,"key",u):r;v=""}if(yh(v)||Sn.isBuffer(v)){if(o){var O=p?r:o(r,zt.encoder,m,"key",u);return[d(O)+"="+d(o(v,zt.encoder,m,"value",u))]}return[d(r)+"="+d(String(v))]}var E=[];if(typeof v>"u")return E;var T;if(n==="comma"&&Te(v))p&&o&&(v=Sn.maybeMap(v,o)),T=[{value:v.length>0?v.join(",")||null:void 0}];else if(Te(l))T=l;else{var R=Object.keys(v);T=f?R.sort(f):R}for(var A=i&&Te(v)&&v.length===1?r+"[]":r,w=0;w<T.length;++w){var S=T[w],I=typeof S=="object"&&typeof S.value<"u"?S.value:v[S];if(!(a&&I===null)){var C=Te(v)?typeof n=="function"?n(A,S):A:A+(c?"."+S:"["+S+"]");b.set(t,_);var F=po();F.set(Ji,b),yo(E,e(I,C,n,i,s,a,n==="comma"&&p&&Te(v)?null:o,l,f,c,h,u,d,p,m,F))}}return E},gh=function(t){if(!t)return zt;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||zt.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=Vr.default;if(typeof t.format<"u"){if(!dh.call(Vr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=Vr.formatters[n],s=zt.filter;return(typeof t.filter=="function"||Te(t.filter))&&(s=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:zt.addQueryPrefix,allowDots:typeof t.allowDots>"u"?zt.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:zt.charsetSentinel,delimiter:typeof t.delimiter>"u"?zt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:zt.encode,encoder:typeof t.encoder=="function"?t.encoder:zt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:zt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:zt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:zt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:zt.strictNullHandling}},bh=function(e,t){var r=e,n=gh(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 vo?o=t.arrayFormat:t&&"indices"in t?o=t.indices?"indices":"repeat":o="indices";var l=vo[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=po(),h=0;h<i.length;++h){var u=i[h];n.skipNulls&&r[u]===null||yo(a,mh(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:""},pr=ho,ts=Object.prototype.hasOwnProperty,_h=Array.isArray,Dt={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},xh=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},go=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Eh="utf8=%26%2310003%3B",Th="utf8=%E2%9C%93",wh=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]===Th?f="utf-8":a[l]===Eh&&(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,Dt.decoder,f,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(c.slice(0,u),Dt.decoder,f,"key"),p=pr.maybeMap(go(c.slice(u+1),r),function(m){return r.decoder(m,Dt.decoder,f,"value")})),p&&r.interpretNumericEntities&&f==="iso-8859-1"&&(p=xh(p)),c.indexOf("[]=")>-1&&(p=_h(p)?[p]:p),ts.call(n,d)?n[d]=pr.combine(n[d],p):n[d]=p}return n},Ah=function(e,t,r,n){for(var i=n?t:go(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},Sh=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&&ts.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&&ts.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),Ah(c,r,n,i)}},Oh=function(t){if(!t)return Dt;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"?Dt.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Dt.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Dt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Dt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Dt.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Dt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Dt.comma,decoder:typeof t.decoder=="function"?t.decoder:Dt.decoder,delimiter:typeof t.delimiter=="string"||pr.isRegExp(t.delimiter)?t.delimiter:Dt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Dt.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Dt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Dt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Dt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Dt.strictNullHandling}},Ih=function(e,t){var r=Oh(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?wh(e,r):e,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),a=0;a<s.length;++a){var o=s[a],l=Sh(o,n[o],r,typeof e=="string");i=pr.merge(i,l,r)}return r.allowSparse===!0?i:pr.compact(i)},Nh=bh,Rh=Ih,Ch=Zi,Ph={formats:Ch,parse:Rh,stringify:Nh},kh=Df;function re(){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 Mh=/^([a-z0-9.+-]+:)/i,Lh=/:[0-9]*$/,Fh=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Bh=["<",">",'"',"`"," ","\r",`
13
+ `," "],Uh=["{","}","|","\\","^","`"].concat(Bh),es=["'"].concat(Uh),bo=["%","/","?",";","#"].concat(es),_o=["/","?","#"],Dh=255,xo=/^[+a-z0-9A-Z_-]{0,63}$/,jh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$h={javascript:!0,"javascript:":!0},rs={javascript:!0,"javascript:":!0},vr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ns=Ph;function On(e,t,r){if(e&&typeof e=="object"&&e instanceof re)return e;var n=new re;return n.parse(e,t,r),n}re.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=Fh.exec(o);if(l)return this.path=o,this.href=o,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=ns.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var f=Mh.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&&rs[f])&&(o=o.substr(2),this.slashes=!0)}if(!rs[f]&&(h||f&&!vr[f])){for(var u=-1,d=0;d<_o.length;d++){var p=o.indexOf(_o[d]);p!==-1&&(u===-1||p<u)&&(u=p)}var m,b;u===-1?b=o.lastIndexOf("@"):b=o.lastIndexOf("@",u),b!==-1&&(m=o.slice(0,b),o=o.slice(b+1),this.auth=decodeURIComponent(m)),u=-1;for(var d=0;d<bo.length;d++){var p=o.indexOf(bo[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 v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v)for(var g=this.hostname.split(/\./),d=0,_=g.length;d<_;d++){var y=g[d];if(y&&!y.match(xo)){for(var x="",O=0,E=y.length;O<E;O++)y.charCodeAt(O)>127?x+="x":x+=y[O];if(!x.match(xo)){var T=g.slice(0,d),R=g.slice(d+1),A=y.match(jh);A&&(T.push(A[1]),R.unshift(A[2])),R.length&&(o="/"+R.join(".")+o),this.hostname=T.join(".");break}}}this.hostname.length>Dh?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=kh.toASCII(this.hostname));var w=this.port?":"+this.port:"",S=this.hostname||"";this.host=S+w,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!$h[c])for(var d=0,_=es.length;d<_;d++){var I=es[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=ns.parse(this.query)),o=o.slice(0,D)):t&&(this.search="",this.query={}),o&&(this.pathname=o),vr[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 Gh(e){return typeof e=="string"&&(e=On(e)),e instanceof re?e.format():re.prototype.format.call(e)}re.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=ns.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||vr[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 qh(e,t){return On(e,!1,!0).resolve(t)}re.prototype.resolve=function(e){return this.resolveObject(On(e,!1,!0)).format()},re.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new re;t.parse(e,!1,!0),e=t}for(var r=new re,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 vr[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(!vr[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&&!rs[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)==="/",m=e.host||e.pathname&&e.pathname.charAt(0)==="/",b=m||p||r.host&&e.pathname,v=b,g=r.pathname&&r.pathname.split("/")||[],_=e.pathname&&e.pathname.split("/")||[],y=r.protocol&&!vr[r.protocol];if(y&&(r.hostname="",r.port=null,r.host&&(g[0]===""?g[0]=r.host:g.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),b=b&&(_[0]===""||g[0]==="")),m)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,g=_;else if(_.length)g||(g=[]),g.pop(),g=g.concat(_),r.search=e.search,r.query=e.query;else if(e.search!=null){if(y){r.host=g.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(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=g.slice(-1)[0],E=(r.host||e.host||g.length>1)&&(O==="."||O==="..")||O==="",T=0,R=g.length;R>=0;R--)O=g[R],O==="."?g.splice(R,1):O===".."?(g.splice(R,1),T++):T&&(g.splice(R,1),T--);if(!b&&!v)for(;T--;T)g.unshift("..");b&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),E&&g.join("/").substr(-1)!=="/"&&g.push("");var A=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(y){r.hostname=A?"":g.length?g.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 b=b||r.host&&g.length,b&&!A&&g.unshift(""),g.length>0?r.pathname=g.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},re.prototype.parseHost=function(){var e=this.host,t=Lh.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 Hh=On,Vh=qh,zh=Gh;const Xh={parse:Hh,format:zh,resolve:Vh},Eo={};function _t(e,t,r=3){if(Eo[t])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
14
14
  Deprecated since v${e}`):(n=n.split(`
15
15
  `).splice(r).join(`
16
16
  `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
17
17
  Deprecated since v${e}`),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t}
18
- Deprecated since v${e}`),console.warn(n))),Uo[t]=!0}let _s;function Sd(){return typeof _s>"u"&&(_s=function(){var r;const t={stencil:!0,failIfMajorPerformanceCaveat:vt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!vt.ADAPTER.getWebGLRenderingContext())return!1;const n=vt.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}}()),_s}var Od={grad:.9,turn:360,rad:360/(2*Math.PI)},Ae=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},te=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},jo=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Go=function(e){return{r:te(e.r,0,255),g:te(e.g,0,255),b:te(e.b,0,255),a:te(e.a)}},xs=function(e){return{r:$t(e.r),g:$t(e.g),b:$t(e.b),a:$t(e.a,3)}},Rd=/^#([0-9a-f]{3,8})$/i,Ln=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},$o=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}},qo=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),h=s%6;return{r:255*[n,o,a,a,l,n][h],g:255*[l,n,n,o,a,a][h],b:255*[a,a,l,n,n,o][h],a:i}},Ho=function(e){return{h:jo(e.h),s:te(e.s,0,100),l:te(e.l,0,100),a:te(e.a)}},zo=function(e){return{h:$t(e.h),s:$t(e.s),l:$t(e.l),a:$t(e.a,3)}},Vo=function(e){return qo((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},Zr=function(e){return{h:(t=$o(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},Id=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ws={string:[[function(e){var t=Rd.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=Cd.exec(e)||kd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Go({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=Id.exec(e)||Nd.exec(e);if(!t)return null;var r,n,i=Ho({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Od[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Vo(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 Ae(t)&&Ae(r)&&Ae(n)?Go({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(!Ae(t)||!Ae(r)||!Ae(n))return null;var a=Ho({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return Vo(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,s=i===void 0?1:i;if(!Ae(t)||!Ae(r)||!Ae(n))return null;var a=function(o){return{h:jo(o.h),s:te(o.s,0,100),v:te(o.v,0,100),a:te(o.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return qo(a)},"hsv"]]},Xo=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]},Pd=function(e){return typeof e=="string"?Xo(e.trim(),ws.string):typeof e=="object"&&e!==null?Xo(e,ws.object):[null,void 0]},Es=function(e,t){var r=Zr(e);return{h:r.h,s:te(r.s+100*t,0,100),l:r.l,a:r.a}},Ts=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Wo=function(e,t){var r=Zr(e);return{h:r.h,s:r.s,l:te(r.l+100*t,0,100),a:r.a}},As=function(){function e(t){this.parsed=Pd(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(Ts(this.rgba),2)},e.prototype.isDark=function(){return Ts(this.rgba)<.5},e.prototype.isLight=function(){return Ts(this.rgba)>=.5},e.prototype.toHex=function(){return t=xs(this.rgba),r=t.r,n=t.g,i=t.b,a=(s=t.a)<1?Ln($t(255*s)):"","#"+Ln(r)+Ln(n)+Ln(i)+a;var t,r,n,i,s,a},e.prototype.toRgb=function(){return xs(this.rgba)},e.prototype.toRgbString=function(){return t=xs(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 zo(Zr(this.rgba))},e.prototype.toHslString=function(){return t=zo(Zr(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=$o(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 be({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),be(Es(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),be(Es(this.rgba,-t))},e.prototype.grayscale=function(){return be(Es(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),be(Wo(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),be(Wo(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"?be({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=Zr(this.rgba);return typeof t=="number"?be({h:t,s:r.s,l:r.l,a:r.a}):$t(r.h)},e.prototype.isEqual=function(t){return this.toHex()===be(t).toHex()},e}(),be=function(e){return e instanceof As?e:new As(e)},Yo=[],Md=function(e){e.forEach(function(t){Yo.indexOf(t)<0&&(t(As,ws),Yo.push(t))})};function Ld(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,h=n[this.toHex()];if(h)return h;if(a!=null&&a.closest){var c=this.toRgb(),f=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<f&&(f=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"])}Md([Ld]);const _r=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 _r)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]=_r.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=_r.HEX_PATTERN.exec(e);n&&(e=`#${n[2]}`)}const r=be(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 Wt=_r;Wt.shared=new _r,Wt.temp=new _r,Wt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function Fd(){const e=[],t=[];for(let n=0;n<32;n++)e[n]=n,t[n]=n;e[ut.NORMAL_NPM]=ut.NORMAL,e[ut.ADD_NPM]=ut.ADD,e[ut.SCREEN_NPM]=ut.SCREEN,t[ut.NORMAL]=ut.NORMAL_NPM,t[ut.ADD]=ut.ADD_NPM,t[ut.SCREEN]=ut.SCREEN_NPM;const r=[];return r.push(t),r.push(e),r}const Bd=Fd();function Ko(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 Fn(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 Zo(e){return!(e&e-1)&&!!e}function Qo(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 Bn(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 Dd=0;function Qr(){return++Dd}const Jo={},_e=Object.create(null),De=Object.create(null);let Dn;function Ud(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,Dn||(Dn=document.createElement("a")),Dn.href=e;const r=Ad.parse(Dn.href),n=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!n||r.protocol!==t.protocol?"anonymous":""}function tl(e,t=1){var n;const r=(n=vt.RETINA_PREFIX)==null?void 0:n.exec(e);return r?parseFloat(r[1]):t}var pt=(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))(pt||{});const Ss=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},el=(e,t)=>Ss(e).priority??t,wt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(Ss).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(Ss).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)=>el(s,r)-el(i,r)))},n=>{const i=t.indexOf(n.ref);i!==-1&&t.splice(i,1)})}};class jd{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 Gd=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
19
- `);function $d(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 qd(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=Gd.replace(/%forloop%/gi,$d(e));if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))e=e/2|0;else break}return e}const Os=0,Rs=1,Is=2,Ns=3,Cs=4,ks=5;let Un=class Uh{constructor(){this.data=0,this.blendMode=ut.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Os)}set blend(t){!!(this.data&1<<Os)!==t&&(this.data^=1<<Os)}get offsets(){return!!(this.data&1<<Rs)}set offsets(t){!!(this.data&1<<Rs)!==t&&(this.data^=1<<Rs)}get culling(){return!!(this.data&1<<Is)}set culling(t){!!(this.data&1<<Is)!==t&&(this.data^=1<<Is)}get depthTest(){return!!(this.data&1<<Ns)}set depthTest(t){!!(this.data&1<<Ns)!==t&&(this.data^=1<<Ns)}get depthMask(){return!!(this.data&1<<ks)}set depthMask(t){!!(this.data&1<<ks)!==t&&(this.data^=1<<ks)}get clockwiseFrontFace(){return!!(this.data&1<<Cs)}set clockwiseFrontFace(t){!!(this.data&1<<Cs)!==t&&(this.data^=1<<Cs)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==ut.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 Uh;return t.depthTest=!1,t.blend=!0,t}};const Ps=[];function rl(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=Ps.length-1;n>=0;--n){const i=Ps[n];if(i.test&&i.test(e,r))return new i(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class se{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:h,items:c}=this;this._aliasCount++;for(let f=0,u=c.length;f<u;f++)c[f][h](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(se.prototype,{dispatch:{value:se.prototype.emit},run:{value:se.prototype.emit}});class Jr{constructor(t=0,r=0){this._width=t,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new se("setRealSize"),this.onUpdate=new se("update"),this.onError=new se("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 Ms extends Jr{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===Me.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 Hd={scaleMode:we.NEAREST,format:rt.RGBA,alphaMode:Me.NPM},xr=class extends _n{constructor(e=null,t=null){super(),t=Object.assign({},xr.defaultOptions,t);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:s,width:a,height:o,wrapMode:l,format:h,type:c,target:f,resolution:u,resourceOptions:d}=t;e&&!(e instanceof Jr)&&(e=rl(e,d),e.internal=!0),this.resolution=u||vt.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=h,this.type=c,this.target=f,this.alphaMode=r,this.uid=Qr(),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=Zo(this.realWidth)&&Zo(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 De[this.cacheId],delete _e[this.cacheId],this.cacheId=null),this.dispose(),xr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,r=vt.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}_${Qr()}`}i=e._pixiId}let s=De[i];if(n&&r&&!s)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return s||(s=new xr(e,t),s.cacheId=i,xr.addToCache(s,i)),s}static fromBuffer(e,t,r,n){e=e||new Float32Array(t*r*4);const i=new Ms(e,{width:t,height:r}),s=e instanceof Float32Array?mt.FLOAT:mt.UNSIGNED_BYTE;return new xr(i,Object.assign({},Hd,n||{width:t,height:r,type:s}))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),De[t]&&De[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),De[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=De[e];if(t){const r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete De[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)delete De[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}};let gt=xr;gt.defaultOptions={mipmap:qe.POW2,anisotropicLevel:0,scaleMode:we.LINEAR,wrapMode:$r.CLAMP,alphaMode:Me.UNPACK,target:lr.TEXTURE_2D,format:rt.RGBA,type:mt.UNSIGNED_BYTE},gt._globalBatch=0;class Ls{constructor(){this.texArray=null,this.blend=0,this.type=Pe.TRIANGLES,this.start=0,this.size=0,this.data=null}}let zd=0,Yt=class jh{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=zd++,this.disposeRunner=new se("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?ve.ELEMENT_ARRAY_BUFFER:ve.ARRAY_BUFFER}get index(){return this.type===ve.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new jh(t)}};class jn{constructor(t,r=0,n=!1,i=mt.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 jn(t,r,n,i,s)}}const Vd={Float32Array,Uint32Array,Int32Array,Uint8Array};function Xd(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 h=t[l],c=e[l],f=Ko(c);i[f]||(i[f]=new Vd[f](s)),a=i[f];for(let u=0;u<c.length;u++){const d=(u/h|0)*n+o,p=u%h;a[d+p]=c[u]}o+=h}return new Float32Array(s)}const nl={5126:4,5123:2,5121:1};let Wd=0;const Yd={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class wr{constructor(t=[],r={}){this.buffers=t,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=Wd++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new se("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 Yt||(r instanceof Array&&(r=new Float32Array(r)),r=new Yt(r));const h=t.split("|");if(h.length>1){for(let f=0;f<h.length;f++)this.addAttribute(h[f],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 jn(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 Yt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Yt(t)),t.type=ve.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 Yt;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*nl[s.type]/4),s.buffer=0}for(n.data=Xd(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 wr;for(let r=0;r<this.buffers.length;r++)t.buffers[r]=new Yt(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];t.attributes[r]=new jn(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=ve.ELEMENT_ARRAY_BUFFER),t}static merge(t){const r=new wr,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 Yd[Ko(a.buffers[o].data)](i[o]),r.buffers[o]=new Yt(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=ve.ELEMENT_ARRAY_BUFFER;let o=0,l=0,h=0,c=0;for(let f=0;f<a.buffers.length;f++)if(a.buffers[f]!==a.indexBuffer){c=f;break}for(const f in a.attributes){const u=a.attributes[f];(u.buffer|0)===c&&(l+=u.size*nl[u.type]/4)}for(let f=0;f<t.length;f++){const u=t[f].indexBuffer.data;for(let d=0;d<u.length;d++)r.indexBuffer.data[d+h]+=o;o+=t[f].buffers[c].data.length/l,h+=u.length}}return r}}class il extends wr{constructor(t=!1){super(),this._buffer=new Yt(null,t,!1),this._indexBuffer=new Yt(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,mt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,mt.FLOAT).addAttribute("aColor",this._buffer,4,!0,mt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,mt.FLOAT).addIndex(this._indexBuffer)}}const Gn=Math.PI*2,Kd=180/Math.PI,Zd=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 nt{constructor(t=0,r=0){this.x=0,this.y=0,this.x=t,this.y=r}clone(){return new nt(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 $n=[new nt,new nt,new nt,new nt];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=$n[0].set(t.left,t.top),l=$n[1].set(t.left,t.bottom),h=$n[2].set(t.right,t.top),c=$n[3].set(t.right,t.bottom);if(h.x<=o.x||l.y<=o.y)return!1;const f=Math.sign(r.a*r.d-r.b*r.c);if(f===0||(r.apply(o,o),r.apply(l,l),r.apply(h,h),r.apply(c,c),Math.max(o.x,l.x,h.x,c.x)<=n||Math.min(o.x,l.x,h.x,c.x)>=i||Math.max(o.y,l.y,h.y,c.y)<=s||Math.min(o.y,l.y,h.y,c.y)>=a))return!1;const u=f*(l.y-o.y),d=f*(o.x-l.x),p=u*n+d*s,v=u*i+d*s,g=u*n+d*a,y=u*i+d*a;if(Math.max(p,v,g,y)<=u*o.x+d*o.y||Math.min(p,v,g,y)>=u*c.x+d*c.y)return!1;const b=f*(o.y-h.y),_=f*(h.x-o.x),m=b*n+_*s,x=b*i+_*s,S=b*n+_*a,w=b*i+_*a;return!(Math.max(m,x,S,w)<=b*o.x+_*o.y||Math.min(m,x,S,w)>=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 Fs{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.radius=n,this.type=qt.CIRC}clone(){return new Fs(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 Qd=class Gh{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 Gh(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 tn{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 tn(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],h=this.points[a*2],c=this.points[a*2+1];l>r!=c>r&&t<(h-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 Bs{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 Bs(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 Ot=class Bi{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 nt;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 nt;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,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*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),h=Math.abs(o+l);return h<1e-5||Math.abs(Gn-h)<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 Bi;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 Bi}static get TEMP_MATRIX(){return new Bi}};const Ye=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ke=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ze=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Qe=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ds=[],sl=[],qn=Math.sign;function Jd(){for(let e=0;e<16;e++){const t=[];Ds.push(t);for(let r=0;r<16;r++){const n=qn(Ye[e]*Ye[r]+Ze[e]*Ke[r]),i=qn(Ke[e]*Ye[r]+Qe[e]*Ke[r]),s=qn(Ye[e]*Ze[r]+Ze[e]*Qe[r]),a=qn(Ke[e]*Ze[r]+Qe[e]*Qe[r]);for(let o=0;o<16;o++)if(Ye[o]===n&&Ke[o]===i&&Ze[o]===s&&Qe[o]===a){t.push(o);break}}}for(let e=0;e<16;e++){const t=new Ot;t.set(Ye[e],Ke[e],Ze[e],Qe[e],0,0),sl.push(t)}}Jd();const Mt={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=>Ye[e],uY:e=>Ke[e],vX:e=>Ze[e],vY:e=>Qe[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Ds[e][t],sub:(e,t)=>Ds[e][Mt.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Mt.S:Mt.N:Math.abs(t)*2<=Math.abs(e)?e>0?Mt.E:Mt.W:t>0?e>0?Mt.SE:Mt.SW:e>0?Mt.NE:Mt.NW,matrixAppendRotationInv:(e,t,r=0,n=0)=>{const i=sl[Mt.inv(t)];i.tx=r,i.ty=n,e.append(i)}};class Je{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 Je(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 al=class{constructor(){this.worldTransform=new Ot,this.localTransform=new Ot,this.position=new Je(this.onChange,this,0,0),this.scale=new Je(this.onChange,this,1,1),this.pivot=new Je(this.onChange,this,0,0),this.skew=new Je(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 Hn=al;Hn.IDENTITY=new al;var tp=`varying vec2 vTextureCoord;
18
+ Deprecated since v${e}`),console.warn(n))),Eo[t]=!0}let is;function Wh(){return typeof is>"u"&&(is=function(){var r;const t={stencil:!0,failIfMajorPerformanceCaveat:pt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!pt.ADAPTER.getWebGLRenderingContext())return!1;const n=pt.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}}()),is}var Yh={grad:.9,turn:360,rad:360/(2*Math.PI)},we=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},jt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},Jt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},To=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},wo=function(e){return{r:Jt(e.r,0,255),g:Jt(e.g,0,255),b:Jt(e.b,0,255),a:Jt(e.a)}},ss=function(e){return{r:jt(e.r),g:jt(e.g),b:jt(e.b),a:jt(e.a,3)}},Kh=/^#([0-9a-f]{3,8})$/i,In=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ao=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}},So=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}},Oo=function(e){return{h:To(e.h),s:Jt(e.s,0,100),l:Jt(e.l,0,100),a:Jt(e.a)}},Io=function(e){return{h:jt(e.h),s:jt(e.s),l:jt(e.l),a:jt(e.a,3)}},No=function(e){return So((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},zr=function(e){return{h:(t=Ao(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},Zh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Jh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,td=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,as={string:[[function(e){var t=Kh.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?jt(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?jt(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Jh.exec(e)||td.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:wo({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=Zh.exec(e)||Qh.exec(e);if(!t)return null;var r,n,i=Oo({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Yh[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return No(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)?wo({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=Oo({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return No(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:To(o.h),s:Jt(o.s,0,100),v:Jt(o.v,0,100),a:Jt(o.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return So(a)},"hsv"]]},Ro=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]},ed=function(e){return typeof e=="string"?Ro(e.trim(),as.string):typeof e=="object"&&e!==null?Ro(e,as.object):[null,void 0]},os=function(e,t){var r=zr(e);return{h:r.h,s:Jt(r.s+100*t,0,100),l:r.l,a:r.a}},ls=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Co=function(e,t){var r=zr(e);return{h:r.h,s:r.s,l:Jt(r.l+100*t,0,100),a:r.a}},us=function(){function e(t){this.parsed=ed(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 jt(ls(this.rgba),2)},e.prototype.isDark=function(){return ls(this.rgba)<.5},e.prototype.isLight=function(){return ls(this.rgba)>=.5},e.prototype.toHex=function(){return t=ss(this.rgba),r=t.r,n=t.g,i=t.b,a=(s=t.a)<1?In(jt(255*s)):"","#"+In(r)+In(n)+In(i)+a;var t,r,n,i,s,a},e.prototype.toRgb=function(){return ss(this.rgba)},e.prototype.toRgbString=function(){return t=ss(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 Io(zr(this.rgba))},e.prototype.toHslString=function(){return t=Io(zr(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=Ao(this.rgba),{h:jt(t.h),s:jt(t.s),v:jt(t.v),a:jt(t.a,3)};var t},e.prototype.invert=function(){return ge({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),ge(os(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),ge(os(this.rgba,-t))},e.prototype.grayscale=function(){return ge(os(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),ge(Co(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),ge(Co(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"?ge({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):jt(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=zr(this.rgba);return typeof t=="number"?ge({h:t,s:r.s,l:r.l,a:r.a}):jt(r.h)},e.prototype.isEqual=function(t){return this.toHex()===ge(t).toHex()},e}(),ge=function(e){return e instanceof us?e:new us(e)},Po=[],rd=function(e){e.forEach(function(t){Po.indexOf(t)<0&&(t(us,as),Po.push(t))})};function nd(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 m=(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));m<h&&(h=m,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"])}rd([nd]);const yr=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 yr)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]=yr.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=yr.HEX_PATTERN.exec(e);n&&(e=`#${n[2]}`)}const r=ge(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 Wt=yr;Wt.shared=new yr,Wt.temp=new yr,Wt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function id(){const e=[],t=[];for(let n=0;n<32;n++)e[n]=n,t[n]=n;e[lt.NORMAL_NPM]=lt.NORMAL,e[lt.ADD_NPM]=lt.ADD,e[lt.SCREEN_NPM]=lt.SCREEN,t[lt.NORMAL]=lt.NORMAL_NPM,t[lt.ADD]=lt.ADD_NPM,t[lt.SCREEN]=lt.SCREEN_NPM;const r=[];return r.push(t),r.push(e),r}const sd=id();function ko(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 Nn(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 Mo(e){return!(e&e-1)&&!!e}function Lo(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 Rn(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 ad=0;function Xr(){return++ad}const Fo={},be=Object.create(null),Fe=Object.create(null);let Cn;function od(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,Cn||(Cn=document.createElement("a")),Cn.href=e;const r=Xh.parse(Cn.href),n=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!n||r.protocol!==t.protocol?"anonymous":""}function Bo(e,t=1){var n;const r=(n=pt.RETINA_PREFIX)==null?void 0:n.exec(e);return r?parseFloat(r[1]):t}var dt=(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))(dt||{});const fs=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},Uo=(e,t)=>fs(e).priority??t,xt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(fs).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(fs).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)=>Uo(s,r)-Uo(i,r)))},n=>{const i=t.indexOf(n.ref);i!==-1&&t.splice(i,1)})}};class ld{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 ud=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
19
+ `);function fd(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 cd(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=ud.replace(/%forloop%/gi,fd(e));if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))e=e/2|0;else break}return e}const cs=0,hs=1,ds=2,ps=3,vs=4,ys=5;let Pn=class of{constructor(){this.data=0,this.blendMode=lt.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<cs)}set blend(t){!!(this.data&1<<cs)!==t&&(this.data^=1<<cs)}get offsets(){return!!(this.data&1<<hs)}set offsets(t){!!(this.data&1<<hs)!==t&&(this.data^=1<<hs)}get culling(){return!!(this.data&1<<ds)}set culling(t){!!(this.data&1<<ds)!==t&&(this.data^=1<<ds)}get depthTest(){return!!(this.data&1<<ps)}set depthTest(t){!!(this.data&1<<ps)!==t&&(this.data^=1<<ps)}get depthMask(){return!!(this.data&1<<ys)}set depthMask(t){!!(this.data&1<<ys)!==t&&(this.data^=1<<ys)}get clockwiseFrontFace(){return!!(this.data&1<<vs)}set clockwiseFrontFace(t){!!(this.data&1<<vs)!==t&&(this.data^=1<<vs)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==lt.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 of;return t.depthTest=!1,t.blend=!0,t}};const ms=[];function Do(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=ms.length-1;n>=0;--n){const i=ms[n];if(i.test&&i.test(e,r))return new i(e,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class ne{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(ne.prototype,{dispatch:{value:ne.prototype.emit},run:{value:ne.prototype.emit}});class Wr{constructor(t=0,r=0){this._width=t,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new ne("setRealSize"),this.onUpdate=new ne("update"),this.onError=new ne("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 gs extends Wr{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 hd={scaleMode:xe.NEAREST,format:rt.RGBA,alphaMode:Pe.NPM},mr=class extends dn{constructor(e=null,t=null){super(),t=Object.assign({},mr.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 Wr)&&(e=Do(e,d),e.internal=!0),this.resolution=u||pt.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=Xr(),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=Mo(this.realWidth)&&Mo(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 be[this.cacheId],this.cacheId=null),this.dispose(),mr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,r=pt.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}_${Xr()}`}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 mr(e,t),s.cacheId=i,mr.addToCache(s,i)),s}static fromBuffer(e,t,r,n){e=e||new Float32Array(t*r*4);const i=new gs(e,{width:t,height:r}),s=e instanceof Float32Array?yt.FLOAT:yt.UNSIGNED_BYTE;return new mr(i,Object.assign({},hd,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 mt=mr;mt.defaultOptions={mipmap:$e.POW2,anisotropicLevel:0,scaleMode:xe.LINEAR,wrapMode:Br.CLAMP,alphaMode:Pe.UNPACK,target:ir.TEXTURE_2D,format:rt.RGBA,type:yt.UNSIGNED_BYTE},mt._globalBatch=0;class bs{constructor(){this.texArray=null,this.blend=0,this.type=Ce.TRIANGLES,this.start=0,this.size=0,this.data=null}}let dd=0,Yt=class lf{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=dd++,this.disposeRunner=new ne("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?ve.ELEMENT_ARRAY_BUFFER:ve.ARRAY_BUFFER}get index(){return this.type===ve.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new lf(t)}};class kn{constructor(t,r=0,n=!1,i=yt.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 kn(t,r,n,i,s)}}const pd={Float32Array,Uint32Array,Int32Array,Uint8Array};function vd(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=ko(c);i[h]||(i[h]=new pd[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 jo={5126:4,5123:2,5121:1};let yd=0;const md={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class gr{constructor(t=[],r={}){this.buffers=t,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=yd++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new ne("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 Yt||(r instanceof Array&&(r=new Float32Array(r)),r=new Yt(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 kn(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 Yt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Yt(t)),t.type=ve.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 Yt;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*jo[s.type]/4),s.buffer=0}for(n.data=vd(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 gr;for(let r=0;r<this.buffers.length;r++)t.buffers[r]=new Yt(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];t.attributes[r]=new kn(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=ve.ELEMENT_ARRAY_BUFFER),t}static merge(t){const r=new gr,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 md[ko(a.buffers[o].data)](i[o]),r.buffers[o]=new Yt(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=ve.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*jo[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 $o extends gr{constructor(t=!1){super(),this._buffer=new Yt(null,t,!1),this._indexBuffer=new Yt(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,yt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,yt.FLOAT).addAttribute("aColor",this._buffer,4,!0,yt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,yt.FLOAT).addIndex(this._indexBuffer)}}const Mn=Math.PI*2,gd=180/Math.PI,bd=Math.PI/180;var Gt=(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))(Gt||{});class $t{constructor(t=0,r=0){this.x=0,this.y=0,this.x=t,this.y=r}clone(){return new $t(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 Ln=[new $t,new $t,new $t,new $t];class wt{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=Gt.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 wt(0,0,0,0)}clone(){return new wt(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 T=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=T)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=Ln[0].set(t.left,t.top),l=Ln[1].set(t.left,t.bottom),f=Ln[2].set(t.right,t.top),c=Ln[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,m=u*i+d*s,b=u*n+d*a,v=u*i+d*a;if(Math.max(p,m,b,v)<=u*o.x+d*o.y||Math.min(p,m,b,v)>=u*c.x+d*c.y)return!1;const g=h*(o.y-f.y),_=h*(f.x-o.x),y=g*n+_*s,x=g*i+_*s,O=g*n+_*a,E=g*i+_*a;return!(Math.max(y,x,O,E)<=g*o.x+_*o.y||Math.min(y,x,O,E)>=g*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 _s{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.radius=n,this.type=Gt.CIRC}clone(){return new _s(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 wt(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 _d=class uf{constructor(t=0,r=0,n=0,i=0){this.x=t,this.y=r,this.width=n,this.height=i,this.type=Gt.ELIP}clone(){return new uf(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 wt(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 Yr{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=Gt.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),r=new Yr(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 xs{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=Gt.RREC}clone(){return new xs(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 Xt=class xi{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 $t;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 $t;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(Mn-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 xi;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 xi}static get TEMP_MATRIX(){return new xi}};const Xe=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],We=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ye=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ke=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Es=[],Go=[],Fn=Math.sign;function xd(){for(let e=0;e<16;e++){const t=[];Es.push(t);for(let r=0;r<16;r++){const n=Fn(Xe[e]*Xe[r]+Ye[e]*We[r]),i=Fn(We[e]*Xe[r]+Ke[e]*We[r]),s=Fn(Xe[e]*Ye[r]+Ye[e]*Ke[r]),a=Fn(We[e]*Ye[r]+Ke[e]*Ke[r]);for(let o=0;o<16;o++)if(Xe[o]===n&&We[o]===i&&Ye[o]===s&&Ke[o]===a){t.push(o);break}}}for(let e=0;e<16;e++){const t=new Xt;t.set(Xe[e],We[e],Ye[e],Ke[e],0,0),Go.push(t)}}xd();const Pt={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=>Xe[e],uY:e=>We[e],vX:e=>Ye[e],vY:e=>Ke[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Es[e][t],sub:(e,t)=>Es[e][Pt.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Pt.S:Pt.N:Math.abs(t)*2<=Math.abs(e)?e>0?Pt.E:Pt.W:t>0?e>0?Pt.SE:Pt.SW:e>0?Pt.NE:Pt.NW,matrixAppendRotationInv:(e,t,r=0,n=0)=>{const i=Go[Pt.inv(t)];i.tx=r,i.ty=n,e.append(i)}};class br{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 br(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 qo=class{constructor(){this.worldTransform=new Xt,this.localTransform=new Xt,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 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 Ts=qo;Ts.IDENTITY=new qo;var Ed=`varying vec2 vTextureCoord;
21
21
 
22
22
  uniform sampler2D uSampler;
23
23
 
24
24
  void main(void){
25
25
  gl_FragColor *= texture2D(uSampler, vTextureCoord);
26
- }`,ep=`attribute vec2 aVertexPosition;
26
+ }`,Td=`attribute vec2 aVertexPosition;
27
27
  attribute vec2 aTextureCoord;
28
28
 
29
29
  uniform mat3 projectionMatrix;
@@ -34,7 +34,7 @@ void main(void){
34
34
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
35
35
  vTextureCoord = aTextureCoord;
36
36
  }
37
- `;function ol(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}function Us(e){const t=new Array(e);for(let r=0;r<t.length;r++)t[r]=!1;return t}function ll(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 Us(2*t);case"bvec3":return Us(3*t);case"bvec4":return Us(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 Er=[{test:e=>e.type==="float"&&e.size===1&&!e.isArray,code:e=>`
37
+ `;function Ho(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}function ws(e){const t=new Array(e);for(let r=0;r<t.length;r++)t[r]=!1;return t}function Vo(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 ws(2*t);case"bvec3":return ws(3*t);case"bvec4":return ws(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 _r=[{test:e=>e.type==="float"&&e.size===1&&!e.isArray,code:e=>`
38
38
  if(uv["${e}"] !== ud["${e}"].value)
39
39
  {
40
40
  ud["${e}"].value = uv["${e}"]
@@ -154,7 +154,7 @@ void main(void){
154
154
  cv[3] = v[3];
155
155
 
156
156
  gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2], v[3])
157
- }`}],rp={float:`
157
+ }`}],wd={float:`
158
158
  if (cv !== v)
159
159
  {
160
160
  cu.value = v;
@@ -290,7 +290,7 @@ void main(void){
290
290
  cu.value = v;
291
291
 
292
292
  gl.uniform1i(location, v);
293
- }`},np={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 ip(e,t){var n;const r=[`
293
+ }`},Ad={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 Sd(e,t){var n;const r=[`
294
294
  var v = null;
295
295
  var cv = null;
296
296
  var cu = null;
@@ -300,18 +300,18 @@ void main(void){
300
300
  renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');
301
301
  `):r.push(`
302
302
  renderer.shader.syncUniformGroup(uv.${i}, syncData);
303
- `));continue}const a=e.uniforms[i];let o=!1;for(let l=0;l<Er.length;l++)if(Er[l].test(s,a)){r.push(Er[l].code(i,a)),o=!0;break}if(!o){const h=(s.size===1&&!s.isArray?rp:np)[s.type].replace("location",`ud["${i}"].location`);r.push(`
303
+ `));continue}const a=e.uniforms[i];let o=!1;for(let l=0;l<_r.length;l++)if(_r[l].test(s,a)){r.push(_r[l].code(i,a)),o=!0;break}if(!o){const f=(s.size===1&&!s.isArray?wd:Ad)[s.type].replace("location",`ud["${i}"].location`);r.push(`
304
304
  cu = ud["${i}"];
305
305
  cv = cu.value;
306
306
  v = uv["${i}"];
307
- ${h};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
308
- `))}const ul={};let Tr=ul;function sp(){if(Tr===ul||Tr!=null&&Tr.isContextLost()){const e=vt.ADAPTER.createCanvas();let t;vt.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),Tr=t}return Tr}let zn;function ap(){if(!zn){zn=Jt.MEDIUM;const e=sp();e&&e.getShaderPrecisionFormat&&(zn=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Jt.HIGH:Jt.MEDIUM)}return zn}function hl(e,t){const r=e.getShaderSource(t).split(`
309
- `).map((h,c)=>`${c}: ${h}`),n=e.getShaderInfoLog(t),i=n.split(`
310
- `),s={},a=i.map(h=>parseFloat(h.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(h=>h&&!s[h]?(s[h]=!0,!0):!1),o=[""];a.forEach(h=>{r[h-1]=`%c${r[h-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 op(e,t,r,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||hl(e,r),e.getShaderParameter(n,e.COMPILE_STATUS)||hl(e,n),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const lp={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 cl(e){return lp[e]}let Vn=null;const fl={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 dl(e,t){if(!Vn){const r=Object.keys(fl);Vn={};for(let n=0;n<r.length;++n){const i=r[n];Vn[e[i]]=fl[i]}}return Vn[t]}function pl(e,t,r){if(e.substring(0,9)!=="precision"){let n=t;return t===Jt.HIGH&&r!==Jt.HIGH&&(n=Jt.MEDIUM),`precision ${n} float;
312
- ${e}`}else if(r!==Jt.HIGH&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}let en;function up(){if(typeof en=="boolean")return en;try{en=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{en=!1}return en}let hp=0;const Xn={},Ar=class{constructor(e,t,r="pixi-shader",n={}){this.extra={},this.id=hp++,this.vertexSrc=e||Ar.defaultVertexSrc,this.fragmentSrc=t||Ar.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,"-"),Xn[r]?(Xn[r]++,r+=`-${Xn[r]}`):Xn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
307
+ ${f};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
308
+ `))}const zo={};let xr=zo;function Od(){if(xr===zo||xr!=null&&xr.isContextLost()){const e=pt.ADAPTER.createCanvas();let t;pt.PREFER_ENV>=je.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),xr=t}return xr}let Bn;function Id(){if(!Bn){Bn=Qt.MEDIUM;const e=Od();e&&e.getShaderPrecisionFormat&&(Bn=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Qt.HIGH:Qt.MEDIUM)}return Bn}function Xo(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 Nd(e,t,r,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||Xo(e,r),e.getShaderParameter(n,e.COMPILE_STATUS)||Xo(e,n),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const Rd={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 Wo(e){return Rd[e]}let Un=null;const Yo={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 Ko(e,t){if(!Un){const r=Object.keys(Yo);Un={};for(let n=0;n<r.length;++n){const i=r[n];Un[e[i]]=Yo[i]}}return Un[t]}function Zo(e,t,r){if(e.substring(0,9)!=="precision"){let n=t;return t===Qt.HIGH&&r!==Qt.HIGH&&(n=Qt.MEDIUM),`precision ${n} float;
312
+ ${e}`}else if(r!==Qt.HIGH&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}let Kr;function Cd(){if(typeof Kr=="boolean")return Kr;try{Kr=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Kr=!1}return Kr}let Pd=0;const Dn={},Er=class{constructor(e,t,r="pixi-shader",n={}){this.extra={},this.id=Pd++,this.vertexSrc=e||Er.defaultVertexSrc,this.fragmentSrc=t||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,"-"),Dn[r]?(Dn[r]++,r+=`-${Dn[r]}`):Dn[r]=1,this.vertexSrc=`#define SHADER_NAME ${r}
313
313
  ${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${r}
314
- ${this.fragmentSrc}`,this.vertexSrc=pl(this.vertexSrc,Ar.defaultVertexPrecision,Jt.HIGH),this.fragmentSrc=pl(this.fragmentSrc,Ar.defaultFragmentPrecision,ap())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return ep}static get defaultFragmentSrc(){return tp}static from(e,t,r){const n=e+t;let i=Jo[n];return i||(Jo[n]=i=new Ar(e,t,r)),i}};let Se=Ar;Se.defaultVertexPrecision=Jt.HIGH,Se.defaultFragmentPrecision=hr.apple.device?Jt.HIGH:Jt.MEDIUM;let cp=0;class ae{constructor(t,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=cp++,this.static=!!r,this.ubo=!!n,t instanceof Yt?(this.buffer=t,this.buffer.type=ve.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Yt(new Float32Array(1)),this.buffer.type=ve.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 ae(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 ae(t,r,n)}static uboFrom(t,r){return new ae(t,r??!0,!0)}}class rn{constructor(t,r){this.uniformBindCount=0,this.program=t,r?r instanceof ae?this.uniformGroup=r:this.uniformGroup=new ae(r):this.uniformGroup=new ae({}),this.disposeRunner=new se("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=Se.from(t,r);return new rn(i,n)}}class fp{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]=ae.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 Se(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ot,default:this.defaultGroupCache[t]};return new rn(this.programCache[t],r)}generateSampleSrc(t){let r="";r+=`
314
+ ${this.fragmentSrc}`,this.vertexSrc=Zo(this.vertexSrc,Er.defaultVertexPrecision,Qt.HIGH),this.fragmentSrc=Zo(this.fragmentSrc,Er.defaultFragmentPrecision,Id())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return Td}static get defaultFragmentSrc(){return Ed}static from(e,t,r){const n=e+t;let i=Fo[n];return i||(Fo[n]=i=new Er(e,t,r)),i}};let Ae=Er;Ae.defaultVertexPrecision=Qt.HIGH,Ae.defaultFragmentPrecision=ar.apple.device?Qt.HIGH:Qt.MEDIUM;let kd=0;class ie{constructor(t,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=kd++,this.static=!!r,this.ubo=!!n,t instanceof Yt?(this.buffer=t,this.buffer.type=ve.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Yt(new Float32Array(1)),this.buffer.type=ve.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 ie(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 ie(t,r,n)}static uboFrom(t,r){return new ie(t,r??!0,!0)}}class Zr{constructor(t,r){this.uniformBindCount=0,this.program=t,r?r instanceof ie?this.uniformGroup=r:this.uniformGroup=new ie(r):this.uniformGroup=new ie({}),this.disposeRunner=new ne("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 Zr(i,n)}}class Md{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]=ie.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 Xt,default:this.defaultGroupCache[t]};return new Zr(this.programCache[t],r)}generateSampleSrc(t){let r="";r+=`
315
315
  `,r+=`
316
316
  `;for(let n=0;n<t;n++)n>0&&(r+=`
317
317
  else `),n<t-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
@@ -319,7 +319,7 @@ else `),n<t-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
319
319
  color = texture2D(uSamplers[${n}], vTextureCoord);`,r+=`
320
320
  }`;return r+=`
321
321
  `,r+=`
322
- `,r}}class js{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 dp(){return!hr.apple.device}function pp(e){let t=!0;const r=vt.ADAPTER.getNavigator();if(hr.tablet||hr.phone){if(hr.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(t=!1)}if(hr.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(t=!1)}}return t?e:4}class yl{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var yp=`varying vec2 vTextureCoord;
322
+ `,r}}class As{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 Ld(){return!ar.apple.device}function Fd(e){let t=!0;const r=pt.ADAPTER.getNavigator();if(ar.tablet||ar.phone){if(ar.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(t=!1)}if(ar.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(t=!1)}}return t?e:4}class Qo{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var Bd=`varying vec2 vTextureCoord;
323
323
  varying vec4 vColor;
324
324
  varying float vTextureId;
325
325
  uniform sampler2D uSamplers[%count%];
@@ -329,7 +329,7 @@ void main(void){
329
329
  %forloop%
330
330
  gl_FragColor = color * vColor;
331
331
  }
332
- `,vp=`precision highp float;
332
+ `,Ud=`precision highp float;
333
333
  attribute vec2 aVertexPosition;
334
334
  attribute vec2 aTextureCoord;
335
335
  attribute vec4 aColor;
@@ -350,14 +350,14 @@ void main(void){
350
350
  vTextureId = aTextureId;
351
351
  vColor = aColor * tint;
352
352
  }
353
- `;const oe=class extends yl{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=il,this.vertexSize=6,this.state=Un.for2d(),this.size=oe.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??pp(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??dp(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return xt("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return vp}static get defaultFragmentTemplate(){return yp}setShaderGenerator({vertex:e=oe.defaultVertexSrc,fragment:t=oe.defaultFragmentTemplate}={}){this.shaderGenerator=new fp(e,t)}contextChange(){const e=this.renderer.gl;vt.PREFER_ENV===$e.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),oe.defaultMaxTextures),this.maxTextures=qd(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}=oe,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new Ls);for(;t.length<n;)t.push(new js);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=oe._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++gt._globalBatch,o=0,l=r[0],h=0;n.copyBoundTextures(i,t);for(let c=0;c<this._bufferSize;++c){const f=e[c];e[c]=null,f._batchEnabled!==a&&(l.count>=t&&(n.boundArray(l,i,a,t),this.buildDrawCalls(l,h,c),h=c,l=r[++o],++a),f._batchEnabled=a,f.touched=s,l.elements[l.count++]=f)}l.count>0&&(n.boundArray(l,i,a,t),this.buildDrawCalls(l,h,this._bufferSize),++o,++a);for(let c=0;c<i.length;c++)i[c]=null;gt._globalBatch=a}buildDrawCalls(e,t,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:s,vertexSize:a}=this,o=oe._drawCallPool;let l=this._dcIndex,h=this._aIndex,c=this._iIndex,f=o[l];f.start=this._iIndex,f.texArray=e;for(let u=t;u<r;++u){const d=n[u],p=d._texture.baseTexture,v=Bd[p.alphaMode?1:0][d.blendMode];n[u]=null,t<u&&f.blend!==v&&(f.size=c-f.start,t=u,f=o[++l],f.texArray=e,f.start=c),this.packInterleavedGeometry(d,i,s,h,c),h+=d.vertexData.length/2*a,c+=d.indices.length,f.blend=v}t<r&&(f.size=c-f.start,++l),this._dcIndex=l,this._aIndex=h,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;oe.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=oe._drawCallPool;let i=null;for(let s=0;s<e;s++){const{texArray:a,type:o,size:l,start:h,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,h*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),oe.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=Fn(Math.ceil(e/8)),r=Qo(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 jd(n*this.vertexSize*4)),i}getIndexBuffer(e){const t=Fn(Math.ceil(e/12)),r=Qo(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,h=e.indices,c=e.vertexData,f=e._texture.baseTexture._batchLocation,u=Math.min(e.worldAlpha,1),d=Wt.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++]=f;for(let p=0;p<h.length;p++)r[i++]=o+h[p]}};let le=oe;le.defaultBatchSize=4096,le.extension={name:"batch",type:pt.RendererPlugin},le._drawCallPool=[],le._textureArrayPool=[],wt.add(le);var mp=`varying vec2 vTextureCoord;
353
+ `;const se=class extends Qo{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=$o,this.vertexSize=6,this.state=Pn.for2d(),this.size=se.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??Fd(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??Ld(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return _t("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return Ud}static get defaultFragmentTemplate(){return Bd}setShaderGenerator({vertex:e=se.defaultVertexSrc,fragment:t=se.defaultFragmentTemplate}={}){this.shaderGenerator=new Md(e,t)}contextChange(){const e=this.renderer.gl;pt.PREFER_ENV===je.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),se.defaultMaxTextures),this.maxTextures=cd(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}=se,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new bs);for(;t.length<n;)t.push(new As);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=se._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,s=this.renderer.textureGC.count;let a=++mt._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;mt._globalBatch=a}buildDrawCalls(e,t,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:s,vertexSize:a}=this,o=se._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,m=sd[p.alphaMode?1:0][d.blendMode];n[u]=null,t<u&&h.blend!==m&&(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=m}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;se.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=se._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),se.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=Nn(Math.ceil(e/8)),r=Lo(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 ld(n*this.vertexSize*4)),i}getIndexBuffer(e){const t=Nn(Math.ceil(e/12)),r=Lo(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=Wt.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 ae=se;ae.defaultBatchSize=4096,ae.extension={name:"batch",type:dt.RendererPlugin},ae._drawCallPool=[],ae._textureArrayPool=[],xt.add(ae);var Dd=`varying vec2 vTextureCoord;
354
354
 
355
355
  uniform sampler2D uSampler;
356
356
 
357
357
  void main(void){
358
358
  gl_FragColor = texture2D(uSampler, vTextureCoord);
359
359
  }
360
- `,gp=`attribute vec2 aVertexPosition;
360
+ `,jd=`attribute vec2 aVertexPosition;
361
361
 
362
362
  uniform mat3 projectionMatrix;
363
363
 
@@ -383,7 +383,7 @@ void main(void)
383
383
  gl_Position = filterVertexPosition();
384
384
  vTextureCoord = filterTextureCoord();
385
385
  }
386
- `;const nn=class extends rn{constructor(e,t,r){const n=Se.from(e||nn.defaultVertexSrc,t||nn.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=nn.defaultResolution,this.multisample=nn.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Un}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 gp}static get defaultFragmentSrc(){return mp}};let Oe=nn;Oe.defaultResolution=1,Oe.defaultMultisample=Dt.NONE;class Wn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Wt(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(){}}Wn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Wn.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"background"},wt.add(Wn);class vl{constructor(t){this.renderer=t,this.emptyRenderer=new yl(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 h=0;h<o;h++){const c=s[h],f=c._batchLocation;if(f>=0&&f<i&&r[f]===c){a[h]=f;continue}for(;l<i;){const u=r[l];if(u&&u._batchEnabled===n&&u._batchLocation===l){l++;continue}a[h]=l,c._batchLocation=l,r[l]=c;break}}}destroy(){this.renderer=null}}vl.extension={type:pt.RendererSystem,name:"batch"},wt.add(vl);let ml=0;class Yn{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=ml++}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=ml++,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(vt.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")}}Yn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Yn.extension={type:pt.RendererSystem,name:"context"},wt.add(Yn);class bp extends Ms{upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Me.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 Gs{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 se("disposeFramebuffer"),this.multisample=Dt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,r){return this.colorTextures[t]=r||new gt(null,{scaleMode:we.NEAREST,resolution:1,mipmap:qe.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new gt(new bp(null,{width:this.width,height:this.height}),{scaleMode:we.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:qe.OFF,format:rt.DEPTH_COMPONENT,type:mt.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 gl extends gt{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=Dt.NONE),super(null,t),this.mipmap=qe.OFF,this.valid=!0,this._clear=new Wt([0,0,0,0]),this.framebuffer=new Gs(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 Ue extends Jr{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=Ud(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===Me.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 bl extends Ue{constructor(t,r){if(r=r||{},typeof t=="string"){const n=new Image;Ue.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??vt.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===Me.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 _l{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,h=t.y/s+o;n=Mt.add(n,Mt.NW),this.x0=l+a*Mt.uX(n),this.y0=h+o*Mt.uY(n),n=Mt.add(n,2),this.x1=l+a*Mt.uX(n),this.y1=h+o*Mt.uY(n),n=Mt.add(n,2),this.x2=l+a*Mt.uX(n),this.y2=h+o*Mt.uY(n),n=Mt.add(n,2),this.x3=l+a*Mt.uX(n),this.y3=h+o*Mt.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 xl=new _l;function Kn(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class bt extends _n{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 bt&&(t=t.baseTexture),this.baseTexture=t,this._frame=r,this.trim=i,this.valid=!1,this._uvs=xl,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 nt(a.x,a.y):new nt(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&&_e[r.url]&&bt.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,bt.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),n=new bt(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===xl&&(this._uvs=new _l),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,r={},n=vt.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let s=null;if(i)s=t;else if(t instanceof gt){if(!t.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Qr()}`,gt.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Qr()}`}s=t._pixiId}let a=_e[s];if(i&&n&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(t instanceof gt)?(r.resolution||(r.resolution=tl(t)),a=new bt(new gt(t,r)),a.baseTexture.cacheId=s,gt.addToCache(a.baseTexture,s),bt.addToCache(a,s)):!a&&t instanceof gt&&(a=new bt(t),bt.addToCache(a,s)),a}static fromURL(t,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=bt.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 bt(gt.fromBuffer(t,r,n,i))}static fromLoader(t,r,n,i){const s=new gt(t,Object.assign({scaleMode:gt.defaultOptions.scaleMode,resolution:tl(r)},i)),{resource:a}=s;a instanceof bl&&(a.url=r);const o=new bt(s);return n||(n=r),gt.addToCache(o.baseTexture,n),bt.addToCache(o,n),n!==r&&(gt.addToCache(o.baseTexture,r),bt.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),_e[r]&&_e[r]!==t&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),_e[r]=t)}static removeFromCache(t){if(typeof t=="string"){const r=_e[t];if(r){const n=r.textureCacheIds.indexOf(t);return n>-1&&r.textureCacheIds.splice(n,1),delete _e[t],r}}else if(t!=null&&t.textureCacheIds){for(let r=0;r<t.textureCacheIds.length;++r)_e[t.textureCacheIds[r]]===t&&delete _e[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",h=`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: ${h} ${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 bt._EMPTY||(bt._EMPTY=new bt(new gt),Kn(bt._EMPTY),Kn(bt._EMPTY.baseTexture)),bt._EMPTY}static get WHITE(){if(!bt._WHITE){const t=vt.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),bt._WHITE=new bt(gt.from(t)),Kn(bt._WHITE),Kn(bt._WHITE.baseTexture)}return bt._WHITE}}class Zn extends bt{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 gl(t))}}class wl{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,r,n=Dt.NONE){const i=new gl(Object.assign({width:t,height:r,resolution:1,multisample:n},this.textureOptions));return new Zn(i)}getOptimalTexture(t,r,n=1,i=Dt.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=Fn(t),r=Fn(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||Dt.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}}}wl.SCREEN_KEY=-1;class _p extends wr{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class xp extends wr{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 Yt(this.vertices),this.uvBuffer=new Yt(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 wp{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Dt.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 Qn=[new nt,new nt,new nt,new nt],$s=new Ot;class El{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new wl,this.statePool=[],this.quad=new _p,this.quadUv=new xp,this.tempRect=new At,this.activeState={},this.globalUniforms=new ae({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 wp,a=this.renderer.renderTexture;let o=r[0].resolution,l=r[0].multisample,h=r[0].padding,c=r[0].autoFit,f=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),h=this.useMaxPadding?Math.max(h,v.padding):h+v.padding,c=c&&v.autoFit,f=f||(v.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),i.push(s),s.resolution=o,s.multisample=l,s.legacy=f,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(h);const u=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB($s.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 h=i.filterArea;h[0]=r.destinationFrame.width,h[1]=r.destinationFrame.height,h[2]=r.sourceFrame.x,h[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,He.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let h=r.renderTexture,c=this.getOptimalFilterTexture(h.width,h.height,r.resolution);c.filterFrame=h.filterFrame;let f=0;for(f=0;f<n.length-1;++f){f===1&&r.multisample>1&&(c=this.getOptimalFilterTexture(h.width,h.height,r.resolution),c.filterFrame=h.filterFrame),n[f].apply(this,h,c,He.CLEAR,r);const u=h;h=c,c=u}n[f].apply(this,h,l.renderTexture,He.BLEND,r),f>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(c)}r.clear(),this.statePool.push(r)}bindAndClear(t,r=He.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===He.CLEAR||r===He.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(Pe.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Pe.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(Ot.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=Dt.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||Dt.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=Qn[0],i=Qn[1],s=Qn[2],a=Qn[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),h=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=h-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:h}=s;if((Math.abs(o)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(h)>1e-4))return}s=s?$s.copyFrom(s):$s.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)}}}El.extension={type:pt.RendererSystem,name:"filter"},wt.add(El);class Ep{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Dt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Tp=new At;class Tl{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Gs(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;vt.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=Di.COLOR|Di.DEPTH){const{gl:a}=this;a.clearColor(t,r,n,i),a.clear(s)}initFramebuffer(t){const{gl:r}=this,n=new Ep(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 h=s[l],c=h.parentTextureArray||h;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,h.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 h=t.depthTexture;this.renderer.texture.bind(h,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,h._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=Dt.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=Dt.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 Gs(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=Tp,r.width=i.width,r.height=i.height),n||(n=r);const h=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,h?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}}Tl.extension={type:pt.RendererSystem,name:"framebuffer"},wt.add(Tl);const qs={5126:4,5123:2,5121:1};class Al{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;vt.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),h=t.glVertexArrayObjects[this.CONTEXT_UID];let c=h[l];if(c)return h[o.id]=c,c;const f=t.buffers,u=t.attributes,d={},p={};for(const v in f)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*qs[u[v].type];for(const v in u){const g=u[v],y=g.size;g.stride===void 0&&(d[g.buffer]===y*qs[g.type]?g.stride=0:g.stride=d[g.buffer]),g.start===void 0&&(g.start=p[g.buffer],p[g.buffer]+=y*qs[g.type])}c=i.createVertexArray(),i.bindVertexArray(c);for(let v=0;v<f.length;v++){const g=f[v];a.bind(g),n&&g._glBuffers[s].refCount++}return this.activateVao(t,o),h[o.id]=c,h[l]=c,i.bindVertexArray(null),a.unbind(ve.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 h=s[l]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&a.dispose(s[l],r))}if(!r){for(const l in n)if(l[0]==="g"){const h=n[l];this._activeVao===h&&this.unbind(),i.deleteVertexArray(h)}}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 h in o){const c=o[h],f=a[c.buffer],u=f._glBuffers[i];if(r.attributeData[h]){l!==u&&(s.bind(f),l=u);const d=r.attributeData[h].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}}Al.extension={type:pt.RendererSystem,name:"geometry"},wt.add(Al);const Sl=new Ot;class Ap{constructor(t,r){this._texture=t,this.mapCoord=new Ot,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&&(Sl.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Sl));const a=r.baseTexture,o=this.uClampFrame,l=this.clampMargin/a.resolution,h=this.clampOffset;return o[0]=(r._frame.x+l+h)/a.width,o[1]=(r._frame.y+l+h)/a.height,o[2]=(r._frame.x+r._frame.width-l+h)/a.width,o[3]=(r._frame.y+r._frame.height-l+h)/a.height,this.uClampOffset[0]=h/a.realWidth,this.uClampOffset[1]=h/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var Sp=`varying vec2 vMaskCoord;
386
+ `;const Qr=class extends Zr{constructor(e,t,r){const n=Ae.from(e||Qr.defaultVertexSrc,t||Qr.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=Qr.defaultResolution,this.multisample=Qr.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Pn}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 jd}static get defaultFragmentSrc(){return Dd}};let Se=Qr;Se.defaultResolution=1,Se.defaultMultisample=Ft.NONE;class jn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Wt(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(){}}jn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},jn.extension={type:[dt.RendererSystem,dt.CanvasRendererSystem],name:"background"},xt.add(jn);class Jo{constructor(t){this.renderer=t,this.emptyRenderer=new Qo(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}}Jo.extension={type:dt.RendererSystem,name:"batch"},xt.add(Jo);let tl=0;class $n{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=tl++}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=tl++,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(pt.PREFER_ENV>=je.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")}}$n.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},$n.extension={type:dt.RendererSystem,name:"context"},xt.add($n);class $d extends gs{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 Ss{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 ne("disposeFramebuffer"),this.multisample=Ft.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,r){return this.colorTextures[t]=r||new mt(null,{scaleMode:xe.NEAREST,resolution:1,mipmap:$e.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new mt(new $d(null,{width:this.width,height:this.height}),{scaleMode:xe.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:$e.OFF,format:rt.DEPTH_COMPONENT,type:yt.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 el extends mt{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=Ft.NONE),super(null,t),this.mipmap=$e.OFF,this.valid=!0,this._clear=new Wt([0,0,0,0]),this.framebuffer=new Ss(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 Wr{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=od(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 rl 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??pt.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 nl{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=Pt.add(n,Pt.NW),this.x0=l+a*Pt.uX(n),this.y0=f+o*Pt.uY(n),n=Pt.add(n,2),this.x1=l+a*Pt.uX(n),this.y1=f+o*Pt.uY(n),n=Pt.add(n,2),this.x2=l+a*Pt.uX(n),this.y2=f+o*Pt.uY(n),n=Pt.add(n,2),this.x3=l+a*Pt.uX(n),this.y3=f+o*Pt.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 il=new nl;function Gn(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class gt extends dn{constructor(t,r,n,i,s,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new wt(0,0,1,1)),t instanceof gt&&(t=t.baseTexture),this.baseTexture=t,this._frame=r,this.trim=i,this.valid=!1,this._uvs=il,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 $t(a.x,a.y):new $t(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&&be[r.url]&&gt.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,gt.removeFromCache(this),this.textureCacheIds=null}clone(){var i;const t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),n=new gt(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===il&&(this._uvs=new nl),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,r={},n=pt.STRICT_TEXTURE_CACHE){const i=typeof t=="string";let s=null;if(i)s=t;else if(t instanceof mt){if(!t.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Xr()}`,mt.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Xr()}`}s=t._pixiId}let a=be[s];if(i&&n&&!a)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!a&&!(t instanceof mt)?(r.resolution||(r.resolution=Bo(t)),a=new gt(new mt(t,r)),a.baseTexture.cacheId=s,mt.addToCache(a.baseTexture,s),gt.addToCache(a,s)):!a&&t instanceof mt&&(a=new gt(t),gt.addToCache(a,s)),a}static fromURL(t,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=gt.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 gt(mt.fromBuffer(t,r,n,i))}static fromLoader(t,r,n,i){const s=new mt(t,Object.assign({scaleMode:mt.defaultOptions.scaleMode,resolution:Bo(r)},i)),{resource:a}=s;a instanceof rl&&(a.url=r);const o=new gt(s);return n||(n=r),mt.addToCache(o.baseTexture,n),gt.addToCache(o,n),n!==r&&(mt.addToCache(o.baseTexture,r),gt.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),be[r]&&be[r]!==t&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),be[r]=t)}static removeFromCache(t){if(typeof t=="string"){const r=be[t];if(r){const n=r.textureCacheIds.indexOf(t);return n>-1&&r.textureCacheIds.splice(n,1),delete be[t],r}}else if(t!=null&&t.textureCacheIds){for(let r=0;r<t.textureCacheIds.length;++r)be[t.textureCacheIds[r]]===t&&delete be[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 gt._EMPTY||(gt._EMPTY=new gt(new mt),Gn(gt._EMPTY),Gn(gt._EMPTY.baseTexture)),gt._EMPTY}static get WHITE(){if(!gt._WHITE){const t=pt.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),gt._WHITE=new gt(mt.from(t)),Gn(gt._WHITE),Gn(gt._WHITE.baseTexture)}return gt._WHITE}}class qn extends gt{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 qn(new el(t))}}class sl{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,r,n=Ft.NONE){const i=new el(Object.assign({width:t,height:r,resolution:1,multisample:n},this.textureOptions));return new qn(i)}getOptimalTexture(t,r,n=1,i=Ft.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=Nn(t),r=Nn(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||Ft.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}}}sl.SCREEN_KEY=-1;class Gd extends gr{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class qd extends gr{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 Yt(this.vertices),this.uvBuffer=new Yt(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 Hd{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ft.NONE,this.sourceFrame=new wt,this.destinationFrame=new wt,this.bindingSourceFrame=new wt,this.bindingDestinationFrame=new wt,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Hn=[new $t,new $t,new $t,new $t],Os=new Xt;class al{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new sl,this.statePool=[],this.quad=new Gd,this.quadUv=new qd,this.tempRect=new wt,this.activeState={},this.globalUniforms=new ie({outputFrame:new wt,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 Hd,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 m=r[p];o=Math.min(o,m.resolution),l=Math.min(l,m.multisample),f=this.useMaxPadding?Math.max(f,m.padding):f+m.padding,c=c&&m.autoFit,h=h||(m.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(Os.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,Ge.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,Ge.CLEAR,r);const u=f;f=c,c=u}n[h].apply(this,f,l.renderTexture,Ge.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=Ge.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===Ge.CLEAR||r===Ge.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(Xt.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=Ft.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||Ft.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=Hn[0],i=Hn[1],s=Hn[2],a=Hn[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?Os.copyFrom(s):Os.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)}}}al.extension={type:dt.RendererSystem,name:"filter"},xt.add(al);class Vd{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ft.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const zd=new wt;class ol{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Ss(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 wt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;pt.PREFER_ENV===je.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=Ei.COLOR|Ei.DEPTH){const{gl:a}=this;a.clearColor(t,r,n,i),a.clear(s)}initFramebuffer(t){const{gl:r}=this,n=new Vd(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=Ft.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=Ft.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 Ss(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=zd,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 wt}destroy(){this.renderer=null}}ol.extension={type:dt.RendererSystem,name:"framebuffer"},xt.add(ol);const Is={5126:4,5123:2,5121:1};class ll{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;pt.PREFER_ENV===je.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 m in h)d[m]=0,p[m]=0;for(const m in u)!u[m].size&&o.attributeData[m]?u[m].size=o.attributeData[m].size:u[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),d[u[m].buffer]+=u[m].size*Is[u[m].type];for(const m in u){const b=u[m],v=b.size;b.stride===void 0&&(d[b.buffer]===v*Is[b.type]?b.stride=0:b.stride=d[b.buffer]),b.start===void 0&&(b.start=p[b.buffer],p[b.buffer]+=v*Is[b.type])}c=i.createVertexArray(),i.bindVertexArray(c);for(let m=0;m<h.length;m++){const b=h[m];a.bind(b),n&&b._glBuffers[s].refCount++}return this.activateVao(t,o),f[o.id]=c,f[l]=c,i.bindVertexArray(null),a.unbind(ve.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}}ll.extension={type:dt.RendererSystem,name:"geometry"},xt.add(ll);const ul=new Xt;class Xd{constructor(t,r){this._texture=t,this.mapCoord=new Xt,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&&(ul.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(ul));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 Wd=`varying vec2 vMaskCoord;
387
387
  varying vec2 vTextureCoord;
388
388
 
389
389
  uniform sampler2D uSampler;
@@ -408,7 +408,7 @@ void main(void)
408
408
 
409
409
  gl_FragColor = original;
410
410
  }
411
- `,Op=`attribute vec2 aVertexPosition;
411
+ `,Yd=`attribute vec2 aVertexPosition;
412
412
  attribute vec2 aTextureCoord;
413
413
 
414
414
  uniform mat3 projectionMatrix;
@@ -424,7 +424,7 @@ void main(void)
424
424
  vTextureCoord = aTextureCoord;
425
425
  vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
426
426
  }
427
- `;class Rp extends Oe{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||Op,r||Sp,n),this.maskSprite=i,this.maskMatrix=new Ot}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 Ap(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 Ip{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=Oe.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 Ol{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 Ip;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 Rp]));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 h=n.filterArea;n.filterArea=r.getBounds(!0),s.filter.push(n,i),n.filterArea=h,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}}Ol.extension={type:pt.RendererSystem,name:"mask"},wt.add(Ol);class Rl{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 Il=new Ot,Nl=[],Jn=class extends Rl{constructor(e){super(e),this.glConst=vt.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,Nl.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()||Jn.isMatrixRotated(t.worldTransform)||Jn.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){Jn.isMatrixRotated(i)||(i=i?Il.copyFrom(i):Il.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&&Nl.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 Cl=Jn;Cl.extension={type:pt.RendererSystem,name:"scissor"},wt.add(Cl);class kl extends Rl{constructor(t){super(t),this.glConst=vt.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)}}kl.extension={type:pt.RendererSystem,name:"stencil"},wt.add(kl);class Pl{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return xt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return xt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return xt("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}}Pl.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"_plugin"},wt.add(Pl);class Ml{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ot,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}}Ml.extension={type:pt.RendererSystem,name:"projection"},wt.add(Ml);const Np=new Hn;class Ll{constructor(t){this.renderer=t,this._tempMatrix=new Ot}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=Np,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,a}destroy(){}}Ll.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"textureGenerator"},wt.add(Ll);const tr=new At,sn=new At;class Fl{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||(tr.width=t.frame.width,tr.height=t.frame.height,r=tr),n||(sn.x=t.frame.x,sn.y=t.frame.y,sn.width=r.width,sn.height=r.height,n=sn),a=s.framebuffer):(o=i.resolution,r||(tr.width=i._view.screen.width,tr.height=i._view.screen.height,r=tr),n||(n=tr,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?Wt.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:h,width:c,height:f}=this.viewportFrame;l=Math.round(l),h=Math.round(h),c=Math.round(c),f=Math.round(f),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(l,h,c,f)}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}}Fl.extension={type:pt.RendererSystem,name:"renderTexture"},wt.add(Fl);class Cp{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 kp(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=dl(t,s.type),o={type:a,name:s.name,size:cl(a),location:t.getAttribLocation(e,s.name)};r[s.name]=o}return r}function Pp(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=dl(t,s.type);r[a]={name:a,index:i,type:l,size:s.size,isArray:o,value:ll(l,s.size)}}return r}function Mp(e,t){var l;const r=ol(e,e.VERTEX_SHADER,t.vertexSrc),n=ol(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)||op(e,i,r,n),t.attributeData=kp(i,e),t.uniformData=Pp(i,e),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){const h=Object.keys(t.attributeData);h.sort((c,f)=>c>f?1:-1);for(let c=0;c<h.length;c++)t.attributeData[h[c]].location=c,e.bindAttribLocation(i,c,h[c]);e.linkProgram(i)}e.deleteShader(r),e.deleteShader(n);const a={};for(const h in t.uniformData){const c=t.uniformData[h];a[h]={location:e.getUniformLocation(i,h),value:ll(c.type,c.size)}}return new Cp(i,a)}function Lp(e,t,r,n,i){r.buffer.update(i)}const Fp={float:`
427
+ `;class Kd 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||Yd,r||Wd,n),this.maskSprite=i,this.maskMatrix=new Xt}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 Xd(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 Zd{constructor(t=null){this.type=Bt.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=Bt.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 fl{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 Zd;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!==Bt.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Bt.SCISSOR:this.renderer.scissor.push(n);break;case Bt.STENCIL:this.renderer.stencil.push(n);break;case Bt.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Bt.COLOR:this.pushColorMask(n);break}n.type===Bt.SPRITE&&this.maskStack.push(n)}pop(t){const r=this.maskStack.pop();if(!(!r||r._target!==t)){if(r.enabled)switch(r.type){case Bt.SCISSOR:this.renderer.scissor.pop(r);break;case Bt.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Bt.SPRITE:this.popSpriteMask(r);break;case Bt.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===Bt.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(t){const r=t.maskObject;r?r.isSprite?t.type=Bt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Bt.SCISSOR:t.type=Bt.STENCIL:t.type=Bt.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 Kd]));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}}fl.extension={type:dt.RendererSystem,name:"mask"},xt.add(fl);class cl{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 hl=new Xt,dl=[],Vn=class extends cl{constructor(e){super(e),this.glConst=pt.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,dl.pop()??new wt);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()||Vn.isMatrixRotated(t.worldTransform)||Vn.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){Vn.isMatrixRotated(i)||(i=i?hl.copyFrom(i):hl.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&&dl.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 pl=Vn;pl.extension={type:dt.RendererSystem,name:"scissor"},xt.add(pl);class vl extends cl{constructor(t){super(t),this.glConst=pt.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)}}vl.extension={type:dt.RendererSystem,name:"stencil"},xt.add(vl);class yl{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return _t("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return _t("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return _t("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}}yl.extension={type:[dt.RendererSystem,dt.CanvasRendererSystem],name:"_plugin"},xt.add(yl);class ml{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Xt,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}}ml.extension={type:dt.RendererSystem,name:"projection"},xt.add(ml);const Qd=new Ts;class gl{constructor(t){this.renderer=t,this._tempMatrix=new Xt}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=qn.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=Qd,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,a}destroy(){}}gl.extension={type:[dt.RendererSystem,dt.CanvasRendererSystem],name:"textureGenerator"},xt.add(gl);const Ze=new wt,Jr=new wt;class bl{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new wt,this.destinationFrame=new wt,this.viewportFrame=new wt}bind(t=null,r,n){const i=this.renderer;this.current=t;let s,a,o;t?(s=t.baseTexture,o=s.resolution,r||(Ze.width=t.frame.width,Ze.height=t.frame.height,r=Ze),n||(Jr.x=t.frame.x,Jr.y=t.frame.y,Jr.width=r.width,Jr.height=r.height,n=Jr),a=s.framebuffer):(o=i.resolution,r||(Ze.width=i._view.screen.width,Ze.height=i._view.screen.height,r=Ze),n||(n=Ze,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?Wt.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}}bl.extension={type:dt.RendererSystem,name:"renderTexture"},xt.add(bl);class Jd{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 tp(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=Ko(t,s.type),o={type:a,name:s.name,size:Wo(a),location:t.getAttribLocation(e,s.name)};r[s.name]=o}return r}function ep(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=Ko(t,s.type);r[a]={name:a,index:i,type:l,size:s.size,isArray:o,value:Vo(l,s.size)}}return r}function rp(e,t){var l;const r=Ho(e,e.VERTEX_SHADER,t.vertexSrc),n=Ho(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)||Nd(e,i,r,n),t.attributeData=tp(i,e),t.uniformData=ep(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:Vo(c.type,c.size)}}return new Jd(i,a)}function np(e,t,r,n,i){r.buffer.update(i)}const ip={float:`
428
428
  data[offset] = v;
429
429
  `,vec2:`
430
430
  data[offset] = v[0];
@@ -462,7 +462,7 @@ void main(void)
462
462
  {
463
463
  data[offset + i] = v[i];
464
464
  }
465
- `},Bl={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 Bp(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=Bl[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 Dp(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 Up(e,t){if(!e.autoManage)return{size:0,syncFunc:Lp};const r=Dp(e.uniforms,t),{uboElements:n,size:i}=Bp(r),s=[`
465
+ `},_l={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 sp(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=_l[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 ap(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 op(e,t){if(!e.autoManage)return{size:0,syncFunc:np};const r=ap(e.uniforms,t),{uboElements:n,size:i}=sp(r),s=[`
466
466
  var v = null;
467
467
  var v2 = null;
468
468
  var cv = null;
@@ -470,9 +470,9 @@ void main(void)
470
470
  var gl = renderer.gl
471
471
  var index = 0;
472
472
  var data = buffer.data;
473
- `];for(let a=0;a<n.length;a++){const o=n[a],l=e.uniforms[o.data.name],h=o.data.name;let c=!1;for(let f=0;f<Er.length;f++){const u=Er[f];if(u.codeUbo&&u.test(o.data,l)){s.push(`offset = ${o.offset/4};`,Er[f].codeUbo(o.data.name,l)),c=!0;break}}if(!c)if(o.data.size>1){const f=cl(o.data.type),u=Math.max(Bl[o.data.type]/16,1),d=f/u,p=(4-d%4)%4;s.push(`
474
- cv = ud.${h}.value;
475
- v = uv.${h};
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<_r.length;h++){const u=_r[h];if(u.codeUbo&&u.test(o.data,l)){s.push(`offset = ${o.offset/4};`,_r[h].codeUbo(o.data.name,l)),c=!0;break}}if(!c)if(o.data.size>1){const h=Wo(o.data.type),u=Math.max(_l[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
476
  offset = ${o.offset/4};
477
477
 
478
478
  t = 0;
@@ -486,15 +486,15 @@ void main(void)
486
486
  offset += ${p};
487
487
  }
488
488
 
489
- `)}else{const f=Fp[o.data.type];s.push(`
490
- cv = ud.${h}.value;
491
- v = uv.${h};
489
+ `)}else{const h=ip[o.data.type];s.push(`
490
+ cv = ud.${f}.value;
491
+ v = uv.${f};
492
492
  offset = ${o.offset/4};
493
- ${f};
493
+ ${h};
494
494
  `)}}return s.push(`
495
495
  renderer.buffer.update(buffer);
496
496
  `),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
497
- `))}}let jp=0;const ti={textureCount:0,uboCount:0};class Dl{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=jp++}systemCheck(){if(!up())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||(ti.textureCount=0,ti.uboCount=0,this.syncUniformGroup(t.uniformGroup,ti)),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]=ip(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,ti,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]=Up(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=Mp(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}}Dl.extension={type:pt.RendererSystem,name:"shader"},wt.add(Dl);class ei{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(){}}ei.defaultOptions={hello:!1},ei.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"startup"},wt.add(ei);function Gp(e,t=[]){return t[ut.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.ADD]=[e.ONE,e.ONE],t[ut.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.NONE]=[0,0],t[ut.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[ut.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ut.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[ut.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[ut.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ut.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[ut.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[ut.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[ut.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[ut.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ut.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const $p=0,qp=1,Hp=2,zp=3,Vp=4,Xp=5,Hs=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ut.NONE,this._blendEq=!1,this.map=[],this.map[$p]=this.setBlend,this.map[qp]=this.setOffset,this.map[Hp]=this.setCullFace,this.map[zp]=this.setDepthTest,this.map[Vp]=this.setFrontFace,this.map[Xp]=this.setDepthMask,this.checks=[],this.defaultState=new Un,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=Gp(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(Hs.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Hs.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 Ul=Hs;Ul.extension={type:pt.RendererSystem,name:"state"},wt.add(Ul);class Wp extends _n{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 se(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 ri=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=ri.defaultMaxIdle,this.checkCountMax=ri.defaultCheckCountMax,this.mode=ri.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==ji.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 ue=ri;ue.defaultMode=ji.AUTO,ue.defaultMaxIdle=60*60,ue.defaultCheckCountMax=60*10,ue.extension={type:pt.RendererSystem,name:"textureGC"},wt.add(ue);class zs{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=mt.UNSIGNED_BYTE,this.internalFormat=rt.RGBA,this.samplerType=0}}function Yp(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[mt.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},[mt.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},[mt.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},[mt.SHORT]:{[rt.RGBA_INTEGER]:e.RGBA16I,[rt.RGB_INTEGER]:e.RGB16I,[rt.RG_INTEGER]:e.RG16I,[rt.RED_INTEGER]:e.R16I},[mt.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},[mt.INT]:{[rt.RGBA_INTEGER]:e.RGBA32I,[rt.RGB_INTEGER]:e.RGB32I,[rt.RG_INTEGER]:e.RG32I,[rt.RED_INTEGER]:e.R32I},[mt.FLOAT]:{[rt.RGBA]:e.RGBA32F,[rt.RGB]:e.RGB32F,[rt.RG]:e.RG32F,[rt.RED]:e.R32F,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[mt.HALF_FLOAT]:{[rt.RGBA]:e.RGBA16F,[rt.RGB]:e.RGB16F,[rt.RG]:e.RG16F,[rt.RED]:e.R16F},[mt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB565},[mt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA4},[mt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGB5_A1},[mt.UNSIGNED_INT_2_10_10_10_REV]:{[rt.RGBA]:e.RGB10_A2,[rt.RGBA_INTEGER]:e.RGB10_A2UI},[mt.UNSIGNED_INT_10F_11F_11F_REV]:{[rt.RGB]:e.R11F_G11F_B10F},[mt.UNSIGNED_INT_5_9_9_9_REV]:{[rt.RGB]:e.RGB9_E5},[mt.UNSIGNED_INT_24_8]:{[rt.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[mt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[rt.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[mt.UNSIGNED_BYTE]:{[rt.RGBA]:e.RGBA,[rt.RGB]:e.RGB,[rt.ALPHA]:e.ALPHA,[rt.LUMINANCE]:e.LUMINANCE,[rt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[mt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB},[mt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA},[mt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGBA}},t}class jl{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new gt,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=Yp(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 zs(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 zs(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!==Ui.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const r=new zs(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===mt.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!==Ui.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&&Bn(this.managedTextures,i,1)}}updateTextureStyle(t){var n;const r=t._glTextures[this.CONTEXT_UID];r&&((t.mipmap===qe.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?r.mipmap=!1:r.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?r.wrapMode=$r.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!==qe.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===we.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===we.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===we.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===we.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}jl.extension={type:pt.RendererSystem,name:"texture"},wt.add(jl);class Gl{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}}Gl.extension={type:pt.RendererSystem,name:"transformFeedback"},wt.add(Gl);class ni{constructor(t){this.renderer=t}init(t){this.screen=new At(0,0,t.width,t.height),this.element=t.view||vt.ADAPTER.createCanvas(),this.resolution=t.resolution||vt.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}}ni.defaultOptions={width:800,height:600,resolution:vt.RESOLUTION,autoDensity:!1},ni.extension={type:[pt.RendererSystem,pt.CanvasRendererSystem],name:"_view"},wt.add(ni),vt.PREFER_ENV=$e.WEBGL2,vt.STRICT_TEXTURE_CACHE=!1,vt.RENDER_OPTIONS={...Yn.defaultOptions,...Wn.defaultOptions,...ni.defaultOptions,...ei.defaultOptions},Object.defineProperties(vt,{WRAP_MODE:{get(){return gt.defaultOptions.wrapMode},set(e){xt("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),gt.defaultOptions.wrapMode=e}},SCALE_MODE:{get(){return gt.defaultOptions.scaleMode},set(e){xt("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),gt.defaultOptions.scaleMode=e}},MIPMAP_TEXTURES:{get(){return gt.defaultOptions.mipmap},set(e){xt("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),gt.defaultOptions.mipmap=e}},ANISOTROPIC_LEVEL:{get(){return gt.defaultOptions.anisotropicLevel},set(e){xt("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),gt.defaultOptions.anisotropicLevel=e}},FILTER_RESOLUTION:{get(){return xt("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Oe.defaultResolution},set(e){Oe.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return xt("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Oe.defaultMultisample},set(e){Oe.defaultMultisample=e}},SPRITE_MAX_TEXTURES:{get(){return le.defaultMaxTextures},set(e){xt("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),le.defaultMaxTextures=e}},SPRITE_BATCH_SIZE:{get(){return le.defaultBatchSize},set(e){xt("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),le.defaultBatchSize=e}},CAN_UPLOAD_SAME_BUFFER:{get(){return le.canUploadSameBuffer},set(e){xt("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),le.canUploadSameBuffer=e}},GC_MODE:{get(){return ue.defaultMode},set(e){xt("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),ue.defaultMode=e}},GC_MAX_IDLE:{get(){return ue.defaultMaxIdle},set(e){xt("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),ue.defaultMaxIdle=e}},GC_MAX_CHECK_COUNT:{get(){return ue.defaultCheckCountMax},set(e){xt("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),ue.defaultCheckCountMax=e}},PRECISION_VERTEX:{get(){return Se.defaultVertexPrecision},set(e){xt("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Se.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return Se.defaultFragmentPrecision},set(e){xt("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Se.defaultFragmentPrecision=e}}});var an=(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))(an||{});class Vs{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 Kt=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 Vs(null,null,1/0),this.deltaMS=1/Kt.targetFPMS,this.elapsedMS=1/Kt.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=an.NORMAL){return this._addListener(new Vs(e,t,r))}addOnce(e,t,r=an.NORMAL){return this._addListener(new Vs(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*Kt.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,Kt.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(!Kt._shared){const e=Kt._shared=new Kt;e.autoStart=!0,e._protected=!0}return Kt._shared}static get system(){if(!Kt._system){const e=Kt._system=new Kt;e.autoStart=!0,e._protected=!0}return Kt._system}};let Zt=Kt;Zt.targetFPMS=.06,Object.defineProperties(vt,{TARGET_FPMS:{get(){return Zt.targetFPMS},set(e){xt("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Zt.targetFPMS=e}}});class $l{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,an.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Zt.shared:new Zt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}$l.extension=pt.Application,wt.add($l);const Kp=[];wt.handleByList(pt.Renderer,Kp);class ql{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>=Dt.HIGH?this.multisample=Dt.HIGH:r>=Dt.MEDIUM?this.multisample=Dt.MEDIUM:r>=Dt.LOW?this.multisample=Dt.LOW:this.multisample=Dt.NONE}destroy(){}}ql.extension={type:pt.RendererSystem,name:"_multisample"},wt.add(ql);class Zp{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Hl{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 Zp(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[r]}}Hl.extension={type:pt.RendererSystem,name:"buffer"},wt.add(Hl);class zl{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}}zl.extension={type:pt.RendererSystem,name:"objectRenderer"},wt.add(zl);const Xs=class extends Wp{constructor(e){super(),this.type=Da.WEBGL,e=Object.assign({},vt.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new ae({projectionMatrix:new Ot},!0);const t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Xs.__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&&(xt("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=Xs.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:Sd()}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 xt("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return xt("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return xt("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return xt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){xt("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return xt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){xt("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return xt("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 Sr=Xs;Sr.extension={type:pt.Renderer,priority:1},Sr.__plugins={},Sr.__systems={},wt.handleByMap(pt.RendererPlugin,Sr.__plugins),wt.handleByMap(pt.RendererSystem,Sr.__systems),wt.add(Sr);class Vl extends Jr{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 gt;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 Jr?this.addResourceAt(t[n],n):this.addResourceAt(rl(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 Qp extends Vl{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=lr.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 h=a[l];s[l]<h.dirtyId&&(s[l]=h.dirtyId,h.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,l,h.resource.width,h.resource.height,1,r.format,n.type,h.resource.source))}return!0}}class Jp extends Ue{constructor(t){super(t)}static test(t){const{OffscreenCanvas:r}=globalThis;return r&&t instanceof r?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const on=class extends Vl{constructor(e,t){const{width:r,height:n,autoLoad:i,linkBaseTexture:s}=t||{};if(e&&e.length!==on.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:r,height:n});for(let a=0;a<on.SIDES;a++)this.items[a].target=lr.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=lr.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=lr.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<on.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===on.SIDES}};let Xl=on;Xl.SIDES=6;class Or extends Ue{constructor(t,r){r=r||{};let n,i;typeof t=="string"?(n=Or.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 vt.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===Me.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 Or._EMPTY=Or._EMPTY??vt.ADAPTER.createCanvas(0,0),Or._EMPTY}}const ii=class extends Ue{constructor(e,t){t=t||{},super(vt.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)},ii.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;Ue.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_${Qr()}`,s.getContext("2d").drawImage(e,0,0,t,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(e){const t=ii.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"&&ii.SVG_XML.test(e)}};let Ws=ii;Ws.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Ws.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Ys=class extends Ue{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];Ue.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(),h=l.slice(l.lastIndexOf(".")+1);o=o||Ys.MIME_TYPES[h]||`video/${h}`,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=Zt.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&&(Zt.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(Zt.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&&(Zt.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?(Zt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Zt.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||Ys.TYPES.includes(t)}};let Ks=Ys;Ks.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ks.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},Ps.push(Or,bl,Jp,Ks,Ws,Ms,Xl,Qp);var ty=`attribute vec2 aVertexPosition;
497
+ `))}}let lp=0;const zn={textureCount:0,uboCount:0};class xl{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=lp++}systemCheck(){if(!Cd())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||(zn.textureCount=0,zn.uboCount=0,this.syncUniformGroup(t.uniformGroup,zn)),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]=Sd(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,zn,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]=op(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=rp(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}}xl.extension={type:dt.RendererSystem,name:"shader"},xt.add(xl);class Xn{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(){}}Xn.defaultOptions={hello:!1},Xn.extension={type:[dt.RendererSystem,dt.CanvasRendererSystem],name:"startup"},xt.add(Xn);function up(e,t=[]){return t[lt.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.ADD]=[e.ONE,e.ONE],t[lt.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.NONE]=[0,0],t[lt.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.ADD_NPM]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t[lt.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[lt.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[lt.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[lt.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[lt.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[lt.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[lt.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[lt.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[lt.XOR]=[e.ONE_MINUS_DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[lt.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}const fp=0,cp=1,hp=2,dp=3,pp=4,vp=5,Ns=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=lt.NONE,this._blendEq=!1,this.map=[],this.map[fp]=this.setBlend,this.map[cp]=this.setOffset,this.map[hp]=this.setCullFace,this.map[dp]=this.setDepthTest,this.map[pp]=this.setFrontFace,this.map[vp]=this.setDepthMask,this.checks=[],this.defaultState=new Pn,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=up(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(Ns.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Ns.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 El=Ns;El.extension={type:dt.RendererSystem,name:"state"},xt.add(El);class yp extends dn{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 ne(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 Wn=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Wn.defaultMaxIdle,this.checkCountMax=Wn.defaultCheckCountMax,this.mode=Wn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==wi.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 oe=Wn;oe.defaultMode=wi.AUTO,oe.defaultMaxIdle=60*60,oe.defaultCheckCountMax=60*10,oe.extension={type:dt.RendererSystem,name:"textureGC"},xt.add(oe);class Rs{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=yt.UNSIGNED_BYTE,this.internalFormat=rt.RGBA,this.samplerType=0}}function mp(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[yt.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},[yt.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},[yt.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},[yt.SHORT]:{[rt.RGBA_INTEGER]:e.RGBA16I,[rt.RGB_INTEGER]:e.RGB16I,[rt.RG_INTEGER]:e.RG16I,[rt.RED_INTEGER]:e.R16I},[yt.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},[yt.INT]:{[rt.RGBA_INTEGER]:e.RGBA32I,[rt.RGB_INTEGER]:e.RGB32I,[rt.RG_INTEGER]:e.RG32I,[rt.RED_INTEGER]:e.R32I},[yt.FLOAT]:{[rt.RGBA]:e.RGBA32F,[rt.RGB]:e.RGB32F,[rt.RG]:e.RG32F,[rt.RED]:e.R32F,[rt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[yt.HALF_FLOAT]:{[rt.RGBA]:e.RGBA16F,[rt.RGB]:e.RGB16F,[rt.RG]:e.RG16F,[rt.RED]:e.R16F},[yt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB565},[yt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA4},[yt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGB5_A1},[yt.UNSIGNED_INT_2_10_10_10_REV]:{[rt.RGBA]:e.RGB10_A2,[rt.RGBA_INTEGER]:e.RGB10_A2UI},[yt.UNSIGNED_INT_10F_11F_11F_REV]:{[rt.RGB]:e.R11F_G11F_B10F},[yt.UNSIGNED_INT_5_9_9_9_REV]:{[rt.RGB]:e.RGB9_E5},[yt.UNSIGNED_INT_24_8]:{[rt.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[yt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[rt.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[yt.UNSIGNED_BYTE]:{[rt.RGBA]:e.RGBA,[rt.RGB]:e.RGB,[rt.ALPHA]:e.ALPHA,[rt.LUMINANCE]:e.LUMINANCE,[rt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[yt.UNSIGNED_SHORT_5_6_5]:{[rt.RGB]:e.RGB},[yt.UNSIGNED_SHORT_4_4_4_4]:{[rt.RGBA]:e.RGBA},[yt.UNSIGNED_SHORT_5_5_5_1]:{[rt.RGBA]:e.RGBA}},t}class Tl{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new mt,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=mp(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 Rs(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 Rs(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!==Ti.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const r=new Rs(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===yt.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!==Ti.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&&Rn(this.managedTextures,i,1)}}updateTextureStyle(t){var n;const r=t._glTextures[this.CONTEXT_UID];r&&((t.mipmap===$e.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?r.mipmap=!1:r.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?r.wrapMode=Br.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!==$e.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}}Tl.extension={type:dt.RendererSystem,name:"texture"},xt.add(Tl);class wl{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}}wl.extension={type:dt.RendererSystem,name:"transformFeedback"},xt.add(wl);class Yn{constructor(t){this.renderer=t}init(t){this.screen=new wt(0,0,t.width,t.height),this.element=t.view||pt.ADAPTER.createCanvas(),this.resolution=t.resolution||pt.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}}Yn.defaultOptions={width:800,height:600,resolution:pt.RESOLUTION,autoDensity:!1},Yn.extension={type:[dt.RendererSystem,dt.CanvasRendererSystem],name:"_view"},xt.add(Yn),pt.PREFER_ENV=je.WEBGL2,pt.STRICT_TEXTURE_CACHE=!1,pt.RENDER_OPTIONS={...$n.defaultOptions,...jn.defaultOptions,...Yn.defaultOptions,...Xn.defaultOptions},Object.defineProperties(pt,{WRAP_MODE:{get(){return mt.defaultOptions.wrapMode},set(e){_t("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),mt.defaultOptions.wrapMode=e}},SCALE_MODE:{get(){return mt.defaultOptions.scaleMode},set(e){_t("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),mt.defaultOptions.scaleMode=e}},MIPMAP_TEXTURES:{get(){return mt.defaultOptions.mipmap},set(e){_t("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),mt.defaultOptions.mipmap=e}},ANISOTROPIC_LEVEL:{get(){return mt.defaultOptions.anisotropicLevel},set(e){_t("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),mt.defaultOptions.anisotropicLevel=e}},FILTER_RESOLUTION:{get(){return _t("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Se.defaultResolution},set(e){Se.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return _t("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Se.defaultMultisample},set(e){Se.defaultMultisample=e}},SPRITE_MAX_TEXTURES:{get(){return ae.defaultMaxTextures},set(e){_t("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),ae.defaultMaxTextures=e}},SPRITE_BATCH_SIZE:{get(){return ae.defaultBatchSize},set(e){_t("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),ae.defaultBatchSize=e}},CAN_UPLOAD_SAME_BUFFER:{get(){return ae.canUploadSameBuffer},set(e){_t("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),ae.canUploadSameBuffer=e}},GC_MODE:{get(){return oe.defaultMode},set(e){_t("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),oe.defaultMode=e}},GC_MAX_IDLE:{get(){return oe.defaultMaxIdle},set(e){_t("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),oe.defaultMaxIdle=e}},GC_MAX_CHECK_COUNT:{get(){return oe.defaultCheckCountMax},set(e){_t("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),oe.defaultCheckCountMax=e}},PRECISION_VERTEX:{get(){return Ae.defaultVertexPrecision},set(e){_t("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Ae.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return Ae.defaultFragmentPrecision},set(e){_t("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Ae.defaultFragmentPrecision=e}}});var Kn=(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))(Kn||{});class Cs{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 Kt=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 Cs(null,null,1/0),this.deltaMS=1/Kt.targetFPMS,this.elapsedMS=1/Kt.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=Kn.NORMAL){return this._addListener(new Cs(e,t,r))}addOnce(e,t,r=Kn.NORMAL){return this._addListener(new Cs(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*Kt.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,Kt.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(!Kt._shared){const e=Kt._shared=new Kt;e.autoStart=!0,e._protected=!0}return Kt._shared}static get system(){if(!Kt._system){const e=Kt._system=new Kt;e.autoStart=!0,e._protected=!0}return Kt._system}};let le=Kt;le.targetFPMS=.06,Object.defineProperties(pt,{TARGET_FPMS:{get(){return le.targetFPMS},set(e){_t("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),le.targetFPMS=e}}});class Al{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,Kn.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?le.shared:new le,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Al.extension=dt.Application,xt.add(Al);const gp=[];xt.handleByList(dt.Renderer,gp);class Sl{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>=Ft.HIGH?this.multisample=Ft.HIGH:r>=Ft.MEDIUM?this.multisample=Ft.MEDIUM:r>=Ft.LOW?this.multisample=Ft.LOW:this.multisample=Ft.NONE}destroy(){}}Sl.extension={type:dt.RendererSystem,name:"_multisample"},xt.add(Sl);class bp{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Ol{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 bp(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[r]}}Ol.extension={type:dt.RendererSystem,name:"buffer"},xt.add(Ol);class Il{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}}Il.extension={type:dt.RendererSystem,name:"objectRenderer"},xt.add(Il);const Ps=class extends yp{constructor(e){super(),this.type=xa.WEBGL,e=Object.assign({},pt.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new ie({projectionMatrix:new Xt},!0);const t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Ps.__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&&(_t("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=Ps.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:Wh()}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 _t("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return _t("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return _t("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return _t("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){_t("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return _t("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){_t("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return _t("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 Tr=Ps;Tr.extension={type:dt.Renderer,priority:1},Tr.__plugins={},Tr.__systems={},xt.handleByMap(dt.RendererPlugin,Tr.__plugins),xt.handleByMap(dt.RendererSystem,Tr.__systems),xt.add(Tr);class Nl extends Wr{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 mt;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 Wr?this.addResourceAt(t[n],n):this.addResourceAt(Do(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 _p extends Nl{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=ir.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 xp 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 tn=class extends Nl{constructor(e,t){const{width:r,height:n,autoLoad:i,linkBaseTexture:s}=t||{};if(e&&e.length!==tn.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:r,height:n});for(let a=0;a<tn.SIDES;a++)this.items[a].target=ir.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=ir.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=ir.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<tn.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===tn.SIDES}};let Rl=tn;Rl.SIDES=6;class wr extends Be{constructor(t,r){r=r||{};let n,i;typeof t=="string"?(n=wr.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 pt.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 wr._EMPTY=wr._EMPTY??pt.ADAPTER.createCanvas(0,0),wr._EMPTY}}const Zn=class extends Be{constructor(e,t){t=t||{},super(pt.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)},Zn.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_${Xr()}`,s.getContext("2d").drawImage(e,0,0,t,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(e){const t=Zn.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"&&Zn.SVG_XML.test(e)}};let ks=Zn;ks.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,ks.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const Ms=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||Ms.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=le.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&&(le.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(le.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&&(le.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?(le.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(le.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||Ms.TYPES.includes(t)}};let Ls=Ms;Ls.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ls.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},ms.push(wr,rl,xp,Ls,ks,gs,Rl,_p);var Ep=`attribute vec2 aVertexPosition;
498
498
  attribute vec2 aTextureCoord;
499
499
 
500
500
  uniform mat3 projectionMatrix;
@@ -505,7 +505,7 @@ void main(void)
505
505
  {
506
506
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
507
507
  vTextureCoord = aTextureCoord;
508
- }`,ey=`varying vec2 vTextureCoord;
508
+ }`,Tp=`varying vec2 vTextureCoord;
509
509
  uniform sampler2D uSampler;
510
510
 
511
511
  uniform float gamma;
@@ -536,7 +536,7 @@ void main(void)
536
536
 
537
537
  gl_FragColor = c * alpha;
538
538
  }
539
- `;class Zs extends Oe{constructor(t){super(ty,ey),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 er=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(er||{});class Qs{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,h=n*r.x+s*r.y+o,c=i*r.x+a*r.y+l;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),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,h=t.d,c=t.tx,f=t.ty;let u=this.minX,d=this.minY,p=this.maxX,v=this.maxY,g=a*r+l*n+c,y=o*r+h*n+f;u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,g=a*i+l*n+c,y=o*i+h*n+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,g=a*r+l*s+c,y=o*r+h*s+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y:v,g=a*i+l*s+c,y=o*i+h*s+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,v=y>v?y: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 h=t[l],c=t[l+1];i=h<i?h:i,s=c<s?c:s,a=h>a?h: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,h=t.c,c=t.d,f=t.tx,u=t.ty;let d=this.minX,p=this.minY,v=this.maxX,g=this.maxY;for(let y=n;y<i;y+=2){const b=r[y],_=r[y+1],m=o*b+h*_+f,x=c*_+l*b+u;d=Math.min(d,m-s),v=Math.max(v,m+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,h=this.maxX,c=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=s>h?s:h,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,h=this.maxX,c=this.maxY;this.minX=n<o?n:o,this.minY=i<l?i:l,this.maxX=s>h?s:h,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 Rr extends _n{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Hn,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 Qs,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(Rr.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 Qs);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,h=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=h,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 ry),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*Kd}set angle(t){this.transform.rotation=t*Zd}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 ry extends Rr{constructor(){super(...arguments),this.sortDirty=null}}Rr.prototype.displayObjectUpdateTransform=Rr.prototype.updateTransform;const ny=new Ot;function iy(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}const Js=class extends Rr{constructor(){super(),this.children=[],this.sortableChildren=Js.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);Bn(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,Bn(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,Bn(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(iy),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!==Js.prototype._render&&(r=this.getBounds(!0));const i=e.projection.transform;if(i&&(n?(n=ny.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 rr=Js;rr.defaultSortableChildren=!1,rr.prototype.containerUpdateTransform=rr.prototype.updateTransform,Object.defineProperties(vt,{SORTABLE_CHILDREN:{get(){return rr.defaultSortableChildren},set(e){xt("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),rr.defaultSortableChildren=e}}});class si{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._hull=[new nt,new nt,new nt,new nt],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(t){this._x=t,this.dirtyID++}get y(){return this._y}set y(t){this._y=t,this.dirtyID++}get width(){return this._width}set width(t){this._width=t,this.dirtyID++}get height(){return this._height}set height(t){this._height=t,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[t,r,n,i]=this._hull;t.set(this._x,this._y),r.set(this._x+this._width,this._y),n.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new si(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}equals(t){return t?t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height:!1}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}}const Wl=new nt;class ai{constructor(t=0,r=0,n=0,i=0,s=0){t instanceof si&&(s=r||0,r=t.y,n=t.width,i=t.height,t=t.x),this.innerBounds=new si(t,r,n,i),this._rotation=s,this._center=new Je(this.updateCenter,this),this._hull=[new nt,new nt,new nt,new nt],this._matrix=new Ot,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(t){this.center.copyFrom(t)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(t){return t?this.innerBounds.equals(t.innerBounds)&&this.rotation===t.rotation:!1}contains(t,r){typeof t=="number"&&(t=Wl.set(t,r));const n=this._matrix.applyInverse(t,Wl);return this.innerBounds.contains(n.x,n.y)}copyFrom(t){return this.innerBounds.copyFrom(t.innerBounds),this.rotation=t.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const t=this.innerBounds,r=this._rotation,n=this._center,[i,s,a,o]=this._hull,l=this._matrix;n._x=t.x+t.width/2,n._y=t.y+t.height/2,l.identity().translate(-n.x,-n.y).rotate(r).translate(n.x,n.y),l.apply(t.topLeft,i),l.apply(t.topRight,s),l.apply(t.bottomRight,a),l.apply(t.bottomLeft,o),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const t=this.center,r=this.innerBounds;r.x=t.x-r.width/2,r.y=t.y-r.height/2}}class Yl{constructor(t,r){this._history=new Array(t),this._decayRatio=r,this._currentIndex=0;for(let n=0;n<t;n++)this._history[n]=0}next(t){const{_history:r,_decayRatio:n}=this,i=r.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,r[this._currentIndex]=t;let s=0,a=0;for(let o=this._currentIndex+1;o<i;o++)s=(s+r[o])*n,a=(a+1)*n;for(let o=0;o<=this._currentIndex;o++)s=(s+r[o])*n,a=(a+1)*n;return this._average=s/a,this._average}absDev(){let t=0;for(let r=0,n=this._history.length;r<n;r++)t+=Math.abs(this._history[r]-this._average);return t/this._history.length}}class oi{constructor(t={}){oi.prototype.__init.call(this),this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=t.reserve||0,this._capacityRatio=t.capacityRatio||1.2,this._decayRatio=t.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new Yl(128,this._decayRatio),this._marginAverageProvider=new Yl(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(t){this._freeList.length=Math.ceil(t)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(t){let r,n;Array.isArray(t)?(r=t,n=t.length):(n=t,r=new Array(n)),this._borrowRate+=n,this._flowRate+=n;let i=0;if(this._freeCount>0){const s=this._freeList,a=Math.min(this._freeCount,n);let o=this._freeCount;for(let l=0;l<a;l++)r[i]=s[o-1],++i,--o;this._freeCount=o}for(;i<n;)r[i]=this.create(),++i;return r}release(t){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=t,++this._freeCount}releaseArray(t){this._returnRate+=t.length,this._flowRate-=t.length,this._freeCount+t.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+t.length));for(let r=0,n=t.length;r<n;r++)this._freeList[this._freeCount]=t[r],++this._freeCount}reserve(t){if(this._reserveCount=t,this._freeCount<t){const r=this._freeCount-t;for(let n=0;n<r;n++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(t){if(this._freeCount>t){this.capacity>t*this._capacityRatio&&(this.capacity=t*this._capacityRatio);const n=Math.min(this._freeCount,this.capacity);for(let i=t;i<n;i++)this._freeList[i]=null}}startGC(t=Zt.shared){t.add(this._gcTick,null,an.UTILITY)}stopGC(t=Zt.shared){t.remove(this._gcTick)}__init(){this._gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const t=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const r=this._freeCount,n=this._freeList.length;if(r<128&&this._borrowRateAverage<128&&n<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+t){const s=i+t;this.capacity=Math.min(this._freeList.length,Math.ceil(s)),this._freeCount=this._freeList.length}}}}var ta;const Kl=new Map;class Zl{static build(t){let r=Kl.get(t);return r||(r=new class extends oi{create(){return new t}},Kl.set(t,r),r)}static buildFunctional(t){return new(ta=class extends oi{constructor(...n){super(...n),ta.prototype.__init.call(this)}__init(){this.create=t}},ta)}}const 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)),h=l*8+(i?4:0)+(s?4:0);if(t.length=h,h===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,f=l*4+(i?2:0)+2,u=f,d=h;{const p=i+a,v=s,g=r+p,y=r-p,b=n+v;if(t[c++]=g,t[c++]=b,t[--f]=b,t[--f]=y,s){const _=n-v;t[u++]=y,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,y=s+Math.sin(v)*o,b=r+g,_=r-g,m=n+y,x=n-y;t[c++]=b,t[c++]=m,t[--f]=m,t[--f]=_,t[u++]=_,t[u++]=x,t[--d]=x,t[--d]=b}{const p=i,v=s+o,g=r+p,y=r-p,b=n+v,_=n-v;t[c++]=g,t[c++]=b,t[--d]=_,t[--d]=g,i&&(t[c++]=y,t[c++]=b,t[--d]=_,t[--d]=y)}},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 h=e.matrix;n.push(e.matrix?h.a*o+h.c*l+h.tx:o,e.matrix?h.b*o+h.d*l+h.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 Ql(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,h=s+1;[e[a],e[l]]=[e[l],e[a]],[e[o],e[h]]=[e[h],e[o]]}}}const Jl={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){Ql(r,!1);const a=[];for(let h=0;h<n.length;h++){const c=n[h];Ql(c.points,!0),a.push(r.length/2),r=r.concat(c.points)}const o=yc(r,a,2);if(!o)return;const l=i.length/2;for(let h=0;h<o.length;h+=3)s.push(o[h]+l),s.push(o[h+1]+l),s.push(o[h+2]+l);for(let h=0;h<r.length;h++)i.push(r[h])}}},sy={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)}},ay={build(e){li.build(e)},triangulate(e,t){li.triangulate(e,t)}};var he=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(he||{}),nr=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(nr||{});const Ir={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 tu{static curveTo(t,r,n,i,s,a){const o=a[a.length-2],h=a[a.length-1]-r,c=o-t,f=i-r,u=n-t,d=Math.abs(h*u-c*f);if(d<1e-8||s===0)return(a[a.length-2]!==t||a[a.length-1]!==r)&&a.push(t,r),null;const p=h*h+c*c,v=f*f+u*u,g=h*f+c*u,y=s*Math.sqrt(p)/d,b=s*Math.sqrt(v)/d,_=y*g/p,m=b*g/v,x=y*u+b*c,S=y*f+b*h,w=c*(b+_),E=h*(b+_),N=u*(y+m),A=f*(y+m),T=Math.atan2(E-S,w-x),O=Math.atan2(A-S,N-x);return{cx:x+t,cy:S+r,radius:s,startAngle:T,endAngle:O,anticlockwise:c*f>u*h}}static arc(t,r,n,i,s,a,o,l,h){const c=o-a,f=Ir._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/Gn)*40),u=c/(f*2),d=u*2,p=Math.cos(u),v=Math.sin(u),g=f-1,y=g%1/g;for(let b=0;b<=g;++b){const _=b+y*b,m=u+a+d*_,x=Math.cos(m),S=-Math.sin(m);h.push((p*x+v*S)*s+n,(p*-S+v*x)*s+i)}}}class oy{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 ea{static curveLength(t,r,n,i,s,a,o,l){let c=0,f=0,u=0,d=0,p=0,v=0,g=0,y=0,b=0,_=0,m=0,x=t,S=r;for(let w=1;w<=10;++w)f=w/10,u=f*f,d=u*f,p=1-f,v=p*p,g=v*p,y=g*t+3*v*f*n+3*p*u*s+d*o,b=g*r+3*v*f*i+3*p*u*a+d*l,_=x-y,m=S-b,x=y,S=b,c+=Math.sqrt(_*_+m*m);return c}static curveTo(t,r,n,i,s,a,o){const l=o[o.length-2],h=o[o.length-1];o.length-=2;const c=Ir._segmentsCount(ea.curveLength(l,h,t,r,n,i,s,a));let f=0,u=0,d=0,p=0,v=0;o.push(l,h);for(let g=1,y=0;g<=c;++g)y=g/c,f=1-y,u=f*f,d=u*f,p=y*y,v=p*y,o.push(d*l+3*u*y*t+3*f*p*n+v*s,d*h+3*u*y*r+3*f*p*i+v*a)}}function eu(e,t,r,n,i,s,a,o){const l=e-r*i,h=t-n*i,c=e+r*s,f=t+n*s;let u,d;a?(u=n,d=-r):(u=-n,d=r);const p=l+u,v=h+d,g=c+u,y=f+d;return o.push(p,v,g,y),2}function ir(e,t,r,n,i,s,a,o){const l=r-e,h=n-t;let c=Math.atan2(l,h),f=Math.atan2(i-e,s-t);o&&c<f?c+=Math.PI*2:!o&&c>f&&(f+=Math.PI*2);let u=c;const d=f-c,p=Math.abs(d),v=Math.sqrt(l*l+h*h),g=(15*p*Math.sqrt(v)/Math.PI>>0)+1,y=d/g;if(u+=y,o){a.push(e,t,r,n);for(let b=1,_=u;b<g;b++,_+=y)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++,_+=y)a.push(e+Math.sin(_)*v,t+Math.cos(_)*v,e,t);a.push(i,s,e,t)}return g*2}function ly(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 nt(n[0],n[1]),o=new nt(n[n.length-2],n[n.length-1]),l=r.type!==qt.POLY||r.closeStroke,h=Math.abs(a.x-o.x)<i&&Math.abs(a.y-o.y)<i;if(l){n=n.slice(),h&&(n.pop(),n.pop(),o.set(n[n.length-2],n[n.length-1]));const D=(a.x+o.x)*.5,z=(o.y+a.y)*.5;n.unshift(D,z),n.push(D,z)}const c=t.points,f=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 y=n[0],b=n[1],_=n[2],m=n[3],x=0,S=0,w=-(b-m),E=y-_,N=0,A=0,T=Math.sqrt(w*w+E*E);w/=T,E/=T,w*=p,E*=p;const O=s.alignment,R=(1-O)*2,C=O*2;l||(s.cap===nr.ROUND?u+=ir(y-w*(R-C)*.5,b-E*(R-C)*.5,y-w*R,b-E*R,y+w*C,b+E*C,c,!0)+2:s.cap===nr.SQUARE&&(u+=eu(y,b,w,E,R,C,!0,c))),c.push(y-w*R,b-E*R,y+w*C,b+E*C);for(let D=1;D<f-1;++D){y=n[(D-1)*2],b=n[(D-1)*2+1],_=n[D*2],m=n[D*2+1],x=n[(D+1)*2],S=n[(D+1)*2+1],w=-(b-m),E=y-_,T=Math.sqrt(w*w+E*E),w/=T,E/=T,w*=p,E*=p,N=-(m-S),A=_-x,T=Math.sqrt(N*N+A*A),N/=T,A/=T,N*=p,A*=p;const z=_-y,j=b-m,k=_-x,I=S-m,P=z*k+j*I,L=j*k-I*z,G=L<0;if(Math.abs(L)<.001*Math.abs(P)){c.push(_-w*R,m-E*R,_+w*C,m+E*C),P>=0&&(s.join===he.ROUND?u+=ir(_,m,_-w*R,m-E*R,_-N*R,m-A*R,c,!1)+4:u+=2,c.push(_-N*C,m-A*C,_+N*R,m+A*R));continue}const $=(-w+y)*(-E+m)-(-w+_)*(-E+b),M=(-N+x)*(-A+m)-(-N+_)*(-A+S),B=(z*M-k*$)/L,q=(I*$-j*M)/L,H=(B-_)*(B-_)+(q-m)*(q-m),X=_+(B-_)*R,K=m+(q-m)*R,et=_-(B-_)*C,it=m-(q-m)*C,lt=Math.min(z*z+j*j,k*k+I*I),ht=G?R:C,Ct=lt+ht*ht*v,It=H<=Ct;let V=s.join;if(V===he.MITER&&H/v>g&&(V=he.BEVEL),It)switch(V){case he.MITER:{c.push(X,K,et,it);break}case he.BEVEL:{G?c.push(X,K,_+w*C,m+E*C,X,K,_+N*C,m+A*C):c.push(_-w*R,m-E*R,et,it,_-N*R,m-A*R,et,it),u+=2;break}case he.ROUND:{G?(c.push(X,K,_+w*C,m+E*C),u+=ir(_,m,_+w*C,m+E*C,_+N*C,m+A*C,c,!0)+4,c.push(X,K,_+N*C,m+A*C)):(c.push(_-w*R,m-E*R,et,it),u+=ir(_,m,_-w*R,m-E*R,_-N*R,m-A*R,c,!1)+4,c.push(_-N*R,m-A*R,et,it));break}}else{switch(c.push(_-w*R,m-E*R,_+w*C,m+E*C),V){case he.MITER:{G?c.push(et,it,et,it):c.push(X,K,X,K),u+=2;break}case he.ROUND:{G?u+=ir(_,m,_+w*C,m+E*C,_+N*C,m+A*C,c,!0)+2:u+=ir(_,m,_-w*R,m-E*R,_-N*R,m-A*R,c,!1)+2;break}}c.push(_-N*R,m-A*R,_+N*C,m+A*C),u+=2}}y=n[(f-2)*2],b=n[(f-2)*2+1],_=n[(f-1)*2],m=n[(f-1)*2+1],w=-(b-m),E=y-_,T=Math.sqrt(w*w+E*E),w/=T,E/=T,w*=p,E*=p,c.push(_-w*R,m-E*R,_+w*C,m+E*C),l||(s.cap===nr.ROUND?u+=ir(_-w*(R-C)*.5,m-E*(R-C)*.5,_-w*R,m-E*R,_+w*C,m+E*C,c,!1)+2:s.cap===nr.SQUARE&&(u+=eu(_,m,w,E,R,C,!1,c)));const F=t.indices,U=Ir.epsilon*Ir.epsilon;for(let D=d;D<u+d-2;++D)y=c[D*2],b=c[D*2+1],_=c[(D+1)*2],m=c[(D+1)*2+1],x=c[(D+2)*2],S=c[(D+2)*2+1],!(Math.abs(y*(m-S)+_*(S-b)+x*(b-m))<U)&&F.push(D,D+1,D+2)}function uy(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,h=a.length/2;let c=h;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,h)}function ru(e,t){e.lineStyle.native?uy(e,t):ly(e,t)}class ra{static curveLength(t,r,n,i,s,a){const o=t-2*n+s,l=r-2*i+a,h=2*n-2*t,c=2*i-2*r,f=4*(o*o+l*l),u=4*(o*h+l*c),d=h*h+c*c,p=2*Math.sqrt(f+u+d),v=Math.sqrt(f),g=2*f*v,y=2*Math.sqrt(d),b=u/v;return(g*p+v*u*(p-y)+(4*d*f-u*u)*Math.log((2*v+b+p)/(b+y)))/(4*g)}static curveTo(t,r,n,i,s){const a=s[s.length-2],o=s[s.length-1],l=Ir._segmentsCount(ra.curveLength(a,o,t,r,n,i));let h=0,c=0;for(let f=1;f<=l;++f){const u=f/l;h=a+(t-a)*u,c=o+(r-o)*u,s.push(h+(t+(n-t)*u-h)*u,c+(r+(i-r)*u-c)*u)}}}const na={[qt.POLY]:Jl,[qt.CIRC]:li,[qt.ELIP]:li,[qt.RECT]:sy,[qt.RREC]:ay},nu=[],ui=[];class hi{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 hi(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 Nr=new nt,iu=class extends il{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 Qs,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(),nu.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 hi(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 hi(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,Nr):Nr.copyFrom(e),n.shape.contains(Nr.x,Nr.y))){let i=!1;if(n.holes){for(let s=0;s<n.holes.length;s++)if(n.holes[s].shape.contains(Nr.x,Nr.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],h=l.fillStyle,c=l.lineStyle;na[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(h.visible||c.visible)&&this.processHoles(l.holes);for(let u=0;u<2;u++){const d=u===0?h:c;if(!d.visible)continue;const p=d.texture.baseTexture,v=this.indices.length,g=this.points.length/2;p.wrapMode=$r.REPEAT,u===0?this.processFill(l):this.processLine(l);const y=this.points.length/2-g;y!==0&&(r&&!this._compareStyles(n,d)&&(r.end(v,g),r=null),r||(r=nu.pop()||new oy,r.begin(d,v,g),this.batches.push(r),n=d),this.addUvs(this.points,e,d.texture,g,y,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<iu.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++gt._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 Ls,n.texArray=new js),n.texArray.count=0,n.start=0,n.size=0,n.type=Pe.TRIANGLES;let i=0,s=null,a=0,o=!1,l=Pe.TRIANGLES,h=0;this.drawCalls.push(n);for(let c=0;c<this.batches.length;c++){const f=this.batches[c],u=8,d=f.style,p=d.texture.baseTexture;o!==!!d.native&&(o=!!d.native,l=o?Pe.LINES:Pe.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 Ls,n.texArray=new js),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=i,p.wrapMode=$r.REPEAT,n.texArray.elements[n.texArray.count++]=p,i++)),n.size+=f.size,h+=f.size,a=p._batchLocation,this.addColors(t,d.color,d.alpha,f.attribSize,f.attribStart),this.addTextureIds(r,a,f.attribSize,f.attribStart)}gt._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?Jl.triangulate(e,this):na[e.type].triangulate(e,this)}processLine(e){ru(e,this);for(let t=0;t<e.holes.length;t++)ru(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){const r=e[t];na[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=Wt.shared.setValue(t).toLittleEndianNumber(),a=Wt.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],f=e[(n+a)*2+1];if(s){const u=s.a*c+s.c*f+s.tx;f=s.b*c+s.d*f+s.ty,c=u}a++,t.push(c/l.width,f/l.height)}const h=r.baseTexture;(l.width<h.width||l.height<h.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,h=o.height/i.height;let c=o.x/o.width,f=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,f-=d;for(let p=r;p<a;p+=2)e[p]=(e[p]+c)*l,e[p+1]=(e[p+1]+f)*h}};let su=iu;su.BATCHABLE_SIZE=100;class ci{constructor(){this.color=16777215,this.alpha=1,this.texture=bt.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=bt.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ia extends ci{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=nr.BUTT,this.join=he.MITER,this.miterLimit=10}clone(){const t=new ia;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 sa={},fi=class extends rr{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 ia,this._matrix=null,this._holeMode=!1,this.state=Un.for2d(),this._geometry=e||new su,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Wt(16777215),this.blendMode=ut.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new fi(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:bt.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:nr.BUTT,join:he.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 tn,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new tn,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),ra.curveTo(e,t,r,n,i),this}bezierCurveTo(e,t,r,n,i,s){return this._initCurve(),ea.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=tu.curveTo(e,t,r,n,i,s);if(a){const{cx:o,cy:l,radius:h,startAngle:c,endAngle:f,anticlockwise:u}=a;this.arc(o,l,h,c,f,u)}return this}arc(e,t,r,n,i,s=!1){if(n===i)return this;if(!s&&i<=n?i+=Gn:s&&n<=i&&(n+=Gn),i-n===0)return this;const o=e+Math.cos(n)*r,l=t+Math.sin(n)*r,h=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const f=Math.abs(c[c.length-2]-o),u=Math.abs(c[c.length-1]-l);f<h&&u<h||c.push(o,l)}else this.moveTo(o,l),c=this.currentPath.points;return tu.arc(o,l,e,t,r,n,i,s,c),this}beginFill(e=0,t){return this.beginTextureFill({texture:bt.WHITE,color:e,alpha:t})}normalizeColor(e){const t=Wt.shared.setValue(e.color??0);e.color=t.toNumber(),e.alpha??(e.alpha=t.alpha)}beginTextureFill(e){const t={texture:bt.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 Bs(e,t,r,n,i))}drawCircle(e,t,r){return this.drawShape(new Fs(e,t,r))}drawEllipse(e,t,r,n){return this.drawShape(new Qd(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 tn(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),h={vertexData:a,blendMode:t,indices:l,uvs:o,_batchRGB:Wt.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[n]=h}}_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,Wt.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(!sa[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 Ot,default:ae.from({uSamplers:i},!0)},a=e.plugins[r]._shader.program;sa[r]=new rn(a,s)}t=sa[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,fi._TEMP_POINT),this._geometry.containsPoint(fi._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=Wt.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,h=this.vertexData;let c=0;for(let f=0;f<l.length;f+=2){const u=l[f],d=l[f+1];h[c++]=r*u+i*d+a,h[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 Re=fi;Re.curves=Ir,Re._TEMP_POINT=new nt;const au={color:16777215,outlineColor:0,outlineThickness:1,radius:8,shape:"tooth"},hy=Re;class cy extends hy{constructor(t,r,n={},i,s,a){super(),this.transformer=t;const o=Object.assign({},au,n);this._handle=r,this._style=o,this.onHandleDelta=i,this.onHandleCommit=s,this._dirty=!0,this.interactive=!0,this.cursor=a||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new nt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp}get handle(){return this._handle}set handle(t){this._handle=t,this._dirty=!0}get style(){return this._style}set style(t){this._style=Object.assign({},au,t),this._dirty=!0}render(t){this._dirty&&(this.draw(),this._dirty=!1),super.render(t)}draw(){const t=this._handle,r=this._style,n=r.radius;if(this.clear().lineStyle(r.outlineThickness,r.outlineColor).beginFill(r.color),r.shape==="square")this.drawRect(-n/2,-n/2,n,n);else if(r.shape==="tooth")switch(t){case"middleLeft":this.drawPolygon([-n/2,-n/2,-n/2,n/2,n/2,n/2,n*1.1,0,n/2,-n/2]);break;case"topCenter":this.drawPolygon([-n/2,-n/2,n/2,-n/2,n/2,n/2,0,n*1.1,-n/2,n/2]);break;case"middleRight":this.drawPolygon([-n/2,n/2,-n*1.1,0,-n/2,-n/2,n/2,-n/2,n/2,n/2]);break;case"bottomCenter":this.drawPolygon([0,-n*1.1,n/2,-n/2,n/2,n/2,-n/2,n/2,-n/2,-n/2]);break;case"rotator":this.drawCircle(0,0,n/Math.sqrt(2));break;default:this.drawRect(-n/2,-n/2,n,n);break}else this.drawCircle(0,0,n);this.endFill()}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){this._pointerDown&&(this._pointerDragging?this.onDrag(t):this.onDragStart(t),t.stopPropagation())}onPointerUp(t){this._pointerDragging&&this.onDragEnd(t),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(t){this._pointerPosition.copyFrom(t.data.global),this._pointerDragging=!0}onDrag(t){const r=t.data.global;this.onHandleDelta&&this.onHandleDelta(r),this._pointerPosition.copyFrom(r)}onDragEnd(t){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function di(e,t,r,n){const{x:i,y:s}=r,{x:a,y:o}=n;if(Math.abs(a-i)<.01)return Math.abs(e-i);if(Math.abs(o-s)<.01)return Math.abs(t-s);const l=(o-s)/(a-i);return Math.abs((l*e-t+(o-l*a))/Math.sqrt(l*l+1))}const ou=Zl.build(nt),fy=[new nt,new nt,new nt,new nt],dy=new Ot,Cr=new nt,py=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],yy=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],vy=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],my=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],aa=new Array(12),gy=[py,yy,vy,my],by=Re;class _y extends by{constructor(t){super(),this.transformer=t,this.boxScalingHandles=[this.addChild(new Re),this.addChild(new Re),this.addChild(new Re),this.addChild(new Re)],this.boxScalingHandles.forEach(r=>{r.interactive=!0}),this.boxScalingHandles[0].cursor=ln.topCenter,this.boxScalingHandles[1].cursor=ln.middleRight,this.boxScalingHandles[2].cursor=ln.bottomCenter,this.boxScalingHandles[3].cursor=ln.middleLeft}hitHandleType(t,r,n){const{boxRotationEnabled:i,boxRotationTolerance:s,boxScalingEnabled:a,boxScalingTolerance:o}=this.transformer,[l,h,c,f]=t.hull,{x:u,y:d}=r.applyInverse(n,Cr);if(a){const p=di(u,d,l,h)*r.d,v=di(u,d,l,f)*r.a,g=di(u,d,h,c)*r.a,y=di(u,d,f,c)*r.d,b=Math.min(p,v,g,y);if(b<o)switch(b){case p:return"topCenter";case v:return"middleLeft";case g:return"middleRight";case y:return"bottomCenter"}}if(i&&!t.contains(u,d)){const p=Math.sqrt((l.x-u)**2+(l.y-d)**2),v=Math.sqrt((h.x-u)**2+(h.y-d)**2),g=Math.sqrt((f.x-u)**2+(f.y-d)**2),y=Math.sqrt((c.x-u)**2+(c.y-d)**2),b=Math.min(p,v,g,y);if(b<s*1.45)switch(b){case p:return"boxRotateTopLeft";case v:return"boxRotateTopRight";case g:return"boxRotateBottomLeft";case y:return"boxRotateBottomRight"}}return null}drawBounds(t){const r=fy;for(let n=0;n<4;n++)this.transformer.projectToLocal(t.hull[n],r[n]);this.drawPolygon(r)}drawBoxScalingTolerance(t,r=this.transformer.boxScalingTolerance){t.innerBounds.pad(-r);const n=ou.allocateArray(4);n.forEach((s,a)=>{this.projectToLocal(t.hull[a],s)}),t.innerBounds.pad(2.5*r);const i=ou.allocateArray(4);i.forEach((s,a)=>{this.projectToLocal(t.hull[a],s)}),t.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let s=0;s<4;s++){const a=n[s],o=n[(s+1)%4],l=i[s],h=i[(s+1)%4];this.boxScalingHandles[s].clear().beginFill(16777215,1e-4).drawPolygon(a,l,h,o).endFill()}}drawBoxRotationTolerance(){const{boxRotateTopLeft:t,boxRotateTopRight:r,boxRotateBottomLeft:n,boxRotateBottomRight:i}=this.transformer.handleAnchors,s=this.transformer.boxRotationTolerance*2,a=dy.identity().scale(s,s).rotate(this.transformer.getGroupBounds().rotation);for(let o=0;o<4;o++){const l=gy[o];let h;switch(o){case 0:h=t;break;case 1:h=r;break;case 2:h=n;break;case 3:h=i;break}for(let c=0;c<l.length;c+=2){const f=l[c],u=l[c+1];Cr.set(f,u),a.apply(Cr,Cr),aa[c]=Cr.x+h.x,aa[c+1]=Cr.y+h.y}this.drawPolygon(aa.slice())}}projectToLocal(t,r){return this.transformer.projectToLocal(t,r)}}const lu=new Ot;function uu(e){const t=lu.identity();return t.c=Math.tan(e),t}function hu(e){const t=lu.identity();return t.b=Math.tan(e),t}function cu(e,t,r,n=e.pivot){const i=t.a,s=t.b,a=t.c,o=t.d,l=-Math.atan2(-a,o),h=Math.atan2(s,i);return r=r??h,e.pivot.set(n.x,n.y),e.rotation=r,e.skew.x=r+l,e.skew.y=-r+h,e.scale.x=Math.sqrt(i*i+s*s),e.scale.y=Math.sqrt(a*a+o*o),e.position.x=t.tx+(n.x*t.a+n.y*t.c),e.position.y=t.ty+(n.x*t.b+n.y*t.d),e}const pi=new Ot,xy=new Ot;function wy(e,t,r){if(!r){const s=e.parent?e.parent:e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}const n=e.worldTransform,i=e.parent?xy.copyFrom(e.parent.worldTransform):Ot.IDENTITY;pi.copyFrom(n),pi.prepend(t),pi.prepend(i.invert()),cu(e.transform,pi)}const yi=new Hn,Ey=[new nt,new nt,new nt,new nt],kr=new Ot,Pr=new nt,oa=new ai,Ty=new At,fu=[new nt,new nt,new nt,new nt],du=new nt,pu=new Ot,vi=Zl.build(nt),ln={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},mi=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],yu={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},Ay=[...mi,"rotator","skewHorizontal","skewVertical"],Sy=4,Oy=16,Ry=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],Iy=Math.PI/90,Ny=[Math.PI/4,-Math.PI/4],Cy=Math.PI/90,vu={color:0,thickness:2},ky=rr;let Py=class re extends ky{constructor(t={}){super(),re.prototype.__init.call(this),re.prototype.__init2.call(this),re.prototype.__init3.call(this),re.prototype.__init4.call(this),re.prototype.__init5.call(this),this.interactive=!0,this.cursors=Object.assign({default:"move"},t.cursors),this.cursor=this.cursors.default,this.boundingBoxes=t.boundingBoxes||"all",this.group=t.group||[],this.boxRotationTolerance=t.boxRotationTolerance||Oy,this.boxScalingTolerance=t.boxScalingTolerance||Sy,this.centeredScaling=!!t.centeredScaling,this.projectionTransform=new Ot,this.lockAspectRatio=t.lockAspectRatio===!0,this.rotationSnaps=t.rotationSnaps||Ry,this.rotationSnapTolerance=t.rotationSnapTolerance!==void 0?t.rotationSnapTolerance:Iy,this.skewRadius=t.skewRadius||64,this.skewSnaps=t.skewSnaps||Ny,this.skewSnapTolerance=t.skewSnapTolerance!==void 0?t.skewSnapTolerance:Cy,this.boxRotationEnabled=t.boxRotationEnabled===!0,this.boxScalingEnabled=t.boxScalingEnabled===!0,this._rotateEnabled=t.rotateEnabled!==!1,this._scaleEnabled=t.scaleEnabled!==!1,this._skewEnabled=t.skewEnabled===!0,this.translateEnabled=t.translateEnabled!==!1,this.transientGroupTilt=t.transientGroupTilt!==void 0?t.transientGroupTilt:!0,this.wireframe=this.addChild(new _y(this)),this.wireframe.cursor="none",this.stage=t.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._wireframeStyle=Object.assign({},vu,t.wireframeStyle||{});const r=t.handleConstructor||cy,n=t.handleStyle||{};this._handleStyle=n;const i={rotator:this.addChild(new r(this,"rotator",n,o=>{this.rotateGroup("rotator",o)},this.commitGroup))},s=mi.reduce((o,l)=>{const h=new r(this,l,n,null,this.commitGroup,ln[l]);return h.onHandleDelta=c=>{this.scaleGroup(h.handle,c)},h.visible=this._scaleEnabled,o[l]=h,this.addChild(o[l]),o},{}),a={skewHorizontal:this.addChild(new r(this,"skewHorizontal",n,o=>{this.skewGroup("skewHorizontal",o)},this.commitGroup,"pointer")),skewVertical:this.addChild(new r(this,"skewVertical",n,o=>{this.skewGroup("skewVertical",o)},this.commitGroup,"pointer"))};this.handles=Object.assign({},s,i,a),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new nt,boxRotateTopLeft:new nt,boxRotateTopRight:new nt,boxRotateBottomLeft:new nt,boxRotateBottomRight:new nt,topLeft:new nt,topCenter:new nt,topRight:new nt,middleLeft:new nt,middleCenter:new nt,middleRight:new nt,bottomLeft:new nt,bottomCenter:new nt,bottomRight:new nt,skewHorizontal:new nt,skewVertical:new nt},this.groupBounds=new ai,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new nt,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerupoutside",this.onPointerUp)}get enabledHandles(){return this._enabledHandles}set enabledHandles(t){!this._enabledHandles&&!t||(this._enabledHandles=t,Ay.forEach(r=>{this.handles[r].visible=!1}),t?t.forEach(r=>{this.handles[r].visible=!0}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,mi.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(t){const r=this.handles;for(const n in r)r[n].style=t;this._handleStyle=t}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(t){if(this._rotateEnabled!==t){if(this._rotateEnabled=t,this._enabledHandles)return;this.handles.rotator.visible=t}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(t){if(this._scaleEnabled!==t){if(this._scaleEnabled=t,this._enabledHandles)return;mi.forEach(r=>{r!=="middleCenter"&&(this.handles[r].visible=t)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(t){if(this._skewEnabled!==t){if(this._skewEnabled=t,this._enabledHandles)return;this.handles.skewHorizontal.visible=t,this.handles.skewVertical.visible=t}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(t){this._wireframeStyle=Object.assign({},vu,t)}getGroupBounds(t=!1){return t&&this.updateGroupBounds(),this.groupBounds}__init(){this.translateGroup=t=>{this._transformHandle=null,this._transformType="translate";const r=kr.identity().translate(t.x,t.y);this.prependTransform(r)}}__init2(){this.rotateGroup=(t,r)=>{this._transformHandle=t,this._transformType="rotate";const n=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[t],Pr);this.projectionTransform.applyInverse(i,i),r=this.projectionTransform.applyInverse(r,du);const s=n.center,a=Math.atan2(i.y-s.y,i.x-s.x);let l=Math.atan2(r.y-s.y,r.x-s.x)-a,h=this.groupBounds.rotation+l;h=this.snapAngle(h,this.rotationSnapTolerance,this.rotationSnaps),l=h-this.groupBounds.rotation;const c=kr.identity().translate(-s.x,-s.y).rotate(l).translate(s.x,s.y);this.prependTransform(c,!0),this.updateGroupBounds(h),this._skewX+=l,this._skewY+=l}}__init3(){this.scaleGroup=(t,r)=>{this._transformHandle=t,this._transformType="scale";const n=yu[t].x,i=yu[t].y,s=this.handles,a=this.groupBounds,o=a.rotation,l=a.innerBounds,h=this.worldTransform.apply(this.handleAnchors[t],Pr);this.projectionTransform.applyInverse(h,h),r=this.projectionTransform.applyInverse(r,du);const c=r.x-h.x,f=r.y-h.y,u=(a.topRight.x-a.topLeft.x)/l.width,d=(a.topRight.y-a.topLeft.y)/l.width,p=(a.bottomLeft.x-a.topLeft.x)/l.height,v=(a.bottomLeft.y-a.topLeft.y)/l.height,g=c*u+f*d,y=c*p+f*v;let b=1+g*n/l.width,_=1+y*i/l.height;this.lockAspectRatio&&(t==="topLeft"||t==="topRight"||t==="bottomLeft"||t==="bottomRight")&&(b>_?_=b:b=_);const x=kr.identity();if(n!==0&&b!==0){const S=this.centeredScaling?a.center:n===1?a.topLeft:a.topRight;x.translate(-S.x,-S.y).rotate(-o).scale(b,1).rotate(o).translate(S.x,S.y)}if(i!==0&&_!==0){const S=this.centeredScaling?a.center:i===1?a.topLeft:a.bottomLeft;x.translate(-S.x,-S.y).rotate(-o).scale(1,_).rotate(o).translate(S.x,S.y)}if((_<0||b<0)&&!(_<0&&b<0))switch(t){case"topLeft":case"bottomLeft":this.swapHandles(s.topLeft,s.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(s.topCenter,s.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(s.topRight,s.bottomRight);break}this.prependTransform(x)}}__init4(){this.skewGroup=(t,r)=>{this._transformHandle=t,this._transformType="skew";const n=this.groupBounds,i=Pr.copyFrom(r);this.projectionTransform.applyInverse(i,i);const s=n.center,a=kr.identity().translate(-s.x,-s.y);let o=this.groupBounds.rotation;if(t==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-s.y,i.x-s.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),a.prepend(hu(-l)),a.prepend(hu(this._skewX))}else{const l=this._skewY,h=Math.atan2(i.y-s.y,i.x-s.x)-Math.PI/2;this._skewY=h,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),a.prepend(uu(l)),a.prepend(uu(-this._skewY)),o-=this._skewY-l}a.translate(s.x,s.y),this.prependTransform(a,!0),this.updateGroupBounds(o)}}__init5(){this.commitGroup=()=>{this._transformHandle=null,this._transformType="none",this.transientGroupTilt!==!1&&this.group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit")}}render(t){this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw(),super.render(t)}draw(){const t=this.group,{color:r,thickness:n}=this._wireframeStyle;this.wireframe.clear(),this.boundingBoxes!=="none"&&this.wireframe.lineStyle(n,r),this.translateEnabled&&this.wireframe.beginFill(16777215,1e-4);for(let s=0,a=t.length;s<a&&this.boundingBoxes==="all";s++)this.wireframe.drawBounds(re.calculateOrientedBounds(t[s],oa));const i=t.length!==1?re.calculateGroupOrientedBounds(t,this.groupBounds.rotation,oa,!0):re.calculateOrientedBounds(t[0],oa);this.wireframe.drawBounds(i),this.drawHandles(i),this.groupBounds.copyFrom(i),this.boxRotationEnabled&&(this.wireframe.closePath().beginFill(16777215,1e-4).lineStyle(),this.wireframe.drawBoxRotationTolerance()),this.boxScalingEnabled&&(this.wireframe.closePath().beginFill(16773375,1e-4).lineStyle(),this.wireframe.drawBoxScalingTolerance(i)),this.lazyDirty=!1}drawHandles(t){const r=this.handles,n=this.handleAnchors,{topLeft:i,topRight:s,bottomLeft:a,bottomRight:o,center:l}=t,[h,c,f,u]=fu,d=Pr;if(this.projectToLocal(i,h),this.projectToLocal(s,c),this.projectToLocal(a,f),this.projectToLocal(o,u),this.projectToLocal(l,d),n.topLeft.copyFrom(h),n.topCenter.set((h.x+c.x)/2,(h.y+c.y)/2),n.topRight.copyFrom(c),n.middleLeft.set((h.x+f.x)/2,(h.y+f.y)/2),n.middleCenter.set((h.x+u.x)/2,(h.y+u.y)/2),n.middleRight.set((c.x+u.x)/2,(c.y+u.y)/2),n.bottomLeft.copyFrom(f),n.bottomCenter.set((f.x+u.x)/2,(f.y+u.y)/2),n.bottomRight.copyFrom(u),this.boxRotationEnabled&&(n.boxRotateTopLeft.copyFrom(n.topLeft),n.boxRotateTopRight.copyFrom(n.topRight),n.boxRotateBottomLeft.copyFrom(n.bottomLeft),n.boxRotateBottomRight.copyFrom(n.bottomRight)),this._rotateEnabled){const p=(h.x+c.x)/2,v=(h.y+c.y)/2;let g=-(h.y-c.y),y=h.x-c.x;const b=Math.sqrt(g*g+y*y);g*=32/b,y*=32/b,r.rotator.position.x=p+g,r.rotator.position.y=v+y,this.wireframe.moveTo(p,v).lineTo(r.rotator.position.x,r.rotator.position.y),this.handleAnchors.rotator.copyFrom(r.rotator.position)}if(this._skewEnabled){const p=d.x,v=d.y;this.worldTransform.apply(d,d),n.skewHorizontal.set(d.x+Math.cos(this._skewX)*this.skewRadius,d.y+Math.sin(this._skewX)*this.skewRadius),n.skewVertical.set(d.x+-Math.sin(this._skewY)*this.skewRadius,d.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(n.skewHorizontal,n.skewHorizontal),this.worldTransform.applyInverse(n.skewVertical,n.skewVertical),d.set(p,v),this.wireframe.beginFill(this.wireframeStyle.color).drawCircle(d.x,d.y,this.wireframeStyle.thickness*2).endFill(),this.wireframe.moveTo(d.x,d.y).lineTo(r.skewHorizontal.x,r.skewHorizontal.y).moveTo(d.x,d.y).lineTo(r.skewVertical.x,r.skewVertical.y)}for(const p in r){let v=this.groupBounds.rotation;p==="skewHorizontal"?v=this._skewX:p==="skewVertical"&&(v=this._skewY);const g=r[p];g.rotation=v,g.position.copyFrom(n[p]),g.getBounds(!1,Ty)}}onPointerDown(t){this._pointerDown=!0,this._pointerDragging=!1,t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(t){const r=this._pointerPosition,n=vi.allocate().copyFrom(t.data.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const s=n.x,a=n.y;if(this._pointerDragging)switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,n);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,n);break;default:if(this.translateEnabled){const[o,l,h]=fu;o.set(0,0),l.set(n.x-r.x,n.y-r.y),this.projectionTransform.applyInverse(o,o),this.projectionTransform.applyInverse(l,l),h.set(l.x-o.x,l.y-o.y),this.translateGroup(h)}}else this._transformHandle=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,n),this.setCursorFromHoveredHandle(i);this._pointerPosition.x=s,this._pointerPosition.y=a,this._pointerDragging=!0,t.stopPropagation()}vi.release(n)}onPointerUp(t){this._pointerDragging=!1,this._pointerDown=!1,this.commitGroup(),t.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}prependTransform(t,r=!1){const n=this.group;for(let i=0,s=n.length;i<s;i++)wy(n[i],t,!1);pu.copyFrom(t),r||this.updateGroupBounds(),this.emit("transformchange",pu)}updateGroupBounds(t=this.groupBounds.rotation){re.calculateGroupOrientedBounds(this.group,t,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(t,r,n){if(t=t%(Math.PI*2),!n||n.length===1||!r)return t;for(let i=0,s=n.length;i<s;i++)if(Math.abs(t-n[i])<=r)return n[i];return t}swapHandles(t,r){const n=t.handle,i=r.handle,s=t.cursor,a=r.cursor,o=t.x,l=r.x,h=t.y,c=r.y;t.handle=i,r.handle=n,t.position.set(l,c),r.position.set(o,h),t.cursor=a,r.cursor=s,this.handles[n]=r,this.handles[i]=t,this._transformHandle===n?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=n)}setCursorFromHoveredHandle(t){if(t&&t.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(t)switch(t){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(t,r){return r||(r=new nt),this.projectionTransform.apply(t,r),this.worldTransform.applyInverse(r,r),r}static calculateTransformedCorners(t,r=t.worldTransform,n,i=0){const s=t.getLocalBounds();return t.getBounds(),n=n||[new nt,new nt,new nt,new nt],n[i].set(s.x,s.y),n[i+1].set(s.x+s.width,s.y),n[i+2].set(s.x+s.width,s.y+s.height),n[i+3].set(s.x,s.y+s.height),r.apply(n[i],n[i]),r.apply(n[i+1],n[i+1]),r.apply(n[i+2],n[i+2]),r.apply(n[i+3],n[i+3]),n}static calculateOrientedBounds(t,r){const n=t.parent?t.parent:t.enableTempParent();t.updateTransform(),t.disableTempParent(n),cu(yi,t.worldTransform),yi.updateLocalTransform();const i=yi.rotation,s=re.calculateTransformedCorners(t,t.worldTransform,Ey),a=(s[0].x+s[1].x+s[2].x+s[3].x)/4,o=(s[0].y+s[1].y+s[2].y+s[3].y)/4,l=kr.identity().translate(-a,-o).rotate(-yi.rotation).translate(a,o);return l.apply(s[0],s[0]),l.apply(s[1],s[1]),l.apply(s[2],s[2]),l.apply(s[3],s[3]),r=r||new ai,r.rotation=i,r.innerBounds.x=Math.min(s[0].x,s[1].x,s[2].x,s[3].x),r.innerBounds.y=Math.min(s[0].y,s[1].y,s[2].y,s[3].y),r.innerBounds.width=Math.max(s[0].x,s[1].x,s[2].x,s[3].x)-r.innerBounds.x,r.innerBounds.height=Math.max(s[0].y,s[1].y,s[2].y,s[3].y)-r.innerBounds.y,r}static calculateGroupOrientedBounds(t,r,n,i=!1){const s=t.length,a=vi.allocateArray(s*4);for(let u=0;u<s;u++){const d=t[u];if(!i){const p=d.parent?d.parent:d.enableTempParent();d.updateTransform(),d.disableTempParent(p)}re.calculateTransformedCorners(d,d.worldTransform,a,u*4)}const o=kr.identity().rotate(-r);let l=Number.MAX_VALUE,h=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let u=0,d=a.length;u<d;u++){const p=a[u];o.apply(p,p);const v=p.x,g=p.y;l=v<l?v:l,h=g<h?g:h,c=v>c?v:c,f=g>f?g:f}return vi.releaseArray(a),n=n||new ai,n.innerBounds.x=l,n.innerBounds.y=h,n.innerBounds.width=c-l,n.innerBounds.height=f-h,n.rotation=r,o.applyInverse(n.center,Pr),n.center.copyFrom(Pr),n}};function My(e,t,r,n){for(const i in t){const s=r[i],a=n[i],o=t[i];s!==a&&(s&&e.removeEventListener(o,s),a&&e.addEventListener(o,a))}}const gi={},Ly=Ot.IDENTITY,Fy={transformchange:"transformchange",transformcommit:"transformcommit"},mu=yt.PixiComponent("Transformer",{create:e=>new Py(e),applyProps(e,t,r){if(yt.applyDefaultProps(e,t,r),My(e,Fy,t,r),r.cursors&&Object.assign(e.cursors,r.cursors),e.group=r.group||[],e.boundingBoxes=r.boundingBoxes||"all",e.boxScalingEnabled=r.boxScalingEnabled===!0,e.boxScalingTolerance=r.boxScalingTolerance!==void 0?r.boxScalingTolerance:e.boxScalingTolerance,e.boxRotationEnabled=r.boxRotationEnabled===!0,e.boxRotationTolerance=r.boxRotationTolerance!==void 0?r.boxRotationTolerance:e.boxRotationTolerance,e.centeredScaling=!!r.centeredScaling,e.enabledHandles=r.enabledHandles,e.lockAspectRatio=!!r.lockAspectRatio,e.projectionTransform.copyFrom(r.projectionTransform||Ly),e.skewRadius=r.skewRadius||e.skewRadius,e.rotateEnabled=r.rotateEnabled!==!1,e.scaleEnabled=r.scaleEnabled!==!1,e.skewEnabled=r.skewEnabled===!0,e.translateEnabled=r.translateEnabled!==!1,e.transientGroupTilt=!!r.transientGroupTilt,t.handleConstructor!==r.handleConstructor)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");t.rotationSnaps!==r.rotationSnaps&&(e.rotationSnaps=r.rotationSnaps||[]),t.rotationSnapTolerance!==r.rotationSnapTolerance&&(e.rotationSnapTolerance=r.rotationSnapTolerance||0),t.skewSnaps!==r.skewSnaps&&(e.skewSnaps=r.skewSnaps||[]),t.skewSnapTolerance!==r.skewSnapTolerance&&(e.skewSnapTolerance=r.skewSnapTolerance||0);const n=t.handleStyle||gi,i=r.handleStyle||gi;(n.color!==i.color||n.outlineColor!==i.outlineColor||n.outlineThickness!==i.outlineThickness||n.radius!==i.radius||n.shape!==i.shape)&&(e.handleStyle=i);const s=t.wireframeStyle||gi,a=r.wireframeStyle||gi;(s.color!==a.color||s.thickness!==a.thickness)&&(e.wireframeStyle=a)}}),la=({pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:a,uniqueId:o=""})=>{const l=ne.utils.string2hex("#F3C409"),h=ne.utils.string2hex("#F3C409"),c=ot.useRef({isDragging:!1}),f=ot.useCallback(()=>{s&&!c.current.isDragging&&s(!0)},[s]),u=ot.useCallback(()=>{s&&!c.current.isDragging&&s(!1)},[s]),d=ot.useCallback(()=>{c.current.isDragging=!0},[]),p=ot.useCallback(()=>{c.current.isDragging=!1},[]),v=ot.useCallback(()=>{c.current.isDragging=!1},[]),g=ot.useCallback(()=>{console.log("dobule click in pixi transformer"),a&&a({uniqueId:o})},[a]),y=ot.useCallback(_=>{c.current.isDragging=!0,i&&i(_)},[i]),b=ot.useCallback(()=>{if(t.current===null)return;const _=t.current.x,m=t.current.y,x=t.current.width,S=t.current.height,w=t.current.rotation,E=[t.current.scale.x,t.current.scale.y];n&&n({uniqueId:o,transformation:{x:Math.round(_),y:Math.round(m),width:Math.round(Math.max(5,x)),height:Math.round(Math.max(5,S)),rotate:Math.round(w),scale:E}}),c.current.isDragging=!1},[n]);return ot.useEffect(()=>(e.current&&(e.current.on("mouseover",f),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",f),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))}),[]),ft.jsx(mu,{ref:e,group:r?[t.current]:[],rotateEnabled:!0,boxRotationEnabled:!0,centeredScaling:!0,boxScalingEnabled:!0,wireframeStyle:{thickness:1,color:h},lockAspectRatio:!0,scaleEnabled:!0,handleStyle:{outlineColor:l,shape:"circle",radius:9},transformchange:y,transformcommit:b})};var bi={};Object.defineProperty(bi,"__esModule",{value:!0});var By=J,ua;function gu(){return ua||(ua=document.createElement("div")),ua}function Dy(e,t,r){var n;return By.useEffect(function(){n=n||gu();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 Uy(e,t){var r=gu(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function jy(){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 bu=bi.emitCustomEvent=Uy;bi.newCustomEventEmitter=jy;var un=bi.useCustomEventListener=Dy;const Mr=ot.createContext({}),je={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},Gy=({children:e})=>{const[t,r]=J.useState(!1),[n,i]=J.useState(!1),s=J.useRef(),a=J.useRef(),o=J.useRef(.001);J.useLayoutEffect(()=>(a.current=ye.context(()=>{s.current&&s.current.progress(0).kill(),s.current=ye.timeline({paused:!0,defaults:{duration:0}})}),()=>a.current.revert()),[]);const l=J.useCallback(()=>{let b=s.current.time();o.current=b},[]);J.useEffect(()=>{const y=s.current;y.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){y.pause(),l()}).eventCallback("onUpdate",function(){l()}).eventCallback("onPause",function(){console.log("onPause",y.progress()),l()}).eventCallback("onResume",function(){console.log("onResume",y.progress()),l()}).eventCallback("onComplete",function(){y.seek(0),y.pause(),l()})},[]);const h=J.useCallback(()=>{s.current.revert()},[]),c=J.useCallback(()=>{s.current.restart(),r(!0)},[]),f=J.useCallback(()=>{const y=s.current;y.repeat(1),y.restart()},[]),u=J.useCallback(y=>{s.current.seek(y)},[]),d=J.useCallback(()=>{s.current.seek(4)},[]),p=J.useCallback(()=>{const y=s.current;return y?y.totalDuration():0},[]),v=()=>{s.current.pause(),bu(je.PAUSE),r(!1)},g=()=>{const y=s.current;r(!0),y.resume(),bu(je.RESUME)};return un(je.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),un(je.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),ft.jsx(Mr.Provider,{value:{gsapCtx:a,tl:s,handlePlay:g,handlePause:v,handleReset:h,handleSeek:u,handleSeekTest:d,handleRestart:c,handleRepeat:f,playerTimeRef:o,isDragging:n,getTimelineDuration:p},children:e})},ha=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 $y=Object.prototype;function qy(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||$y;return e===r}var _u=qy;function Hy(e,t){return function(r){return e(t(r))}}var zy=Hy,Vy=zy,Xy=Vy(Object.keys,Object),Wy=Xy,Yy=_u,Ky=Wy,Zy=Object.prototype,Qy=Zy.hasOwnProperty;function Jy(e){if(!Yy(e))return Ky(e);var t=[];for(var r in Object(e))Qy.call(e,r)&&r!="constructor"&&t.push(r);return t}var xu=Jy,tv=typeof ke=="object"&&ke&&ke.Object===Object&&ke,wu=tv,ev=wu,rv=typeof self=="object"&&self&&self.Object===Object&&self,nv=ev||rv||Function("return this")(),Ie=nv,iv=Ie,sv=iv.Symbol,_i=sv,Eu=_i,Tu=Object.prototype,av=Tu.hasOwnProperty,ov=Tu.toString,hn=Eu?Eu.toStringTag:void 0;function lv(e){var t=av.call(e,hn),r=e[hn];try{e[hn]=void 0;var n=!0}catch{}var i=ov.call(e);return n&&(t?e[hn]=r:delete e[hn]),i}var uv=lv,hv=Object.prototype,cv=hv.toString;function fv(e){return cv.call(e)}var dv=fv,Au=_i,pv=uv,yv=dv,vv="[object Null]",mv="[object Undefined]",Su=Au?Au.toStringTag:void 0;function gv(e){return e==null?e===void 0?mv:vv:Su&&Su in Object(e)?pv(e):yv(e)}var cn=gv;function bv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ca=bv,_v=cn,xv=ca,wv="[object AsyncFunction]",Ev="[object Function]",Tv="[object GeneratorFunction]",Av="[object Proxy]";function Sv(e){if(!xv(e))return!1;var t=_v(e);return t==Ev||t==Tv||t==wv||t==Av}var Ou=Sv,Ov=Ie,Rv=Ov["__core-js_shared__"],Iv=Rv,fa=Iv,Ru=function(){var e=/[^.]+$/.exec(fa&&fa.keys&&fa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Nv(e){return!!Ru&&Ru in e}var Cv=Nv,kv=Function.prototype,Pv=kv.toString;function Mv(e){if(e!=null){try{return Pv.call(e)}catch{}try{return e+""}catch{}}return""}var Iu=Mv,Lv=Ou,Fv=Cv,Bv=ca,Dv=Iu,Uv=/[\\^$.*+?()[\]{}|]/g,jv=/^\[object .+?Constructor\]$/,Gv=Function.prototype,$v=Object.prototype,qv=Gv.toString,Hv=$v.hasOwnProperty,zv=RegExp("^"+qv.call(Hv).replace(Uv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vv(e){if(!Bv(e)||Fv(e))return!1;var t=Lv(e)?zv:jv;return t.test(Dv(e))}var Xv=Vv;function Wv(e,t){return e==null?void 0:e[t]}var Yv=Wv,Kv=Xv,Zv=Yv;function Qv(e,t){var r=Zv(e,t);return Kv(r)?r:void 0}var Lr=Qv,Jv=Lr,tm=Ie,em=Jv(tm,"DataView"),rm=em,nm=Lr,im=Ie,sm=nm(im,"Map"),da=sm,am=Lr,om=Ie,lm=am(om,"Promise"),um=lm,hm=Lr,cm=Ie,fm=hm(cm,"Set"),dm=fm,pm=Lr,ym=Ie,vm=pm(ym,"WeakMap"),mm=vm,pa=rm,ya=da,va=um,ma=dm,ga=mm,Nu=cn,Fr=Iu,Cu="[object Map]",gm="[object Object]",ku="[object Promise]",Pu="[object Set]",Mu="[object WeakMap]",Lu="[object DataView]",bm=Fr(pa),_m=Fr(ya),xm=Fr(va),wm=Fr(ma),Em=Fr(ga),sr=Nu;(pa&&sr(new pa(new ArrayBuffer(1)))!=Lu||ya&&sr(new ya)!=Cu||va&&sr(va.resolve())!=ku||ma&&sr(new ma)!=Pu||ga&&sr(new ga)!=Mu)&&(sr=function(e){var t=Nu(e),r=t==gm?e.constructor:void 0,n=r?Fr(r):"";if(n)switch(n){case bm:return Lu;case _m:return Cu;case xm:return ku;case wm:return Pu;case Em:return Mu}return t});var Fu=sr;function Tm(e){return e!=null&&typeof e=="object"}var fn=Tm,Am=cn,Sm=fn,Om="[object Arguments]";function Rm(e){return Sm(e)&&Am(e)==Om}var Im=Rm,Bu=Im,Nm=fn,Du=Object.prototype,Cm=Du.hasOwnProperty,km=Du.propertyIsEnumerable,Pm=Bu(function(){return arguments}())?Bu:function(e){return Nm(e)&&Cm.call(e,"callee")&&!km.call(e,"callee")},ba=Pm,Mm=Array.isArray,xe=Mm,Lm=9007199254740991;function Fm(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Lm}var _a=Fm,Bm=Ou,Dm=_a;function Um(e){return e!=null&&Dm(e.length)&&!Bm(e)}var xi=Um,wi={exports:{}};function jm(){return!1}var Gm=jm;wi.exports,function(e,t){var r=Ie,n=Gm,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,h=l||n;e.exports=h}(wi,wi.exports);var xa=wi.exports,$m=cn,qm=_a,Hm=fn,zm="[object Arguments]",Vm="[object Array]",Xm="[object Boolean]",Wm="[object Date]",Ym="[object Error]",Km="[object Function]",Zm="[object Map]",Qm="[object Number]",Jm="[object Object]",tg="[object RegExp]",eg="[object Set]",rg="[object String]",ng="[object WeakMap]",ig="[object ArrayBuffer]",sg="[object DataView]",ag="[object Float32Array]",og="[object Float64Array]",lg="[object Int8Array]",ug="[object Int16Array]",hg="[object Int32Array]",cg="[object Uint8Array]",fg="[object Uint8ClampedArray]",dg="[object Uint16Array]",pg="[object Uint32Array]",Rt={};Rt[ag]=Rt[og]=Rt[lg]=Rt[ug]=Rt[hg]=Rt[cg]=Rt[fg]=Rt[dg]=Rt[pg]=!0,Rt[zm]=Rt[Vm]=Rt[ig]=Rt[Xm]=Rt[sg]=Rt[Wm]=Rt[Ym]=Rt[Km]=Rt[Zm]=Rt[Qm]=Rt[Jm]=Rt[tg]=Rt[eg]=Rt[rg]=Rt[ng]=!1;function yg(e){return Hm(e)&&qm(e.length)&&!!Rt[$m(e)]}var vg=yg;function mg(e){return function(t){return e(t)}}var gg=mg,Ei={exports:{}};Ei.exports,function(e,t){var r=wu,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}(Ei,Ei.exports);var bg=Ei.exports,_g=vg,xg=gg,Uu=bg,ju=Uu&&Uu.isTypedArray,wg=ju?xg(ju):_g,wa=wg,Eg=xu,Tg=Fu,Ag=ba,Sg=xe,Og=xi,Rg=xa,Ig=_u,Ng=wa,Cg="[object Map]",kg="[object Set]",Pg=Object.prototype,Mg=Pg.hasOwnProperty;function Lg(e){if(e==null)return!0;if(Og(e)&&(Sg(e)||typeof e=="string"||typeof e.splice=="function"||Rg(e)||Ng(e)||Ag(e)))return!e.length;var t=Tg(e);if(t==Cg||t==kg)return!e.size;if(Ig(e))return!Eg(e).length;for(var r in e)if(Mg.call(e,r))return!1;return!0}var Fg=Lg;const ee=or(Fg),Bg=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Ea=e=>{const[t,r]=ot.useState(!1),[,n]=J.useState(!1),[,i]=J.useState(!1),s=J.useRef(null),a=J.useRef(null),o=J.useRef(null),l=J.useRef(null),{tl:h}=J.useContext(Mr),{uniqueId:c,startAt:f,endAt:u,initialAlpha:d,transformation:{x:p,y:v,width:g,height:y,colorCorrection:b,animation:_,effect:m},applyTransformer:x}=e;console.log("all abstract props",e);const{contrast:S=1,saturation:w=1,brightness:E=1,alpha:N=1,blurRadius:A=0}=b||{},T={...E>1&&{brightness:E},...S>1&&{contrast:S},...w>1&&{saturation:w},...N!==0&&{alpha:N}};ot.useEffect(()=>{s.current&&r(!0)},[]),ot.useEffect(()=>{let U=ye.context(()=>{});if(s.current&&h.current){const D={duration:Number(u)-Number(f)},z=ha(_||"None");U=ye.context(()=>{var j,k;ee(z.from)?ee(z.to)?ee(z.fromTo)?h.current.to(s.current,{alpha:1,duration:.01},f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.1},Number(u)-.1):h.current.fromTo(s.current,(j=z.fromTo)==null?void 0:j.from,(k=z.fromTo)==null?void 0:k.to,f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2):h.current.to(s.current,{alpha:1,duration:.2,...z.to},f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2):h.current.from(s.current,{...z.from},f).to(o.current,{alpha:1,duration:.2},f).from(o.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2)})}return()=>U.revert()},[_,f,u]);const O=ot.useCallback(()=>{n(!0)},[]),R=ot.useCallback(U=>{console.log("changeEnd",U),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(U))},[]),C=yt.withFilters(yt.Container,{...A>0&&{blur:ne.filters.BlurFilter},...!ee(T)&&{adjust:Zs},matrix:ne.filters.ColorMatrixFilter}),F=(b==null?void 0:b.enabled)||m&&m!==er.Normal;return ft.jsxs(yt.Container,{ref:a,children:[ft.jsxs(yt.Container,{ref:s,alpha:d,position:[p,v],pivot:[p,v],width:g,height:y,children:[F&&ft.jsx(C,{scale:1,blur:{blur:A,quality:4},adjust:T,apply:({matrix:U})=>{m===er.BlackAndWhite?U.desaturate():m===er.Sepia?U.sepia():m===er.RetroVintage||m===er.NightVision?U.negative():m===er.Normal&&U.reset()},matrix:{enabled:!0,matrix:Bg},children:ft.jsx(yt.Container,{ref:o,children:e.children})}),!F&&ft.jsx(yt.Container,{ref:o,children:e.children})]}),x&&ft.jsx(la,{pixiTransformerRef:l,imageRef:s,isMounted:t,transformCommit:R,transformChange:O,mouseoverEvent:i,uniqueId:c})]})},Dg=e=>{const t=J.useRef(null),r=J.useRef(null),{src:n,transformation:{x:i,y:s,width:a,height:o,anchor:l},pointerdown:h,pointerup:c,mousedown:f,mouseup:u,pointerover:d,mouseover:p,mouseout:v}=e;return ft.jsx(Ea,{...e,children:ft.jsx(yt.Container,{ref:r,children:ft.jsx(yt.Sprite,{image:n,width:a,height:o,anchor:l,ref:t,x:i,y:s,interactive:!0,pointerdown:h,pointerup:c,pointerover:d,mousedown:f,mouseup:u,mouseover:p,mouseout:v})})})};var Ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ta={},jg={get exports(){return Ta},set exports(e){Ta=e}};/*!
539
+ `;class Fs extends Se{constructor(t){super(Ep,Tp),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 Qe=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(Qe||{});const Bs=({pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:a,uniqueId:o=""})=>{const l=ee.utils.string2hex("#F3C409"),f=ee.utils.string2hex("#F3C409"),c=at.useRef({isDragging:!1}),h=at.useCallback(()=>{s&&!c.current.isDragging&&s(!0)},[s]),u=at.useCallback(()=>{s&&!c.current.isDragging&&s(!1)},[s]),d=at.useCallback(()=>{c.current.isDragging=!0},[]),p=at.useCallback(()=>{c.current.isDragging=!1},[]),m=at.useCallback(()=>{c.current.isDragging=!1},[]),b=at.useCallback(()=>{console.log("dobule click in pixi transformer"),a&&a({uniqueId:o})},[a]),v=at.useCallback(_=>{c.current.isDragging=!0,i&&i(_)},[i]),g=at.useCallback(()=>{if(t.current===null)return;const _=t.current.x,y=t.current.y,x=t.current.width,O=t.current.height,E=t.current.rotation,T=[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(E),scale:T}}),c.current.isDragging=!1},[n]);return at.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",m),e.current.addListener("dblclick",b)),()=>{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",m),e.current.removeListener("dblclick",b))}),[]),ct.jsx(cf.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:v,transformcommit:g})};var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});var wp=J,Us;function Cl(){return Us||(Us=document.createElement("div")),Us}function Ap(e,t,r){var n;return wp.useEffect(function(){n=n||Cl();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 Sp(e,t){var r=Cl(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function Op(){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 Pl=Qn.emitCustomEvent=Sp;Qn.newCustomEventEmitter=Op;var en=Qn.useCustomEventListener=Ap;const Ar=at.createContext({}),Ue={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",DRAGGING_START:"GSAP_DRAGGING_START",DRAGGING_END:"GSAP_DRAGGING_END"},Ip=({children:e})=>{const[t,r]=J.useState(!1),[n,i]=J.useState(!1),s=J.useRef(),a=J.useRef(),o=J.useRef(.001);J.useLayoutEffect(()=>(a.current=pe.context(()=>{s.current&&s.current.progress(0).kill(),s.current=pe.timeline({paused:!0,defaults:{duration:0}})}),()=>a.current.revert()),[]);const l=J.useCallback(()=>{let g=s.current.time();o.current=g},[]);J.useEffect(()=>{const v=s.current;v.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){v.pause(),l()}).eventCallback("onUpdate",function(){l()}).eventCallback("onPause",function(){console.log("onPause",v.progress()),l()}).eventCallback("onResume",function(){console.log("onResume",v.progress()),l()}).eventCallback("onComplete",function(){v.seek(0),v.pause(),l()})},[]);const f=J.useCallback(()=>{s.current.revert()},[]),c=J.useCallback(()=>{s.current.restart(),r(!0)},[]),h=J.useCallback(()=>{const v=s.current;v.repeat(1),v.restart()},[]),u=J.useCallback(v=>{s.current.seek(v)},[]),d=J.useCallback(()=>{s.current.seek(4)},[]),p=J.useCallback(()=>{const v=s.current;return v?v.totalDuration():0},[]),m=()=>{s.current.pause(),Pl(Ue.PAUSE),r(!1)},b=()=>{const v=s.current;r(!0),v.resume(),Pl(Ue.RESUME)};return en(Ue.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),en(Ue.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),ct.jsx(Ar.Provider,{value:{gsapCtx:a,tl:s,handlePlay:b,handlePause:m,handleReset:f,handleSeek:u,handleSeekTest:d,handleRestart:c,handleRepeat:h,playerTimeRef:o,isDragging:n,getTimelineDuration:p},children:e})},Ds=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 Np=Object.prototype;function Rp(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Np;return e===r}var kl=Rp;function Cp(e,t){return function(r){return e(t(r))}}var Pp=Cp,kp=Pp,Mp=kp(Object.keys,Object),Lp=Mp,Fp=kl,Bp=Lp,Up=Object.prototype,Dp=Up.hasOwnProperty;function jp(e){if(!Fp(e))return Bp(e);var t=[];for(var r in Object(e))Dp.call(e,r)&&r!="constructor"&&t.push(r);return t}var Ml=jp,$p=typeof Re=="object"&&Re&&Re.Object===Object&&Re,Ll=$p,Gp=Ll,qp=typeof self=="object"&&self&&self.Object===Object&&self,Hp=Gp||qp||Function("return this")(),Oe=Hp,Vp=Oe,zp=Vp.Symbol,Jn=zp,Fl=Jn,Bl=Object.prototype,Xp=Bl.hasOwnProperty,Wp=Bl.toString,rn=Fl?Fl.toStringTag:void 0;function Yp(e){var t=Xp.call(e,rn),r=e[rn];try{e[rn]=void 0;var n=!0}catch{}var i=Wp.call(e);return n&&(t?e[rn]=r:delete e[rn]),i}var Kp=Yp,Zp=Object.prototype,Qp=Zp.toString;function Jp(e){return Qp.call(e)}var tv=Jp,Ul=Jn,ev=Kp,rv=tv,nv="[object Null]",iv="[object Undefined]",Dl=Ul?Ul.toStringTag:void 0;function sv(e){return e==null?e===void 0?iv:nv:Dl&&Dl in Object(e)?ev(e):rv(e)}var nn=sv;function av(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var js=av,ov=nn,lv=js,uv="[object AsyncFunction]",fv="[object Function]",cv="[object GeneratorFunction]",hv="[object Proxy]";function dv(e){if(!lv(e))return!1;var t=ov(e);return t==fv||t==cv||t==uv||t==hv}var jl=dv,pv=Oe,vv=pv["__core-js_shared__"],yv=vv,$s=yv,$l=function(){var e=/[^.]+$/.exec($s&&$s.keys&&$s.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mv(e){return!!$l&&$l in e}var gv=mv,bv=Function.prototype,_v=bv.toString;function xv(e){if(e!=null){try{return _v.call(e)}catch{}try{return e+""}catch{}}return""}var Gl=xv,Ev=jl,Tv=gv,wv=js,Av=Gl,Sv=/[\\^$.*+?()[\]{}|]/g,Ov=/^\[object .+?Constructor\]$/,Iv=Function.prototype,Nv=Object.prototype,Rv=Iv.toString,Cv=Nv.hasOwnProperty,Pv=RegExp("^"+Rv.call(Cv).replace(Sv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kv(e){if(!wv(e)||Tv(e))return!1;var t=Ev(e)?Pv:Ov;return t.test(Av(e))}var Mv=kv;function Lv(e,t){return e==null?void 0:e[t]}var Fv=Lv,Bv=Mv,Uv=Fv;function Dv(e,t){var r=Uv(e,t);return Bv(r)?r:void 0}var Sr=Dv,jv=Sr,$v=Oe,Gv=jv($v,"DataView"),qv=Gv,Hv=Sr,Vv=Oe,zv=Hv(Vv,"Map"),Gs=zv,Xv=Sr,Wv=Oe,Yv=Xv(Wv,"Promise"),Kv=Yv,Zv=Sr,Qv=Oe,Jv=Zv(Qv,"Set"),ty=Jv,ey=Sr,ry=Oe,ny=ey(ry,"WeakMap"),iy=ny,qs=qv,Hs=Gs,Vs=Kv,zs=ty,Xs=iy,ql=nn,Or=Gl,Hl="[object Map]",sy="[object Object]",Vl="[object Promise]",zl="[object Set]",Xl="[object WeakMap]",Wl="[object DataView]",ay=Or(qs),oy=Or(Hs),ly=Or(Vs),uy=Or(zs),fy=Or(Xs),Je=ql;(qs&&Je(new qs(new ArrayBuffer(1)))!=Wl||Hs&&Je(new Hs)!=Hl||Vs&&Je(Vs.resolve())!=Vl||zs&&Je(new zs)!=zl||Xs&&Je(new Xs)!=Xl)&&(Je=function(e){var t=ql(e),r=t==sy?e.constructor:void 0,n=r?Or(r):"";if(n)switch(n){case ay:return Wl;case oy:return Hl;case ly:return Vl;case uy:return zl;case fy:return Xl}return t});var Yl=Je;function cy(e){return e!=null&&typeof e=="object"}var sn=cy,hy=nn,dy=sn,py="[object Arguments]";function vy(e){return dy(e)&&hy(e)==py}var yy=vy,Kl=yy,my=sn,Zl=Object.prototype,gy=Zl.hasOwnProperty,by=Zl.propertyIsEnumerable,_y=Kl(function(){return arguments}())?Kl:function(e){return my(e)&&gy.call(e,"callee")&&!by.call(e,"callee")},Ws=_y,xy=Array.isArray,_e=xy,Ey=9007199254740991;function Ty(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ey}var Ys=Ty,wy=jl,Ay=Ys;function Sy(e){return e!=null&&Ay(e.length)&&!wy(e)}var ti=Sy,ei={exports:{}};function Oy(){return!1}var Iy=Oy;ei.exports,function(e,t){var r=Oe,n=Iy,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}(ei,ei.exports);var Ks=ei.exports,Ny=nn,Ry=Ys,Cy=sn,Py="[object Arguments]",ky="[object Array]",My="[object Boolean]",Ly="[object Date]",Fy="[object Error]",By="[object Function]",Uy="[object Map]",Dy="[object Number]",jy="[object Object]",$y="[object RegExp]",Gy="[object Set]",qy="[object String]",Hy="[object WeakMap]",Vy="[object ArrayBuffer]",zy="[object DataView]",Xy="[object Float32Array]",Wy="[object Float64Array]",Yy="[object Int8Array]",Ky="[object Int16Array]",Zy="[object Int32Array]",Qy="[object Uint8Array]",Jy="[object Uint8ClampedArray]",tm="[object Uint16Array]",em="[object Uint32Array]",St={};St[Xy]=St[Wy]=St[Yy]=St[Ky]=St[Zy]=St[Qy]=St[Jy]=St[tm]=St[em]=!0,St[Py]=St[ky]=St[Vy]=St[My]=St[zy]=St[Ly]=St[Fy]=St[By]=St[Uy]=St[Dy]=St[jy]=St[$y]=St[Gy]=St[qy]=St[Hy]=!1;function rm(e){return Cy(e)&&Ry(e.length)&&!!St[Ny(e)]}var nm=rm;function im(e){return function(t){return e(t)}}var sm=im,ri={exports:{}};ri.exports,function(e,t){var r=Ll,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}(ri,ri.exports);var am=ri.exports,om=nm,lm=sm,Ql=am,Jl=Ql&&Ql.isTypedArray,um=Jl?lm(Jl):om,Zs=um,fm=Ml,cm=Yl,hm=Ws,dm=_e,pm=ti,vm=Ks,ym=kl,mm=Zs,gm="[object Map]",bm="[object Set]",_m=Object.prototype,xm=_m.hasOwnProperty;function Em(e){if(e==null)return!0;if(pm(e)&&(dm(e)||typeof e=="string"||typeof e.splice=="function"||vm(e)||mm(e)||hm(e)))return!e.length;var t=cm(e);if(t==gm||t==bm)return!e.size;if(ym(e))return!fm(e).length;for(var r in e)if(xm.call(e,r))return!1;return!0}var Tm=Em;const te=nr(Tm),wm=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Qs=e=>{const[t,r]=at.useState(!1),[,n]=J.useState(!1),[,i]=J.useState(!1),s=J.useRef(null),a=J.useRef(null),o=J.useRef(null),l=J.useRef(null),{tl:f}=J.useContext(Ar),{uniqueId:c,startAt:h,endAt:u,initialAlpha:d,transformation:{x:p,y:m,width:b,height:v,colorCorrection:g,animation:_,effect:y},applyTransformer:x}=e;console.log("all abstract props",e);const{contrast:O=1,saturation:E=1,brightness:T=1,alpha:R=1,blurRadius:A=0}=g||{},w={...T>1&&{brightness:T},...O>1&&{contrast:O},...E>1&&{saturation:E},...R!==0&&{alpha:R}};at.useEffect(()=>{s.current&&r(!0)},[]),at.useEffect(()=>{let D=pe.context(()=>{});if(s.current&&f.current){const U={duration:Number(u)-Number(h)},V=Ds(_||"None");D=pe.context(()=>{var j,P;te(V.from)?te(V.to)?te(V.fromTo)?f.current.to(s.current,{alpha:1,duration:.01},h).from(o.current,{...U},h).to(s.current,{alpha:0,duration:.1},Number(u)-.1):f.current.fromTo(s.current,(j=V.fromTo)==null?void 0:j.from,(P=V.fromTo)==null?void 0:P.to,h).from(o.current,{...U},h).to(s.current,{alpha:0,duration:.2},u-.2):f.current.to(s.current,{alpha:1,duration:.2,...V.to},h).from(o.current,{...U},h).to(s.current,{alpha:0,duration:.2},u-.2):f.current.from(s.current,{...V.from},h).to(o.current,{alpha:1,duration:.2},h).from(o.current,{...U},h).to(s.current,{alpha:0,duration:.2},u-.2)})}return()=>D.revert()},[_,h,u]);const S=at.useCallback(()=>{n(!0)},[]),I=at.useCallback(D=>{console.log("changeEnd",D),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(D))},[]),C=vt.withFilters(vt.Container,{...A>0&&{blur:ee.filters.BlurFilter},...!te(w)&&{adjust:Fs},matrix:ee.filters.ColorMatrixFilter}),F=(g==null?void 0:g.enabled)||y&&y!==Qe.Normal;return ct.jsxs(vt.Container,{ref:a,children:[ct.jsxs(vt.Container,{ref:s,alpha:d,position:[p,m],pivot:[p,m],width:b,height:v,children:[F&&ct.jsx(C,{scale:1,blur:{blur:A,quality:4},adjust:w,apply:({matrix:D})=>{y===Qe.BlackAndWhite?D.desaturate():y===Qe.Sepia?D.sepia():y===Qe.RetroVintage||y===Qe.NightVision?D.negative():y===Qe.Normal&&D.reset()},matrix:{enabled:!0,matrix:wm},children:ct.jsx(vt.Container,{ref:o,children:e.children})}),!F&&ct.jsx(vt.Container,{ref:o,children:e.children})]}),x&&ct.jsx(Bs,{pixiTransformerRef:l,imageRef:s,isMounted:t,transformCommit:I,transformChange:S,mouseoverEvent:i,uniqueId:c})]})},Am=e=>{const t=J.useRef(null),r=J.useRef(null),{src:n,transformation:{x:i,y:s,width:a,height:o,anchor:l},pointerdown:f,pointerup:c,mousedown:h,mouseup:u,pointerover:d,mouseover:p,mouseout:m}=e;return ct.jsx(Qs,{...e,children:ct.jsx(vt.Container,{ref:r,children:ct.jsx(vt.Sprite,{image:n,width:a,height:o,anchor:l,ref:t,x:i,y:s,interactive:!0,pointerdown:f,pointerup:c,pointerover:d,mousedown:h,mouseup:u,mouseover:p,mouseout:m})})})},ni={build(e){const t=e.points;let r,n,i,s,a,o;if(e.type===Gt.CIRC){const p=e.shape;r=p.x,n=p.y,a=o=p.radius,i=s=0}else if(e.type===Gt.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,m=p.width/2,b=p.height/2;r=p.x+m,n=p.y+b,a=o=Math.max(0,Math.min(p.radius,Math.min(m,b))),i=m-a,s=b-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,m=s,b=r+p,v=r-p,g=n+m;if(t[c++]=b,t[c++]=g,t[--h]=g,t[--h]=v,s){const _=n-m;t[u++]=v,t[u++]=_,t[--d]=_,t[--d]=b}}for(let p=1;p<l;p++){const m=Math.PI/2*(p/l),b=i+Math.cos(m)*a,v=s+Math.sin(m)*o,g=r+b,_=r-b,y=n+v,x=n-v;t[c++]=g,t[c++]=y,t[--h]=y,t[--h]=_,t[u++]=_,t[u++]=x,t[--d]=x,t[--d]=g}{const p=i,m=s+o,b=r+p,v=r-p,g=n+m,_=n-m;t[c++]=b,t[c++]=g,t[--d]=_,t[--d]=b,i&&(t[c++]=v,t[c++]=g,t[--d]=_,t[--d]=v)}},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!==Gt.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 tu(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 eu={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){tu(r,!1);const a=[];for(let f=0;f<n.length;f++){const c=n[f];tu(c.points,!0),a.push(r.length/2),r=r.concat(c.points)}const o=Uf(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])}}},Sm={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)}},Om={build(e){ni.build(e)},triangulate(e,t){ni.triangulate(e,t)}};var ue=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(ue||{}),tr=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(tr||{});const Ir={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 ru{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,m=h*h+u*u,b=f*h+c*u,v=s*Math.sqrt(p)/d,g=s*Math.sqrt(m)/d,_=v*b/p,y=g*b/m,x=v*u+g*c,O=v*h+g*f,E=c*(g+_),T=f*(g+_),R=u*(v+y),A=h*(v+y),w=Math.atan2(T-O,E-x),S=Math.atan2(A-O,R-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=Ir._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/Mn)*40),u=c/(h*2),d=u*2,p=Math.cos(u),m=Math.sin(u),b=h-1,v=b%1/b;for(let g=0;g<=b;++g){const _=g+v*g,y=u+a+d*_,x=Math.cos(y),O=-Math.sin(y);f.push((p*x+m*O)*s+n,(p*-O+m*x)*s+i)}}}class Im{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 Js{static curveLength(t,r,n,i,s,a,o,l){let c=0,h=0,u=0,d=0,p=0,m=0,b=0,v=0,g=0,_=0,y=0,x=t,O=r;for(let E=1;E<=10;++E)h=E/10,u=h*h,d=u*h,p=1-h,m=p*p,b=m*p,v=b*t+3*m*h*n+3*p*u*s+d*o,g=b*r+3*m*h*i+3*p*u*a+d*l,_=x-v,y=O-g,x=v,O=g,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=Ir._segmentsCount(Js.curveLength(l,f,t,r,n,i,s,a));let h=0,u=0,d=0,p=0,m=0;o.push(l,f);for(let b=1,v=0;b<=c;++b)v=b/c,h=1-v,u=h*h,d=u*h,p=v*v,m=p*v,o.push(d*l+3*u*v*t+3*h*p*n+m*s,d*f+3*u*v*r+3*h*p*i+m*a)}}function nu(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,m=f+d,b=c+u,v=h+d;return o.push(p,m,b,v),2}function er(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),m=Math.sqrt(l*l+f*f),b=(15*p*Math.sqrt(m)/Math.PI>>0)+1,v=d/b;if(u+=v,o){a.push(e,t,r,n);for(let g=1,_=u;g<b;g++,_+=v)a.push(e,t,e+Math.sin(_)*m,t+Math.cos(_)*m);a.push(e,t,i,s)}else{a.push(r,n,e,t);for(let g=1,_=u;g<b;g++,_+=v)a.push(e+Math.sin(_)*m,t+Math.cos(_)*m,e,t);a.push(i,s,e,t)}return b*2}function Nm(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 $t(n[0],n[1]),o=new $t(n[n.length-2],n[n.length-1]),l=r.type!==Gt.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,V=(o.y+a.y)*.5;n.unshift(U,V),n.push(U,V)}const c=t.points,h=n.length/2;let u=n.length;const d=c.length/2,p=s.width/2,m=p*p,b=s.miterLimit*s.miterLimit;let v=n[0],g=n[1],_=n[2],y=n[3],x=0,O=0,E=-(g-y),T=v-_,R=0,A=0,w=Math.sqrt(E*E+T*T);E/=w,T/=w,E*=p,T*=p;const S=s.alignment,I=(1-S)*2,C=S*2;l||(s.cap===tr.ROUND?u+=er(v-E*(I-C)*.5,g-T*(I-C)*.5,v-E*I,g-T*I,v+E*C,g+T*C,c,!0)+2:s.cap===tr.SQUARE&&(u+=nu(v,g,E,T,I,C,!0,c))),c.push(v-E*I,g-T*I,v+E*C,g+T*C);for(let U=1;U<h-1;++U){v=n[(U-1)*2],g=n[(U-1)*2+1],_=n[U*2],y=n[U*2+1],x=n[(U+1)*2],O=n[(U+1)*2+1],E=-(g-y),T=v-_,w=Math.sqrt(E*E+T*T),E/=w,T/=w,E*=p,T*=p,R=-(y-O),A=_-x,w=Math.sqrt(R*R+A*A),R/=w,A/=w,R*=p,A*=p;const V=_-v,j=g-y,P=_-x,N=O-y,k=V*P+j*N,L=j*P-N*V,$=L<0;if(Math.abs(L)<.001*Math.abs(k)){c.push(_-E*I,y-T*I,_+E*C,y+T*C),k>=0&&(s.join===ue.ROUND?u+=er(_,y,_-E*I,y-T*I,_-R*I,y-A*I,c,!1)+4:u+=2,c.push(_-R*C,y-A*C,_+R*I,y+A*I));continue}const G=(-E+v)*(-T+y)-(-E+_)*(-T+g),M=(-R+x)*(-A+y)-(-R+_)*(-A+O),B=(V*M-P*G)/L,q=(N*G-j*M)/L,H=(B-_)*(B-_)+(q-y)*(q-y),X=_+(B-_)*I,K=y+(q-y)*I,et=_-(B-_)*C,nt=y-(q-y)*C,ot=Math.min(V*V+j*j,P*P+N*N),ut=$?I:C,Nt=ot+ut*ut*m,Ot=H<=Nt;let z=s.join;if(z===ue.MITER&&H/m>b&&(z=ue.BEVEL),Ot)switch(z){case ue.MITER:{c.push(X,K,et,nt);break}case ue.BEVEL:{$?c.push(X,K,_+E*C,y+T*C,X,K,_+R*C,y+A*C):c.push(_-E*I,y-T*I,et,nt,_-R*I,y-A*I,et,nt),u+=2;break}case ue.ROUND:{$?(c.push(X,K,_+E*C,y+T*C),u+=er(_,y,_+E*C,y+T*C,_+R*C,y+A*C,c,!0)+4,c.push(X,K,_+R*C,y+A*C)):(c.push(_-E*I,y-T*I,et,nt),u+=er(_,y,_-E*I,y-T*I,_-R*I,y-A*I,c,!1)+4,c.push(_-R*I,y-A*I,et,nt));break}}else{switch(c.push(_-E*I,y-T*I,_+E*C,y+T*C),z){case ue.MITER:{$?c.push(et,nt,et,nt):c.push(X,K,X,K),u+=2;break}case ue.ROUND:{$?u+=er(_,y,_+E*C,y+T*C,_+R*C,y+A*C,c,!0)+2:u+=er(_,y,_-E*I,y-T*I,_-R*I,y-A*I,c,!1)+2;break}}c.push(_-R*I,y-A*I,_+R*C,y+A*C),u+=2}}v=n[(h-2)*2],g=n[(h-2)*2+1],_=n[(h-1)*2],y=n[(h-1)*2+1],E=-(g-y),T=v-_,w=Math.sqrt(E*E+T*T),E/=w,T/=w,E*=p,T*=p,c.push(_-E*I,y-T*I,_+E*C,y+T*C),l||(s.cap===tr.ROUND?u+=er(_-E*(I-C)*.5,y-T*(I-C)*.5,_-E*I,y-T*I,_+E*C,y+T*C,c,!1)+2:s.cap===tr.SQUARE&&(u+=nu(_,y,E,T,I,C,!1,c)));const F=t.indices,D=Ir.epsilon*Ir.epsilon;for(let U=d;U<u+d-2;++U)v=c[U*2],g=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(v*(y-O)+_*(O-g)+x*(g-y))<D)&&F.push(U,U+1,U+2)}function Rm(e,t){let r=0;const n=e.shape,i=e.points||n.points,s=n.type!==Gt.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 iu(e,t){e.lineStyle.native?Rm(e,t):Nm(e,t)}class ta{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),m=Math.sqrt(h),b=2*h*m,v=2*Math.sqrt(d),g=u/m;return(b*p+m*u*(p-v)+(4*d*h-u*u)*Math.log((2*m+g+p)/(g+v)))/(4*b)}static curveTo(t,r,n,i,s){const a=s[s.length-2],o=s[s.length-1],l=Ir._segmentsCount(ta.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 ea={[Gt.POLY]:eu,[Gt.CIRC]:ni,[Gt.ELIP]:ni,[Gt.RECT]:Sm,[Gt.RREC]:Om},su=[],ii=[];class ra{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?wt.EMPTY:(t=t||new wt(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,m=this.maxY,b=a*r+l*n+c,v=o*r+f*n+h;u=b<u?b:u,d=v<d?v:d,p=b>p?b:p,m=v>m?v:m,b=a*i+l*n+c,v=o*i+f*n+h,u=b<u?b:u,d=v<d?v:d,p=b>p?b:p,m=v>m?v:m,b=a*r+l*s+c,v=o*r+f*s+h,u=b<u?b:u,d=v<d?v:d,p=b>p?b:p,m=v>m?v:m,b=a*i+l*s+c,v=o*i+f*s+h,u=b<u?b:u,d=v<d?v:d,p=b>p?b:p,m=v>m?v:m,this.minX=u,this.minY=d,this.maxX=p,this.maxY=m}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,m=this.maxX,b=this.maxY;for(let v=n;v<i;v+=2){const g=r[v],_=r[v+1],y=o*g+f*_+h,x=c*_+l*g+u;d=Math.min(d,y-s),m=Math.max(m,y+s),p=Math.min(p,x-a),b=Math.max(b,x+a)}this.minX=d,this.minY=p,this.maxX=m,this.maxY=b}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 dn{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Ts,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 ra,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 wt),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new wt),t=this._localBoundsRect),this._localBounds||(this._localBounds=new ra);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 Cm),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*gd}set angle(t){this.transform.rotation=t*bd}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 Cm extends Nr{constructor(){super(...arguments),this.sortDirty=null}}Nr.prototype.displayObjectUpdateTransform=Nr.prototype.updateTransform;const Pm=new Xt;function km(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}const na=class extends Nr{constructor(){super(),this.children=[],this.sortableChildren=na.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);Rn(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,Rn(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,Rn(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(km),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!==na.prototype._render&&(r=this.getBounds(!0));const i=e.projection.transform;if(i&&(n?(n=Pm.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!==Bt.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 Rr=na;Rr.defaultSortableChildren=!1,Rr.prototype.containerUpdateTransform=Rr.prototype.updateTransform,Object.defineProperties(pt,{SORTABLE_CHILDREN:{get(){return Rr.defaultSortableChildren},set(e){_t("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Rr.defaultSortableChildren=e}}});class si{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 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 Cr=new $t,au=class extends $o{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 ra,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(),ii.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t.reset(),su.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 si(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 si(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,Cr):Cr.copyFrom(e),n.shape.contains(Cr.x,Cr.y))){let i=!1;if(n.holes){for(let s=0;s<n.holes.length;s++)if(n.holes[s].shape.contains(Cr.x,Cr.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;ea[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,m=this.indices.length,b=this.points.length/2;p.wrapMode=Br.REPEAT,u===0?this.processFill(l):this.processLine(l);const v=this.points.length/2-b;v!==0&&(r&&!this._compareStyles(n,d)&&(r.end(m,b),r=null),r||(r=su.pop()||new Im,r.begin(d,m,b),this.batches.push(r),n=d),this.addUvs(this.points,e,d.texture,b,v,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<au.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++mt._globalBatch;for(let c=0;c<this.drawCalls.length;c++)this.drawCalls[c].texArray.clear(),ii.push(this.drawCalls[c]);this.drawCalls.length=0;const t=this.colors,r=this.textureIds;let n=ii.pop();n||(n=new bs,n.texArray=new As),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=ii.pop(),n||(n=new bs,n.texArray=new As),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=Br.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)}mt._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?eu.triangulate(e,this):ea[e.type].triangulate(e,this)}processLine(e){iu(e,this);for(let t=0;t<e.holes.length;t++)iu(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){const r=e[t];ea[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=Wt.shared.setValue(t).toLittleEndianNumber(),a=Wt.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 ou=au;ou.BATCHABLE_SIZE=100;class ai{constructor(){this.color=16777215,this.alpha=1,this.texture=gt.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new ai;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=gt.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ia extends ai{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=tr.BUTT,this.join=ue.MITER,this.miterLimit=10}clone(){const t=new ia;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 sa={},oi=class extends Rr{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 ai,this._lineStyle=new ia,this._matrix=null,this._holeMode=!1,this.state=Pn.for2d(),this._geometry=e||new ou,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Wt(16777215),this.blendMode=lt.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new oi(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:gt.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:tr.BUTT,join:ue.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 Yr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Yr,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),ta.curveTo(e,t,r,n,i),this}bezierCurveTo(e,t,r,n,i,s){return this._initCurve(),Js.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=ru.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+=Mn:s&&n<=i&&(n+=Mn),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 ru.arc(o,l,e,t,r,n,i,s,c),this}beginFill(e=0,t){return this.beginTextureFill({texture:gt.WHITE,color:e,alpha:t})}normalizeColor(e){const t=Wt.shared.setValue(e.color??0);e.color=t.toNumber(),e.alpha??(e.alpha=t.alpha)}beginTextureFill(e){const t={texture:gt.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 wt(e,t,r,n))}drawRoundedRect(e,t,r,n,i){return this.drawShape(new xs(e,t,r,n,i))}drawCircle(e,t,r){return this.drawShape(new _s(e,t,r))}drawEllipse(e,t,r,n){return this.drawShape(new _d(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 Yr(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===Gt.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:Wt.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,Wt.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(!sa[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 Xt,default:ie.from({uSamplers:i},!0)},a=e.plugins[r]._shader.program;sa[r]=new Zr(a,s)}t=sa[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,oi._TEMP_POINT),this._geometry.containsPoint(oi._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=Wt.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 aa=oi;aa.curves=Ir,aa._TEMP_POINT=new $t;var Mm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},oa={},Lm={get exports(){return oa},set exports(e){oa=e}};/*!
540
540
  * d-path-parser - v1.0.0
541
541
  * by Massimo Artizzu (MaxArt2501)
542
542
  *
@@ -544,47 +544,47 @@ void main(void)
544
544
  *
545
545
  * Licensed under the MIT License
546
546
  * See LICENSE for details
547
- */(function(e,t){(function(r,n){e.exports=n()})(Ug,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 y=d("number",!0);return{x:+g,y:+y}},"arc definition":function(v){var g=s["coordinate pair"](v);if(!g&&!v)return null;d("comma");var y=+d("number",!0);d("comma",!0);var b=!!+d("flag",!0);d("comma");var _=!!+d("flag",!0);d("comma");var m=s["coordinate pair"](!0);return{radii:g,rotation:y,large:b,clockwise:_,end:m}}},a=0,o=[];a<n.length;){var l=d("command"),h=l.toUpperCase(),c=l!==h,f;switch(h){case"M":f=p("coordinate pair").map(function(v,g){return g===1&&(l=c?"l":"L"),u({end:v})});break;case"L":case"T":f=p("coordinate pair").map(function(v){return u({end:v})});break;case"C":if(f=p("coordinate pair"),f.length%3)throw Error("Expected coordinate pair triplet at position "+a);f=f.reduce(function(v,g,y){var b=y%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(f=p("coordinate pair"),f.length&1)throw Error("Expected coordinate pair couple at position "+a);f=f.reduce(function(v,g,y){var b=y&1;if(!b)v.push(u({cp:g}));else{var _=v[v.length-1];_.end=g}return v},[]);break;case"H":case"V":f=p("number").map(function(v){return u({value:v})});break;case"A":f=p("arc definition").map(u);break;case"Z":f=[{code:"Z"}];break}o.push.apply(o,f)}return o;function u(v){return v.code=l,v.relative=c,v}function d(v,g){i[v].lastIndex=a;var y=i[v].exec(n);if(!y||y.index!==a){if(!g)return null;throw Error("Expected "+v+" at position "+a)}return a=i[v].lastIndex,y[1]}function p(v){for(var g=[],y,b=!0;y=s[v](b);)g.push(y),b=!!d("comma");return g}}})})(jg);const Gg=/^\s+/,$g=/\s+$/;function st(e,t){if(e=e||"",t=t||{},e instanceof st)return e;if(!(this instanceof st))return new st(e,t);var r=qg(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}st.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=Vu(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=$u(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=$u(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=Gu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Gu(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 qu(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Xg(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(Nt(this._r,255)*100)+"%",g:Math.round(Nt(this._g,255)*100)+"%",b:Math.round(Nt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Nt(this._r,255)*100)+"%, "+Math.round(Nt(this._g,255)*100)+"%, "+Math.round(Nt(this._b,255)*100)+"%)":"rgba("+Math.round(Nt(this._r,255)*100)+"%, "+Math.round(Nt(this._g,255)*100)+"%, "+Math.round(Nt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:s0[qu(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+Hu(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=st(e);r="#"+Hu(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 st(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(Zg,arguments)},brighten:function(){return this._applyModification(Qg,arguments)},darken:function(){return this._applyModification(Jg,arguments)},desaturate:function(){return this._applyModification(Wg,arguments)},saturate:function(){return this._applyModification(Yg,arguments)},greyscale:function(){return this._applyModification(Kg,arguments)},spin:function(){return this._applyModification(t0,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(n0,arguments)},complement:function(){return this._applyCombination(e0,arguments)},monochromatic:function(){return this._applyCombination(i0,arguments)},splitcomplement:function(){return this._applyCombination(r0,arguments)},triad:function(){return this._applyCombination(zu,[3])},tetrad:function(){return this._applyCombination(zu,[4])}},st.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]=dn(e[n]));e=r}return st(e,t)};function qg(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=u0(e)),typeof e=="object"&&(Ne(e.r)&&Ne(e.g)&&Ne(e.b)?(t=Hg(e.r,e.g,e.b),a=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ne(e.h)&&Ne(e.s)&&Ne(e.v)?(n=dn(e.s),i=dn(e.v),t=Vg(e.h,n,i),a=!0,o="hsv"):Ne(e.h)&&Ne(e.s)&&Ne(e.l)&&(n=dn(e.s),s=dn(e.l),t=zg(e.h,n,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=Vu(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 Hg(e,t,r){return{r:Nt(e,255)*255,g:Nt(t,255)*255,b:Nt(r,255)*255}}function Gu(e,t,r){e=Nt(e,255),t=Nt(t,255),r=Nt(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 zg(e,t,r){var n,i,s;e=Nt(e,360),t=Nt(t,100),r=Nt(r,100);function a(h,c,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?h+(c-h)*6*f:f<1/2?c:f<2/3?h+(c-h)*(2/3-f)*6:h}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 $u(e,t,r){e=Nt(e,255),t=Nt(t,255),r=Nt(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 Vg(e,t,r){e=Nt(e,360)*6,t=Nt(t,100),r=Nt(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,h=[r,a,s,s,o,r][l],c=[o,r,r,a,s,s][l],f=[s,s,o,r,r,a][l];return{r:h*255,g:c*255,b:f*255}}function qu(e,t,r,n){var i=[ce(Math.round(e).toString(16)),ce(Math.round(t).toString(16)),ce(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 Xg(e,t,r,n,i){var s=[ce(Math.round(e).toString(16)),ce(Math.round(t).toString(16)),ce(Math.round(r).toString(16)),ce(Xu(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 Hu(e,t,r,n){var i=[ce(Xu(n)),ce(Math.round(e).toString(16)),ce(Math.round(t).toString(16)),ce(Math.round(r).toString(16))];return i.join("")}st.equals=function(e,t){return!e||!t?!1:st(e).toRgbString()==st(t).toRgbString()},st.random=function(){return st.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Wg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.s-=t/100,r.s=Ti(r.s),st(r)}function Yg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.s+=t/100,r.s=Ti(r.s),st(r)}function Kg(e){return st(e).desaturate(100)}function Zg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.l+=t/100,r.l=Ti(r.l),st(r)}function Qg(e,t){t=t===0?0:t||10;var r=st(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)))),st(r)}function Jg(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.l-=t/100,r.l=Ti(r.l),st(r)}function t0(e,t){var r=st(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,st(r)}function e0(e){var t=st(e).toHsl();return t.h=(t.h+180)%360,st(t)}function zu(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=st(e).toHsl(),n=[st(e)],i=360/t,s=1;s<t;s++)n.push(st({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function r0(e){var t=st(e).toHsl(),r=t.h;return[st(e),st({h:(r+72)%360,s:t.s,l:t.l}),st({h:(r+216)%360,s:t.s,l:t.l})]}function n0(e,t,r){t=t||6,r=r||30;var n=st(e).toHsl(),i=360/r,s=[st(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(st(n));return s}function i0(e,t){t=t||6;for(var r=st(e).toHsv(),n=r.h,i=r.s,s=r.v,a=[],o=1/t;t--;)a.push(st({h:n,s:i,v:s})),s=(s+o)%1;return a}st.mix=function(e,t,r){r=r===0?0:r||50;var n=st(e).toRgb(),i=st(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 st(a)},st.readability=function(e,t){var r=st(e),n=st(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},st.isReadable=function(e,t,r){var n=st.readability(e,t),i,s;switch(s=!1,i=h0(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},st.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 h=0;h<t.length;h++)s=st.readability(e,t[h]),s>i&&(i=s,n=st(t[h]));return st.isReadable(e,n,{level:o,size:l})||!a?n:(r.includeFallbackColors=!1,st.mostReadable(e,["#fff","#000"],r))};var Aa=st.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"},s0=st.hexNames=a0(Aa);function a0(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function Vu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Nt(e,t){o0(e)&&(e="100%");var r=l0(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 Ti(e){return Math.min(1,Math.max(0,e))}function Qt(e){return parseInt(e,16)}function o0(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function l0(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ce(e){return e.length==1?"0"+e:""+e}function dn(e){return e<=1&&(e=e*100+"%"),e}function Xu(e){return Math.round(parseFloat(e)*255).toString(16)}function Wu(e){return Qt(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 Ne(e){return!!fe.CSS_UNIT.exec(e)}function u0(e){e=e.replace(Gg,"").replace($g,"").toLowerCase();var t=!1;if(Aa[e])e=Aa[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:Qt(r[1]),g:Qt(r[2]),b:Qt(r[3]),a:Wu(r[4]),format:t?"name":"hex8"}:(r=fe.hex6.exec(e))?{r:Qt(r[1]),g:Qt(r[2]),b:Qt(r[3]),format:t?"name":"hex"}:(r=fe.hex4.exec(e))?{r:Qt(r[1]+""+r[1]),g:Qt(r[2]+""+r[2]),b:Qt(r[3]+""+r[3]),a:Wu(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=fe.hex3.exec(e))?{r:Qt(r[1]+""+r[1]),g:Qt(r[2]+""+r[2]),b:Qt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function h0(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 c0=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(h){s=!0,a=h}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")}}(),pn=Math.PI*2,Sa=function(t,r,n,i,s,a,o){var l=t.x,h=t.y;l*=r,h*=n;var c=i*l-s*h,f=s*l+i*h;return{x:c+a,y:f+o}},f0=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}]},Yu=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)},d0=function(t,r,n,i,s,a,o,l,h,c,f,u){var d=Math.pow(s,2),p=Math.pow(a,2),v=Math.pow(f,2),g=Math.pow(u,2),y=d*p-d*g-p*v;y<0&&(y=0),y/=d*g+p*v,y=Math.sqrt(y)*(o===l?-1:1);var b=y*s/a*u,_=y*-a/s*f,m=c*b-h*_+(t+n)/2,x=h*b+c*_+(r+i)/2,S=(f-b)/s,w=(u-_)/a,E=(-f-b)/s,N=(-u-_)/a,A=Yu(1,0,S,w),T=Yu(S,w,E,N);return l===0&&T>0&&(T-=pn),l===1&&T<0&&(T+=pn),[m,x,A,T]},Ku=function(t){var r=t.px,n=t.py,i=t.cx,s=t.cy,a=t.rx,o=t.ry,l=t.xAxisRotation,h=l===void 0?0:l,c=t.largeArcFlag,f=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(h*pn/360),g=Math.cos(h*pn/360),y=g*(r-i)/2+v*(n-s)/2,b=-v*(r-i)/2+g*(n-s)/2;if(y===0&&b===0)return[];a=Math.abs(a),o=Math.abs(o);var _=Math.pow(y,2)/Math.pow(a,2)+Math.pow(b,2)/Math.pow(o,2);_>1&&(a*=Math.sqrt(_),o*=Math.sqrt(_));var m=d0(r,n,i,s,a,o,f,d,v,g,y,b),x=c0(m,4),S=x[0],w=x[1],E=x[2],N=x[3],A=Math.abs(N)/(pn/4);Math.abs(1-A)<1e-7&&(A=1);var T=Math.max(Math.ceil(A),1);N/=T;for(var O=0;O<T;O++)p.push(f0(E,N)),E+=N;return p.map(function(R){var C=Sa(R[0],a,o,g,v,S,w),F=C.x,U=C.y,D=Sa(R[1],a,o,g,v,S,w),z=D.x,j=D.y,k=Sa(R[2],a,o,g,v,S,w),I=k.x,P=k.y;return{x1:F,y1:U,x2:z,y2:j,x:I,y:P}})};class p0 extends Re{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}=st(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 h=0,c=0;o!==null&&(h=parseFloat(o)),l!==null&&(c=parseFloat(l)),i?this.drawEllipse(h,c,s,a):this.drawCircle(h,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:h,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:h===null&&r?this.line.join:h,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=Ta(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,h=i;this.bezierCurveTo(l+o.cp1.x,h+o.cp1.y,l+o.cp2.x,h+o.cp2.y,n+=o.end.x,i+=o.end.y);break}case"s":case"q":{const l=n,h=i;this.quadraticCurveTo(l+o.cp.x,h+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":{Ku({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:h,x2:c,y2:f,x:u,y:d})=>this.bezierCurveTo(l,h,c,f,u,d));break}case"A":{Ku({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:h,x2:c,y2:f,x:u,y:d})=>this.bezierCurveTo(l,h,c,f,u,d));break}default:{console.info("[PIXI.SVG] Draw command not supported:",o.code,o);break}}}}}var Ai={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},y0=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function v0(e){return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&y0.indexOf(e)>=0}function m0(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 g0(e){return(e|32)===97}function Br(e){return e>=48&&e<=57}function b0(e){return e>=48&&e<=57||e===43||e===45||e===46}function _0(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Si(e){for(;e.index<e.max&&v0(e.path.charCodeAt(e.index));)e.index++}function x0(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 w0(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),!Br(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&&Br(l)){e.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+t+")";return}for(;r<n&&Br(e.path.charCodeAt(r));)r++,s=!0;l=r<n?e.path.charCodeAt(r):0}if(l===46){for(o=!0,r++;Br(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&&Br(e.path.charCodeAt(r)))for(;r<n&&Br(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 Oa(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>=Ai[r]&&(e.result.push([t].concat(n.splice(0,Ai[r]))),!!Ai[r]););}function E0(e){var t=e.max,r,n,i,s,a;if(e.segmentStart=e.index,r=e.path.charCodeAt(e.index),n=g0(r),!m0(r)){e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")";return}if(s=Ai[e.path[e.index].toLowerCase()],e.index++,Si(e),e.data=[],!s){Oa(e);return}for(i=!1;;){for(a=s;a>0;a--){if(n&&(a===3||a===4)?x0(e):w0(e),e.err.length){Oa(e);return}e.data.push(e.param),Si(e),i=!1,e.index<t&&e.path.charCodeAt(e.index)===44&&(e.index++,Si(e),i=!0)}if(!i&&(e.index>=e.max||!b0(e.path.charCodeAt(e.index))))break}Oa(e)}var T0=function(t){var r=new _0(t),n=r.max;for(Si(r);r.index<n&&!r.err.length;)E0(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 A0(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 de(){if(!(this instanceof de))return new de;this.queue=[],this.cache=null}de.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)},de.prototype.translate=function(e,t){return(e!==0||t!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},de.prototype.scale=function(e,t){return(e!==1||t!==1)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},de.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},de.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},de.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},de.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=A0(this.cache,this.queue[e]);return this.cache},de.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 Zu=de,S0=Zu,O0={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},R0=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,I0=/[\s,]+/,N0=function(t){var r=new S0,n,i;return t.split(R0).forEach(function(s){if(s.length){if(typeof O0[s]<"u"){n=s;return}switch(i=s.split(I0).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},yn=Math.PI*2;function Qu(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 C0(e,t,r,n,i,s,a,o,l,h){var c=h*(e-r)/2+l*(t-n)/2,f=-l*(e-r)/2+h*(t-n)/2,u=a*a,d=o*o,p=c*c,v=f*f,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 y=g*a/o*f,b=g*-o/a*c,_=h*y-l*b+(e+r)/2,m=l*y+h*b+(t+n)/2,x=(c-y)/a,S=(f-b)/o,w=(-c-y)/a,E=(-f-b)/o,N=Qu(1,0,x,S),A=Qu(x,S,w,E);return s===0&&A>0&&(A-=yn),s===1&&A<0&&(A+=yn),[_,m,N,A]}function k0(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 P0=function(t,r,n,i,s,a,o,l,h){var c=Math.sin(h*yn/360),f=Math.cos(h*yn/360),u=f*(t-n)/2+c*(r-i)/2,d=-c*(t-n)/2+f*(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=C0(t,r,n,i,s,a,o,l,c,f),g=[],y=v[2],b=v[3],_=Math.max(Math.ceil(Math.abs(b)/(yn/4)),1);b/=_;for(var m=0;m<_;m++)g.push(k0(y,b)),y+=b;return g.map(function(x){for(var S=0;S<x.length;S+=2){var w=x[S+0],E=x[S+1];w*=o,E*=l;var N=f*w-c*E,A=c*w+f*E;x[S+0]=N+v[0],x[S+1]=A+v[1]}return x})},vn=1e-10,Ju=Math.PI/180;function mn(e,t,r){if(!(this instanceof mn))return new mn(e,t,r);this.rx=e,this.ry=t,this.ax=r}mn.prototype.transform=function(e){var t=Math.cos(this.ax*Ju),r=Math.sin(this.ax*Ju),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<vn*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 h=o+a/2,c=o-a/2;return this.ax=Math.abs(l)<vn&&Math.abs(h-s)<vn?90:Math.atan(Math.abs(l)>Math.abs(h-s)?(h-i)/l:l/(h-s))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(h),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(h)),this},mn.prototype.isDegenerate=function(){return this.rx<vn*this.ry||this.ry<vn*this.rx};var M0=mn,L0=T0,F0=N0,Ge=Zu,B0=P0,D0=M0;function Lt(e){if(!(this instanceof Lt))return new Lt(e);var t=L0(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}Lt.from=function(e){if(typeof e=="string")return new Lt(e);if(e instanceof Lt){var t=new Lt("");return t.err=e.err,t.segments=e.segments.map(function(r){return r.slice()}),t.__stack=e.__stack.map(function(r){return Ge().matrix(r.toArray())}),t}throw new Error("SvgPath.from: invalid param type "+e)},Lt.prototype.__matrix=function(e){var t=this,r;e.queue.length&&this.iterate(function(n,i,s,a){var o,l,h,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 f=e.toArray(),u=D0(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[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(h=n[0],l=[h],c=h.toLowerCase()===h,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)},Lt.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=Ge(),t=this.__stack.length;--t>=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},Lt.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},Lt.prototype.translate=function(e,t){return this.__stack.push(Ge().translate(e,t||0)),this},Lt.prototype.scale=function(e,t){return this.__stack.push(Ge().scale(e,!t&&t!==0?e:t)),this},Lt.prototype.rotate=function(e,t,r){return this.__stack.push(Ge().rotate(e,t||0,r||0)),this},Lt.prototype.skewX=function(e){return this.__stack.push(Ge().skewX(e)),this},Lt.prototype.skewY=function(e){return this.__stack.push(Ge().skewY(e)),this},Lt.prototype.matrix=function(e){return this.__stack.push(Ge().matrix(e)),this},Lt.prototype.transform=function(e){return e.trim()?(this.__stack.push(F0(e)),this):this},Lt.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,h){h&&(a[h]=+a[h].toFixed(e))});return}}),this},Lt.prototype.iterate=function(e,t){var r=this.segments,n={},i=!1,s=0,a=0,o=0,l=0,h,c,f;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(f=[],h=0;h<r.length;h++)if(typeof n[h]<"u")for(c=0;c<n[h].length;c++)f.push(n[h][c]);else f.push(r[h]);return this.segments=f,this},Lt.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},Lt.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},Lt.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=B0(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(h){o.push(["C",h[2],h[3],h[4],h[5],h[6],h[7]])}),o))}),this},Lt.prototype.unshort=function(){var e=this.segments,t,r,n,i,s;return this.iterate(function(a,o,l,h){var c=a[0],f=c.toUpperCase(),u;o&&(f==="T"?(u=c==="t",n=e[o-1],n[0]==="Q"?(t=n[1]-l,r=n[2]-h):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+=h),e[o]=[u?"q":"Q",i,s,a[1],a[2]]):f==="S"&&(u=c==="s",n=e[o-1],n[0]==="C"?(t=n[3]-l,r=n[4]-h):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+=h),e[o]=[u?"c":"C",i,s,a[1],a[2],a[3],a[4]]))}),this};var U0=Lt,j0=U0;const G0=or(j0),$0=e=>{const[t,r]=ot.useState(null),n=J.useRef(null),i=J.useRef(null),s=J.useRef(null),{path:a,transformation:{x:o,y:l,width:h,height:c,anchor:f,fill:u,stroke:d="none",strokeWidth:p=0},pointerdown:v,pointerup:g,mousedown:y,mouseup:b,pointerover:_,mouseover:m,mouseout:x}=e,S=yt.useApp();return ot.useEffect(()=>{const w=G0(a).scale(5).translate(0,0).toString(),E=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${c}">
548
- <path stroke="${d}" stroke-width="${p}" fill="${u}" d="${w}">
547
+ */(function(e,t){(function(r,n){e.exports=n()})(Mm,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(m){return+d("number",m)},"coordinate pair":function(m){var b=d("number",m);if(b===null&&!m)return null;d("comma");var v=d("number",!0);return{x:+b,y:+v}},"arc definition":function(m){var b=s["coordinate pair"](m);if(!b&&!m)return null;d("comma");var v=+d("number",!0);d("comma",!0);var g=!!+d("flag",!0);d("comma");var _=!!+d("flag",!0);d("comma");var y=s["coordinate pair"](!0);return{radii:b,rotation:v,large:g,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(m,b){return b===1&&(l=c?"l":"L"),u({end:m})});break;case"L":case"T":h=p("coordinate pair").map(function(m){return u({end:m})});break;case"C":if(h=p("coordinate pair"),h.length%3)throw Error("Expected coordinate pair triplet at position "+a);h=h.reduce(function(m,b,v){var g=v%3;if(!g)m.push(u({cp1:b}));else{var _=m[m.length-1];_[g===1?"cp2":"end"]=b}return m},[]);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(m,b,v){var g=v&1;if(!g)m.push(u({cp:b}));else{var _=m[m.length-1];_.end=b}return m},[]);break;case"H":case"V":h=p("number").map(function(m){return u({value:m})});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(m){return m.code=l,m.relative=c,m}function d(m,b){i[m].lastIndex=a;var v=i[m].exec(n);if(!v||v.index!==a){if(!b)return null;throw Error("Expected "+m+" at position "+a)}return a=i[m].lastIndex,v[1]}function p(m){for(var b=[],v,g=!0;v=s[m](g);)b.push(v),g=!!d("comma");return b}}})})(Lm);const Fm=/^\s+/,Bm=/\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=Um(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=du(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=uu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=uu(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=lu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=lu(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 fu(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Gm(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(It(this._r,255)*100)+"%",g:Math.round(It(this._g,255)*100)+"%",b:Math.round(It(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(It(this._r,255)*100)+"%, "+Math.round(It(this._g,255)*100)+"%, "+Math.round(It(this._b,255)*100)+"%)":"rgba("+Math.round(It(this._r,255)*100)+"%, "+Math.round(It(this._g,255)*100)+"%, "+Math.round(It(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:tg[fu(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+cu(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=it(e);r="#"+cu(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(zm,arguments)},brighten:function(){return this._applyModification(Xm,arguments)},darken:function(){return this._applyModification(Wm,arguments)},desaturate:function(){return this._applyModification(qm,arguments)},saturate:function(){return this._applyModification(Hm,arguments)},greyscale:function(){return this._applyModification(Vm,arguments)},spin:function(){return this._applyModification(Ym,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Qm,arguments)},complement:function(){return this._applyCombination(Km,arguments)},monochromatic:function(){return this._applyCombination(Jm,arguments)},splitcomplement:function(){return this._applyCombination(Zm,arguments)},triad:function(){return this._applyCombination(hu,[3])},tetrad:function(){return this._applyCombination(hu,[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]=an(e[n]));e=r}return it(e,t)};function Um(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=ig(e)),typeof e=="object"&&(Ie(e.r)&&Ie(e.g)&&Ie(e.b)?(t=Dm(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=an(e.s),i=an(e.v),t=$m(e.h,n,i),a=!0,o="hsv"):Ie(e.h)&&Ie(e.s)&&Ie(e.l)&&(n=an(e.s),s=an(e.l),t=jm(e.h,n,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=du(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 Dm(e,t,r){return{r:It(e,255)*255,g:It(t,255)*255,b:It(r,255)*255}}function lu(e,t,r){e=It(e,255),t=It(t,255),r=It(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 jm(e,t,r){var n,i,s;e=It(e,360),t=It(t,100),r=It(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 uu(e,t,r){e=It(e,255),t=It(t,255),r=It(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 $m(e,t,r){e=It(e,360)*6,t=It(t,100),r=It(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 fu(e,t,r,n){var i=[fe(Math.round(e).toString(16)),fe(Math.round(t).toString(16)),fe(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 Gm(e,t,r,n,i){var s=[fe(Math.round(e).toString(16)),fe(Math.round(t).toString(16)),fe(Math.round(r).toString(16)),fe(pu(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 cu(e,t,r,n){var i=[fe(pu(n)),fe(Math.round(e).toString(16)),fe(Math.round(t).toString(16)),fe(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 qm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.s-=t/100,r.s=li(r.s),it(r)}function Hm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.s+=t/100,r.s=li(r.s),it(r)}function Vm(e){return it(e).desaturate(100)}function zm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.l+=t/100,r.l=li(r.l),it(r)}function Xm(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 Wm(e,t){t=t===0?0:t||10;var r=it(e).toHsl();return r.l-=t/100,r.l=li(r.l),it(r)}function Ym(e,t){var r=it(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,it(r)}function Km(e){var t=it(e).toHsl();return t.h=(t.h+180)%360,it(t)}function hu(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 Zm(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 Qm(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 Jm(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=sg(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 la=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"},tg=it.hexNames=eg(la);function eg(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function du(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function It(e,t){rg(e)&&(e="100%");var r=ng(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 li(e){return Math.min(1,Math.max(0,e))}function Zt(e){return parseInt(e,16)}function rg(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function ng(e){return typeof e=="string"&&e.indexOf("%")!=-1}function fe(e){return e.length==1?"0"+e:""+e}function an(e){return e<=1&&(e=e*100+"%"),e}function pu(e){return Math.round(parseFloat(e)*255).toString(16)}function vu(e){return Zt(e)/255}var ce=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!!ce.CSS_UNIT.exec(e)}function ig(e){e=e.replace(Fm,"").replace(Bm,"").toLowerCase();var t=!1;if(la[e])e=la[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ce.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ce.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ce.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ce.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ce.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ce.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ce.hex8.exec(e))?{r:Zt(r[1]),g:Zt(r[2]),b:Zt(r[3]),a:vu(r[4]),format:t?"name":"hex8"}:(r=ce.hex6.exec(e))?{r:Zt(r[1]),g:Zt(r[2]),b:Zt(r[3]),format:t?"name":"hex"}:(r=ce.hex4.exec(e))?{r:Zt(r[1]+""+r[1]),g:Zt(r[2]+""+r[2]),b:Zt(r[3]+""+r[3]),a:vu(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=ce.hex3.exec(e))?{r:Zt(r[1]+""+r[1]),g:Zt(r[2]+""+r[2]),b:Zt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function sg(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 ag=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")}}(),on=Math.PI*2,ua=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}},og=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}]},yu=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)},lg=function(t,r,n,i,s,a,o,l,f,c,h,u){var d=Math.pow(s,2),p=Math.pow(a,2),m=Math.pow(h,2),b=Math.pow(u,2),v=d*p-d*b-p*m;v<0&&(v=0),v/=d*b+p*m,v=Math.sqrt(v)*(o===l?-1:1);var g=v*s/a*u,_=v*-a/s*h,y=c*g-f*_+(t+n)/2,x=f*g+c*_+(r+i)/2,O=(h-g)/s,E=(u-_)/a,T=(-h-g)/s,R=(-u-_)/a,A=yu(1,0,O,E),w=yu(O,E,T,R);return l===0&&w>0&&(w-=on),l===1&&w<0&&(w+=on),[y,x,A,w]},mu=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 m=Math.sin(f*on/360),b=Math.cos(f*on/360),v=b*(r-i)/2+m*(n-s)/2,g=-m*(r-i)/2+b*(n-s)/2;if(v===0&&g===0)return[];a=Math.abs(a),o=Math.abs(o);var _=Math.pow(v,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(o,2);_>1&&(a*=Math.sqrt(_),o*=Math.sqrt(_));var y=lg(r,n,i,s,a,o,h,d,m,b,v,g),x=ag(y,4),O=x[0],E=x[1],T=x[2],R=x[3],A=Math.abs(R)/(on/4);Math.abs(1-A)<1e-7&&(A=1);var w=Math.max(Math.ceil(A),1);R/=w;for(var S=0;S<w;S++)p.push(og(T,R)),T+=R;return p.map(function(I){var C=ua(I[0],a,o,b,m,O,E),F=C.x,D=C.y,U=ua(I[1],a,o,b,m,O,E),V=U.x,j=U.y,P=ua(I[2],a,o,b,m,O,E),N=P.x,k=P.y;return{x1:F,y1:D,x2:V,y2:j,x:N,y:k}})};class ug extends aa{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=oa(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":{mu({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":{mu({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 ui={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},fg=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function cg(e){return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&fg.indexOf(e)>=0}function hg(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 dg(e){return(e|32)===97}function Pr(e){return e>=48&&e<=57}function pg(e){return e>=48&&e<=57||e===43||e===45||e===46}function vg(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function fi(e){for(;e.index<e.max&&cg(e.path.charCodeAt(e.index));)e.index++}function yg(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 mg(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),!Pr(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&&Pr(l)){e.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+t+")";return}for(;r<n&&Pr(e.path.charCodeAt(r));)r++,s=!0;l=r<n?e.path.charCodeAt(r):0}if(l===46){for(o=!0,r++;Pr(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&&Pr(e.path.charCodeAt(r)))for(;r<n&&Pr(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 fa(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>=ui[r]&&(e.result.push([t].concat(n.splice(0,ui[r]))),!!ui[r]););}function gg(e){var t=e.max,r,n,i,s,a;if(e.segmentStart=e.index,r=e.path.charCodeAt(e.index),n=dg(r),!hg(r)){e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")";return}if(s=ui[e.path[e.index].toLowerCase()],e.index++,fi(e),e.data=[],!s){fa(e);return}for(i=!1;;){for(a=s;a>0;a--){if(n&&(a===3||a===4)?yg(e):mg(e),e.err.length){fa(e);return}e.data.push(e.param),fi(e),i=!1,e.index<t&&e.path.charCodeAt(e.index)===44&&(e.index++,fi(e),i=!0)}if(!i&&(e.index>=e.max||!pg(e.path.charCodeAt(e.index))))break}fa(e)}var bg=function(t){var r=new vg(t),n=r.max;for(fi(r);r.index<n&&!r.err.length;)gg(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 _g(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 he(){if(!(this instanceof he))return new he;this.queue=[],this.cache=null}he.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)},he.prototype.translate=function(e,t){return(e!==0||t!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},he.prototype.scale=function(e,t){return(e!==1||t!==1)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},he.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},he.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},he.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},he.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=_g(this.cache,this.queue[e]);return this.cache},he.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 gu=he,xg=gu,Eg={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},Tg=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,wg=/[\s,]+/,Ag=function(t){var r=new xg,n,i;return t.split(Tg).forEach(function(s){if(s.length){if(typeof Eg[s]<"u"){n=s;return}switch(i=s.split(wg).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},ln=Math.PI*2;function bu(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 Sg(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,m=h*h,b=u*d-u*m-d*p;b<0&&(b=0),b/=u*m+d*p,b=Math.sqrt(b)*(i===s?-1:1);var v=b*a/o*h,g=b*-o/a*c,_=f*v-l*g+(e+r)/2,y=l*v+f*g+(t+n)/2,x=(c-v)/a,O=(h-g)/o,E=(-c-v)/a,T=(-h-g)/o,R=bu(1,0,x,O),A=bu(x,O,E,T);return s===0&&A>0&&(A-=ln),s===1&&A<0&&(A+=ln),[_,y,R,A]}function Og(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 Ig=function(t,r,n,i,s,a,o,l,f){var c=Math.sin(f*ln/360),h=Math.cos(f*ln/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 m=Sg(t,r,n,i,s,a,o,l,c,h),b=[],v=m[2],g=m[3],_=Math.max(Math.ceil(Math.abs(g)/(ln/4)),1);g/=_;for(var y=0;y<_;y++)b.push(Og(v,g)),v+=g;return b.map(function(x){for(var O=0;O<x.length;O+=2){var E=x[O+0],T=x[O+1];E*=o,T*=l;var R=h*E-c*T,A=c*E+h*T;x[O+0]=R+m[0],x[O+1]=A+m[1]}return x})},un=1e-10,_u=Math.PI/180;function fn(e,t,r){if(!(this instanceof fn))return new fn(e,t,r);this.rx=e,this.ry=t,this.ax=r}fn.prototype.transform=function(e){var t=Math.cos(this.ax*_u),r=Math.sin(this.ax*_u),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<un*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)<un&&Math.abs(f-s)<un?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},fn.prototype.isDegenerate=function(){return this.rx<un*this.ry||this.ry<un*this.rx};var Ng=fn,Rg=bg,Cg=Ag,De=gu,Pg=Ig,kg=Ng;function kt(e){if(!(this instanceof kt))return new kt(e);var t=Rg(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}kt.from=function(e){if(typeof e=="string")return new kt(e);if(e instanceof kt){var t=new kt("");return t.err=e.err,t.segments=e.segments.map(function(r){return r.slice()}),t.__stack=e.__stack.map(function(r){return De().matrix(r.toArray())}),t}throw new Error("SvgPath.from: invalid param type "+e)},kt.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=kg(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)},kt.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=De(),t=this.__stack.length;--t>=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},kt.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},kt.prototype.translate=function(e,t){return this.__stack.push(De().translate(e,t||0)),this},kt.prototype.scale=function(e,t){return this.__stack.push(De().scale(e,!t&&t!==0?e:t)),this},kt.prototype.rotate=function(e,t,r){return this.__stack.push(De().rotate(e,t||0,r||0)),this},kt.prototype.skewX=function(e){return this.__stack.push(De().skewX(e)),this},kt.prototype.skewY=function(e){return this.__stack.push(De().skewY(e)),this},kt.prototype.matrix=function(e){return this.__stack.push(De().matrix(e)),this},kt.prototype.transform=function(e){return e.trim()?(this.__stack.push(Cg(e)),this):this},kt.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},kt.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 m=u[0]===u[0].toLowerCase();switch(u[0]){case"m":case"M":s=u[1]+(m?s:0),a=u[2]+(m?a:0),o=s,l=a;return;case"h":case"H":s=u[1]+(m?s:0);return;case"v":case"V":a=u[1]+(m?a:0);return;case"z":case"Z":s=o,a=l;return;default:s=u[u.length-2]+(m?s:0),a=u[u.length-1]+(m?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},kt.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},kt.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},kt.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=Pg(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},kt.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 Mg=kt,Lg=Mg;const Fg=nr(Lg),Bg=e=>{const[t,r]=at.useState(null),n=J.useRef(null),i=J.useRef(null),s=J.useRef(null),{path:a,transformation:{x:o,y:l,width:f,height:c,anchor:h,fill:u,stroke:d="none",strokeWidth:p=0},pointerdown:m,pointerup:b,mousedown:v,mouseup:g,pointerover:_,mouseover:y,mouseout:x}=e,O=vt.useApp();return at.useEffect(()=>{const E=Fg(a).scale(5).translate(0,0).toString(),T=`<svg xmlns="http://www.w3.org/2000/svg" width="${f}" height="${c}">
548
+ <path stroke="${d}" stroke-width="${p}" fill="${u}" d="${E}">
549
549
  </path>
550
- </svg>`,N=new p0(E),A=S.renderer.generateTexture(N);return r(A),()=>{}},[S,a,d,p,u]),ft.jsx(Ea,{...e,children:ft.jsx(yt.Container,{ref:i,children:ft.jsx(yt.Container,{ref:s,children:t&&ft.jsx(yt.Sprite,{texture:t,width:h,height:c,anchor:f,ref:n,x:o,y:l,interactive:!0,pointerdown:v,pointerup:g,pointerover:_,mousedown:y,mouseup:b,mouseover:m,mouseout:x})})})})},q0=e=>{const t={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=ot.useState(!1),n=J.useRef(t);console.log("allProps",e);const i=J.useRef(null),s=J.useRef(null),{tl:a,playerTimeRef:o}=J.useContext(Mr),{uniqueId:l,src:h,startAt:c,endAt:f,mute:u,speed:d}=e,p=ot.useRef(null);un(je.PAUSE,()=>{var m;console.log("pause event"),i.current&&((m=p.current)==null||m.pause(),n.current.isPlaying=!1)});const v=m=>{var x;i.current&&(console.log("audio gsapOnStart",m),o.current>=m&&o.current<=f&&((x=p.current)==null||x.play({volume:u?0:1,start:m,end:f,speed:d||1}),n.current.isPlaying=!0,n.current.completed=!1))},g=()=>{var m;i.current&&(console.log("audio gsapOnStart",c),(m=p.current)==null||m.stop(),n.current.isPlaying=!1,n.current.completed=!0)},y=m=>{var x,S,w;i.current&&!n.current.isPlaying&&!n.current.completed&&(console.log("audio gsapOnUpdate",m),(x=p.current)==null||x.refresh(),(S=p.current)==null||S.refreshPaused(),(w=p.current)==null||w.resume(),n.current.isPlaying=!0)},b=()=>{};J.useEffect(()=>{let m=ye.context(()=>{});if(i.current&&a.current){const x={duration:Number(f)-Number(c),onStart:v,onComplete:g,onStartParams:[c],onCompleteParams:[],onInterrupt:b,onUpdate:y,onUpdateParams:[]};m=ye.context(()=>{a.current.to(i.current,{alpha:1,duration:.01},c).from(s.current,{...x},c).to(i.current,{alpha:0,duration:.1},Number(f)-.1)})}return()=>m.revert()},[c,f]),ot.useEffect(()=>{i.current&&r(!0)},[]),ot.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 _=ot.useCallback((m,x)=>{p.current=x,n.current.loaded=!0},[]);return ot.useEffect(()=>(ee(h)||(p.current=qh.Sound.from({url:h,preload:!0,singleInstance:!0,loaded:_})),()=>{}),[l,h,_]),ft.jsx(yt.Container,{ref:i})};function H0(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 th=H0;function z0(){this.__data__=[],this.size=0}var V0=z0;function X0(e,t){return e===t||e!==e&&t!==t}var eh=X0,W0=eh;function Y0(e,t){for(var r=e.length;r--;)if(W0(e[r][0],t))return r;return-1}var Oi=Y0,K0=Oi,Z0=Array.prototype,Q0=Z0.splice;function J0(e){var t=this.__data__,r=K0(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Q0.call(t,r,1),--this.size,!0}var tb=J0,eb=Oi;function rb(e){var t=this.__data__,r=eb(t,e);return r<0?void 0:t[r][1]}var nb=rb,ib=Oi;function sb(e){return ib(this.__data__,e)>-1}var ab=sb,ob=Oi;function lb(e,t){var r=this.__data__,n=ob(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var ub=lb,hb=V0,cb=tb,fb=nb,db=ab,pb=ub;function Dr(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])}}Dr.prototype.clear=hb,Dr.prototype.delete=cb,Dr.prototype.get=fb,Dr.prototype.has=db,Dr.prototype.set=pb;var Ri=Dr,yb=Ri;function vb(){this.__data__=new yb,this.size=0}var mb=vb;function gb(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var bb=gb;function _b(e){return this.__data__.get(e)}var xb=_b;function wb(e){return this.__data__.has(e)}var Eb=wb,Tb=Lr,Ab=Tb(Object,"create"),Ii=Ab,rh=Ii;function Sb(){this.__data__=rh?rh(null):{},this.size=0}var Ob=Sb;function Rb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ib=Rb,Nb=Ii,Cb="__lodash_hash_undefined__",kb=Object.prototype,Pb=kb.hasOwnProperty;function Mb(e){var t=this.__data__;if(Nb){var r=t[e];return r===Cb?void 0:r}return Pb.call(t,e)?t[e]:void 0}var Lb=Mb,Fb=Ii,Bb=Object.prototype,Db=Bb.hasOwnProperty;function Ub(e){var t=this.__data__;return Fb?t[e]!==void 0:Db.call(t,e)}var jb=Ub,Gb=Ii,$b="__lodash_hash_undefined__";function qb(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Gb&&t===void 0?$b:t,this}var Hb=qb,zb=Ob,Vb=Ib,Xb=Lb,Wb=jb,Yb=Hb;function Ur(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])}}Ur.prototype.clear=zb,Ur.prototype.delete=Vb,Ur.prototype.get=Xb,Ur.prototype.has=Wb,Ur.prototype.set=Yb;var Kb=Ur,nh=Kb,Zb=Ri,Qb=da;function Jb(){this.size=0,this.__data__={hash:new nh,map:new(Qb||Zb),string:new nh}}var t_=Jb;function e_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var r_=e_,n_=r_;function i_(e,t){var r=e.__data__;return n_(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Ni=i_,s_=Ni;function a_(e){var t=s_(this,e).delete(e);return this.size-=t?1:0,t}var o_=a_,l_=Ni;function u_(e){return l_(this,e).get(e)}var h_=u_,c_=Ni;function f_(e){return c_(this,e).has(e)}var d_=f_,p_=Ni;function y_(e,t){var r=p_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var v_=y_,m_=t_,g_=o_,b_=h_,__=d_,x_=v_;function jr(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])}}jr.prototype.clear=m_,jr.prototype.delete=g_,jr.prototype.get=b_,jr.prototype.has=__,jr.prototype.set=x_;var Ra=jr,w_=Ri,E_=da,T_=Ra,A_=200;function S_(e,t){var r=this.__data__;if(r instanceof w_){var n=r.__data__;if(!E_||n.length<A_-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new T_(n)}return r.set(e,t),this.size=r.size,this}var O_=S_,R_=Ri,I_=mb,N_=bb,C_=xb,k_=Eb,P_=O_;function Gr(e){var t=this.__data__=new R_(e);this.size=t.size}Gr.prototype.clear=I_,Gr.prototype.delete=N_,Gr.prototype.get=C_,Gr.prototype.has=k_,Gr.prototype.set=P_;var ih=Gr,M_="__lodash_hash_undefined__";function L_(e){return this.__data__.set(e,M_),this}var F_=L_;function B_(e){return this.__data__.has(e)}var D_=B_,U_=Ra,j_=F_,G_=D_;function Ci(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new U_;++t<r;)this.add(e[t])}Ci.prototype.add=Ci.prototype.push=j_,Ci.prototype.has=G_;var $_=Ci;function q_(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 H_=q_;function z_(e,t){return e.has(t)}var V_=z_,X_=$_,W_=H_,Y_=V_,K_=1,Z_=2;function Q_(e,t,r,n,i,s){var a=r&K_,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var h=s.get(e),c=s.get(t);if(h&&c)return h==t&&c==e;var f=-1,u=!0,d=r&Z_?new X_:void 0;for(s.set(e,t),s.set(t,e);++f<o;){var p=e[f],v=t[f];if(n)var g=a?n(v,p,f,t,e,s):n(p,v,f,e,t,s);if(g!==void 0){if(g)continue;u=!1;break}if(d){if(!W_(t,function(y,b){if(!Y_(d,b)&&(p===y||i(p,y,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 sh=Q_,J_=Ie,t1=J_.Uint8Array,e1=t1;function r1(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var n1=r1;function i1(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var s1=i1,ah=_i,oh=e1,a1=eh,o1=sh,l1=n1,u1=s1,h1=1,c1=2,f1="[object Boolean]",d1="[object Date]",p1="[object Error]",y1="[object Map]",v1="[object Number]",m1="[object RegExp]",g1="[object Set]",b1="[object String]",_1="[object Symbol]",x1="[object ArrayBuffer]",w1="[object DataView]",lh=ah?ah.prototype:void 0,Ia=lh?lh.valueOf:void 0;function E1(e,t,r,n,i,s,a){switch(r){case w1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x1:return!(e.byteLength!=t.byteLength||!s(new oh(e),new oh(t)));case f1:case d1:case v1:return a1(+e,+t);case p1:return e.name==t.name&&e.message==t.message;case m1:case b1:return e==t+"";case y1:var o=l1;case g1:var l=n&h1;if(o||(o=u1),e.size!=t.size&&!l)return!1;var h=a.get(e);if(h)return h==t;n|=c1,a.set(e,t);var c=o1(o(e),o(t),n,i,s,a);return a.delete(e),c;case _1:if(Ia)return Ia.call(e)==Ia.call(t)}return!1}var T1=E1;function A1(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var S1=A1,O1=S1,R1=xe;function I1(e,t,r){var n=t(e);return R1(e)?n:O1(n,r(e))}var N1=I1;function C1(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 k1=C1;function P1(){return[]}var M1=P1,L1=k1,F1=M1,B1=Object.prototype,D1=B1.propertyIsEnumerable,uh=Object.getOwnPropertySymbols,U1=uh?function(e){return e==null?[]:(e=Object(e),L1(uh(e),function(t){return D1.call(e,t)}))}:F1,j1=U1;function G1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var $1=G1,q1=9007199254740991,H1=/^(?:0|[1-9]\d*)$/;function z1(e,t){var r=typeof e;return t=t??q1,!!t&&(r=="number"||r!="symbol"&&H1.test(e))&&e>-1&&e%1==0&&e<t}var hh=z1,V1=$1,X1=ba,W1=xe,Y1=xa,K1=hh,Z1=wa,Q1=Object.prototype,J1=Q1.hasOwnProperty;function tx(e,t){var r=W1(e),n=!r&&X1(e),i=!r&&!n&&Y1(e),s=!r&&!n&&!i&&Z1(e),a=r||n||i||s,o=a?V1(e.length,String):[],l=o.length;for(var h in e)(t||J1.call(e,h))&&!(a&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||K1(h,l)))&&o.push(h);return o}var ex=tx,rx=ex,nx=xu,ix=xi;function sx(e){return ix(e)?rx(e):nx(e)}var Na=sx,ax=N1,ox=j1,lx=Na;function ux(e){return ax(e,lx,ox)}var hx=ux,ch=hx,cx=1,fx=Object.prototype,dx=fx.hasOwnProperty;function px(e,t,r,n,i,s){var a=r&cx,o=ch(e),l=o.length,h=ch(t),c=h.length;if(l!=c&&!a)return!1;for(var f=l;f--;){var u=o[f];if(!(a?u in t:dx.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;++f<l;){u=o[f];var y=e[u],b=t[u];if(n)var _=a?n(b,y,u,t,e,s):n(y,b,u,e,t,s);if(!(_===void 0?y===b||i(y,b,r,n,s):_)){v=!1;break}g||(g=u=="constructor")}if(v&&!g){var m=e.constructor,x=t.constructor;m!=x&&"constructor"in e&&"constructor"in t&&!(typeof m=="function"&&m instanceof m&&typeof x=="function"&&x instanceof x)&&(v=!1)}return s.delete(e),s.delete(t),v}var yx=px,Ca=ih,vx=sh,mx=T1,gx=yx,fh=Fu,dh=xe,ph=xa,bx=wa,_x=1,yh="[object Arguments]",vh="[object Array]",ki="[object Object]",xx=Object.prototype,mh=xx.hasOwnProperty;function wx(e,t,r,n,i,s){var a=dh(e),o=dh(t),l=a?vh:fh(e),h=o?vh:fh(t);l=l==yh?ki:l,h=h==yh?ki:h;var c=l==ki,f=h==ki,u=l==h;if(u&&ph(e)){if(!ph(t))return!1;a=!0,c=!1}if(u&&!c)return s||(s=new Ca),a||bx(e)?vx(e,t,r,n,i,s):mx(e,t,l,r,n,i,s);if(!(r&_x)){var d=c&&mh.call(e,"__wrapped__"),p=f&&mh.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,g=p?t.value():t;return s||(s=new Ca),i(v,g,r,n,s)}}return u?(s||(s=new Ca),gx(e,t,r,n,i,s)):!1}var Ex=wx,Tx=Ex,gh=fn;function bh(e,t,r,n,i){return e===t?!0:e==null||t==null||!gh(e)&&!gh(t)?e!==e&&t!==t:Tx(e,t,r,n,bh,i)}var _h=bh,Ax=ih,Sx=_h,Ox=1,Rx=2;function Ix(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],h=e[l],c=o[1];if(a&&o[2]){if(h===void 0&&!(l in e))return!1}else{var f=new Ax;if(n)var u=n(h,c,l,e,t,f);if(!(u===void 0?Sx(c,h,Ox|Rx,n,f):u))return!1}}return!0}var Nx=Ix,Cx=ca;function kx(e){return e===e&&!Cx(e)}var xh=kx,Px=xh,Mx=Na;function Lx(e){for(var t=Mx(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Px(i)]}return t}var Fx=Lx;function Bx(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var wh=Bx,Dx=Nx,Ux=Fx,jx=wh;function Gx(e){var t=Ux(e);return t.length==1&&t[0][2]?jx(t[0][0],t[0][1]):function(r){return r===e||Dx(r,e,t)}}var $x=Gx,qx=cn,Hx=fn,zx="[object Symbol]";function Vx(e){return typeof e=="symbol"||Hx(e)&&qx(e)==zx}var ka=Vx,Xx=xe,Wx=ka,Yx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kx=/^\w*$/;function Zx(e,t){if(Xx(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Wx(e)?!0:Kx.test(e)||!Yx.test(e)||t!=null&&e in Object(t)}var Pa=Zx,Eh=Ra,Qx="Expected a function";function Ma(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Qx);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(Ma.Cache||Eh),r}Ma.Cache=Eh;var Jx=Ma,tw=Jx,ew=500;function rw(e){var t=tw(e,function(n){return r.size===ew&&r.clear(),n}),r=t.cache;return t}var nw=rw,iw=nw,sw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aw=/\\(\\)?/g,ow=iw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sw,function(r,n,i,s){t.push(i?s.replace(aw,"$1"):n||r)}),t}),lw=ow,Th=_i,uw=th,hw=xe,cw=ka,fw=1/0,Ah=Th?Th.prototype:void 0,Sh=Ah?Ah.toString:void 0;function Oh(e){if(typeof e=="string")return e;if(hw(e))return uw(e,Oh)+"";if(cw(e))return Sh?Sh.call(e):"";var t=e+"";return t=="0"&&1/e==-fw?"-0":t}var dw=Oh,pw=dw;function yw(e){return e==null?"":pw(e)}var vw=yw,mw=xe,gw=Pa,bw=lw,_w=vw;function xw(e,t){return mw(e)?e:gw(e,t)?[e]:bw(_w(e))}var Rh=xw,ww=ka,Ew=1/0;function Tw(e){if(typeof e=="string"||ww(e))return e;var t=e+"";return t=="0"&&1/e==-Ew?"-0":t}var Pi=Tw,Aw=Rh,Sw=Pi;function Ow(e,t){t=Aw(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Sw(t[r++])];return r&&r==n?e:void 0}var Ih=Ow,Rw=Ih;function Iw(e,t,r){var n=e==null?void 0:Rw(e,t);return n===void 0?r:n}var Nw=Iw;function Cw(e,t){return e!=null&&t in Object(e)}var kw=Cw,Pw=Rh,Mw=ba,Lw=xe,Fw=hh,Bw=_a,Dw=Pi;function Uw(e,t,r){t=Pw(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var a=Dw(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&&Bw(i)&&Fw(a,i)&&(Lw(e)||Mw(e)))}var jw=Uw,Gw=kw,$w=jw;function qw(e,t){return e!=null&&$w(e,t,Gw)}var Hw=qw,zw=_h,Vw=Nw,Xw=Hw,Ww=Pa,Yw=xh,Kw=wh,Zw=Pi,Qw=1,Jw=2;function tE(e,t){return Ww(e)&&Yw(t)?Kw(Zw(e),t):function(r){var n=Vw(r,e);return n===void 0&&n===t?Xw(r,e):zw(t,n,Qw|Jw)}}var eE=tE;function rE(e){return e}var nE=rE;function iE(e){return function(t){return t==null?void 0:t[e]}}var sE=iE,aE=Ih;function oE(e){return function(t){return aE(t,e)}}var lE=oE,uE=sE,hE=lE,cE=Pa,fE=Pi;function dE(e){return cE(e)?uE(fE(e)):hE(e)}var pE=dE,yE=$x,vE=eE,mE=nE,gE=xe,bE=pE;function _E(e){return typeof e=="function"?e:e==null?mE:typeof e=="object"?gE(e)?vE(e[0],e[1]):yE(e):bE(e)}var xE=_E;function wE(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 EE=wE,TE=EE,AE=TE(),SE=AE,OE=SE,RE=Na;function IE(e,t){return e&&OE(e,t,RE)}var NE=IE,CE=xi;function kE(e,t){return function(r,n){if(r==null)return r;if(!CE(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 PE=kE,ME=NE,LE=PE,FE=LE(ME),BE=FE,DE=BE,UE=xi;function jE(e,t){var r=-1,n=UE(e)?Array(e.length):[];return DE(e,function(i,s,a){n[++r]=t(i,s,a)}),n}var GE=jE,$E=th,qE=xE,HE=GE,zE=xe;function VE(e,t){var r=zE(e)?$E:HE;return r(e,qE(t))}var XE=VE;const WE=or(XE);var ar={},Nh={},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.loop=Ce.conditional=Ce.parse=void 0;var YE=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};Ce.parse=YE;var KE=function(t,r){return function(n,i,s,a){r(n,i,s)&&a(n,t,i,s)}};Ce.conditional=KE;var ZE=function(t,r){return function(n,i,s,a){for(var o=[],l=n.pos;r(n,i,s);){var h={};if(a(n,t,i,h),n.pos===l)break;l=n.pos,o.push(h)}return o}};Ce.loop=ZE;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 QE=function(t){return{data:t,pos:0}};Ft.buildStream=QE;var Ch=function(){return function(t){return t.data[t.pos++]}};Ft.readByte=Ch;var JE=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+t]}};Ft.peekByte=JE;var Mi=function(t){return function(r){return r.data.subarray(r.pos,r.pos+=t)}};Ft.readBytes=Mi;var tT=function(t){return function(r){return r.data.subarray(r.pos,r.pos+t)}};Ft.peekBytes=tT;var eT=function(t){return function(r){return Array.from(Mi(t)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};Ft.readString=eT;var rT=function(t){return function(r){var n=Mi(2)(r);return t?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};Ft.readUnsigned=rT;var nT=function(t,r){return function(n,i,s){for(var a=typeof r=="function"?r(n,i,s):r,o=Mi(t),l=new Array(a),h=0;h<a;h++)l[h]=o(n);return l}};Ft.readArray=nT;var iT=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},sT=function(t){return function(r){for(var n=Ch()(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]=iT(i,l.index,l.length):a[o]=i[l.index],a},{})}};Ft.readBits=sT,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Ce,r=Ft,n={blocks:function(u){for(var d=0,p=[],v=u.data.length,g=0,y=(0,r.readByte)()(u);y!==d&&y;y=(0,r.readByte)()(u)){if(u.pos+y>=v){var b=v-u.pos;p.push((0,r.readBytes)(b)(u)),g+=b;break}p.push((0,r.readBytes)(y)(u)),g+=y}for(var _=new Uint8Array(g),m=0,x=0;x<p.length;x++)_.set(p[x],m),m+=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(f){var u=(0,r.peekBytes)(2)(f);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(f,u,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(f,u,d){return d.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(f){return(0,r.peekByte)()(f)===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(f){var u=(0,r.peekBytes)(2)(f);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(f){var u=(0,r.peekBytes)(2)(f);return u[0]===33&&u[1]===255}),l=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(f){var u=(0,r.peekBytes)(2)(f);return u[0]===33&&u[1]===254}),h=[{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(f,u){return Math.pow(2,u.lsd.gct.size+1)})},function(f,u){return u.lsd.gct.exists}),{frames:(0,t.loop)([i,o,l,s,a],function(f){var u=(0,r.peekByte)()(f);return u===33||u===44})}],c=h;e.default=c}(Nh);var Li={};Object.defineProperty(Li,"__esModule",{value:!0}),Li.deinterlace=void 0;var aT=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,h=0;h<4;h++)for(var c=a[h];c<i;c+=o[h])s(c,l),l++;return n};Li.deinterlace=aT;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.lzw=void 0;var oT=function(t,r,n){var i=4096,s=-1,a=n,o,l,h,c,f,u,d,S,p,v,x,g,w,E,A,N,y=new Array(n),b=new Array(i),_=new Array(i),m=new Array(i+1);for(g=t,l=1<<g,f=l+1,o=l+2,d=s,c=g+1,h=(1<<c)-1,p=0;p<l;p++)b[p]=0,_[p]=p;var x,S,w,E,N,A;for(x=S=w=E=N=A=0,v=0;v<a;){if(E===0){if(S<c){x+=r[A]<<S,S+=8,A++;continue}if(p=x&h,x>>=c,S-=c,p>o||p==f)break;if(p==l){c=g+1,h=(1<<c)-1,o=l+2,d=s;continue}if(d==s){m[E++]=_[p],d=p,w=p;continue}for(u=p,p==o&&(m[E++]=w,p=d);p>l;)m[E++]=_[p],p=b[p];w=_[p]&255,m[E++]=w,o<i&&(b[o]=d,_[o]=w,o++,!(o&h)&&o<i&&(c++,h+=o)),d=u}E--,y[N++]=m[E],v++}for(v=N;v<a;v++)y[v]=0;return y};Fi.lzw=oT,Object.defineProperty(ar,"__esModule",{value:!0}),ar.decompressFrames=ar.decompressFrame=ar.parseGIF=void 0;var lT=dT(Nh),uT=Ce,hT=Ft,cT=Li,fT=Fi;function dT(e){return e&&e.__esModule?e:{default:e}}var pT=function(t){var r=new Uint8Array(t);return(0,uT.parse)((0,hT.buildStream)(r),lT.default)};ar.parseGIF=pT;var yT=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},kh=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,cT.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=yT(o)),o};ar.decompressFrame=kh;var vT=function(t,r){return t.frames.filter(function(n){return n.image}).map(function(n){return kh(n,t.gct,r)})};ar.decompressFrames=vT;const Ph=(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},mT=e=>Ph({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},e),gT=e=>J.useReducer(Ph,e,mT);var bT='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 _T(e){const t=new Blob([bT],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r,e);return URL.revokeObjectURL(r),n}const xT=e=>({...e,frames:e.frames.map(t=>{const r=new ImageData(e.width,e.height);return r.data.set(new Uint8ClampedArray(t)),r})}),wT=(e,t)=>{const r={};return()=>(r.instance||(r.instance=e()),J.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)},ET=e=>{const t=J.useRef(e);return J.useEffect(()=>{t.current=e},[e]),t},TT=e=>{const t=ET(e);return J.useCallback(r=>t.current&&t.current(r),[])},AT=wT(()=>new _T,e=>e.terminate()),ST=(e,t)=>{const r=TT(t),n=AT();J.useEffect(()=>{if(typeof e=="string"){const i=s=>{const a=s.data||s;if(a.src===e){const o=a.error?a:xT(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])},OT=({isPlaying:e,forwardRef:t,...r})=>{const n=ot.useRef(null);return ot.useImperativeHandle(t,()=>n.current,[n]),ot.useEffect(()=>{if(n.current===null)return;const i=n.current;i[e?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[e]),ft.jsx(yt.AnimatedSprite,{ref:n,...r,isPlaying:e})},Mh=ot.memo(OT),RT=yt.withFilters(yt.Container,{blur:ne.filters.BlurFilter,adjust:Zs,matrix:ne.filters.ColorMatrixFilter}),IT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],NT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},CT=e=>{const[t,r]=ot.useState([]),[,n]=ot.useState(0),[i,s]=ot.useState([]),[,a]=J.useState(0),[,o]=J.useState(!1),[l,h]=J.useState(!1),[,c]=J.useState(!1),[f,u]=gT({autoPlay:!1}),d=ot.useRef(null),p=J.useRef(null),v=J.useRef(null),g=J.useRef(null),y=J.useRef(null),b=J.useRef(null),_=J.useRef(NT),{tl:m}=J.useContext(Mr),{frames:x,delays:S,loaded:w}=f,{uniqueId:E,src:N,startAt:A,endAt:T,initialAlpha:O,locked:R,loop:C,transformation:{width:F=0,height:U=0,x:D,y:z,rotation:j=0,scale:k,animation:I,colorCorrection:P,effect:L},pointerdown:G,pointerup:$,mousedown:M,mouseup:B,pointerover:q,mouseover:H,mouseout:X,pointerout:K,applyTransformer:et,onAnchorTransformationEnd:it}=e,{contrast:lt=1,saturation:ht=1,exposure:Ct=1,blurRadius:It=0,alpha:V=1}=P||{},W={brightness:Ct,contrast:lt,saturation:ht,alpha:V},Q=yt.useApp();ST(N,u),un(je.PAUSE,Et=>{console.log("pause event",Et),p.current&&(p.current.stop(),_.current.isPlaying=!1)});const tt=ot.useCallback(Et=>{console.log("changeEnd",Et),it&&it(Et)},[]);ot.useEffect(()=>{if(!ee(x)){const Et=WE(x,pe=>{const{data:zt,width:Dh,height:UT}=pe,jT=new Uint8Array(zt);return ne.Texture.fromBuffer(jT,Dh,UT)}),Tt=Et.map((pe,zt)=>({texture:pe,time:S[zt]}));r(Et),s(Tt);let Bt=0;S.forEach(pe=>{Bt+=pe*10}),n(Bt)}},[x,S]);const Y=Et=>{p.current&&(p.current.gotoAndPlay(Et||0),_.current.isPlaying=!0)},ct=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},Z=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},at=()=>{p.current&&!_.current.isPlaying&&(p.current.play(),_.current.isPlaying=!0)},St=()=>{o(!0)};J.useEffect(()=>{let Et=ye.context(()=>{});if(v.current&&m.current){const Tt={duration:Number(T)-Number(A),onStart:Y,onComplete:ct,onStartParams:[A],onCompleteParams:[],onInterrupt:Z,onUpdate:at,onUpdateParams:[]},Bt=ha(I||"None");Et=ye.context(()=>{var pe,zt;ee(Bt.from)?ee(Bt.to)?ee(Bt.fromTo)?m.current.to(v.current,{alpha:1,duration:.01},A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.1},Number(T)-.1):m.current.fromTo(v.current,(pe=Bt.fromTo)==null?void 0:pe.from,(zt=Bt.fromTo)==null?void 0:zt.to,A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.2},T-.2):m.current.to(v.current,{alpha:1,duration:.2,...Bt.to},A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.2},T-.2):m.current.from(v.current,{...Bt.from},A).to(y.current,{alpha:1,duration:.2},A).from(y.current,{...Tt},A).to(v.current,{alpha:0,duration:.2},T-.2)})}return()=>Et.revert()},[I,A,T]);const Ht=ot.useCallback(()=>{h(!0)},[]);Q.ticker.add(Et=>{d.current&&(d.current.rotation+=.01*Et,d.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,Math.PI*2*.6,!1))});const _t=ot.useCallback(Et=>{Et.clear()},[]);return ft.jsxs(yt.Container,{ref:g,children:[ft.jsx(yt.Container,{ref:v,alpha:O,position:[D,z],pivot:[D,z],width:F,height:U,children:ft.jsxs(yt.Container,{ref:y,children:[!w&&ft.jsx(yt.Container,{anchor:.5,position:[F/2,U/2],children:ft.jsx(yt.Graphics,{x:D,y:z,ref:d,draw:_t})}),t&&t.length>0&&ft.jsx(RT,{scale:1,blur:{blur:It,quality:4},adjust:W,apply:({matrix:Et})=>{L==="BlackAndWhite"?Et.desaturate():L==="Sepia"?Et.sepia():L==="RetroVintage"||L==="NightVision"?Et.negative():L==="Normal"&&Et.reset()},matrix:{enabled:!0,matrix:IT},children:ft.jsx(Mh,{x:D,y:z,width:F,height:U,rotation:j,animationSpeed:1,loop:C,textures:i,onComplete:St,onFrameChange:Et=>a(Et),anchor:.5,...!R&&!l&&{interactive:!0,buttonMode:!0,pointerdown:G,pointerover:q,pointerout:K,pointerup:$,mousedown:M,mouseup:B,mouseover:H,mouseout:X},forwardRef:p,scale:k})})]})}),et&&ft.jsx(la,{pixiTransformerRef:b,imageRef:v,isMounted:w,transformCommit:tt,transformChange:Ht,mouseoverEvent:c,uniqueId:E})]})};var Lh={exports:{}};/*!
550
+ </svg>`,R=new ug(T),A=O.renderer.generateTexture(R);return r(A),()=>{}},[O,a,d,p,u]),ct.jsx(Qs,{...e,children:ct.jsx(vt.Container,{ref:i,children:ct.jsx(vt.Container,{ref:s,children:t&&ct.jsx(vt.Sprite,{texture:t,width:f,height:c,anchor:h,ref:n,x:o,y:l,interactive:!0,pointerdown:m,pointerup:b,pointerover:_,mousedown:v,mouseup:g,mouseover:y,mouseout:x})})})})},Ug=e=>{const t={isPlaying:!1,progress:0,speed:1,mute:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},[,r]=at.useState(!1),n=J.useRef(t);console.log("allProps",e);const i=J.useRef(null),s=J.useRef(null),{tl:a,playerTimeRef:o}=J.useContext(Ar),{uniqueId:l,src:f,startAt:c,endAt:h,mute:u,speed:d}=e,p=at.useRef(null);en(Ue.PAUSE,()=>{var y;console.log("pause event"),i.current&&((y=p.current)==null||y.pause(),n.current.isPlaying=!1)});const m=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))},b=()=>{var y;i.current&&(console.log("audio gsapOnStart",c),(y=p.current)==null||y.stop(),n.current.isPlaying=!1,n.current.completed=!0)},v=y=>{var x,O,E;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(),(E=p.current)==null||E.resume(),n.current.isPlaying=!0)},g=()=>{};J.useEffect(()=>{let y=pe.context(()=>{});if(i.current&&a.current){const x={duration:Number(h)-Number(c),onStart:m,onComplete:b,onStartParams:[c],onCompleteParams:[],onInterrupt:g,onUpdate:v,onUpdateParams:[]};y=pe.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]),at.useEffect(()=>{i.current&&r(!0)},[]),at.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 _=at.useCallback((y,x)=>{p.current=x,n.current.loaded=!0},[]);return at.useEffect(()=>(te(f)||(p.current=hf.Sound.from({url:f,preload:!0,singleInstance:!0,loaded:_})),()=>{}),[l,f,_]),ct.jsx(vt.Container,{ref:i})};function Dg(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 xu=Dg;function jg(){this.__data__=[],this.size=0}var $g=jg;function Gg(e,t){return e===t||e!==e&&t!==t}var Eu=Gg,qg=Eu;function Hg(e,t){for(var r=e.length;r--;)if(qg(e[r][0],t))return r;return-1}var ci=Hg,Vg=ci,zg=Array.prototype,Xg=zg.splice;function Wg(e){var t=this.__data__,r=Vg(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Xg.call(t,r,1),--this.size,!0}var Yg=Wg,Kg=ci;function Zg(e){var t=this.__data__,r=Kg(t,e);return r<0?void 0:t[r][1]}var Qg=Zg,Jg=ci;function t0(e){return Jg(this.__data__,e)>-1}var e0=t0,r0=ci;function n0(e,t){var r=this.__data__,n=r0(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var i0=n0,s0=$g,a0=Yg,o0=Qg,l0=e0,u0=i0;function kr(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])}}kr.prototype.clear=s0,kr.prototype.delete=a0,kr.prototype.get=o0,kr.prototype.has=l0,kr.prototype.set=u0;var hi=kr,f0=hi;function c0(){this.__data__=new f0,this.size=0}var h0=c0;function d0(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var p0=d0;function v0(e){return this.__data__.get(e)}var y0=v0;function m0(e){return this.__data__.has(e)}var g0=m0,b0=Sr,_0=b0(Object,"create"),di=_0,Tu=di;function x0(){this.__data__=Tu?Tu(null):{},this.size=0}var E0=x0;function T0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var w0=T0,A0=di,S0="__lodash_hash_undefined__",O0=Object.prototype,I0=O0.hasOwnProperty;function N0(e){var t=this.__data__;if(A0){var r=t[e];return r===S0?void 0:r}return I0.call(t,e)?t[e]:void 0}var R0=N0,C0=di,P0=Object.prototype,k0=P0.hasOwnProperty;function M0(e){var t=this.__data__;return C0?t[e]!==void 0:k0.call(t,e)}var L0=M0,F0=di,B0="__lodash_hash_undefined__";function U0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=F0&&t===void 0?B0:t,this}var D0=U0,j0=E0,$0=w0,G0=R0,q0=L0,H0=D0;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=j0,Mr.prototype.delete=$0,Mr.prototype.get=G0,Mr.prototype.has=q0,Mr.prototype.set=H0;var V0=Mr,wu=V0,z0=hi,X0=Gs;function W0(){this.size=0,this.__data__={hash:new wu,map:new(X0||z0),string:new wu}}var Y0=W0;function K0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Z0=K0,Q0=Z0;function J0(e,t){var r=e.__data__;return Q0(t)?r[typeof t=="string"?"string":"hash"]:r.map}var pi=J0,tb=pi;function eb(e){var t=tb(this,e).delete(e);return this.size-=t?1:0,t}var rb=eb,nb=pi;function ib(e){return nb(this,e).get(e)}var sb=ib,ab=pi;function ob(e){return ab(this,e).has(e)}var lb=ob,ub=pi;function fb(e,t){var r=ub(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var cb=fb,hb=Y0,db=rb,pb=sb,vb=lb,yb=cb;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=hb,Lr.prototype.delete=db,Lr.prototype.get=pb,Lr.prototype.has=vb,Lr.prototype.set=yb;var ca=Lr,mb=hi,gb=Gs,bb=ca,_b=200;function xb(e,t){var r=this.__data__;if(r instanceof mb){var n=r.__data__;if(!gb||n.length<_b-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new bb(n)}return r.set(e,t),this.size=r.size,this}var Eb=xb,Tb=hi,wb=h0,Ab=p0,Sb=y0,Ob=g0,Ib=Eb;function Fr(e){var t=this.__data__=new Tb(e);this.size=t.size}Fr.prototype.clear=wb,Fr.prototype.delete=Ab,Fr.prototype.get=Sb,Fr.prototype.has=Ob,Fr.prototype.set=Ib;var Au=Fr,Nb="__lodash_hash_undefined__";function Rb(e){return this.__data__.set(e,Nb),this}var Cb=Rb;function Pb(e){return this.__data__.has(e)}var kb=Pb,Mb=ca,Lb=Cb,Fb=kb;function vi(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Mb;++t<r;)this.add(e[t])}vi.prototype.add=vi.prototype.push=Lb,vi.prototype.has=Fb;var Bb=vi;function Ub(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 Db=Ub;function jb(e,t){return e.has(t)}var $b=jb,Gb=Bb,qb=Db,Hb=$b,Vb=1,zb=2;function Xb(e,t,r,n,i,s){var a=r&Vb,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&zb?new Gb:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(n)var b=a?n(m,p,h,t,e,s):n(p,m,h,e,t,s);if(b!==void 0){if(b)continue;u=!1;break}if(d){if(!qb(t,function(v,g){if(!Hb(d,g)&&(p===v||i(p,v,r,n,s)))return d.push(g)})){u=!1;break}}else if(!(p===m||i(p,m,r,n,s))){u=!1;break}}return s.delete(e),s.delete(t),u}var Su=Xb,Wb=Oe,Yb=Wb.Uint8Array,Kb=Yb;function Zb(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var Qb=Zb;function Jb(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var t1=Jb,Ou=Jn,Iu=Kb,e1=Eu,r1=Su,n1=Qb,i1=t1,s1=1,a1=2,o1="[object Boolean]",l1="[object Date]",u1="[object Error]",f1="[object Map]",c1="[object Number]",h1="[object RegExp]",d1="[object Set]",p1="[object String]",v1="[object Symbol]",y1="[object ArrayBuffer]",m1="[object DataView]",Nu=Ou?Ou.prototype:void 0,ha=Nu?Nu.valueOf:void 0;function g1(e,t,r,n,i,s,a){switch(r){case m1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y1:return!(e.byteLength!=t.byteLength||!s(new Iu(e),new Iu(t)));case o1:case l1:case c1:return e1(+e,+t);case u1:return e.name==t.name&&e.message==t.message;case h1:case p1:return e==t+"";case f1:var o=n1;case d1:var l=n&s1;if(o||(o=i1),e.size!=t.size&&!l)return!1;var f=a.get(e);if(f)return f==t;n|=a1,a.set(e,t);var c=r1(o(e),o(t),n,i,s,a);return a.delete(e),c;case v1:if(ha)return ha.call(e)==ha.call(t)}return!1}var b1=g1;function _1(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var x1=_1,E1=x1,T1=_e;function w1(e,t,r){var n=t(e);return T1(e)?n:E1(n,r(e))}var A1=w1;function S1(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 O1=S1;function I1(){return[]}var N1=I1,R1=O1,C1=N1,P1=Object.prototype,k1=P1.propertyIsEnumerable,Ru=Object.getOwnPropertySymbols,M1=Ru?function(e){return e==null?[]:(e=Object(e),R1(Ru(e),function(t){return k1.call(e,t)}))}:C1,L1=M1;function F1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var B1=F1,U1=9007199254740991,D1=/^(?:0|[1-9]\d*)$/;function j1(e,t){var r=typeof e;return t=t??U1,!!t&&(r=="number"||r!="symbol"&&D1.test(e))&&e>-1&&e%1==0&&e<t}var Cu=j1,$1=B1,G1=Ws,q1=_e,H1=Ks,V1=Cu,z1=Zs,X1=Object.prototype,W1=X1.hasOwnProperty;function Y1(e,t){var r=q1(e),n=!r&&G1(e),i=!r&&!n&&H1(e),s=!r&&!n&&!i&&z1(e),a=r||n||i||s,o=a?$1(e.length,String):[],l=o.length;for(var f in e)(t||W1.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||V1(f,l)))&&o.push(f);return o}var K1=Y1,Z1=K1,Q1=Ml,J1=ti;function t_(e){return J1(e)?Z1(e):Q1(e)}var da=t_,e_=A1,r_=L1,n_=da;function i_(e){return e_(e,n_,r_)}var s_=i_,Pu=s_,a_=1,o_=Object.prototype,l_=o_.hasOwnProperty;function u_(e,t,r,n,i,s){var a=r&a_,o=Pu(e),l=o.length,f=Pu(t),c=f.length;if(l!=c&&!a)return!1;for(var h=l;h--;){var u=o[h];if(!(a?u in t:l_.call(t,u)))return!1}var d=s.get(e),p=s.get(t);if(d&&p)return d==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var b=a;++h<l;){u=o[h];var v=e[u],g=t[u];if(n)var _=a?n(g,v,u,t,e,s):n(v,g,u,e,t,s);if(!(_===void 0?v===g||i(v,g,r,n,s):_)){m=!1;break}b||(b=u=="constructor")}if(m&&!b){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)&&(m=!1)}return s.delete(e),s.delete(t),m}var f_=u_,pa=Au,c_=Su,h_=b1,d_=f_,ku=Yl,Mu=_e,Lu=Ks,p_=Zs,v_=1,Fu="[object Arguments]",Bu="[object Array]",yi="[object Object]",y_=Object.prototype,Uu=y_.hasOwnProperty;function m_(e,t,r,n,i,s){var a=Mu(e),o=Mu(t),l=a?Bu:ku(e),f=o?Bu:ku(t);l=l==Fu?yi:l,f=f==Fu?yi:f;var c=l==yi,h=f==yi,u=l==f;if(u&&Lu(e)){if(!Lu(t))return!1;a=!0,c=!1}if(u&&!c)return s||(s=new pa),a||p_(e)?c_(e,t,r,n,i,s):h_(e,t,l,r,n,i,s);if(!(r&v_)){var d=c&&Uu.call(e,"__wrapped__"),p=h&&Uu.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,b=p?t.value():t;return s||(s=new pa),i(m,b,r,n,s)}}return u?(s||(s=new pa),d_(e,t,r,n,i,s)):!1}var g_=m_,b_=g_,Du=sn;function ju(e,t,r,n,i){return e===t?!0:e==null||t==null||!Du(e)&&!Du(t)?e!==e&&t!==t:b_(e,t,r,n,ju,i)}var $u=ju,__=Au,x_=$u,E_=1,T_=2;function w_(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 __;if(n)var u=n(f,c,l,e,t,h);if(!(u===void 0?x_(c,f,E_|T_,n,h):u))return!1}}return!0}var A_=w_,S_=js;function O_(e){return e===e&&!S_(e)}var Gu=O_,I_=Gu,N_=da;function R_(e){for(var t=N_(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,I_(i)]}return t}var C_=R_;function P_(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var qu=P_,k_=A_,M_=C_,L_=qu;function F_(e){var t=M_(e);return t.length==1&&t[0][2]?L_(t[0][0],t[0][1]):function(r){return r===e||k_(r,e,t)}}var B_=F_,U_=nn,D_=sn,j_="[object Symbol]";function $_(e){return typeof e=="symbol"||D_(e)&&U_(e)==j_}var va=$_,G_=_e,q_=va,H_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V_=/^\w*$/;function z_(e,t){if(G_(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||q_(e)?!0:V_.test(e)||!H_.test(e)||t!=null&&e in Object(t)}var ya=z_,Hu=ca,X_="Expected a function";function ma(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(X_);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(ma.Cache||Hu),r}ma.Cache=Hu;var W_=ma,Y_=W_,K_=500;function Z_(e){var t=Y_(e,function(n){return r.size===K_&&r.clear(),n}),r=t.cache;return t}var Q_=Z_,J_=Q_,tx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ex=/\\(\\)?/g,rx=J_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tx,function(r,n,i,s){t.push(i?s.replace(ex,"$1"):n||r)}),t}),nx=rx,Vu=Jn,ix=xu,sx=_e,ax=va,ox=1/0,zu=Vu?Vu.prototype:void 0,Xu=zu?zu.toString:void 0;function Wu(e){if(typeof e=="string")return e;if(sx(e))return ix(e,Wu)+"";if(ax(e))return Xu?Xu.call(e):"";var t=e+"";return t=="0"&&1/e==-ox?"-0":t}var lx=Wu,ux=lx;function fx(e){return e==null?"":ux(e)}var cx=fx,hx=_e,dx=ya,px=nx,vx=cx;function yx(e,t){return hx(e)?e:dx(e,t)?[e]:px(vx(e))}var Yu=yx,mx=va,gx=1/0;function bx(e){if(typeof e=="string"||mx(e))return e;var t=e+"";return t=="0"&&1/e==-gx?"-0":t}var mi=bx,_x=Yu,xx=mi;function Ex(e,t){t=_x(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[xx(t[r++])];return r&&r==n?e:void 0}var Ku=Ex,Tx=Ku;function wx(e,t,r){var n=e==null?void 0:Tx(e,t);return n===void 0?r:n}var Ax=wx;function Sx(e,t){return e!=null&&t in Object(e)}var Ox=Sx,Ix=Yu,Nx=Ws,Rx=_e,Cx=Cu,Px=Ys,kx=mi;function Mx(e,t,r){t=Ix(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var a=kx(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&&Px(i)&&Cx(a,i)&&(Rx(e)||Nx(e)))}var Lx=Mx,Fx=Ox,Bx=Lx;function Ux(e,t){return e!=null&&Bx(e,t,Fx)}var Dx=Ux,jx=$u,$x=Ax,Gx=Dx,qx=ya,Hx=Gu,Vx=qu,zx=mi,Xx=1,Wx=2;function Yx(e,t){return qx(e)&&Hx(t)?Vx(zx(e),t):function(r){var n=$x(r,e);return n===void 0&&n===t?Gx(r,e):jx(t,n,Xx|Wx)}}var Kx=Yx;function Zx(e){return e}var Qx=Zx;function Jx(e){return function(t){return t==null?void 0:t[e]}}var tE=Jx,eE=Ku;function rE(e){return function(t){return eE(t,e)}}var nE=rE,iE=tE,sE=nE,aE=ya,oE=mi;function lE(e){return aE(e)?iE(oE(e)):sE(e)}var uE=lE,fE=B_,cE=Kx,hE=Qx,dE=_e,pE=uE;function vE(e){return typeof e=="function"?e:e==null?hE:typeof e=="object"?dE(e)?cE(e[0],e[1]):fE(e):pE(e)}var yE=vE;function mE(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 gE=mE,bE=gE,_E=bE(),xE=_E,EE=xE,TE=da;function wE(e,t){return e&&EE(e,t,TE)}var AE=wE,SE=ti;function OE(e,t){return function(r,n){if(r==null)return r;if(!SE(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 IE=OE,NE=AE,RE=IE,CE=RE(NE),PE=CE,kE=PE,ME=ti;function LE(e,t){var r=-1,n=ME(e)?Array(e.length):[];return kE(e,function(i,s,a){n[++r]=t(i,s,a)}),n}var FE=LE,BE=xu,UE=yE,DE=FE,jE=_e;function $E(e,t){var r=jE(e)?BE:DE;return r(e,UE(t))}var GE=$E;const qE=nr(GE);var rr={},Zu={},Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.loop=Ne.conditional=Ne.parse=void 0;var HE=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};Ne.parse=HE;var VE=function(t,r){return function(n,i,s,a){r(n,i,s)&&a(n,t,i,s)}};Ne.conditional=VE;var zE=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}};Ne.loop=zE;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.readBits=Mt.readArray=Mt.readUnsigned=Mt.readString=Mt.peekBytes=Mt.readBytes=Mt.peekByte=Mt.readByte=Mt.buildStream=void 0;var XE=function(t){return{data:t,pos:0}};Mt.buildStream=XE;var Qu=function(){return function(t){return t.data[t.pos++]}};Mt.readByte=Qu;var WE=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+t]}};Mt.peekByte=WE;var gi=function(t){return function(r){return r.data.subarray(r.pos,r.pos+=t)}};Mt.readBytes=gi;var YE=function(t){return function(r){return r.data.subarray(r.pos,r.pos+t)}};Mt.peekBytes=YE;var KE=function(t){return function(r){return Array.from(gi(t)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};Mt.readString=KE;var ZE=function(t){return function(r){var n=gi(2)(r);return t?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};Mt.readUnsigned=ZE;var QE=function(t,r){return function(n,i,s){for(var a=typeof r=="function"?r(n,i,s):r,o=gi(t),l=new Array(a),f=0;f<a;f++)l[f]=o(n);return l}};Mt.readArray=QE;var JE=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},tT=function(t){return function(r){for(var n=Qu()(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]=JE(i,l.index,l.length):a[o]=i[l.index],a},{})}};Mt.readBits=tT,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Ne,r=Mt,n={blocks:function(u){for(var d=0,p=[],m=u.data.length,b=0,v=(0,r.readByte)()(u);v!==d&&v;v=(0,r.readByte)()(u)){if(u.pos+v>=m){var g=m-u.pos;p.push((0,r.readBytes)(g)(u)),b+=g;break}p.push((0,r.readBytes)(v)(u)),b+=v}for(var _=new Uint8Array(b),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}(Zu);var bi={};Object.defineProperty(bi,"__esModule",{value:!0}),bi.deinterlace=void 0;var eT=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};bi.deinterlace=eT;var _i={};Object.defineProperty(_i,"__esModule",{value:!0}),_i.lzw=void 0;var rT=function(t,r,n){var i=4096,s=-1,a=n,o,l,f,c,h,u,d,O,p,m,x,b,E,T,A,R,v=new Array(n),g=new Array(i),_=new Array(i),y=new Array(i+1);for(b=t,l=1<<b,h=l+1,o=l+2,d=s,c=b+1,f=(1<<c)-1,p=0;p<l;p++)g[p]=0,_[p]=p;var x,O,E,T,R,A;for(x=O=E=T=R=A=0,m=0;m<a;){if(T===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=b+1,f=(1<<c)-1,o=l+2,d=s;continue}if(d==s){y[T++]=_[p],d=p,E=p;continue}for(u=p,p==o&&(y[T++]=E,p=d);p>l;)y[T++]=_[p],p=g[p];E=_[p]&255,y[T++]=E,o<i&&(g[o]=d,_[o]=E,o++,!(o&f)&&o<i&&(c++,f+=o)),d=u}T--,v[R++]=y[T],m++}for(m=R;m<a;m++)v[m]=0;return v};_i.lzw=rT,Object.defineProperty(rr,"__esModule",{value:!0}),rr.decompressFrames=rr.decompressFrame=rr.parseGIF=void 0;var nT=lT(Zu),iT=Ne,sT=Mt,aT=bi,oT=_i;function lT(e){return e&&e.__esModule?e:{default:e}}var uT=function(t){var r=new Uint8Array(t);return(0,iT.parse)((0,sT.buildStream)(r),nT.default)};rr.parseGIF=uT;var fT=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},Ju=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,oT.lzw)(i.data.minCodeSize,i.data.blocks,s);i.descriptor.lct.interlaced&&(a=(0,aT.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=fT(o)),o};rr.decompressFrame=Ju;var cT=function(t,r){return t.frames.filter(function(n){return n.image}).map(function(n){return Ju(n,t.gct,r)})};rr.decompressFrames=cT;const tf=(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},hT=e=>tf({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},e),dT=e=>J.useReducer(tf,e,hT);var pT='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 vT(e){const t=new Blob([pT],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r,e);return URL.revokeObjectURL(r),n}const yT=e=>({...e,frames:e.frames.map(t=>{const r=new ImageData(e.width,e.height);return r.data.set(new Uint8ClampedArray(t)),r})}),mT=(e,t)=>{const r={};return()=>(r.instance||(r.instance=e()),J.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)},gT=e=>{const t=J.useRef(e);return J.useEffect(()=>{t.current=e},[e]),t},bT=e=>{const t=gT(e);return J.useCallback(r=>t.current&&t.current(r),[])},_T=mT(()=>new vT,e=>e.terminate()),xT=(e,t)=>{const r=bT(t),n=_T();J.useEffect(()=>{if(typeof e=="string"){const i=s=>{const a=s.data||s;if(a.src===e){const o=a.error?a:yT(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])},ET=({isPlaying:e,forwardRef:t,...r})=>{const n=at.useRef(null);return at.useImperativeHandle(t,()=>n.current,[n]),at.useEffect(()=>{if(n.current===null)return;const i=n.current;i[e?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[e]),ct.jsx(vt.AnimatedSprite,{ref:n,...r,isPlaying:e})},ef=at.memo(ET),TT=vt.withFilters(vt.Container,{blur:ee.filters.BlurFilter,adjust:Fs,matrix:ee.filters.ColorMatrixFilter}),wT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],AT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},ST=e=>{const[t,r]=at.useState([]),[,n]=at.useState(0),[i,s]=at.useState([]),[,a]=J.useState(0),[,o]=J.useState(!1),[l,f]=J.useState(!1),[,c]=J.useState(!1),[h,u]=dT({autoPlay:!1}),d=at.useRef(null),p=J.useRef(null),m=J.useRef(null),b=J.useRef(null),v=J.useRef(null),g=J.useRef(null),_=J.useRef(AT),{tl:y}=J.useContext(Ar),{frames:x,delays:O,loaded:E}=h,{uniqueId:T,src:R,startAt:A,endAt:w,initialAlpha:S,locked:I,loop:C,transformation:{width:F=0,height:D=0,x:U,y:V,rotation:j=0,scale:P,animation:N,colorCorrection:k,effect:L},pointerdown:$,pointerup:G,mousedown:M,mouseup:B,pointerover:q,mouseover:H,mouseout:X,pointerout:K,applyTransformer:et,onAnchorTransformationEnd:nt}=e,{contrast:ot=1,saturation:ut=1,exposure:Nt=1,blurRadius:Ot=0,alpha:z=1}=k||{},W={brightness:Nt,contrast:ot,saturation:ut,alpha:z},Q=vt.useApp();xT(R,u),en(Ue.PAUSE,Et=>{console.log("pause event",Et),p.current&&(p.current.stop(),_.current.isPlaying=!1)});const tt=at.useCallback(Et=>{console.log("changeEnd",Et),nt&&nt(Et)},[]);at.useEffect(()=>{if(!te(x)){const Et=qE(x,de=>{const{data:Ht,width:af,height:MT}=de,LT=new Uint8Array(Ht);return ee.Texture.fromBuffer(LT,af,MT)}),Tt=Et.map((de,Ht)=>({texture:de,time:O[Ht]}));r(Et),s(Tt);let Lt=0;O.forEach(de=>{Lt+=de*10}),n(Lt)}},[x,O]);const Y=Et=>{p.current&&(p.current.gotoAndPlay(Et||0),_.current.isPlaying=!0)},ft=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},Z=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},st=()=>{p.current&&!_.current.isPlaying&&(p.current.play(),_.current.isPlaying=!0)},At=()=>{o(!0)};J.useEffect(()=>{let Et=pe.context(()=>{});if(m.current&&y.current){const Tt={duration:Number(w)-Number(A),onStart:Y,onComplete:ft,onStartParams:[A],onCompleteParams:[],onInterrupt:Z,onUpdate:st,onUpdateParams:[]},Lt=Ds(N||"None");Et=pe.context(()=>{var de,Ht;te(Lt.from)?te(Lt.to)?te(Lt.fromTo)?y.current.to(m.current,{alpha:1,duration:.01},A).from(v.current,{...Tt},A).to(m.current,{alpha:0,duration:.1},Number(w)-.1):y.current.fromTo(m.current,(de=Lt.fromTo)==null?void 0:de.from,(Ht=Lt.fromTo)==null?void 0:Ht.to,A).from(v.current,{...Tt},A).to(m.current,{alpha:0,duration:.2},w-.2):y.current.to(m.current,{alpha:1,duration:.2,...Lt.to},A).from(v.current,{...Tt},A).to(m.current,{alpha:0,duration:.2},w-.2):y.current.from(m.current,{...Lt.from},A).to(v.current,{alpha:1,duration:.2},A).from(v.current,{...Tt},A).to(m.current,{alpha:0,duration:.2},w-.2)})}return()=>Et.revert()},[N,A,w]);const qt=at.useCallback(()=>{f(!0)},[]);Q.ticker.add(Et=>{d.current&&(d.current.rotation+=.01*Et,d.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,Math.PI*2*.6,!1))});const bt=at.useCallback(Et=>{Et.clear()},[]);return ct.jsxs(vt.Container,{ref:b,children:[ct.jsx(vt.Container,{ref:m,alpha:S,position:[U,V],pivot:[U,V],width:F,height:D,children:ct.jsxs(vt.Container,{ref:v,children:[!E&&ct.jsx(vt.Container,{anchor:.5,position:[F/2,D/2],children:ct.jsx(vt.Graphics,{x:U,y:V,ref:d,draw:bt})}),t&&t.length>0&&ct.jsx(TT,{scale:1,blur:{blur:Ot,quality:4},adjust:W,apply:({matrix:Et})=>{L==="BlackAndWhite"?Et.desaturate():L==="Sepia"?Et.sepia():L==="RetroVintage"||L==="NightVision"?Et.negative():L==="Normal"&&Et.reset()},matrix:{enabled:!0,matrix:wT},children:ct.jsx(ef,{x:U,y:V,width:F,height:D,rotation:j,animationSpeed:1,loop:C,textures:i,onComplete:At,onFrameChange:Et=>a(Et),anchor:.5,...!I&&!l&&{interactive:!0,buttonMode:!0,pointerdown:$,pointerover:q,pointerout:K,pointerup:G,mousedown:M,mouseup:B,mouseover:H,mouseout:X},forwardRef:p,scale:P})})]})}),et&&ct.jsx(Bs,{pixiTransformerRef:g,imageRef:m,isMounted:E,transformCommit:tt,transformChange:qt,mouseoverEvent:c,uniqueId:T})]})};var rf={exports:{}};/*!
551
551
  * Quill Editor v1.3.7
552
552
  * https://quilljs.com/
553
553
  * Copyright (c) 2014, Jason Chen
554
554
  * Copyright (c) 2013, salesforce.com
555
- */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:ke,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),h=i(46),c=i(47),f=i(48),u=i(49),d=i(12),p=i(32),v=i(33),g=i(31),y=i(1),b={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:s.default,Format:a.default,Leaf:o.default,Embed:f.default,Scroll:l.default,Block:c.default,Inline:h.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(y,b){y.__proto__=b}||function(y,b){for(var _ in b)b.hasOwnProperty(_)&&(y[_]=b[_])};return function(y,b){g(y,b);function _(){this.constructor=y}y.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=function(g){s(y,g);function y(b){var _=this;return b="[Parchment] "+b,_=g.call(this,b)||this,_.message=b,_.name=_.constructor.name,_}return y}(Error);n.ParchmentError=a;var o={},l={},h={},c={};n.DATA_KEY="__blot";var f;(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"})(f=n.Scope||(n.Scope={}));function u(g,y){var b=p(g);if(b==null)throw new a("Unable to create "+g+" blot");var _=b,m=g instanceof Node||g.nodeType===Node.TEXT_NODE?g:_.create(y);return new _(m,y)}n.create=u;function d(g,y){return y===void 0&&(y=!1),g==null?null:g[n.DATA_KEY]!=null?g[n.DATA_KEY].blot:y?d(g.parentNode,y):null}n.find=d;function p(g,y){y===void 0&&(y=f.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&f.LEVEL&f.BLOCK?b=c.block:g&f.LEVEL&f.INLINE&&(b=c.inline);else if(g instanceof HTMLElement){var _=(g.getAttribute("class")||"").split(/\s+/);for(var m in _)if(b=l[_[m]],b)break;b=b||h[g.tagName]}return b==null?null:y&f.LEVEL&b.scope&&y&f.TYPE&b.scope?b:null}n.query=p;function v(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];if(g.length>1)return g.map(function(m){return v(m)});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(m){return m.toUpperCase()}):b.tagName=b.tagName.toUpperCase();var _=Array.isArray(b.tagName)?b.tagName:[b.tagName];_.forEach(function(m){(h[m]==null||b.className==null)&&(h[m]=b)})}return b}n.register=v},function(r,n,i){var s=i(51),a=i(11),o=i(3),l=i(20),h=String.fromCharCode(0),c=function(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]};c.prototype.insert=function(f,u){var d={};return f.length===0?this:(d.insert=f,u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(d.attributes=u),this.push(d))},c.prototype.delete=function(f){return f<=0?this:this.push({delete:f})},c.prototype.retain=function(f,u){if(f<=0)return this;var d={retain:f};return u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(d.attributes=u),this.push(d)},c.prototype.push=function(f){var u=this.ops.length,d=this.ops[u-1];if(f=o(!0,{},f),typeof d=="object"){if(typeof f.delete=="number"&&typeof d.delete=="number")return this.ops[u-1]={delete:d.delete+f.delete},this;if(typeof d.delete=="number"&&f.insert!=null&&(u-=1,d=this.ops[u-1],typeof d!="object"))return this.ops.unshift(f),this;if(a(f.attributes,d.attributes)){if(typeof f.insert=="string"&&typeof d.insert=="string")return this.ops[u-1]={insert:d.insert+f.insert},typeof f.attributes=="object"&&(this.ops[u-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof d.retain=="number")return this.ops[u-1]={retain:d.retain+f.retain},typeof f.attributes=="object"&&(this.ops[u-1].attributes=f.attributes),this}}return u===this.ops.length?this.ops.push(f):this.ops.splice(u,0,f),this},c.prototype.chop=function(){var f=this.ops[this.ops.length-1];return f&&f.retain&&!f.attributes&&this.ops.pop(),this},c.prototype.filter=function(f){return this.ops.filter(f)},c.prototype.forEach=function(f){this.ops.forEach(f)},c.prototype.map=function(f){return this.ops.map(f)},c.prototype.partition=function(f){var u=[],d=[];return this.forEach(function(p){var v=f(p)?u:d;v.push(p)}),[u,d]},c.prototype.reduce=function(f,u){return this.ops.reduce(f,u)},c.prototype.changeLength=function(){return this.reduce(function(f,u){return u.insert?f+l.length(u):u.delete?f-u.delete:f},0)},c.prototype.length=function(){return this.reduce(function(f,u){return f+l.length(u)},0)},c.prototype.slice=function(f,u){f=f||0,typeof u!="number"&&(u=1/0);for(var d=[],p=l.iterator(this.ops),v=0;v<u&&p.hasNext();){var g;v<f?g=p.next(f-v):(g=p.next(u-v),d.push(g)),v+=l.length(g)}return new c(d)},c.prototype.compose=function(f){var u=l.iterator(this.ops),d=l.iterator(f.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 y=new c(p);u.hasNext()||d.hasNext();)if(d.peekType()==="insert")y.push(d.next());else if(u.peekType()==="delete")y.push(u.next());else{var b=Math.min(u.peekLength(),d.peekLength()),_=u.next(b),m=d.next(b);if(typeof m.retain=="number"){var x={};typeof _.retain=="number"?x.retain=b:x.insert=_.insert;var S=l.attributes.compose(_.attributes,m.attributes,typeof _.retain=="number");if(S&&(x.attributes=S),y.push(x),!d.hasNext()&&a(y.ops[y.ops.length-1],x)){var w=new c(u.rest());return y.concat(w).chop()}}else typeof m.delete=="number"&&typeof _.retain=="number"&&y.push(m)}return y.chop()},c.prototype.concat=function(f){var u=new c(this.ops.slice());return f.ops.length>0&&(u.push(f.ops[0]),u.ops=u.ops.concat(f.ops.slice(1))),u},c.prototype.diff=function(f,u){if(this.ops===f.ops)return new c;var d=[this,f].map(function(b){return b.map(function(_){if(_.insert!=null)return typeof _.insert=="string"?_.insert:h;var m=b===f?"on":"with";throw new Error("diff() called "+m+" non-document")}).join("")}),p=new c,v=s(d[0],d[1],u),g=l.iterator(this.ops),y=l.iterator(f.ops);return v.forEach(function(b){for(var _=b[1].length;_>0;){var m=0;switch(b[0]){case s.INSERT:m=Math.min(y.peekLength(),_),p.push(y.next(m));break;case s.DELETE:m=Math.min(_,g.peekLength()),g.next(m),p.delete(m);break;case s.EQUAL:m=Math.min(g.peekLength(),y.peekLength(),_);var x=g.next(m),S=y.next(m);a(x.insert,S.insert)?p.retain(m,l.attributes.diff(x.attributes,S.attributes)):p.push(S).delete(m);break}_-=m}}),p.chop()},c.prototype.eachLine=function(f,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(),y=l.length(g)-d.peekLength(),b=typeof g.insert=="string"?g.insert.indexOf(u,y)-y:-1;if(b<0)p.push(d.next());else if(b>0)p.push(d.next(b));else{if(f(p,d.next(1).attributes||{},v)===!1)return;v+=1,p=new c}}p.length()>0&&f(p,{},v)},c.prototype.transform=function(f,u){if(u=!!u,typeof f=="number")return this.transformPosition(f,u);for(var d=l.iterator(this.ops),p=l.iterator(f.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()),y=d.next(g),b=p.next(g);if(y.delete)continue;b.delete?v.push(b):v.retain(g,l.attributes.transform(y.attributes,b.attributes,u))}return v.chop()},c.prototype.transformPosition=function(f,u){u=!!u;for(var d=l.iterator(this.ops),p=0;d.hasNext()&&p<=f;){var v=d.peekLength(),g=d.peekType();if(d.next(),g==="delete"){f-=Math.min(v,f-p);continue}else g==="insert"&&(p<f||!u)&&(f+=v);p+=v}return f},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]"},h=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},f=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,y,b,_=arguments[0],m=1,x=arguments.length,S=!1;for(typeof _=="boolean"&&(S=_,_=arguments[1]||{},m=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});m<x;++m)if(d=arguments[m],d!=null)for(p in d)v=f(_,p),g=f(d,p),_!==g&&(S&&g&&(h(g)||(y=l(g)))?(y?(y=!1,b=v&&l(v)?v:[]):b=v&&h(v)?v:{},c(_,{name:p,newValue:u(S,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 T(O,R){for(var C=0;C<R.length;C++){var F=R[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(O,F.key,F)}}return function(O,R,C){return R&&T(O.prototype,R),C&&T(O,C),O}}(),a=function T(O,R,C){O===null&&(O=Function.prototype);var F=Object.getOwnPropertyDescriptor(O,R);if(F===void 0){var U=Object.getPrototypeOf(O);return U===null?void 0:T(U,R,C)}else{if("value"in F)return F.value;var D=F.get;return D===void 0?void 0:D.call(C)}},o=i(3),l=_(o),h=i(2),c=_(h),f=i(0),u=_(f),d=i(16),p=_(d),v=i(6),g=_(v),y=i(7),b=_(y);function _(T){return T&&T.__esModule?T:{default:T}}function m(T,O){if(!(T instanceof O))throw new TypeError("Cannot call a class as a function")}function x(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")?O:T}function S(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 w=1,E=function(T){S(O,T);function O(){return m(this,O),x(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return s(O,[{key:"attach",value:function(){a(O.prototype.__proto__||Object.getPrototypeOf(O.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 U=u.default.query(C,u.default.Scope.BLOCK_ATTRIBUTE);U!=null&&this.attributes.attribute(U,F)}},{key:"formatAt",value:function(C,F,U,D){this.format(U,D)}},{key:"insertAt",value:function(C,F,U){if(typeof F=="string"&&F.endsWith(`
557
- `)){var D=u.default.create(N.blotName);this.parent.insertBefore(D,C===0?this:this.next),D.insertAt(0,F.slice(0,-1))}else a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,C,F,U)}}]),O}(u.default.Embed);E.scope=u.default.Scope.BLOCK_BLOT;var N=function(T){S(O,T);function O(R){m(this,O);var C=x(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R));return C.cache={},C}return s(O,[{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(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,C,F),this.cache={}}},{key:"formatAt",value:function(C,F,U,D){F<=0||(u.default.query(U,u.default.Scope.BLOCK)?C+F===this.length()&&this.format(U,D):a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,C,Math.min(F,this.length()-C-1),U,D),this.cache={})}},{key:"insertAt",value:function(C,F,U){if(U!=null)return a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,C,F,U);if(F.length!==0){var D=F.split(`
559
- `),z=D.shift();z.length>0&&(C<this.length()-1||this.children.tail==null?a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,Math.min(C,this.length()-1),z):this.children.tail.insertAt(this.children.tail.length(),z),this.cache={});var j=this;D.reduce(function(k,I){return j=j.split(k,!0),j.insertAt(0,I),I.length},C+z.length)}}},{key:"insertBefore",value:function(C,F){var U=this.children.head;a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,C,F),U instanceof p.default&&U.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"length",this).call(this)+w),this.cache.length}},{key:"moveChildren",value:function(C,F){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"moveChildren",this).call(this,C,F),this.cache={}}},{key:"optimize",value:function(C){a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,C),this.cache={}}},{key:"path",value:function(C){return a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,C,!0)}},{key:"removeChild",value:function(C){a(O.prototype.__proto__||Object.getPrototypeOf(O.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()-w)){var U=this.clone();return C===0?(this.parent.insertBefore(U,this),this):(this.parent.insertBefore(U,this.next),U)}else{var D=a(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"split",this).call(this,C,F);return this.cache={},D}}}]),O}(u.default.Block);N.blotName="block",N.tagName="P",N.defaultChild="break",N.allowedChildren=[g.default,u.default.Embed,b.default];function A(T){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T==null||(typeof T.formats=="function"&&(O=(0,l.default)(O,T.formats())),T.parent==null||T.parent.blotName=="scroll"||T.parent.statics.scope!==T.statics.scope)?O:A(T.parent,O)}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,I){var P=[],L=!0,G=!1,$=void 0;try{for(var M=k[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(P.push(B.value),!(I&&P.length===I));L=!0);}catch(q){G=!0,$=q}finally{try{!L&&M.return&&M.return()}finally{if(G)throw $}}return P}return function(k,I){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return j(k,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(k,I){for(var P=0;P<I.length;P++){var L=I[P];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}return function(k,I,P){return I&&j(k.prototype,I),P&&j(k,P),k}}();i(50);var l=i(2),h=A(l),c=i(14),f=A(c),u=i(8),d=A(u),p=i(9),v=A(p),g=i(0),y=A(g),b=i(15),_=A(b),m=i(3),x=A(m),S=i(10),w=A(S),E=i(34),N=A(E);function A(j){return j&&j.__esModule?j:{default:j}}function T(j,k,I){return k in j?Object.defineProperty(j,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):j[k]=I,j}function O(j,k){if(!(j instanceof k))throw new TypeError("Cannot call a class as a function")}var R=(0,w.default)("quill"),C=function(){o(j,null,[{key:"debug",value:function(I){I===!0&&(I="log"),w.default.level(I)}},{key:"find",value:function(I){return I.__quill||y.default.find(I)}},{key:"import",value:function(I){return this.imports[I]==null&&R.error("Cannot import "+I+". Are you sure it was registered?"),this.imports[I]}},{key:"register",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof I!="string"){var $=I.attrName||I.blotName;typeof $=="string"?this.register("formats/"+$,I,P):Object.keys(I).forEach(function(M){L.register(M,I[M],P)})}else this.imports[I]!=null&&!G&&R.warn("Overwriting "+I+" with",P),this.imports[I]=P,(I.startsWith("blots/")||I.startsWith("formats/"))&&P.blotName!=="abstract"?y.default.register(P):I.startsWith("modules")&&typeof P.register=="function"&&P.register()}}]);function j(k){var I=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(O(this,j),this.options=F(k,P),this.container=this.options.container,this.container==null)return R.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=y.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new f.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($){$===d.default.events.TEXT_CHANGE&&I.root.classList.toggle("ql-blank",I.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function($,M){var B=I.selection.lastRange,q=B&&B.length===0?B.index:void 0;U.call(I,function(){return I.editor.update(null,M,q)},$)});var G=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+L+"<p><br></p></div>");this.setContents(G),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(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof I=="string"){var L=I;I=document.createElement("div"),I.classList.add(L)}return this.container.insertBefore(I,P),I}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(I,P,L){var G=this,$=D(I,P,L),M=a($,4);return I=M[0],P=M[1],L=M[3],U.call(this,function(){return G.editor.deleteText(I,P)},L,I,-1*P)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(I),this.container.classList.toggle("ql-disabled",!I)}},{key:"focus",value:function(){var I=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=I,this.scrollIntoView()}},{key:"format",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;return U.call(this,function(){var $=L.getSelection(!0),M=new h.default;if($==null)return M;if(y.default.query(I,y.default.Scope.BLOCK))M=L.editor.formatLine($.index,$.length,T({},I,P));else{if($.length===0)return L.selection.format(I,P),M;M=L.editor.formatText($.index,$.length,T({},I,P))}return L.setSelection($,d.default.sources.SILENT),M},G)}},{key:"formatLine",value:function(I,P,L,G,$){var M=this,B=void 0,q=D(I,P,L,G,$),H=a(q,4);return I=H[0],P=H[1],B=H[2],$=H[3],U.call(this,function(){return M.editor.formatLine(I,P,B)},$,I,0)}},{key:"formatText",value:function(I,P,L,G,$){var M=this,B=void 0,q=D(I,P,L,G,$),H=a(q,4);return I=H[0],P=H[1],B=H[2],$=H[3],U.call(this,function(){return M.editor.formatText(I,P,B)},$,I,0)}},{key:"getBounds",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=void 0;typeof I=="number"?L=this.selection.getBounds(I,P):L=this.selection.getBounds(I.index,I.length);var G=this.container.getBoundingClientRect();return{bottom:L.bottom-G.top,height:L.height,left:L.left-G.left,right:L.right-G.left,top:L.top-G.top,width:L.width}}},{key:"getContents",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,L=D(I,P),G=a(L,2);return I=G[0],P=G[1],this.editor.getContents(I,P)}},{key:"getFormat",value:function(){var I=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 I=="number"?this.editor.getFormat(I,P):this.editor.getFormat(I.index,I.length)}},{key:"getIndex",value:function(I){return I.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(I){return this.scroll.leaf(I)}},{key:"getLine",value:function(I){return this.scroll.line(I)}},{key:"getLines",value:function(){var I=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 I!="number"?this.scroll.lines(I.index,I.length):this.scroll.lines(I,P)}},{key:"getModule",value:function(I){return this.theme.modules[I]}},{key:"getSelection",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return I&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,L=D(I,P),G=a(L,2);return I=G[0],P=G[1],this.editor.getText(I,P)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(I,P,L){var G=this,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return U.call(this,function(){return G.editor.insertEmbed(I,P,L)},$,I)}},{key:"insertText",value:function(I,P,L,G,$){var M=this,B=void 0,q=D(I,0,L,G,$),H=a(q,4);return I=H[0],B=H[2],$=H[3],U.call(this,function(){return M.editor.insertText(I,P,B)},$,I,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(I,P,L){this.clipboard.dangerouslyPasteHTML(I,P,L)}},{key:"removeFormat",value:function(I,P,L){var G=this,$=D(I,P,L),M=a($,4);return I=M[0],P=M[1],L=M[3],U.call(this,function(){return G.editor.removeFormat(I,P)},L,I)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(I){var P=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return U.call(this,function(){I=new h.default(I);var G=P.getLength(),$=P.editor.deleteText(0,G),M=P.editor.applyDelta(I),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=$.compose(M);return q},L)}},{key:"setSelection",value:function(I,P,L){if(I==null)this.selection.setRange(null,P||j.sources.API);else{var G=D(I,P,L),$=a(G,4);I=$[0],P=$[1],L=$[3],this.selection.setRange(new b.Range(I,P),L),L!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,L=new h.default().insert(I);return this.setContents(L,P)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,P=this.scroll.update(I);return this.selection.update(I),P}},{key:"updateContents",value:function(I){var P=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return U.call(this,function(){return I=new h.default(I),P.editor.applyDelta(I,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:h.default,parchment:y.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 I=(0,x.default)(!0,{},k.theme.DEFAULTS);[I,k].forEach(function(G){G.modules=G.modules||{},Object.keys(G.modules).forEach(function($){G.modules[$]===!0&&(G.modules[$]={})})});var P=Object.keys(I.modules).concat(Object.keys(k.modules)),L=P.reduce(function(G,$){var M=C.import("modules/"+$);return M==null?R.error("Cannot load "+$+" module. Are you sure you registered it?"):G[$]=M.DEFAULTS||{},G},{});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},I,k),["bounds","container","scrollingContainer"].forEach(function(G){typeof k[G]=="string"&&(k[G]=document.querySelector(k[G]))}),k.modules=Object.keys(k.modules).reduce(function(G,$){return k.modules[$]&&(G[$]=k.modules[$]),G},{}),k}function U(j,k,I,P){if(this.options.strict&&!this.isEnabled()&&k===d.default.sources.USER)return new h.default;var L=I==null?null:this.getSelection(),G=this.editor.delta,$=j();if(L!=null&&(I===!0&&(I=L.index),P==null?L=z(L,$,k):P!==0&&(L=z(L,I,P,k)),this.setSelection(L,d.default.sources.SILENT)),$.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 $}function D(j,k,I,P,L){var G={};return typeof j.index=="number"&&typeof j.length=="number"?typeof k!="number"?(L=P,P=I,I=k,k=j.length,j=j.index):(k=j.length,j=j.index):typeof k!="number"&&(L=P,P=I,I=k,k=0),(typeof I>"u"?"undefined":s(I))==="object"?(G=I,L=P):typeof I=="string"&&(P!=null?G[I]=P:L=I),L=L||d.default.sources.API,[j,k,G,L]}function z(j,k,I,P){if(j==null)return null;var L=void 0,G=void 0;if(k instanceof h.default){var $=[j.index,j.index+j.length].map(function(H){return k.transformPosition(H,P!==d.default.sources.USER)}),M=a($,2);L=M[0],G=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:I>=0?H+I:Math.max(k,H+I)}),q=a(B,2);L=q[0],G=q[1]}return new b.Range(L,G-L)}n.expandConfig=F,n.overload=D,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(7),l=f(o),h=i(0),c=f(h);function f(g){return g&&g.__esModule?g:{default:g}}function u(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function d(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function p(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var v=function(g){p(y,g);function y(){return u(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"formatAt",value:function(_,m,x,S){if(y.compare(this.statics.blotName,x)<0&&c.default.query(x,c.default.Scope.BLOT)){var w=this.isolate(_,m);S&&w.wrap(x,S)}else a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,_,m,x,S)}},{key:"optimize",value:function(_){if(a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,_),this.parent instanceof y&&y.compare(this.statics.blotName,this.parent.statics.blotName)>0){var m=this.parent.isolate(this.offset(),this.length());this.moveChildren(m),m.wrap(this)}}}],[{key:"compare",value:function(_,m){var x=y.order.indexOf(_),S=y.order.indexOf(m);return x>=0||S>=0?x-S:_===m?0:_<m?-1:1}}]),y}(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 h(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 f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default.Text);n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(_,m){for(var x=0;x<m.length;x++){var S=m[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,m,x){return m&&b(_.prototype,m),x&&b(_,x),_}}(),a=function b(_,m,x){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,m);if(S===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,m,x)}else{if("value"in S)return S.value;var E=S.get;return E===void 0?void 0:E.call(x)}},o=i(54),l=f(o),h=i(10),c=f(h);function f(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,m=Array(_),x=0;x<_;x++)m[x]=arguments[x];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(S){if(S.__quill&&S.__quill.emitter){var w;(w=S.__quill.emitter).handleDOM.apply(w,m)}})})});var y=function(b){p(_,b);function _(){u(this,_);var m=d(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return m.listeners={},m.on("error",v.error),m}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 S=arguments.length,w=Array(S>1?S-1:0),E=1;E<S;E++)w[E-1]=arguments[E];(this.listeners[x.type]||[]).forEach(function(N){var A=N.node,T=N.handler;(x.target===A||A.contains(x.target))&&T.apply(void 0,[x].concat(w))})}},{key:"listenDOM",value:function(x,S,w){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push({node:S,handler:w})}}]),_}(l.default);y.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"},y.sources={API:"api",SILENT:"silent",USER:"user"},n.default=y},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 h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,o),this.quill=l,this.options=h};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(h){if(s.indexOf(h)<=s.indexOf(a)){for(var c,f=arguments.length,u=Array(f>1?f-1:0),d=1;d<f;d++)u[d-1]=arguments[d];(c=console)[h].apply(c,u)}}function l(h){return s.reduce(function(c,f){return c[f]=o.bind(console,f,h),c},{})}o.level=l.level=function(h){a=h},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:f(u,d,p)};function h(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 f(u,d,p){var v,g;if(h(u)||h(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 y=a(u),b=a(d)}catch{return!1}if(y.length!=b.length)return!1;for(y.sort(),b.sort(),v=y.length-1;v>=0;v--)if(y[v]!=b[v])return!1;for(v=y.length-1;v>=0;v--)if(g=y[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,h,c){c===void 0&&(c={}),this.attrName=l,this.keyName=h;var f=s.Scope.TYPE&s.Scope.ATTRIBUTE;c.scope!=null?this.scope=c.scope&s.Scope.LEVEL|f:this.scope=s.Scope.ATTRIBUTE,c.whitelist!=null&&(this.whitelist=c.whitelist)}return o.keys=function(l){return[].map.call(l.attributes,function(h){return h.name})},o.prototype.add=function(l,h){return this.canAdd(l,h)?(l.setAttribute(this.keyName,h),!0):!1},o.prototype.canAdd=function(l,h){var c=s.query(l,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return c==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},o.prototype.remove=function(l){l.removeAttribute(this.keyName)},o.prototype.value=function(l){var h=l.getAttribute(this.keyName);return this.canAdd(l,h)&&h?h:""},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 T=[],O=!0,R=!1,C=void 0;try{for(var F=N[Symbol.iterator](),U;!(O=(U=F.next()).done)&&(T.push(U.value),!(A&&T.length===A));O=!0);}catch(D){R=!0,C=D}finally{try{!O&&F.return&&F.return()}finally{if(R)throw C}}return T}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 T=0;T<A.length;T++){var O=A[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,O.key,O)}}return function(N,A,T){return A&&E(N.prototype,A),T&&E(N,T),N}}(),o=function E(N,A,T){N===null&&(N=Function.prototype);var O=Object.getOwnPropertyDescriptor(N,A);if(O===void 0){var R=Object.getPrototypeOf(N);return R===null?void 0:E(R,A,T)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(T)}},l=i(2),h=b(l),c=i(0),f=b(c),u=i(4),d=b(u),p=i(6),v=b(p),g=i(7),y=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 m(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 S=function(E){x(N,E);function N(){return _(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return N}(v.default);S.blotName="code",S.tagName="CODE";var w=function(E){x(N,E);function N(){return _(this,N),m(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return a(N,[{key:"delta",value:function(){var T=this,O=this.domNode.textContent;return O.endsWith(`
561
- `)&&(O=O.slice(0,-1)),O.split(`
562
- `).reduce(function(R,C){return R.insert(C).insert(`
563
- `,T.formats())},new h.default)}},{key:"format",value:function(T,O){if(!(T===this.statics.blotName&&O)){var R=this.descendant(y.default,this.length()-1),C=s(R,1),F=C[0];F!=null&&F.deleteAt(F.length()-1,1),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"format",this).call(this,T,O)}}},{key:"formatAt",value:function(T,O,R,C){if(O!==0&&!(f.default.query(R,f.default.Scope.BLOCK)==null||R===this.statics.blotName&&C===this.statics.formats(this.domNode))){var F=this.newlineIndex(T);if(!(F<0||F>=T+O)){var U=this.newlineIndex(T,!0)+1,D=F-U+1,z=this.isolate(U,D),j=z.next;z.format(R,C),j instanceof N&&j.formatAt(0,T-U+O-D,R,C)}}}},{key:"insertAt",value:function(T,O,R){if(R==null){var C=this.descendant(y.default,T),F=s(C,2),U=F[0],D=F[1];U.insertAt(D,O)}}},{key:"length",value:function(){var T=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
564
- `)?T:T+1}},{key:"newlineIndex",value:function(T){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(O)return this.domNode.textContent.slice(0,T).lastIndexOf(`
565
- `);var R=this.domNode.textContent.slice(T).indexOf(`
566
- `);return R>-1?T+R:-1}},{key:"optimize",value:function(T){this.domNode.textContent.endsWith(`
567
- `)||this.appendChild(f.default.create("text",`
568
- `)),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,T);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===O.statics.formats(O.domNode)&&(O.optimize(T),O.moveChildren(this),O.remove())}},{key:"replace",value:function(T){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"replace",this).call(this,T),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(O){var R=f.default.find(O);R==null?O.parentNode.removeChild(O):R instanceof f.default.Embed?R.remove():R.unwrap()})}}],[{key:"create",value:function(T){var O=o(N.__proto__||Object.getPrototypeOf(N),"create",this).call(this,T);return O.setAttribute("spellcheck",!1),O}},{key:"formats",value:function(){return!0}}]),N}(d.default);w.blotName="code-block",w.tagName="PRE",w.TAB=" ",n.Code=S,n.default=w},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,I){var P=[],L=!0,G=!1,$=void 0;try{for(var M=k[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(P.push(B.value),!(I&&P.length===I));L=!0);}catch(q){G=!0,$=q}finally{try{!L&&M.return&&M.return()}finally{if(G)throw $}}return P}return function(k,I){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return j(k,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(k,I){for(var P=0;P<I.length;P++){var L=I[P];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(k,L.key,L)}}return function(k,I,P){return I&&j(k.prototype,I),P&&j(k,P),k}}(),l=i(2),h=O(l),c=i(20),f=O(c),u=i(0),d=O(u),p=i(13),v=O(p),g=i(24),y=O(g),b=i(4),_=O(b),m=i(16),x=O(m),S=i(21),w=O(S),E=i(11),N=O(E),A=i(3),T=O(A);function O(j){return j&&j.__esModule?j:{default:j}}function R(j,k,I){return k in j?Object.defineProperty(j,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):j[k]=I,j}function C(j,k){if(!(j instanceof k))throw new TypeError("Cannot call a class as a function")}var F=/^[ -~]*$/,U=function(){function j(k){C(this,j),this.scroll=k,this.delta=this.getDelta()}return o(j,[{key:"applyDelta",value:function(I){var P=this,L=!1;this.scroll.update();var G=this.scroll.length();return this.scroll.batchStart(),I=z(I),I.reduce(function($,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($,H);var X=P.scroll.line($),K=a(X,2),et=K[0],it=K[1],lt=(0,T.default)({},(0,b.bubbleFormats)(et));if(et instanceof _.default){var ht=et.descendant(d.default.Leaf,it),Ct=a(ht,1),It=Ct[0];lt=(0,T.default)(lt,(0,b.bubbleFormats)(It))}q=f.default.attributes.diff(lt,q)||{}}else if(s(M.insert)==="object"){var V=Object.keys(M.insert)[0];if(V==null)return $;P.scroll.insertAt($,V,M.insert[V])}G+=B}return Object.keys(q).forEach(function(W){P.scroll.formatAt($,B,W,q[W])}),$+B},0),I.reduce(function($,M){return typeof M.delete=="number"?(P.scroll.deleteAt($,M.delete),$):$+(M.retain||M.insert.length||1)},0),this.scroll.batchEnd(),this.update(I)}},{key:"deleteText",value:function(I,P){return this.scroll.deleteAt(I,P),this.update(new h.default().retain(I).delete(P))}},{key:"formatLine",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(G).forEach(function($){if(!(L.scroll.whitelist!=null&&!L.scroll.whitelist[$])){var M=L.scroll.lines(I,Math.max(P,1)),B=P;M.forEach(function(q){var H=q.length();if(!(q instanceof v.default))q.format($,G[$]);else{var X=I-q.offset(L.scroll),K=q.newlineIndex(X+B)-X+1;q.formatAt(X,K,$,G[$])}B-=H})}}),this.scroll.optimize(),this.update(new h.default().retain(I).retain(P,(0,w.default)(G)))}},{key:"formatText",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(G).forEach(function($){L.scroll.formatAt(I,P,$,G[$])}),this.update(new h.default().retain(I).retain(P,(0,w.default)(G)))}},{key:"getContents",value:function(I,P){return this.delta.slice(I,I+P)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(I,P){return I.concat(P.delta())},new h.default)}},{key:"getFormat",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=[],G=[];P===0?this.scroll.path(I).forEach(function(M){var B=a(M,1),q=B[0];q instanceof _.default?L.push(q):q instanceof d.default.Leaf&&G.push(q)}):(L=this.scroll.lines(I,P),G=this.scroll.descendants(d.default.Leaf,I,P));var $=[L,G].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=D((0,b.bubbleFormats)(q),B)}return B});return T.default.apply(T.default,$)}},{key:"getText",value:function(I,P){return this.getContents(I,P).filter(function(L){return typeof L.insert=="string"}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(I,P,L){return this.scroll.insertAt(I,P,L),this.update(new h.default().retain(I).insert(R({},P,L)))}},{key:"insertText",value:function(I,P){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return P=P.replace(/\r\n/g,`
555
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Re,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),m=i(33),b=i(31),v=i(1),g={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.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:m.default,Store:b.default}};n.default=g},function(r,n,i){var s=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var _ in g)g.hasOwnProperty(_)&&(v[_]=g[_])};return function(v,g){b(v,g);function _(){this.constructor=v}v.prototype=g===null?Object.create(g):(_.prototype=g.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=function(b){s(v,b);function v(g){var _=this;return g="[Parchment] "+g,_=b.call(this,g)||this,_.message=g,_.name=_.constructor.name,_}return v}(Error);n.ParchmentError=a;var o={},l={},f={},c={};n.DATA_KEY="__blot";var h;(function(b){b[b.TYPE=3]="TYPE",b[b.LEVEL=12]="LEVEL",b[b.ATTRIBUTE=13]="ATTRIBUTE",b[b.BLOT=14]="BLOT",b[b.INLINE=7]="INLINE",b[b.BLOCK=11]="BLOCK",b[b.BLOCK_BLOT=10]="BLOCK_BLOT",b[b.INLINE_BLOT=6]="INLINE_BLOT",b[b.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",b[b.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",b[b.ANY=15]="ANY"})(h=n.Scope||(n.Scope={}));function u(b,v){var g=p(b);if(g==null)throw new a("Unable to create "+b+" blot");var _=g,y=b instanceof Node||b.nodeType===Node.TEXT_NODE?b:_.create(v);return new _(y,v)}n.create=u;function d(b,v){return v===void 0&&(v=!1),b==null?null:b[n.DATA_KEY]!=null?b[n.DATA_KEY].blot:v?d(b.parentNode,v):null}n.find=d;function p(b,v){v===void 0&&(v=h.ANY);var g;if(typeof b=="string")g=c[b]||o[b];else if(b instanceof Text||b.nodeType===Node.TEXT_NODE)g=c.text;else if(typeof b=="number")b&h.LEVEL&h.BLOCK?g=c.block:b&h.LEVEL&h.INLINE&&(g=c.inline);else if(b instanceof HTMLElement){var _=(b.getAttribute("class")||"").split(/\s+/);for(var y in _)if(g=l[_[y]],g)break;g=g||f[b.tagName]}return g==null?null:v&h.LEVEL&g.scope&&v&h.TYPE&g.scope?g:null}n.query=p;function m(){for(var b=[],v=0;v<arguments.length;v++)b[v]=arguments[v];if(b.length>1)return b.map(function(y){return m(y)});var g=b[0];if(typeof g.blotName!="string"&&typeof g.attrName!="string")throw new a("Invalid definition");if(g.blotName==="abstract")throw new a("Cannot register abstract class");if(c[g.blotName||g.attrName]=g,typeof g.keyName=="string")o[g.keyName]=g;else if(g.className!=null&&(l[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(y){return y.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var _=Array.isArray(g.tagName)?g.tagName:[g.tagName];_.forEach(function(y){(f[y]==null||g.className==null)&&(f[y]=g)})}return g}n.register=m},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 m=h(p)?u:d;m.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),m=0;m<u&&p.hasNext();){var b;m<h?b=p.next(h-m):(b=p.next(u-m),d.push(b)),m+=l.length(b)}return new c(d)},c.prototype.compose=function(h){var u=l.iterator(this.ops),d=l.iterator(h.ops),p=[],m=d.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var b=m.retain;u.peekType()==="insert"&&u.peekLength()<=b;)b-=u.peekLength(),p.push(u.next());m.retain-b>0&&d.next(m.retain-b)}for(var v=new c(p);u.hasNext()||d.hasNext();)if(d.peekType()==="insert")v.push(d.next());else if(u.peekType()==="delete")v.push(u.next());else{var g=Math.min(u.peekLength(),d.peekLength()),_=u.next(g),y=d.next(g);if(typeof y.retain=="number"){var x={};typeof _.retain=="number"?x.retain=g:x.insert=_.insert;var O=l.attributes.compose(_.attributes,y.attributes,typeof _.retain=="number");if(O&&(x.attributes=O),v.push(x),!d.hasNext()&&a(v.ops[v.ops.length-1],x)){var E=new c(u.rest());return v.concat(E).chop()}}else typeof y.delete=="number"&&typeof _.retain=="number"&&v.push(y)}return v.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(g){return g.map(function(_){if(_.insert!=null)return typeof _.insert=="string"?_.insert:f;var y=g===h?"on":"with";throw new Error("diff() called "+y+" non-document")}).join("")}),p=new c,m=s(d[0],d[1],u),b=l.iterator(this.ops),v=l.iterator(h.ops);return m.forEach(function(g){for(var _=g[1].length;_>0;){var y=0;switch(g[0]){case s.INSERT:y=Math.min(v.peekLength(),_),p.push(v.next(y));break;case s.DELETE:y=Math.min(_,b.peekLength()),b.next(y),p.delete(y);break;case s.EQUAL:y=Math.min(b.peekLength(),v.peekLength(),_);var x=b.next(y),O=v.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,m=0;d.hasNext();){if(d.peekType()!=="insert")return;var b=d.peek(),v=l.length(b)-d.peekLength(),g=typeof b.insert=="string"?b.insert.indexOf(u,v)-v:-1;if(g<0)p.push(d.next());else if(g>0)p.push(d.next(g));else{if(h(p,d.next(1).attributes||{},m)===!1)return;m+=1,p=new c}}p.length()>0&&h(p,{},m)},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),m=new c;d.hasNext()||p.hasNext();)if(d.peekType()==="insert"&&(u||p.peekType()!=="insert"))m.retain(l.length(d.next()));else if(p.peekType()==="insert")m.push(p.next());else{var b=Math.min(d.peekLength(),p.peekLength()),v=d.next(b),g=p.next(b);if(v.delete)continue;g.delete?m.push(g):m.retain(b,l.attributes.transform(v.attributes,g.attributes,u))}return m.chop()},c.prototype.transformPosition=function(h,u){u=!!u;for(var d=l.iterator(this.ops),p=0;d.hasNext()&&p<=h;){var m=d.peekLength(),b=d.peekType();if(d.next(),b==="delete"){h-=Math.min(m,h-p);continue}else b==="insert"&&(p<h||!u)&&(h+=m);p+=m}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"),m=d.constructor&&d.constructor.prototype&&i.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var b;for(b in d);return typeof b>"u"||i.call(d,b)},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,m,b,v,g,_=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)m=h(_,p),b=h(d,p),_!==b&&(O&&b&&(f(b)||(v=l(b)))?(v?(v=!1,g=m&&l(m)?m:[]):g=m&&f(m)?m:{},c(_,{name:p,newValue:u(O,g,b)})):typeof b<"u"&&c(_,{name:p,newValue:b}));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),m=i(6),b=_(m),v=i(7),g=_(v);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 E=1,T=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(R.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);T.scope=u.default.Scope.BLOCK_BLOT;var R=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
+ `),V=U.shift();V.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),V):this.children.tail.insertAt(this.children.tail.length(),V),this.cache={});var j=this;U.reduce(function(P,N){return j=j.split(P,!0),j.insertAt(0,N),N.length},C+V.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)+E),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()-E)){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);R.blotName="block",R.tagName="P",R.defaultChild="break",R.allowedChildren=[b.default,u.default.Embed,g.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=T,n.default=R},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(P,N){var k=[],L=!0,$=!1,G=void 0;try{for(var M=P[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(k.push(B.value),!(N&&k.length===N));L=!0);}catch(q){$=!0,G=q}finally{try{!L&&M.return&&M.return()}finally{if($)throw G}}return k}return function(P,N){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return j(P,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(P,N){for(var k=0;k<N.length;k++){var L=N[k];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,L.key,L)}}return function(P,N,k){return N&&j(P.prototype,N),k&&j(P,k),P}}();i(50);var l=i(2),f=A(l),c=i(14),h=A(c),u=i(8),d=A(u),p=i(9),m=A(p),b=i(0),v=A(b),g=i(15),_=A(g),y=i(3),x=A(y),O=i(10),E=A(O),T=i(34),R=A(T);function A(j){return j&&j.__esModule?j:{default:j}}function w(j,P,N){return P in j?Object.defineProperty(j,P,{value:N,enumerable:!0,configurable:!0,writable:!0}):j[P]=N,j}function S(j,P){if(!(j instanceof P))throw new TypeError("Cannot call a class as a function")}var I=(0,E.default)("quill"),C=function(){o(j,null,[{key:"debug",value:function(N){N===!0&&(N="log"),E.default.level(N)}},{key:"find",value:function(N){return N.__quill||v.default.find(N)}},{key:"import",value:function(N){return this.imports[N]==null&&I.error("Cannot import "+N+". Are you sure it was registered?"),this.imports[N]}},{key:"register",value:function(N,k){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof N!="string"){var G=N.attrName||N.blotName;typeof G=="string"?this.register("formats/"+G,N,k):Object.keys(N).forEach(function(M){L.register(M,N[M],k)})}else this.imports[N]!=null&&!$&&I.warn("Overwriting "+N+" with",k),this.imports[N]=k,(N.startsWith("blots/")||N.startsWith("formats/"))&&k.blotName!=="abstract"?v.default.register(k):N.startsWith("modules")&&typeof k.register=="function"&&k.register()}}]);function j(P){var N=this,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(S(this,j),this.options=F(P,k),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",P);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=v.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&&N.root.classList.toggle("ql-blank",N.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function(G,M){var B=N.selection.lastRange,q=B&&B.length===0?B.index:void 0;D.call(N,function(){return N.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(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof N=="string"){var L=N;N=document.createElement("div"),N.classList.add(L)}return this.container.insertBefore(N,k),N}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(N,k,L){var $=this,G=U(N,k,L),M=a(G,4);return N=M[0],k=M[1],L=M[3],D.call(this,function(){return $.editor.deleteText(N,k)},L,N,-1*k)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(N),this.container.classList.toggle("ql-disabled",!N)}},{key:"focus",value:function(){var N=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=N,this.scrollIntoView()}},{key:"format",value:function(N,k){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(v.default.query(N,v.default.Scope.BLOCK))M=L.editor.formatLine(G.index,G.length,w({},N,k));else{if(G.length===0)return L.selection.format(N,k),M;M=L.editor.formatText(G.index,G.length,w({},N,k))}return L.setSelection(G,d.default.sources.SILENT),M},$)}},{key:"formatLine",value:function(N,k,L,$,G){var M=this,B=void 0,q=U(N,k,L,$,G),H=a(q,4);return N=H[0],k=H[1],B=H[2],G=H[3],D.call(this,function(){return M.editor.formatLine(N,k,B)},G,N,0)}},{key:"formatText",value:function(N,k,L,$,G){var M=this,B=void 0,q=U(N,k,L,$,G),H=a(q,4);return N=H[0],k=H[1],B=H[2],G=H[3],D.call(this,function(){return M.editor.formatText(N,k,B)},G,N,0)}},{key:"getBounds",value:function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=void 0;typeof N=="number"?L=this.selection.getBounds(N,k):L=this.selection.getBounds(N.index,N.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 N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-N,L=U(N,k),$=a(L,2);return N=$[0],k=$[1],this.editor.getContents(N,k)}},{key:"getFormat",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof N=="number"?this.editor.getFormat(N,k):this.editor.getFormat(N.index,N.length)}},{key:"getIndex",value:function(N){return N.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(N){return this.scroll.leaf(N)}},{key:"getLine",value:function(N){return this.scroll.line(N)}},{key:"getLines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof N!="number"?this.scroll.lines(N.index,N.length):this.scroll.lines(N,k)}},{key:"getModule",value:function(N){return this.theme.modules[N]}},{key:"getSelection",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return N&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-N,L=U(N,k),$=a(L,2);return N=$[0],k=$[1],this.editor.getText(N,k)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(N,k,L){var $=this,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return D.call(this,function(){return $.editor.insertEmbed(N,k,L)},G,N)}},{key:"insertText",value:function(N,k,L,$,G){var M=this,B=void 0,q=U(N,0,L,$,G),H=a(q,4);return N=H[0],B=H[2],G=H[3],D.call(this,function(){return M.editor.insertText(N,k,B)},G,N,k.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(N,k,L){this.clipboard.dangerouslyPasteHTML(N,k,L)}},{key:"removeFormat",value:function(N,k,L){var $=this,G=U(N,k,L),M=a(G,4);return N=M[0],k=M[1],L=M[3],D.call(this,function(){return $.editor.removeFormat(N,k)},L,N)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(N){var k=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return D.call(this,function(){N=new f.default(N);var $=k.getLength(),G=k.editor.deleteText(0,$),M=k.editor.applyDelta(N),B=M.ops[M.ops.length-1];B!=null&&typeof B.insert=="string"&&B.insert[B.insert.length-1]===`
560
+ `&&(k.editor.deleteText(k.getLength()-1,1),M.delete(1));var q=G.compose(M);return q},L)}},{key:"setSelection",value:function(N,k,L){if(N==null)this.selection.setRange(null,k||j.sources.API);else{var $=U(N,k,L),G=a($,4);N=G[0],k=G[1],L=G[3],this.selection.setRange(new g.Range(N,k),L),L!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,L=new f.default().insert(N);return this.setContents(L,k)}},{key:"update",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,k=this.scroll.update(N);return this.selection.update(N),k}},{key:"updateContents",value:function(N){var k=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return D.call(this,function(){return N=new f.default(N),k.editor.applyDelta(N,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:v.default,"core/module":m.default,"core/theme":R.default};function F(j,P){if(P=(0,x.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},P),!P.theme||P.theme===C.DEFAULTS.theme)P.theme=R.default;else if(P.theme=C.import("themes/"+P.theme),P.theme==null)throw new Error("Invalid theme "+P.theme+". Did you register it?");var N=(0,x.default)(!0,{},P.theme.DEFAULTS);[N,P].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(G){$.modules[G]===!0&&($.modules[G]={})})});var k=Object.keys(N.modules).concat(Object.keys(P.modules)),L=k.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 P.modules!=null&&P.modules.toolbar&&P.modules.toolbar.constructor!==Object&&(P.modules.toolbar={container:P.modules.toolbar}),P=(0,x.default)(!0,{},C.DEFAULTS,{modules:L},N,P),["bounds","container","scrollingContainer"].forEach(function($){typeof P[$]=="string"&&(P[$]=document.querySelector(P[$]))}),P.modules=Object.keys(P.modules).reduce(function($,G){return P.modules[G]&&($[G]=P.modules[G]),$},{}),P}function D(j,P,N,k){if(this.options.strict&&!this.isEnabled()&&P===d.default.sources.USER)return new f.default;var L=N==null?null:this.getSelection(),$=this.editor.delta,G=j();if(L!=null&&(N===!0&&(N=L.index),k==null?L=V(L,G,P):k!==0&&(L=V(L,N,k,P)),this.setSelection(L,d.default.sources.SILENT)),G.length()>0){var M,B=[d.default.events.TEXT_CHANGE,G,$,P];if((M=this.emitter).emit.apply(M,[d.default.events.EDITOR_CHANGE].concat(B)),P!==d.default.sources.SILENT){var q;(q=this.emitter).emit.apply(q,B)}}return G}function U(j,P,N,k,L){var $={};return typeof j.index=="number"&&typeof j.length=="number"?typeof P!="number"?(L=k,k=N,N=P,P=j.length,j=j.index):(P=j.length,j=j.index):typeof P!="number"&&(L=k,k=N,N=P,P=0),(typeof N>"u"?"undefined":s(N))==="object"?($=N,L=k):typeof N=="string"&&(k!=null?$[N]=k:L=N),L=L||d.default.sources.API,[j,P,$,L]}function V(j,P,N,k){if(j==null)return null;var L=void 0,$=void 0;if(P instanceof f.default){var G=[j.index,j.index+j.length].map(function(H){return P.transformPosition(H,k!==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<P||H===P&&k===d.default.sources.USER?H:N>=0?H+N:Math.max(P,H+N)}),q=a(B,2);L=q[0],$=q[1]}return new g.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 b(v,g){for(var _=0;_<g.length;_++){var y=g[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,g,_){return g&&b(v.prototype,g),_&&b(v,_),v}}(),a=function b(v,g,_){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,g);if(y===void 0){var x=Object.getPrototypeOf(v);return x===null?void 0:b(x,g,_)}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(b){return b&&b.__esModule?b:{default:b}}function u(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function d(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function p(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var m=function(b){p(v,b);function v(){return u(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"formatAt",value:function(_,y,x,O){if(v.compare(this.statics.blotName,x)<0&&c.default.query(x,c.default.Scope.BLOT)){var E=this.isolate(_,y);O&&E.wrap(x,O)}else a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,_,y,x,O)}},{key:"optimize",value:function(_){if(a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,_),this.parent instanceof v&&v.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=v.order.indexOf(_),O=v.order.indexOf(y);return x>=0||O>=0?x-O:_===y?0:_<y?-1:1}}]),v}(c.default.Inline);m.allowedChildren=[m,c.default.Embed,l.default],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=m},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 g(_,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&&g(_.prototype,y),x&&g(_,x),_}}(),a=function g(_,y,x){_===null&&(_=Function.prototype);var O=Object.getOwnPropertyDescriptor(_,y);if(O===void 0){var E=Object.getPrototypeOf(_);return E===null?void 0:g(E,y,x)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(x)}},o=i(54),l=h(o),f=i(10),c=h(f);function h(g){return g&&g.__esModule?g:{default:g}}function u(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function d(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:g}function p(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 m=(0,c.default)("quill:events"),b=["selectionchange","mousedown","mouseup","click"];b.forEach(function(g){document.addEventListener(g,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 E;(E=O.__quill.emitter).handleDOM.apply(E,y)}})})});var v=function(g){p(_,g);function _(){u(this,_);var y=d(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return y.listeners={},y.on("error",m.error),y}return s(_,[{key:"emit",value:function(){m.log.apply(m,arguments),a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(x){for(var O=arguments.length,E=Array(O>1?O-1:0),T=1;T<O;T++)E[T-1]=arguments[T];(this.listeners[x.type]||[]).forEach(function(R){var A=R.node,w=R.handler;(x.target===A||A.contains(x.target))&&w.apply(void 0,[x].concat(E))})}},{key:"listenDOM",value:function(x,O,E){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push({node:O,handler:E})}}]),_}(l.default);v.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"},v.sources={API:"api",SILENT:"silent",USER:"user"},n.default=v},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 m,b;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(m=0;m<u.length;m++)if(u[m]!==d[m])return!1;return!0}try{var v=a(u),g=a(d)}catch{return!1}if(v.length!=g.length)return!1;for(v.sort(),g.sort(),m=v.length-1;m>=0;m--)if(v[m]!=g[m])return!1;for(m=v.length-1;m>=0;m--)if(b=v[m],!l(u[b],d[b],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 T(R,A){var w=[],S=!0,I=!1,C=void 0;try{for(var F=R[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(R,A){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return T(R,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function T(R,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(R,S.key,S)}}return function(R,A,w){return A&&T(R.prototype,A),w&&T(R,w),R}}(),o=function T(R,A,w){R===null&&(R=Function.prototype);var S=Object.getOwnPropertyDescriptor(R,A);if(S===void 0){var I=Object.getPrototypeOf(R);return I===null?void 0:T(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=g(l),c=i(0),h=g(c),u=i(4),d=g(u),p=i(6),m=g(p),b=i(7),v=g(b);function g(T){return T&&T.__esModule?T:{default:T}}function _(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")}function y(T,R){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:T}function x(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);T.prototype=Object.create(R&&R.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(T,R):T.__proto__=R)}var O=function(T){x(R,T);function R(){return _(this,R),y(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return R}(m.default);O.blotName="code",O.tagName="CODE";var E=function(T){x(R,T);function R(){return _(this,R),y(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return a(R,[{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(v.default,this.length()-1),C=s(I,1),F=C[0];F!=null&&F.deleteAt(F.length()-1,1),o(R.prototype.__proto__||Object.getPrototypeOf(R.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,V=this.isolate(D,U),j=V.next;V.format(I,C),j instanceof R&&j.formatAt(0,w-D+S-U,I,C)}}}},{key:"insertAt",value:function(w,S,I){if(I==null){var C=this.descendant(v.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(R.prototype.__proto__||Object.getPrototypeOf(R.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(R.prototype.__proto__||Object.getPrototypeOf(R.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(R.__proto__||Object.getPrototypeOf(R),"create",this).call(this,w);return S.setAttribute("spellcheck",!1),S}},{key:"formats",value:function(){return!0}}]),R}(d.default);E.blotName="code-block",E.tagName="PRE",E.TAB=" ",n.Code=O,n.default=E},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(P,N){var k=[],L=!0,$=!1,G=void 0;try{for(var M=P[Symbol.iterator](),B;!(L=(B=M.next()).done)&&(k.push(B.value),!(N&&k.length===N));L=!0);}catch(q){$=!0,G=q}finally{try{!L&&M.return&&M.return()}finally{if($)throw G}}return k}return function(P,N){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return j(P,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(P,N){for(var k=0;k<N.length;k++){var L=N[k];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,L.key,L)}}return function(P,N,k){return N&&j(P.prototype,N),k&&j(P,k),P}}(),l=i(2),f=S(l),c=i(20),h=S(c),u=i(0),d=S(u),p=i(13),m=S(p),b=i(24),v=S(b),g=i(4),_=S(g),y=i(16),x=S(y),O=i(21),E=S(O),T=i(11),R=S(T),A=i(3),w=S(A);function S(j){return j&&j.__esModule?j:{default:j}}function I(j,P,N){return P in j?Object.defineProperty(j,P,{value:N,enumerable:!0,configurable:!0,writable:!0}):j[P]=N,j}function C(j,P){if(!(j instanceof P))throw new TypeError("Cannot call a class as a function")}var F=/^[ -~]*$/,D=function(){function j(P){C(this,j),this.scroll=P,this.delta=this.getDelta()}return o(j,[{key:"applyDelta",value:function(N){var k=this,L=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),N=V(N),N.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),k.scroll.insertAt(G,H);var X=k.scroll.line(G),K=a(X,2),et=K[0],nt=K[1],ot=(0,w.default)({},(0,g.bubbleFormats)(et));if(et instanceof _.default){var ut=et.descendant(d.default.Leaf,nt),Nt=a(ut,1),Ot=Nt[0];ot=(0,w.default)(ot,(0,g.bubbleFormats)(Ot))}q=h.default.attributes.diff(ot,q)||{}}else if(s(M.insert)==="object"){var z=Object.keys(M.insert)[0];if(z==null)return G;k.scroll.insertAt(G,z,M.insert[z])}$+=B}return Object.keys(q).forEach(function(W){k.scroll.formatAt(G,B,W,q[W])}),G+B},0),N.reduce(function(G,M){return typeof M.delete=="number"?(k.scroll.deleteAt(G,M.delete),G):G+(M.retain||M.insert.length||1)},0),this.scroll.batchEnd(),this.update(N)}},{key:"deleteText",value:function(N,k){return this.scroll.deleteAt(N,k),this.update(new f.default().retain(N).delete(k))}},{key:"formatLine",value:function(N,k){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(N,Math.max(k,1)),B=k;M.forEach(function(q){var H=q.length();if(!(q instanceof m.default))q.format(G,$[G]);else{var X=N-q.offset(L.scroll),K=q.newlineIndex(X+B)-X+1;q.formatAt(X,K,G,$[G])}B-=H})}}),this.scroll.optimize(),this.update(new f.default().retain(N).retain(k,(0,E.default)($)))}},{key:"formatText",value:function(N,k){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(G){L.scroll.formatAt(N,k,G,$[G])}),this.update(new f.default().retain(N).retain(k,(0,E.default)($)))}},{key:"getContents",value:function(N,k){return this.delta.slice(N,N+k)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(N,k){return N.concat(k.delta())},new f.default)}},{key:"getFormat",value:function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=[],$=[];k===0?this.scroll.path(N).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(N,k),$=this.scroll.descendants(d.default.Leaf,N,k));var G=[L,$].map(function(M){if(M.length===0)return{};for(var B=(0,g.bubbleFormats)(M.shift());Object.keys(B).length>0;){var q=M.shift();if(q==null)return B;B=U((0,g.bubbleFormats)(q),B)}return B});return w.default.apply(w.default,G)}},{key:"getText",value:function(N,k){return this.getContents(N,k).filter(function(L){return typeof L.insert=="string"}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(N,k,L){return this.scroll.insertAt(N,k,L),this.update(new f.default().retain(N).insert(I({},k,L)))}},{key:"insertText",value:function(N,k){var L=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return k=k.replace(/\r\n/g,`
571
571
  `).replace(/\r/g,`
572
- `),this.scroll.insertAt(I,P),Object.keys(G).forEach(function($){L.scroll.formatAt(I,P.length,$,G[$])}),this.update(new h.default().retain(I).insert(P,(0,w.default)(G)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var I=this.scroll.children.head;return I.statics.blotName!==_.default.blotName||I.children.length>1?!1:I.children.head instanceof x.default}},{key:"removeFormat",value:function(I,P){var L=this.getText(I,P),G=this.scroll.line(I+P),$=a(G,2),M=$[0],B=$[1],q=0,H=new h.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 X=this.getContents(I,P+q),K=X.diff(new h.default().insert(L).concat(H)),et=new h.default().retain(I).concat(K);return this.applyDelta(et)}},{key:"update",value:function(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,G=this.delta;if(P.length===1&&P[0].type==="characterData"&&P[0].target.data.match(F)&&d.default.find(P[0].target)){var $=d.default.find(P[0].target),M=(0,b.bubbleFormats)($),B=$.offset(this.scroll),q=P[0].oldValue.replace(y.default.CONTENTS,""),H=new h.default().insert(q),X=new h.default().insert($.value()),K=new h.default().retain(B).concat(H.diff(X,L));I=K.reduce(function(et,it){return it.insert?et.insert(it.insert,M):et.push(it)},new h.default),this.delta=G.compose(I)}else this.delta=this.getDelta(),(!I||!(0,N.default)(G.compose(I),this.delta))&&(I=G.diff(this.delta,L));return I}}]),j}();function D(j,k){return Object.keys(k).reduce(function(I,P){return j[P]==null||(k[P]===j[P]?I[P]=k[P]:Array.isArray(k[P])?k[P].indexOf(j[P])<0&&(I[P]=k[P].concat([j[P]])):I[P]=[k[P],j[P]]),I},{})}function z(j){return j.reduce(function(k,I){if(I.insert===1){var P=(0,w.default)(I.attributes);return delete P.image,k.insert({image:I.attributes.image},P)}if(I.attributes!=null&&(I.attributes.list===!0||I.attributes.bullet===!0)&&(I=(0,w.default)(I),I.attributes.list?I.attributes.list="ordered":(I.attributes.list="bullet",delete I.attributes.bullet)),typeof I.insert=="string"){var L=I.insert.replace(/\r\n/g,`
572
+ `),this.scroll.insertAt(N,k),Object.keys($).forEach(function(G){L.scroll.formatAt(N,k.length,G,$[G])}),this.update(new f.default().retain(N).insert(k,(0,E.default)($)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var N=this.scroll.children.head;return N.statics.blotName!==_.default.blotName||N.children.length>1?!1:N.children.head instanceof x.default}},{key:"removeFormat",value:function(N,k){var L=this.getText(N,k),$=this.scroll.line(N+k),G=a($,2),M=G[0],B=G[1],q=0,H=new f.default;M!=null&&(M instanceof m.default?q=M.newlineIndex(B)-B+1:q=M.length()-B,H=M.delta().slice(B,B+q-1).insert(`
573
+ `));var X=this.getContents(N,k+q),K=X.diff(new f.default().insert(L).concat(H)),et=new f.default().retain(N).concat(K);return this.applyDelta(et)}},{key:"update",value:function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(k.length===1&&k[0].type==="characterData"&&k[0].target.data.match(F)&&d.default.find(k[0].target)){var G=d.default.find(k[0].target),M=(0,g.bubbleFormats)(G),B=G.offset(this.scroll),q=k[0].oldValue.replace(v.default.CONTENTS,""),H=new f.default().insert(q),X=new f.default().insert(G.value()),K=new f.default().retain(B).concat(H.diff(X,L));N=K.reduce(function(et,nt){return nt.insert?et.insert(nt.insert,M):et.push(nt)},new f.default),this.delta=$.compose(N)}else this.delta=this.getDelta(),(!N||!(0,R.default)($.compose(N),this.delta))&&(N=$.diff(this.delta,L));return N}}]),j}();function U(j,P){return Object.keys(P).reduce(function(N,k){return j[k]==null||(P[k]===j[k]?N[k]=P[k]:Array.isArray(P[k])?P[k].indexOf(j[k])<0&&(N[k]=P[k].concat([j[k]])):N[k]=[P[k],j[k]]),N},{})}function V(j){return j.reduce(function(P,N){if(N.insert===1){var k=(0,E.default)(N.attributes);return delete k.image,P.insert({image:N.attributes.image},k)}if(N.attributes!=null&&(N.attributes.list===!0||N.attributes.bullet===!0)&&(N=(0,E.default)(N),N.attributes.list?N.attributes.list="ordered":(N.attributes.list="bullet",delete N.attributes.bullet)),typeof N.insert=="string"){var L=N.insert.replace(/\r\n/g,`
574
574
  `).replace(/\r/g,`
575
- `);return k.insert(L,I.attributes)}return k.push(I)},new h.default)}n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var s=function(){function E(N,A){var T=[],O=!0,R=!1,C=void 0;try{for(var F=N[Symbol.iterator](),U;!(O=(U=F.next()).done)&&(T.push(U.value),!(A&&T.length===A));O=!0);}catch(D){R=!0,C=D}finally{try{!O&&F.return&&F.return()}finally{if(R)throw C}}return T}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 T=0;T<A.length;T++){var O=A[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,O.key,O)}}return function(N,A,T){return A&&E(N.prototype,A),T&&E(N,T),N}}(),o=i(0),l=y(o),h=i(21),c=y(h),f=i(11),u=y(f),d=i(8),p=y(d),v=i(10),g=y(v);function y(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 m=(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},S=function(){function E(N,A){var T=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(){T.mouseDown||setTimeout(T.update.bind(T,p.default.sources.USER),1)}),this.emitter.on(p.default.events.EDITOR_CHANGE,function(O,R){O===p.default.events.TEXT_CHANGE&&R.length()>0&&T.update(p.default.sources.SILENT)}),this.emitter.on(p.default.events.SCROLL_BEFORE_UPDATE,function(){if(T.hasFocus()){var O=T.getNativeRange();O!=null&&O.start.node!==T.cursor.textNode&&T.emitter.once(p.default.events.SCROLL_UPDATE,function(){try{T.setNativeRange(O.start.node,O.start.offset,O.end.node,O.end.offset)}catch{}})}}),this.emitter.on(p.default.events.SCROLL_OPTIMIZE,function(O,R){if(R.range){var C=R.range,F=C.startNode,U=C.startOffset,D=C.endNode,z=C.endOffset;T.setNativeRange(F,U,D,z)}}),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 T=A.cursor.restore();if(!T)return;setTimeout(function(){A.setNativeRange(T.startNode,T.startOffset,T.endNode,T.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,T){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var O=this.getNativeRange();if(!(O==null||!O.native.collapsed||l.default.query(A,l.default.Scope.BLOCK))){if(O.start.node!==this.cursor.textNode){var R=l.default.find(O.start.node,!1);if(R==null)return;if(R instanceof l.default.Leaf){var C=R.split(O.start.offset);R.parent.insertBefore(this.cursor,C)}else R.insertBefore(this.cursor,O.start.node);this.cursor.attach()}this.cursor.format(A,T),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=this.scroll.length();A=Math.min(A,O-1),T=Math.min(A+T,O-1)-A;var R=void 0,C=this.scroll.leaf(A),F=s(C,2),U=F[0],D=F[1];if(U==null)return null;var z=U.position(D,!0),j=s(z,2);R=j[0],D=j[1];var k=document.createRange();if(T>0){k.setStart(R,D);var I=this.scroll.leaf(A+T),P=s(I,2);if(U=P[0],D=P[1],U==null)return null;var L=U.position(D,!0),G=s(L,2);return R=G[0],D=G[1],k.setEnd(R,D),k.getBoundingClientRect()}else{var $="left",M=void 0;return R instanceof Text?(D<R.data.length?(k.setStart(R,D),k.setEnd(R,D+1)):(k.setStart(R,D-1),k.setEnd(R,D),$="right"),M=k.getBoundingClientRect()):(M=U.domNode.getBoundingClientRect(),D>0&&($="right")),{bottom:M.top+M.height,height:M.height,left:M[$],right:M[$],top:M.top,width:0}}}},{key:"getNativeRange",value:function(){var A=document.getSelection();if(A==null||A.rangeCount<=0)return null;var T=A.getRangeAt(0);if(T==null)return null;var O=this.normalizeNative(T);return m.info("getNativeRange",O),O}},{key:"getRange",value:function(){var A=this.getNativeRange();if(A==null)return[null,null];var T=this.normalizedToRange(A);return[T,A]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(A){var T=this,O=[[A.start.node,A.start.offset]];A.native.collapsed||O.push([A.end.node,A.end.offset]);var R=O.map(function(U){var D=s(U,2),z=D[0],j=D[1],k=l.default.find(z,!0),I=k.offset(T.scroll);return j===0?I:k instanceof l.default.Container?I+k.length():I+k.index(z,j)}),C=Math.min(Math.max.apply(Math,b(R)),this.scroll.length()-1),F=Math.min.apply(Math,[C].concat(b(R)));return new x(F,C-F)}},{key:"normalizeNative",value:function(A){if(!w(this.root,A.startContainer)||!A.collapsed&&!w(this.root,A.endContainer))return null;var T={start:{node:A.startContainer,offset:A.startOffset},end:{node:A.endContainer,offset:A.endOffset},native:A};return[T.start,T.end].forEach(function(O){for(var R=O.node,C=O.offset;!(R instanceof Text)&&R.childNodes.length>0;)if(R.childNodes.length>C)R=R.childNodes[C],C=0;else if(R.childNodes.length===C)R=R.lastChild,C=R instanceof Text?R.data.length:R.childNodes.length+1;else break;O.node=R,O.offset=C}),T}},{key:"rangeToNative",value:function(A){var T=this,O=A.collapsed?[A.index]:[A.index,A.index+A.length],R=[],C=this.scroll.length();return O.forEach(function(F,U){F=Math.min(C-1,F);var D=void 0,z=T.scroll.leaf(F),j=s(z,2),k=j[0],I=j[1],P=k.position(I,U!==0),L=s(P,2);D=L[0],I=L[1],R.push(D,I)}),R.length<2&&(R=R.concat(R)),R}},{key:"scrollIntoView",value:function(A){var T=this.lastRange;if(T!=null){var O=this.getBounds(T.index,T.length);if(O!=null){var R=this.scroll.length()-1,C=this.scroll.line(Math.min(T.index,R)),F=s(C,1),U=F[0],D=U;if(T.length>0){var z=this.scroll.line(Math.min(T.index+T.length,R)),j=s(z,1);D=j[0]}if(!(U==null||D==null)){var k=A.getBoundingClientRect();O.top<k.top?A.scrollTop-=k.top-O.top:O.bottom>k.bottom&&(A.scrollTop+=O.bottom-k.bottom)}}}}},{key:"setNativeRange",value:function(A,T){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A,R=arguments.length>3&&arguments[3]!==void 0?arguments[3]:T,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",A,T,O,R),!(A!=null&&(this.root.parentNode==null||A.parentNode==null||O.parentNode==null))){var F=document.getSelection();if(F!=null)if(A!=null){this.hasFocus()||this.root.focus();var U=(this.getNativeRange()||{}).native;if(U==null||C||A!==U.startContainer||T!==U.startOffset||O!==U.endContainer||R!==U.endOffset){A.tagName=="BR"&&(T=[].indexOf.call(A.parentNode.childNodes,A),A=A.parentNode),O.tagName=="BR"&&(R=[].indexOf.call(O.parentNode.childNodes,O),O=O.parentNode);var D=document.createRange();D.setStart(A,T),D.setEnd(O,R),F.removeAllRanges(),F.addRange(D)}}else F.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(A){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;if(typeof T=="string"&&(O=T,T=!1),m.info("setRange",A),A!=null){var R=this.rangeToNative(A);this.setNativeRange.apply(this,b(R).concat([T]))}else this.setNativeRange(null);this.update(O)}},{key:"update",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,T=this.lastRange,O=this.getRange(),R=s(O,2),C=R[0],F=R[1];if(this.lastRange=C,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,u.default)(T,this.lastRange)){var U;!this.composing&&F!=null&&F.native.collapsed&&F.start.node!==this.cursor.textNode&&this.cursor.restore();var D=[p.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(T),A];if((U=this.emitter).emit.apply(U,[p.default.events.EDITOR_CHANGE].concat(D)),A!==p.default.sources.SILENT){var z;(z=this.emitter).emit.apply(z,D)}}}}]),E}();function w(E,N){try{N.parentNode}catch{return!1}return N instanceof Text&&(N=N.parentNode),E.contains(N)}n.Range=x,n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){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,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(0),l=h(o);function h(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 f(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),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"insertInto",value:function(y,b){y.children.length===0?a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertInto",this).call(this,y,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 f=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){f(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),h=function(f){s(u,f);function u(d){var p=f.call(this,d)||this;return p.build(),p}return u.prototype.appendChild=function(d){this.insertBefore(d)},u.prototype.attach=function(){f.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,y){v.deleteAt(g,y)})},u.prototype.descendant=function(d,p){var v=this.children.find(p),g=v[0],y=v[1];return d.blotName==null&&d(g)||d.blotName!=null&&g instanceof d?[g,y]:g instanceof u?g.descendant(d,y):[null,-1]},u.prototype.descendants=function(d,p,v){p===void 0&&(p=0),v===void 0&&(v=Number.MAX_VALUE);var g=[],y=v;return this.children.forEachAt(p,v,function(b,_,m){(d.blotName==null&&d(b)||d.blotName!=null&&b instanceof d)&&g.push(b),b instanceof u&&(g=g.concat(b.descendants(d,_,y))),y-=m}),g},u.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),f.prototype.detach.call(this)},u.prototype.formatAt=function(d,p,v,g){this.children.forEachAt(d,p,function(y,b,_){y.formatAt(b,_,v,g)})},u.prototype.insertAt=function(d,p,v){var g=this.children.find(d),y=g[0],b=g[1];if(y)y.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(f.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],y=v[1],b=[[this,d]];return g instanceof u?b.concat(g.path(y,p)):(g!=null&&b.push([g,y]),b)},u.prototype.removeChild=function(d){this.children.remove(d)},u.prototype.replace=function(d){d instanceof u&&d.moveChildren(this),f.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,y,b){g=g.split(y,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=[],y=[];d.forEach(function(b){b.target===v.domNode&&b.type==="childList"&&(g.push.apply(g,b.addedNodes),y.push.apply(y,b.removedNodes))}),y.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 m=c(b);(m.next!=_||m.next==null)&&(m.parent!=null&&m.parent.removeChild(v),v.insertBefore(m,_||void 0))})},u}(o.default);function c(f){var u=l.find(f);if(u==null)try{u=l.create(f)}catch{u=l.create(l.Scope.INLINE),[].slice.call(f.childNodes).forEach(function(p){u.domNode.appendChild(p)}),f.parentNode&&f.parentNode.replaceChild(u.domNode,f),u.attach()}return u}n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var f=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){f(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),h=i(1),c=function(f){s(u,f);function u(d){var p=f.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=h.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=f.prototype.replaceWith.call(this,d,p);return this.attributes.copy(v),v},u.prototype.update=function(d,p){var v=this;f.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=f.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 h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(30),o=i(1),l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.value=function(f){return!0},c.prototype.index=function(f,u){return this.domNode===f||this.domNode.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(u,1):-1},c.prototype.position=function(f,u){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return f>0&&(d+=1),[this.parent.domNode,d]},c.prototype.value=function(){var f;return f={},f[this.statics.blotName]=this.statics.value(this.domNode)||!0,f},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(h,c,f){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var u=a(!0,{},c);f||(u=Object.keys(u).reduce(function(p,v){return u[v]!=null&&(p[v]=u[v]),p},{}));for(var d in h)h[d]!==void 0&&c[d]===void 0&&(u[d]=h[d]);return Object.keys(u).length>0?u:void 0},diff:function(h,c){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var f=Object.keys(h).concat(Object.keys(c)).reduce(function(u,d){return s(h[d],c[d])||(u[d]=c[d]===void 0?null:c[d]),u},{});return Object.keys(f).length>0?f:void 0},transform:function(h,c,f){if(typeof h!="object")return c;if(typeof c=="object"){if(!f)return c;var u=Object.keys(c).reduce(function(d,p){return h[p]===void 0&&(d[p]=c[p]),d},{});return Object.keys(u).length>0?u:void 0}}},iterator:function(h){return new l(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function l(h){this.ops=h,this.index=0,this.offset=0}l.prototype.hasNext=function(){return this.peekLength()<1/0},l.prototype.next=function(h){h||(h=1/0);var c=this.ops[this.index];if(c){var f=this.offset,u=o.length(c);if(h>=u-f?(h=u-f,this.index+=1,this.offset=0):this.offset+=h,typeof c.delete=="number")return{delete:h};var d={};return c.attributes&&(d.attributes=c.attributes),typeof c.retain=="number"?d.retain=h:typeof c.insert=="string"?d.insert=c.insert.substr(f,h):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 h=this.offset,c=this.index,f=this.next(),u=this.ops.slice(this.index);return this.offset=h,this.index=c,[f].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 h(v,g,y,b,_){typeof g=="object"&&(y=g.depth,b=g.prototype,_=g.includeNonEnumerable,g=g.circular);var m=[],x=[],S=typeof Buffer<"u";typeof g>"u"&&(g=!0),typeof y>"u"&&(y=1/0);function w(E,N){if(E===null)return null;if(N===0)return E;var A,T;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,I){E.then(function(P){k(w(P,N-1))},function(P){I(w(P,N-1))})});else if(h.__isArray(E))A=[];else if(h.__isRegExp(E))A=new RegExp(E.source,p(E)),E.lastIndex&&(A.lastIndex=E.lastIndex);else if(h.__isDate(E))A=new Date(E.getTime());else{if(S&&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"?(T=Object.getPrototypeOf(E),A=Object.create(T)):(A=Object.create(b),T=b)}if(g){var O=m.indexOf(E);if(O!=-1)return x[O];m.push(E),x.push(A)}s(E,a)&&E.forEach(function(k,I){var P=w(I,N-1),L=w(k,N-1);A.set(P,L)}),s(E,o)&&E.forEach(function(k){var I=w(k,N-1);A.add(I)});for(var R in E){var C;T&&(C=Object.getOwnPropertyDescriptor(T,R)),!(C&&C.set==null)&&(A[R]=w(E[R],N-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(E),R=0;R<F.length;R++){var U=F[R],D=Object.getOwnPropertyDescriptor(E,U);D&&!D.enumerable&&!_||(A[U]=w(E[U],N-1),D.enumerable||Object.defineProperty(A,U,{enumerable:!1}))}if(_)for(var z=Object.getOwnPropertyNames(E),R=0;R<z.length;R++){var j=z[R],D=Object.getOwnPropertyDescriptor(E,j);D&&D.enumerable||(A[j]=w(E[j],N-1),Object.defineProperty(A,j,{enumerable:!1}))}return A}return w(v,y)}h.clonePrototype=function(g){if(g===null)return null;var y=function(){};return y.prototype=g,new y};function c(v){return Object.prototype.toString.call(v)}h.__objToStr=c;function f(v){return typeof v=="object"&&c(v)==="[object Date]"}h.__isDate=f;function u(v){return typeof v=="object"&&c(v)==="[object Array]"}h.__isArray=u;function d(v){return typeof v=="object"&&c(v)==="[object RegExp]"}h.__isRegExp=d;function p(v){var g="";return v.global&&(g+="g"),v.ignoreCase&&(g+="i"),v.multiline&&(g+="m"),g}return h.__getRegExpFlags=p,h}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function A(T,O){var R=[],C=!0,F=!1,U=void 0;try{for(var D=T[Symbol.iterator](),z;!(C=(z=D.next()).done)&&(R.push(z.value),!(O&&R.length===O));C=!0);}catch(j){F=!0,U=j}finally{try{!C&&D.return&&D.return()}finally{if(F)throw U}}return R}return function(T,O){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return A(T,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function A(T,O){for(var R=0;R<O.length;R++){var C=O[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(T,C.key,C)}}return function(T,O,R){return O&&A(T.prototype,O),R&&A(T,R),T}}(),o=function A(T,O,R){T===null&&(T=Function.prototype);var C=Object.getOwnPropertyDescriptor(T,O);if(C===void 0){var F=Object.getPrototypeOf(T);return F===null?void 0:A(F,O,R)}else{if("value"in C)return C.value;var U=C.get;return U===void 0?void 0:U.call(R)}},l=i(0),h=m(l),c=i(8),f=m(c),u=i(4),d=m(u),p=i(16),v=m(p),g=i(13),y=m(g),b=i(25),_=m(b);function m(A){return A&&A.__esModule?A:{default:A}}function x(A,T){if(!(A instanceof T))throw new TypeError("Cannot call a class as a function")}function S(A,T){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:A}function w(A,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);A.prototype=Object.create(T&&T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(A,T):A.__proto__=T)}function E(A){return A instanceof d.default||A instanceof u.BlockEmbed}var N=function(A){w(T,A);function T(O,R){x(this,T);var C=S(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,O));return C.emitter=R.emitter,Array.isArray(R.whitelist)&&(C.whitelist=R.whitelist.reduce(function(F,U){return F[U]=!0,F},{})),C.domNode.addEventListener("DOMNodeInserted",function(){}),C.optimize(),C.enable(),C}return a(T,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(R,C){var F=this.line(R),U=s(F,2),D=U[0],z=U[1],j=this.line(R+C),k=s(j,1),I=k[0];if(o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"deleteAt",this).call(this,R,C),I!=null&&D!==I&&z>0){if(D instanceof u.BlockEmbed||I instanceof u.BlockEmbed){this.optimize();return}if(D instanceof y.default){var P=D.newlineIndex(D.length(),!0);if(P>-1&&(D=D.split(P+1),D===I)){this.optimize();return}}else if(I instanceof y.default){var L=I.newlineIndex(0);L>-1&&I.split(L+1)}var G=I.children.head instanceof v.default?null:I.children.head;D.moveChildren(I,G),D.remove()}this.optimize()}},{key:"enable",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",R)}},{key:"formatAt",value:function(R,C,F,U){this.whitelist!=null&&!this.whitelist[F]||(o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"formatAt",this).call(this,R,C,F,U),this.optimize())}},{key:"insertAt",value:function(R,C,F){if(!(F!=null&&this.whitelist!=null&&!this.whitelist[C])){if(R>=this.length())if(F==null||h.default.query(C,h.default.Scope.BLOCK)==null){var U=h.default.create(this.statics.defaultChild);this.appendChild(U),F==null&&C.endsWith(`
576
- `)&&(C=C.slice(0,-1)),U.insertAt(0,C,F)}else{var D=h.default.create(C,F);this.appendChild(D)}else o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,R,C,F);this.optimize()}}},{key:"insertBefore",value:function(R,C){if(R.statics.scope===h.default.Scope.INLINE_BLOT){var F=h.default.create(this.statics.defaultChild);F.appendChild(R),R=F}o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,R,C)}},{key:"leaf",value:function(R){return this.path(R).pop()||[null,-1]}},{key:"line",value:function(R){return R===this.length()?this.line(R-1):this.descendant(E,R)}},{key:"lines",value:function(){var R=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 U(D,z,j){var k=[],I=j;return D.children.forEachAt(z,j,function(P,L,G){E(P)?k.push(P):P instanceof h.default.Container&&(k=k.concat(U(P,L,I))),I-=G}),k};return F(this,R,C)}},{key:"optimize",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,R,C),R.length>0&&this.emitter.emit(f.default.events.SCROLL_OPTIMIZE,R,C))}},{key:"path",value:function(R){return o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,R).slice(1)}},{key:"update",value:function(R){if(this.batch!==!0){var C=f.default.sources.USER;typeof R=="string"&&(C=R),Array.isArray(R)||(R=this.observer.takeRecords()),R.length>0&&this.emitter.emit(f.default.events.SCROLL_BEFORE_UPDATE,C,R),o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"update",this).call(this,R.concat([])),R.length>0&&this.emitter.emit(f.default.events.SCROLL_UPDATE,C,R)}}}]),T}(h.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=[],X=!0,K=!1,et=void 0;try{for(var it=B[Symbol.iterator](),lt;!(X=(lt=it.next()).done)&&(H.push(lt.value),!(q&&H.length===q));X=!0);}catch(ht){K=!0,et=ht}finally{try{!X&&it.return&&it.return()}finally{if(K)throw et}}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 X=q[H];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(B,X.key,X)}}return function(B,q,H){return q&&M(B.prototype,q),H&&M(B,H),B}}(),l=i(21),h=A(l),c=i(11),f=A(c),u=i(3),d=A(u),p=i(2),v=A(p),g=i(20),y=A(g),b=i(0),_=A(b),m=i(5),x=A(m),S=i(10),w=A(S),E=i(9),N=A(E);function A(M){return M&&M.__esModule?M:{default:M}}function T(M,B,q){return B in M?Object.defineProperty(M,B,{value:q,enumerable:!0,configurable:!0,writable:!0}):M[B]=q,M}function O(M,B){if(!(M instanceof B))throw new TypeError("Cannot call a class as a function")}function R(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,w.default)("quill:keyboard"),U=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",D=function(M){C(B,M),o(B,null,[{key:"match",value:function(H,X){return X=$(X),["altKey","ctrlKey","metaKey","shiftKey"].some(function(K){return!!X[K]!==H[K]&&X[K]!==null})?!1:X.key===(H.which||H.keyCode)}}]);function B(q,H){O(this,B);var X=R(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,q,H));return X.bindings={},Object.keys(X.options.bindings).forEach(function(K){K==="list autofill"&&q.scroll.whitelist!=null&&!q.scroll.whitelist.list||X.options.bindings[K]&&X.addBinding(X.options.bindings[K])}),X.addBinding({key:B.keys.ENTER,shiftKey:null},P),X.addBinding({key:B.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(X.addBinding({key:B.keys.BACKSPACE},{collapsed:!0},j),X.addBinding({key:B.keys.DELETE},{collapsed:!0},k)):(X.addBinding({key:B.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),X.addBinding({key:B.keys.DELETE},{collapsed:!0,suffix:/^.?$/},k)),X.addBinding({key:B.keys.BACKSPACE},{collapsed:!1},I),X.addBinding({key:B.keys.DELETE},{collapsed:!1},I),X.addBinding({key:B.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),X.listen(),X}return o(B,[{key:"addBinding",value:function(H){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},et=$(H);if(et==null||et.key==null)return F.warn("Attempted to add invalid keyboard binding",et);typeof X=="function"&&(X={handler:X}),typeof K=="function"&&(K={handler:K}),et=(0,d.default)(et,X,K),this.bindings[et.key]=this.bindings[et.key]||[],this.bindings[et.key].push(et)}},{key:"listen",value:function(){var H=this;this.quill.root.addEventListener("keydown",function(X){if(!X.defaultPrevented){var K=X.which||X.keyCode,et=(H.bindings[K]||[]).filter(function(Tt){return B.match(X,Tt)});if(et.length!==0){var it=H.quill.getSelection();if(!(it==null||!H.quill.hasFocus())){var lt=H.quill.getLine(it.index),ht=a(lt,2),Ct=ht[0],It=ht[1],V=H.quill.getLeaf(it.index),W=a(V,2),Q=W[0],tt=W[1],Y=it.length===0?[Q,tt]:H.quill.getLeaf(it.index+it.length),ct=a(Y,2),Z=ct[0],at=ct[1],St=Q instanceof _.default.Text?Q.value().slice(0,tt):"",Ht=Z instanceof _.default.Text?Z.value().slice(at):"",_t={collapsed:it.length===0,empty:it.length===0&&Ct.length()<=1,format:H.quill.getFormat(it),offset:It,prefix:St,suffix:Ht},Et=et.some(function(Tt){if(Tt.collapsed!=null&&Tt.collapsed!==_t.collapsed||Tt.empty!=null&&Tt.empty!==_t.empty||Tt.offset!=null&&Tt.offset!==_t.offset)return!1;if(Array.isArray(Tt.format)){if(Tt.format.every(function(Bt){return _t.format[Bt]==null}))return!1}else if(s(Tt.format)==="object"&&!Object.keys(Tt.format).every(function(Bt){return Tt.format[Bt]===!0?_t.format[Bt]!=null:Tt.format[Bt]===!1?_t.format[Bt]==null:(0,f.default)(Tt.format[Bt],_t.format[Bt])}))return!1;return Tt.prefix!=null&&!Tt.prefix.test(_t.prefix)||Tt.suffix!=null&&!Tt.suffix.test(_t.suffix)?!1:Tt.handler.call(H,it,_t)!==!0});Et&&X.preventDefault()}}}})}}]),B}(N.default);D.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},D.DEFAULTS={bindings:{bold:G("bold"),italic:G("italic"),underline:G("underline"),indent:{key:D.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:D.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:D.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:D.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(B){this.quill.deleteText(B.index-1,1,x.default.sources.USER)}},tab:{key:D.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:D.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:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(B){var q=this.quill.getLine(B.index),H=a(q,2),X=H[0],K=H[1],et=(0,d.default)({},X.formats(),{list:"checked"}),it=new v.default().retain(B.index).insert(`
577
- `,et).retain(X.length()-K-1).retain(1,{list:"unchecked"});this.quill.updateContents(it,x.default.sources.USER),this.quill.setSelection(B.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(B,q){var H=this.quill.getLine(B.index),X=a(H,2),K=X[0],et=X[1],it=new v.default().retain(B.index).insert(`
578
- `,q.format).retain(K.length()-et-1).retain(1,{header:null});this.quill.updateContents(it,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,X=this.quill.getLine(B.index),K=a(X,2),et=K[0],it=K[1];if(it>H)return!0;var lt=void 0;switch(q.prefix.trim()){case"[]":case"[ ]":lt="unchecked";break;case"[x]":lt="checked";break;case"-":case"*":lt="bullet";break;default:lt="ordered"}this.quill.insertText(B.index," ",x.default.sources.USER),this.quill.history.cutoff();var ht=new v.default().retain(B.index-it).delete(H+1).retain(et.length()-2-it).retain(1,{list:lt});this.quill.updateContents(ht,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index-H,x.default.sources.SILENT)}},"code exit":{key:D.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),X=H[0],K=H[1],et=new v.default().retain(B.index+X.length()-K-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(et,x.default.sources.USER)}},"embed left":z(D.keys.LEFT,!1),"embed left shift":z(D.keys.LEFT,!0),"embed right":z(D.keys.RIGHT,!1),"embed right shift":z(D.keys.RIGHT,!0)}};function z(M,B){var q,H=M===D.keys.LEFT?"prefix":"suffix";return q={key:M,shiftKey:B,altKey:null},T(q,H,/^$/),T(q,"handler",function(K){var et=K.index;M===D.keys.RIGHT&&(et+=K.length+1);var it=this.quill.getLeaf(et),lt=a(it,1),ht=lt[0];return ht instanceof _.default.Embed?(M===D.keys.LEFT?B?this.quill.setSelection(K.index-1,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index-1,x.default.sources.USER):B?this.quill.setSelection(K.index,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index+K.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),X=H[0],K={};if(B.offset===0){var et=this.quill.getLine(M.index-1),it=a(et,1),lt=it[0];if(lt!=null&&lt.length()>1){var ht=X.formats(),Ct=this.quill.getFormat(M.index-1,1);K=y.default.attributes.diff(ht,Ct)||{}}}var It=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(B.prefix)?2:1;this.quill.deleteText(M.index-It,It,x.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine(M.index-It,It,K,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={},X=0,K=this.quill.getLine(M.index),et=a(K,1),it=et[0];if(B.offset>=it.length()-1){var lt=this.quill.getLine(M.index+1),ht=a(lt,1),Ct=ht[0];if(Ct){var It=it.formats(),V=this.quill.getFormat(M.index,1);H=y.default.attributes.diff(It,V)||{},X=Ct.length()}}this.quill.deleteText(M.index,q,x.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(M.index+X-1,q,H,x.default.sources.USER)}}function I(M){var B=this.quill.getLines(M),q={};if(B.length>1){var H=B[0].formats(),X=B[B.length-1].formats();q=y.default.attributes.diff(X,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(X,K){return _.default.query(K,_.default.Scope.BLOCK)&&!Array.isArray(B.format[K])&&(X[K]=B.format[K]),X},{});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(X){H[X]==null&&(Array.isArray(B.format[X])||X!=="link"&&q.quill.format(X,B.format[X],x.default.sources.USER))})}function L(M){return{key:D.keys.TAB,shiftKey:!M,format:{"code-block":!0},handler:function(q){var H=_.default.query("code-block"),X=q.index,K=q.length,et=this.quill.scroll.descendant(H,X),it=a(et,2),lt=it[0],ht=it[1];if(lt!=null){var Ct=this.quill.getIndex(lt),It=lt.newlineIndex(ht,!0)+1,V=lt.newlineIndex(Ct+ht+K),W=lt.domNode.textContent.slice(It,V).split(`
580
- `);ht=0,W.forEach(function(Q,tt){M?(lt.insertAt(It+ht,H.TAB),ht+=H.TAB.length,tt===0?X+=H.TAB.length:K+=H.TAB.length):Q.startsWith(H.TAB)&&(lt.deleteAt(It+ht,H.TAB.length),ht-=H.TAB.length,tt===0?X-=H.TAB.length:K-=H.TAB.length),ht+=Q.length+1}),this.quill.update(x.default.sources.USER),this.quill.setSelection(X,K,x.default.sources.SILENT)}}}}function G(M){return{key:M[0].toUpperCase(),shortKey:!0,handler:function(q,H){this.quill.format(M,!H.format[M],x.default.sources.USER)}}}function $(M){if(typeof M=="string"||typeof M=="number")return $({key:M});if((typeof M>"u"?"undefined":s(M))==="object"&&(M=(0,h.default)(M,!1)),typeof M.key=="string")if(D.keys[M.key.toUpperCase()]!=null)M.key=D.keys[M.key.toUpperCase()];else if(M.key.length===1)M.key=M.key.toUpperCase().charCodeAt(0);else return null;return M.shortKey&&(M[U]=M.shortKey,delete M.shortKey),M}n.default=D,n.SHORTKEY=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function y(b,_){var m=[],x=!0,S=!1,w=void 0;try{for(var E=b[Symbol.iterator](),N;!(x=(N=E.next()).done)&&(m.push(N.value),!(_&&m.length===_));x=!0);}catch(A){S=!0,w=A}finally{try{!x&&E.return&&E.return()}finally{if(S)throw w}}return m}return function(b,_){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return y(b,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function y(b,_,m){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:y(S,_,m)}else{if("value"in x)return x.value;var w=x.get;return w===void 0?void 0:w.call(m)}},o=function(){function y(b,_){for(var m=0;m<_.length;m++){var x=_[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,m){return _&&y(b.prototype,_),m&&y(b,m),b}}(),l=i(0),h=u(l),c=i(7),f=u(c);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function p(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function v(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var g=function(y){v(b,y),o(b,null,[{key:"value",value:function(){}}]);function b(_,m){d(this,b);var x=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return x.selection=m,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(m,x){if(this._length!==0)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,m,x);for(var S=this,w=0;S!=null&&S.statics.scope!==h.default.Scope.BLOCK_BLOT;)w+=S.offset(S.parent),S=S.parent;S!=null&&(this._length=b.CONTENTS.length,S.optimize(),S.formatAt(w,b.CONTENTS.length,m,x),this._length=0)}},{key:"index",value:function(m,x){return m===this.textNode?0:a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,m,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 m=this.textNode,x=this.selection.getNativeRange(),S=void 0,w=void 0,E=void 0;if(x!=null&&x.start.node===m&&x.end.node===m){var N=[m,x.start.offset,x.end.offset];S=N[0],w=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 f.default?(S=this.next.domNode,this.next.insertAt(0,A),this.textNode.data=b.CONTENTS):(this.textNode.data=A,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(b.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),w!=null){var T=[w,E].map(function(R){return Math.max(0,Math.min(S.data.length,R-1))}),O=s(T,2);return w=O[0],E=O[1],{startNode:S,startOffset:w,endNode:S,endOffset:E}}}}},{key:"update",value:function(m,x){var S=this;if(m.some(function(E){return E.type==="characterData"&&E.target===S.textNode})){var w=this.restore();w&&(x.range=w)}}},{key:"value",value:function(){return""}}]),b}(h.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=h(s),o=i(4),l=h(o);function h(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 f(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),f(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(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(0),l=h(o);function h(g){return g&&g.__esModule?g:{default:g}}function c(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function f(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function u(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var d=function(g){u(y,g);function y(){return c(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"value",value:function(_){var m=a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,_);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(x){return("00"+parseInt(x).toString(16)).slice(-2)}).join("")):m}}]),y}(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,y){for(var b=0;b<y.length;b++){var _=y[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,y,b){return y&&v(g.prototype,y),b&&v(g,b),g}}(),a=function v(g,y,b){g===null&&(g=Function.prototype);var _=Object.getOwnPropertyDescriptor(g,y);if(_===void 0){var m=Object.getPrototypeOf(g);return m===null?void 0:v(m,y,b)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(b)}},o=i(6),l=h(o);function h(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 f(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),f(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 y=document.createElement("a");y.href=v;var b=y.href.slice(0,y.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(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),o=i(23),l=f(o),h=i(107),c=f(h);function f(g){return g&&g.__esModule?g:{default:g}}function u(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}var d=0;function p(g,y){g.setAttribute(y,g.getAttribute(y)!=="true")}var v=function(){function g(y){var b=this;u(this,g),this.select=y,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,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),b.hasAttribute("value")&&m.setAttribute("data-value",b.getAttribute("value")),b.textContent&&m.setAttribute("data-label",b.textContent),m.addEventListener("click",function(){_.selectItem(m,!0)}),m.addEventListener("keydown",function(x){switch(x.keyCode){case l.default.keys.ENTER:_.selectItem(m,!0),x.preventDefault();break;case l.default.keys.ESCAPE:_.escape(),x.preventDefault();break}}),m}},{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(m){var x=b.buildItem(m);_.appendChild(x),m.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,m=this.container.querySelector(".ql-selected");if(b!==m&&(m!=null&&m.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 m=b!=null&&b!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),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),h=i(4),c=F(h),f=i(16),u=F(f),d=i(25),p=F(d),v=i(24),g=F(v),y=i(35),b=F(y),_=i(6),m=F(_),x=i(22),S=F(x),w=i(7),E=F(w),N=i(55),A=F(N),T=i(42),O=F(T),R=i(23),C=F(R);function F(U){return U&&U.__esModule?U:{default:U}}l.default.register({"blots/block":c.default,"blots/block/embed":h.BlockEmbed,"blots/break":u.default,"blots/container":p.default,"blots/cursor":g.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":S.default,"blots/text":E.default,"modules/clipboard":A.default,"modules/history":O.default,"modules/keyboard":C.default}),a.default.register(c.default,u.default,g.default,m.default,S.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 h;return Array.isArray(this.tagName)?(typeof l=="string"&&(l=l.toUpperCase(),parseInt(l).toString()===l&&(l=parseInt(l))),typeof l=="number"?h=document.createElement(this.tagName[l-1]):this.tagName.indexOf(l)>-1?h=document.createElement(l):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},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,h){var c=this.isolate(l,h);c.remove()},o.prototype.formatAt=function(l,h,c,f){var u=this.isolate(l,h);if(s.query(c,s.Scope.BLOT)!=null&&f)u.wrap(c,f);else if(s.query(c,s.Scope.ATTRIBUTE)!=null){var d=s.create(this.statics.scope);u.wrap(d),d.format(c,f)}},o.prototype.insertAt=function(l,h,c){var f=c==null?s.create("text",h):s.create(h,c),u=this.split(l);this.parent.insertBefore(f,u)},o.prototype.insertInto=function(l,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var c=null;l.children.insertBefore(this,h),h!=null&&(c=h.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,h){var c=this.split(l);return c.split(h),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,h){var c=typeof l=="string"?s.create(l,h):l;return c.replace(this),c},o.prototype.split=function(l,h){return l===0?this:this.next},o.prototype.update=function(l,h){},o.prototype.wrap=function(l,h){var c=typeof l=="string"?s.create(l,h):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),h=function(){function c(f){this.attributes={},this.domNode=f,this.build()}return c.prototype.attribute=function(f,u){u?f.add(this.domNode,u)&&(f.value(this.domNode)!=null?this.attributes[f.attrName]=f:delete this.attributes[f.attrName]):(f.remove(this.domNode),delete this.attributes[f.attrName])},c.prototype.build=function(){var f=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&&(f.attributes[g.attrName]=g)})},c.prototype.copy=function(f){var u=this;Object.keys(this.attributes).forEach(function(d){var p=u.attributes[d].value(u.domNode);f.format(d,p)})},c.prototype.move=function(f){var u=this;this.copy(f),Object.keys(this.attributes).forEach(function(d){u.attributes[d].remove(u.domNode)}),this.attributes={}},c.prototype.values=function(){var f=this;return Object.keys(this.attributes).reduce(function(u,d){return u[d]=f.attributes[d].value(f.domNode),u},{})},c}();n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(h,c){var f=h.getAttribute("class")||"";return f.split(/\s+/).filter(function(u){return u.indexOf(c+"-")===0})}var l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(f){return(f.getAttribute("class")||"").split(/\s+/).map(function(u){return u.split("-").slice(0,-1).join("-")})},c.prototype.add=function(f,u){return this.canAdd(f,u)?(this.remove(f),f.classList.add(this.keyName+"-"+u),!0):!1},c.prototype.remove=function(f){var u=o(f,this.keyName);u.forEach(function(d){f.classList.remove(d)}),f.classList.length===0&&f.removeAttribute("class")},c.prototype.value=function(f){var u=o(f,this.keyName)[0]||"",d=u.slice(this.keyName.length+1);return this.canAdd(f,d)?d:""},c}(a.default);n.default=l},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(12);function o(h){var c=h.split("-"),f=c.slice(1).map(function(u){return u[0].toUpperCase()+u.slice(1)}).join("");return c[0]+f}var l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(f){return(f.getAttribute("style")||"").split(";").map(function(u){var d=u.split(":");return d[0].trim()})},c.prototype.add=function(f,u){return this.canAdd(f,u)?(f.style[o(this.keyName)]=u,!0):!1},c.prototype.remove=function(f){f.style[o(this.keyName)]="",f.getAttribute("style")||f.removeAttribute("style")},c.prototype.value=function(f){var u=f.style[o(this.keyName)];return this.canAdd(f,u)?u:""},c}(a.default);n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(h,c){for(var f=0;f<c.length;f++){var u=c[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(h,u.key,u)}}return function(h,c,f){return c&&l(h.prototype,c),f&&l(h,f),h}}();function a(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(h,c){a(this,l),this.quill=h,this.options=c,this.modules={}}return s(l,[{key:"init",value:function(){var c=this;Object.keys(this.options.modules).forEach(function(f){c.modules[f]==null&&c.addModule(f)})}},{key:"addModule",value:function(c){var f=this.quill.constructor.import("modules/"+c);return this.modules[c]=new f(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 y(b,_){for(var m=0;m<_.length;m++){var x=_[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,m){return _&&y(b.prototype,_),m&&y(b,m),b}}(),a=function y(b,_,m){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:y(S,_,m)}else{if("value"in x)return x.value;var w=x.get;return w===void 0?void 0:w.call(m)}},o=i(0),l=f(o),h=i(7),c=f(h);function f(y){return y&&y.__esModule?y:{default:y}}function u(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function d(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function p(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var v="\uFEFF",g=function(y){p(b,y);function b(_){u(this,b);var m=d(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(x){m.contentNode.appendChild(x)}),m.leftGuard=document.createTextNode(v),m.rightGuard=document.createTextNode(v),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return s(b,[{key:"index",value:function(m,x){return m===this.leftGuard?0:m===this.rightGuard?1:a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,m,x)}},{key:"restore",value:function(m){var x=void 0,S=void 0,w=m.data.split(v).join("");if(m===this.leftGuard)if(this.prev instanceof c.default){var E=this.prev.length();this.prev.insertAt(E,w),x={startNode:this.prev.domNode,startOffset:E+w.length}}else S=document.createTextNode(w),this.parent.insertBefore(l.default.create(S),this),x={startNode:S,startOffset:w.length};else m===this.rightGuard&&(this.next instanceof c.default?(this.next.insertAt(0,w),x={startNode:this.next.domNode,startOffset:w.length}):(S=document.createTextNode(w),this.parent.insertBefore(l.default.create(S),this.next),x={startNode:S,startOffset:w.length}));return m.data=v,x}},{key:"update",value:function(m,x){var S=this;m.forEach(function(w){if(w.type==="characterData"&&(w.target===S.leftGuard||w.target===S.rightGuard)){var E=S.restore(w.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"]},h=new a.default.Attributor.Attribute("align","align",l),c=new a.default.Attributor.Class("align","ql-align",l),f=new a.default.Attributor.Style("align","text-align",l);n.AlignAttribute=h,n.AlignClass=c,n.AlignStyle=f},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(f){return f&&f.__esModule?f:{default:f}}var h=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=h,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"]},h=new a.default.Attributor.Attribute("direction","dir",l),c=new a.default.Attributor.Class("direction","ql-direction",l),f=new a.default.Attributor.Style("direction","direction",l);n.DirectionAttribute=h,n.DirectionClass=c,n.DirectionStyle=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var s=function(){function y(b,_){for(var m=0;m<_.length;m++){var x=_[m];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,m){return _&&y(b.prototype,_),m&&y(b,m),b}}(),a=function y(b,_,m){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,_);if(x===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:y(S,_,m)}else{if("value"in x)return x.value;var w=x.get;return w===void 0?void 0:w.call(m)}},o=i(0),l=h(o);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function f(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function u(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var d={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},p=new l.default.Attributor.Class("font","ql-font",d),v=function(y){u(b,y);function b(){return c(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"value",value:function(m){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,m).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"]}),h=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=l,n.SizeStyle=h},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 _(m,x){for(var S=0;S<x.length;S++){var w=x[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,S){return x&&_(m.prototype,x),S&&_(m,S),m}}(),a=i(0),o=u(a),l=i(5),h=u(l),c=i(9),f=u(c);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,m){if(!(_ instanceof m))throw new TypeError("Cannot call a class as a function")}function p(_,m){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:_}function v(_,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);_.prototype=Object.create(m&&m.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(_,m):_.__proto__=m)}var g=function(_){v(m,_);function m(x,S){d(this,m);var w=p(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,x,S));return w.lastRecorded=0,w.ignoreChange=!1,w.clear(),w.quill.on(h.default.events.EDITOR_CHANGE,function(E,N,A,T){E!==h.default.events.TEXT_CHANGE||w.ignoreChange||(!w.options.userOnly||T===h.default.sources.USER?w.record(N,A):w.transform(N))}),w.quill.keyboard.addBinding({key:"Z",shortKey:!0},w.undo.bind(w)),w.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},w.redo.bind(w)),/Win/i.test(navigator.platform)&&w.quill.keyboard.addBinding({key:"Y",shortKey:!0},w.redo.bind(w)),w}return s(m,[{key:"change",value:function(S,w){if(this.stack[S].length!==0){var E=this.stack[S].pop();this.stack[w].push(E),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(E[S],h.default.sources.USER),this.ignoreChange=!1;var N=b(E[S]);this.quill.setSelection(N)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(S,w){if(S.ops.length!==0){this.stack.redo=[];var E=this.quill.getContents().diff(w),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),S=A.redo.compose(S)}else this.lastRecorded=N;this.stack.undo.push({redo:S,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(S){this.stack.undo.forEach(function(w){w.undo=S.transform(w.undo,!0),w.redo=S.transform(w.redo,!0)}),this.stack.redo.forEach(function(w){w.undo=S.transform(w.undo,!0),w.redo=S.transform(w.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(f.default);g.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function y(_){var m=_.ops[_.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
581
- `):m.attributes!=null?Object.keys(m.attributes).some(function(x){return o.default.query(x,o.default.Scope.BLOCK)!=null}):!1}function b(_){var m=_.reduce(function(S,w){return S+=w.delete||0,S},0),x=_.length()-m;return y(_)&&(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,G){for(var $=0;$<G.length;$++){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 G&&P(L.prototype,G),$&&P(L,$),L}}(),a=function P(L,G,$){L===null&&(L=Function.prototype);var M=Object.getOwnPropertyDescriptor(L,G);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($)}},o=i(3),l=N(o),h=i(2),c=N(h),f=i(8),u=N(f),d=i(23),p=N(d),v=i(34),g=N(v),y=i(59),b=N(y),_=i(60),m=N(_),x=i(28),S=N(x),w=i(61),E=N(w);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 T(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 O(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 R=[!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"],U=["1","2","3",!1],D=["small",!1,"large","huge"],z=function(P){O(L,P);function L(G,$){A(this,L);var M=T(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,G,$)),B=function q(H){if(!document.body.contains(G.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(X){X.container.contains(H.target)||X.close()})};return G.emitter.listenDOM("click",document.body,B),M}return s(L,[{key:"addModule",value:function($){var M=a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"addModule",this).call(this,$);return $==="toolbar"&&this.extendToolbar(M),M}},{key:"buildButtons",value:function($,M){$.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 X=B.value||"";X!=null&&M[H][X]&&(B.innerHTML=M[H][X])}})})}},{key:"buildPickers",value:function($,M){var B=this;this.pickers=$.map(function(H){if(H.classList.contains("ql-align"))return H.querySelector("option")==null&&I(H,R),new m.default(H,M.align);if(H.classList.contains("ql-background")||H.classList.contains("ql-color")){var X=H.classList.contains("ql-background")?"background":"color";return H.querySelector("option")==null&&I(H,C,X==="background"?"#ffffff":"#000000"),new b.default(H,M[X])}else return H.querySelector("option")==null&&(H.classList.contains("ql-font")?I(H,F):H.classList.contains("ql-header")?I(H,U):H.classList.contains("ql-size")&&I(H,D)),new S.default(H)});var q=function(){B.pickers.forEach(function(X){X.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,q)}}]),L}(g.default);z.DEFAULTS=(0,l.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var L=this,G=this.container.querySelector("input.ql-image[type=file]");G==null&&(G=document.createElement("input"),G.setAttribute("type","file"),G.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),G.classList.add("ql-image"),G.addEventListener("change",function(){if(G.files!=null&&G.files[0]!=null){var $=new FileReader;$.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),G.value=""},$.readAsDataURL(G.files[0])}}),this.container.appendChild(G)),G.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var j=function(P){O(L,P);function L(G,$){A(this,L);var M=T(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 $=this;this.textbox.addEventListener("keydown",function(M){p.default.match(M,"enter")?($.save(),M.preventDefault()):p.default.match(M,"escape")&&($.cancel(),M.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var $=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:$!==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-"+$)||""),this.root.setAttribute("data-mode",$)}},{key:"restoreFocus",value:function(){var $=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=$}},{key:"save",value:function(){var $=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",$,u.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",$,u.default.sources.USER)),this.quill.root.scrollTop=M;break}case"video":$=k($);case"formula":{if(!$)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"),$,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 I(P,L){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;L.forEach(function($){var M=document.createElement("option");$===G?M.setAttribute("selected","selected"):M.setAttribute("value",$),P.appendChild(M)})}n.BaseTooltip=j,n.default=z},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,h=this.iterator();l=h();)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,h=this.head;h!=null;){if(h===o)return l;l+=h.length(),h=h.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 h,c=this.iterator();h=c();){var f=h.length();if(o<f||l&&o===f&&(h.next==null||h.next.length()!==0))return[h,o];o-=f}return[null,0]},a.prototype.forEach=function(o){for(var l,h=this.iterator();l=h();)o(l)},a.prototype.forEachAt=function(o,l,h){if(!(l<=0))for(var c=this.find(o),f=c[0],u=c[1],d,p=o-u,v=this.iterator(f);(d=v())&&p<o+l;){var g=d.length();o>p?h(d,o-p,Math.min(l,p+g-o)):h(d,0,Math.min(g,o+l-p)),p+=g}},a.prototype.map=function(o){return this.reduce(function(l,h){return l.push(o(h)),l},[])},a.prototype.reduce=function(o,l){for(var h,c=this.iterator();h=c();)l=o(l,h);return l},a}();n.default=s},function(r,n,i){var s=this&&this.__extends||function(){var f=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){f(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},h=100,c=function(f){s(u,f);function u(d){var p=f.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(){f.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()}):f.prototype.deleteAt.call(this,d,p)},u.prototype.formatAt=function(d,p,v,g){this.update(),f.prototype.formatAt.call(this,d,p,v,g)},u.prototype.insertAt=function(d,p,v){this.update(),f.prototype.insertAt.call(this,d,p,v)},u.prototype.optimize=function(d,p){var v=this;d===void 0&&(d=[]),p===void 0&&(p={}),f.prototype.optimize.call(this,p);for(var g=[].slice.call(this.observer.takeRecords());g.length>0;)d.push(g.pop());for(var y=function(x,S){S===void 0&&(S=!0),!(x==null||x===v)&&x.domNode.parentNode!=null&&(x.domNode[o.DATA_KEY].mutations==null&&(x.domNode[o.DATA_KEY].mutations=[]),S&&y(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,m=0;_.length>0;m+=1){if(m>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(_.forEach(function(x){var S=o.find(x.target,!0);S!=null&&(S.domNode===x.target&&(x.type==="childList"?(y(o.find(x.previousSibling,!1)),[].forEach.call(x.addedNodes,function(w){var E=o.find(w,!1);y(E,!1),E instanceof a.default&&E.children.forEach(function(N){y(N,!1)})})):x.type==="attributes"&&y(S.prev)),y(S))}),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 y=o.find(g.target,!0);return y==null?null:y.domNode[o.DATA_KEY].mutations==null?(y.domNode[o.DATA_KEY].mutations=[g],y):(y.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&&f.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(f,u){f.__proto__=u}||function(f,u){for(var d in u)u.hasOwnProperty(d)&&(f[d]=u[d])};return function(f,u){c(f,u);function d(){this.constructor=f}f.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,f){if(Object.keys(c).length!==Object.keys(f).length)return!1;for(var u in c)if(c[u]!==f[u])return!1;return!0}var h=function(c){s(f,c);function f(){return c!==null&&c.apply(this,arguments)||this}return f.formats=function(u){if(u.tagName!==f.tagName)return c.formats.call(this,u)},f.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(f.blotName,!0)),p.attributes.copy(v)}),this.unwrap()):c.prototype.format.call(this,u,d)},f.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)},f.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 f&&p.prev===this&&l(d,p.formats())&&(p.moveChildren(this),p.remove())},f.blotName="inline",f.scope=o.Scope.INLINE_BLOT,f.tagName="SPAN",f}(a.default);n.default=h},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(18),o=i(1),l=function(h){s(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.formats=function(f){var u=o.query(c.blotName).tagName;if(f.tagName!==u)return h.formats.call(this,f)},c.prototype.format=function(f,u){o.query(f,o.Scope.BLOCK)!=null&&(f===this.statics.blotName&&!u?this.replaceWith(c.blotName):h.prototype.format.call(this,f,u))},c.prototype.formatAt=function(f,u,d,p){o.query(d,o.Scope.BLOCK)!=null?this.format(d,p):h.prototype.formatAt.call(this,f,u,d,p)},c.prototype.insertAt=function(f,u,d){if(d==null||o.query(u,o.Scope.INLINE)!=null)h.prototype.insertAt.call(this,f,u,d);else{var p=this.split(f),v=o.create(u,d);p.parent.insertBefore(v,p)}},c.prototype.update=function(f,u){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,f,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(h,c){h.__proto__=c}||function(h,c){for(var f in c)c.hasOwnProperty(f)&&(h[f]=c[f])};return function(h,c){l(h,c);function f(){this.constructor=h}h.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=function(l){s(h,l);function h(){return l!==null&&l.apply(this,arguments)||this}return h.formats=function(c){},h.prototype.format=function(c,f){l.prototype.formatAt.call(this,0,this.length(),c,f)},h.prototype.formatAt=function(c,f,u,d){c===0&&f===this.length()?this.format(u,d):l.prototype.formatAt.call(this,c,f,u,d)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h}(a.default);n.default=o},function(r,n,i){var s=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var u in f)f.hasOwnProperty(u)&&(c[u]=f[u])};return function(c,f){h(c,f);function u(){this.constructor=c}c.prototype=f===null?Object.create(f):(u.prototype=f.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var a=i(19),o=i(1),l=function(h){s(c,h);function c(f){var u=h.call(this,f)||this;return u.text=u.statics.value(u.domNode),u}return c.create=function(f){return document.createTextNode(f)},c.value=function(f){var u=f.data;return u.normalize&&(u=u.normalize()),u},c.prototype.deleteAt=function(f,u){this.domNode.data=this.text=this.text.slice(0,f)+this.text.slice(f+u)},c.prototype.index=function(f,u){return this.domNode===f?u:-1},c.prototype.insertAt=function(f,u,d){d==null?(this.text=this.text.slice(0,f)+u+this.text.slice(f),this.domNode.data=this.text):h.prototype.insertAt.call(this,f,u,d)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(f){h.prototype.optimize.call(this,f),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(f,u){return[this.domNode,f]},c.prototype.split=function(f,u){if(u===void 0&&(u=!1),!u){if(f===0)return this;if(f===this.length())return this.next}var d=o.create(this.domNode.splitText(f));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},c.prototype.update=function(f,u){var d=this;f.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 h=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>h.length)&&(l=h.length),l-=o.length;var c=h.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 h=Object(this),c=h.length>>>0,f=arguments[1],u,d=0;d<c;d++)if(u=h[d],l.call(f,u,d,h))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(m,x,S){if(m==x)return m?[[a,m]]:[];(S<0||m.length<S)&&(S=null);var w=f(m,x),E=m.substring(0,w);m=m.substring(w),x=x.substring(w),w=u(m,x);var N=m.substring(m.length-w);m=m.substring(0,m.length-w),x=x.substring(0,x.length-w);var A=l(m,x);return E&&A.unshift([a,E]),N&&A.push([a,N]),p(A),S!=null&&(A=y(A,S)),A=b(A),A}function l(m,x){var S;if(!m)return[[s,x]];if(!x)return[[i,m]];var w=m.length>x.length?m:x,E=m.length>x.length?x:m,N=w.indexOf(E);if(N!=-1)return S=[[s,w.substring(0,N)],[a,E],[s,w.substring(N+E.length)]],m.length>x.length&&(S[0][0]=S[2][0]=i),S;if(E.length==1)return[[i,m],[s,x]];var A=d(m,x);if(A){var T=A[0],O=A[1],R=A[2],C=A[3],F=A[4],U=o(T,R),D=o(O,C);return U.concat([[a,F]],D)}return h(m,x)}function h(m,x){for(var S=m.length,w=x.length,E=Math.ceil((S+w)/2),N=E,A=2*E,T=new Array(A),O=new Array(A),R=0;R<A;R++)T[R]=-1,O[R]=-1;T[N+1]=0,O[N+1]=0;for(var C=S-w,F=C%2!=0,U=0,D=0,z=0,j=0,k=0;k<E;k++){for(var I=-k+U;I<=k-D;I+=2){var P=N+I,L;I==-k||I!=k&&T[P-1]<T[P+1]?L=T[P+1]:L=T[P-1]+1;for(var G=L-I;L<S&&G<w&&m.charAt(L)==x.charAt(G);)L++,G++;if(T[P]=L,L>S)D+=2;else if(G>w)U+=2;else if(F){var $=N+C-I;if($>=0&&$<A&&O[$]!=-1){var M=S-O[$];if(L>=M)return c(m,x,L,G)}}}for(var B=-k+z;B<=k-j;B+=2){var $=N+B,M;B==-k||B!=k&&O[$-1]<O[$+1]?M=O[$+1]:M=O[$-1]+1;for(var q=M-B;M<S&&q<w&&m.charAt(S-M-1)==x.charAt(w-q-1);)M++,q++;if(O[$]=M,M>S)j+=2;else if(q>w)z+=2;else if(!F){var P=N+C-B;if(P>=0&&P<A&&T[P]!=-1){var L=T[P],G=N+L-P;if(M=S-M,L>=M)return c(m,x,L,G)}}}}return[[i,m],[s,x]]}function c(m,x,S,w){var E=m.substring(0,S),N=x.substring(0,w),A=m.substring(S),T=x.substring(w),O=o(E,N),R=o(A,T);return O.concat(R)}function f(m,x){if(!m||!x||m.charAt(0)!=x.charAt(0))return 0;for(var S=0,w=Math.min(m.length,x.length),E=w,N=0;S<E;)m.substring(N,E)==x.substring(N,E)?(S=E,N=S):w=E,E=Math.floor((w-S)/2+S);return E}function u(m,x){if(!m||!x||m.charAt(m.length-1)!=x.charAt(x.length-1))return 0;for(var S=0,w=Math.min(m.length,x.length),E=w,N=0;S<E;)m.substring(m.length-E,m.length-N)==x.substring(x.length-E,x.length-N)?(S=E,N=S):w=E,E=Math.floor((w-S)/2+S);return E}function d(m,x){var S=m.length>x.length?m:x,w=m.length>x.length?x:m;if(S.length<4||w.length*2<S.length)return null;function E(D,z,j){for(var k=D.substring(j,j+Math.floor(D.length/4)),I=-1,P="",L,G,$,M;(I=z.indexOf(k,I+1))!=-1;){var B=f(D.substring(j),z.substring(I)),q=u(D.substring(0,j),z.substring(0,I));P.length<q+B&&(P=z.substring(I-q,I)+z.substring(I,I+B),L=D.substring(0,j-q),G=D.substring(j+B),$=z.substring(0,I-q),M=z.substring(I+B))}return P.length*2>=D.length?[L,G,$,M,P]:null}var N=E(S,w,Math.ceil(S.length/4)),A=E(S,w,Math.ceil(S.length/2)),T;if(!N&&!A)return null;A?N?T=N[4].length>A[4].length?N:A:T=A:T=N;var O,R,C,F;m.length>x.length?(O=T[0],R=T[1],C=T[2],F=T[3]):(C=T[0],F=T[1],O=T[2],R=T[3]);var U=T[4];return[O,R,C,F,U]}function p(m){m.push([a,""]);for(var x=0,S=0,w=0,E="",N="",A;x<m.length;)switch(m[x][0]){case s:w++,N+=m[x][1],x++;break;case i:S++,E+=m[x][1],x++;break;case a:S+w>1?(S!==0&&w!==0&&(A=f(N,E),A!==0&&(x-S-w>0&&m[x-S-w-1][0]==a?m[x-S-w-1][1]+=N.substring(0,A):(m.splice(0,0,[a,N.substring(0,A)]),x++),N=N.substring(A),E=E.substring(A)),A=u(N,E),A!==0&&(m[x][1]=N.substring(N.length-A)+m[x][1],N=N.substring(0,N.length-A),E=E.substring(0,E.length-A))),S===0?m.splice(x-w,S+w,[s,N]):w===0?m.splice(x-S,S+w,[i,E]):m.splice(x-S-w,S+w,[i,E],[s,N]),x=x-S-w+(S?1:0)+(w?1:0)+1):x!==0&&m[x-1][0]==a?(m[x-1][1]+=m[x][1],m.splice(x,1)):x++,w=0,S=0,E="",N="";break}m[m.length-1][1]===""&&m.pop();var T=!1;for(x=1;x<m.length-1;)m[x-1][0]==a&&m[x+1][0]==a&&(m[x][1].substring(m[x][1].length-m[x-1][1].length)==m[x-1][1]?(m[x][1]=m[x-1][1]+m[x][1].substring(0,m[x][1].length-m[x-1][1].length),m[x+1][1]=m[x-1][1]+m[x+1][1],m.splice(x-1,1),T=!0):m[x][1].substring(0,m[x+1][1].length)==m[x+1][1]&&(m[x-1][1]+=m[x+1][1],m[x][1]=m[x][1].substring(m[x+1][1].length)+m[x+1][1],m.splice(x+1,1),T=!0)),x++;T&&p(m)}var v=o;v.INSERT=s,v.DELETE=i,v.EQUAL=a,r.exports=v;function g(m,x){if(x===0)return[a,m];for(var S=0,w=0;w<m.length;w++){var E=m[w];if(E[0]===i||E[0]===a){var N=S+E[1].length;if(x===N)return[w+1,m];if(x<N){m=m.slice();var A=x-S,T=[E[0],E[1].slice(0,A)],O=[E[0],E[1].slice(A)];return m.splice(w,1,T,O),[w+1,m]}else S=N}}throw new Error("cursor_pos is out of bounds!")}function y(m,x){var S=g(m,x),w=S[1],E=S[0],N=w[E],A=w[E+1];if(N==null)return m;if(N[0]!==a)return m;if(A!=null&&N[1]+A[1]===A[1]+N[1])return w.splice(E,2,A,N),_(w,E,2);if(A!=null&&A[1].indexOf(N[1])===0){w.splice(E,2,[A[0],N[1]],[0,N[1]]);var T=A[1].slice(N[1].length);return T.length>0&&w.splice(E+2,0,[A[0],T]),_(w,E,3)}else return m}function b(m){for(var x=!1,S=function(A){return A.charCodeAt(0)>=56320&&A.charCodeAt(0)<=57343},w=function(A){return A.charCodeAt(A.length-1)>=55296&&A.charCodeAt(A.length-1)<=56319},E=2;E<m.length;E+=1)m[E-2][0]===a&&w(m[E-2][1])&&m[E-1][0]===i&&S(m[E-1][1])&&m[E][0]===s&&S(m[E][1])&&(x=!0,m[E-1][1]=m[E-2][1].slice(-1)+m[E-1][1],m[E][1]=m[E-2][1].slice(-1)+m[E][1],m[E-2][1]=m[E-2][1].slice(0,-1));if(!x)return m;for(var N=[],E=0;E<m.length;E+=1)m[E][1].length>0&&N.push(m[E]);return N}function _(m,x,S){for(var w=x+S-1;w>=0&&w>=x-1;w--)if(w+1<m.length){var E=m[w],N=m[w+1];E[0]===N[1]&&m.splice(w,2,[E[0],E[1]+N[1]])}return m}},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(h,c,f){this.fn=h,this.context=c,this.once=f||!1}function l(){this._events=new a,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],f,u;if(this._eventsCount===0)return c;for(u in f=this._events)i.call(f,u)&&c.push(s?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(f)):c},l.prototype.listeners=function(c,f){var u=s?s+c:c,d=this._events[u];if(f)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,f,u,d,p,v){var g=s?s+c:c;if(!this._events[g])return!1;var y=this._events[g],b=arguments.length,_,m;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),b){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,f),!0;case 3:return y.fn.call(y.context,f,u),!0;case 4:return y.fn.call(y.context,f,u,d),!0;case 5:return y.fn.call(y.context,f,u,d,p),!0;case 6:return y.fn.call(y.context,f,u,d,p,v),!0}for(m=1,_=new Array(b-1);m<b;m++)_[m-1]=arguments[m];y.fn.apply(y.context,_)}else{var x=y.length,S;for(m=0;m<x;m++)switch(y[m].once&&this.removeListener(c,y[m].fn,void 0,!0),b){case 1:y[m].fn.call(y[m].context);break;case 2:y[m].fn.call(y[m].context,f);break;case 3:y[m].fn.call(y[m].context,f,u);break;case 4:y[m].fn.call(y[m].context,f,u,d);break;default:if(!_)for(S=1,_=new Array(b-1);S<b;S++)_[S-1]=arguments[S];y[m].fn.apply(y[m].context,_)}}return!0},l.prototype.on=function(c,f,u){var d=new o(f,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,f,u){var d=new o(f,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,f,u,d){var p=s?s+c:c;if(!this._events[p])return this;if(!f)return--this._eventsCount===0?this._events=new a:delete this._events[p],this;var v=this._events[p];if(v.fn)v.fn===f&&(!d||v.once)&&(!u||v.context===u)&&(--this._eventsCount===0?this._events=new a:delete this._events[p]);else{for(var g=0,y=[],b=v.length;g<b;g++)(v[g].fn!==f||d&&!v[g].once||u&&v[g].context!==u)&&y.push(v[g]);y.length?this._events[p]=y.length===1?y[0]:y:--this._eventsCount===0?this._events=new a:delete this._events[p]}return this},l.prototype.removeAllListeners=function(c){var f;return c?(f=s?s+c:c,this._events[f]&&(--this._eventsCount===0?this._events=new a:delete this._events[f])):(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,Q){var tt=[],Y=!0,ct=!1,Z=void 0;try{for(var at=W[Symbol.iterator](),St;!(Y=(St=at.next()).done)&&(tt.push(St.value),!(Q&&tt.length===Q));Y=!0);}catch(Ht){ct=!0,Z=Ht}finally{try{!Y&&at.return&&at.return()}finally{if(ct)throw Z}}return tt}return function(W,Q){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return V(W,Q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function V(W,Q){for(var tt=0;tt<Q.length;tt++){var Y=Q[tt];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(W,Y.key,Y)}}return function(W,Q,tt){return Q&&V(W.prototype,Q),tt&&V(W,tt),W}}(),l=i(3),h=O(l),c=i(2),f=O(c),u=i(0),d=O(u),p=i(5),v=O(p),g=i(10),y=O(g),b=i(9),_=O(b),m=i(36),x=i(37),S=i(13),w=O(S),E=i(26),N=i(38),A=i(39),T=i(40);function O(V){return V&&V.__esModule?V:{default:V}}function R(V,W,Q){return W in V?Object.defineProperty(V,W,{value:Q,enumerable:!0,configurable:!0,writable:!0}):V[W]=Q,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 U(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 D=(0,y.default)("quill:clipboard"),z="__ql-matcher",j=[[Node.TEXT_NODE,It],[Node.TEXT_NODE,lt],["br",K],[Node.ELEMENT_NODE,lt],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,ht],[Node.ELEMENT_NODE,H],[Node.ELEMENT_NODE,Ct],["li",it],["b",q.bind(q,"bold")],["i",q.bind(q,"italic")],["style",et]],k=[m.AlignAttribute,N.DirectionAttribute].reduce(function(V,W){return V[W.keyName]=W,V},{}),I=[m.AlignStyle,x.BackgroundStyle,E.ColorStyle,N.DirectionStyle,A.FontStyle,T.SizeStyle].reduce(function(V,W){return V[W.keyName]=W,V},{}),P=function(V){U(W,V);function W(Q,tt){C(this,W);var Y=F(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,Q,tt));return Y.quill.root.addEventListener("paste",Y.onPaste.bind(Y)),Y.container=Y.quill.addContainer("ql-clipboard"),Y.container.setAttribute("contenteditable",!0),Y.container.setAttribute("tabindex",-1),Y.matchers=[],j.concat(Y.options.matchers).forEach(function(ct){var Z=a(ct,2),at=Z[0],St=Z[1];!tt.matchVisual&&St===ht||Y.addMatcher(at,St)}),Y}return o(W,[{key:"addMatcher",value:function(tt,Y){this.matchers.push([tt,Y])}},{key:"convert",value:function(tt){if(typeof tt=="string")return this.container.innerHTML=tt.replace(/\>\r?\n +\</g,"><"),this.convert();var Y=this.quill.getFormat(this.quill.selection.savedRange.index);if(Y[w.default.blotName]){var ct=this.container.innerText;return this.container.innerHTML="",new f.default().insert(ct,R({},w.default.blotName,Y[w.default.blotName]))}var Z=this.prepareMatching(),at=a(Z,2),St=at[0],Ht=at[1],_t=B(this.container,St,Ht);return $(_t,`
582
- `)&&_t.ops[_t.ops.length-1].attributes==null&&(_t=_t.compose(new f.default().retain(_t.length()-1).delete(1))),D.log("convert",this.container.innerHTML,_t),this.container.innerHTML="",_t}},{key:"dangerouslyPasteHTML",value:function(tt,Y){var ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof tt=="string")this.quill.setContents(this.convert(tt),Y),this.quill.setSelection(0,v.default.sources.SILENT);else{var Z=this.convert(Y);this.quill.updateContents(new f.default().retain(tt).concat(Z),ct),this.quill.setSelection(tt+Z.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(tt){var Y=this;if(!(tt.defaultPrevented||!this.quill.isEnabled())){var ct=this.quill.getSelection(),Z=new f.default().retain(ct.index),at=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(v.default.sources.SILENT),setTimeout(function(){Z=Z.concat(Y.convert()).delete(ct.length),Y.quill.updateContents(Z,v.default.sources.USER),Y.quill.setSelection(Z.length()-ct.length,v.default.sources.SILENT),Y.quill.scrollingContainer.scrollTop=at,Y.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var tt=this,Y=[],ct=[];return this.matchers.forEach(function(Z){var at=a(Z,2),St=at[0],Ht=at[1];switch(St){case Node.TEXT_NODE:ct.push(Ht);break;case Node.ELEMENT_NODE:Y.push(Ht);break;default:[].forEach.call(tt.container.querySelectorAll(St),function(_t){_t[z]=_t[z]||[],_t[z].push(Ht)});break}}),[Y,ct]}}]),W}(_.default);P.DEFAULTS={matchers:[],matchVisual:!0};function L(V,W,Q){return(typeof W>"u"?"undefined":s(W))==="object"?Object.keys(W).reduce(function(tt,Y){return L(tt,Y,W[Y])},V):V.reduce(function(tt,Y){return Y.attributes&&Y.attributes[W]?tt.push(Y):tt.insert(Y.insert,(0,h.default)({},R({},W,Q),Y.attributes))},new f.default)}function G(V){if(V.nodeType!==Node.ELEMENT_NODE)return{};var W="__ql-computed-style";return V[W]||(V[W]=window.getComputedStyle(V))}function $(V,W){for(var Q="",tt=V.ops.length-1;tt>=0&&Q.length<W.length;--tt){var Y=V.ops[tt];if(typeof Y.insert!="string")break;Q=Y.insert+Q}return Q.slice(-1*W.length)===W}function M(V){if(V.childNodes.length===0)return!1;var W=G(V);return["block","list-item"].indexOf(W.display)>-1}function B(V,W,Q){return V.nodeType===V.TEXT_NODE?Q.reduce(function(tt,Y){return Y(V,tt)},new f.default):V.nodeType===V.ELEMENT_NODE?[].reduce.call(V.childNodes||[],function(tt,Y){var ct=B(Y,W,Q);return Y.nodeType===V.ELEMENT_NODE&&(ct=W.reduce(function(Z,at){return at(Y,Z)},ct),ct=(Y[z]||[]).reduce(function(Z,at){return at(Y,Z)},ct)),tt.concat(ct)},new f.default):new f.default}function q(V,W,Q){return L(Q,V,!0)}function H(V,W){var Q=d.default.Attributor.Attribute.keys(V),tt=d.default.Attributor.Class.keys(V),Y=d.default.Attributor.Style.keys(V),ct={};return Q.concat(tt).concat(Y).forEach(function(Z){var at=d.default.query(Z,d.default.Scope.ATTRIBUTE);at!=null&&(ct[at.attrName]=at.value(V),ct[at.attrName])||(at=k[Z],at!=null&&(at.attrName===Z||at.keyName===Z)&&(ct[at.attrName]=at.value(V)||void 0),at=I[Z],at!=null&&(at.attrName===Z||at.keyName===Z)&&(at=I[Z],ct[at.attrName]=at.value(V)||void 0))}),Object.keys(ct).length>0&&(W=L(W,ct)),W}function X(V,W){var Q=d.default.query(V);if(Q==null)return W;if(Q.prototype instanceof d.default.Embed){var tt={},Y=Q.value(V);Y!=null&&(tt[Q.blotName]=Y,W=new f.default().insert(tt,Q.formats(V)))}else typeof Q.formats=="function"&&(W=L(W,Q.blotName,Q.formats(V)));return W}function K(V,W){return $(W,`
575
+ `);return P.insert(L,N.attributes)}return P.push(N)},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 T(R,A){var w=[],S=!0,I=!1,C=void 0;try{for(var F=R[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(R,A){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return T(R,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function T(R,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(R,S.key,S)}}return function(R,A,w){return A&&T(R.prototype,A),w&&T(R,w),R}}(),o=i(0),l=v(o),f=i(21),c=v(f),h=i(11),u=v(h),d=i(8),p=v(d),m=i(10),b=v(m);function v(T){return T&&T.__esModule?T:{default:T}}function g(T){if(Array.isArray(T)){for(var R=0,A=Array(T.length);R<T.length;R++)A[R]=T[R];return A}else return Array.from(T)}function _(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")}var y=(0,b.default)("quill:selection"),x=function T(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_(this,T),this.index=R,this.length=A},O=function(){function T(R,A){var w=this;_(this,T),this.emitter=A,this.scroll=R,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,V=C.endOffset;w.setNativeRange(F,D,U,V)}}),this.update(p.default.sources.SILENT)}return a(T,[{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 V=D.position(U,!0),j=s(V,2);I=j[0],U=j[1];var P=document.createRange();if(w>0){P.setStart(I,U);var N=this.scroll.leaf(A+w),k=s(N,2);if(D=k[0],U=k[1],D==null)return null;var L=D.position(U,!0),$=s(L,2);return I=$[0],U=$[1],P.setEnd(I,U),P.getBoundingClientRect()}else{var G="left",M=void 0;return I instanceof Text?(U<I.data.length?(P.setStart(I,U),P.setEnd(I,U+1)):(P.setStart(I,U-1),P.setEnd(I,U),G="right"),M=P.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),V=U[0],j=U[1],P=l.default.find(V,!0),N=P.offset(w.scroll);return j===0?N:P instanceof l.default.Container?N+P.length():N+P.index(V,j)}),C=Math.min(Math.max.apply(Math,g(I)),this.scroll.length()-1),F=Math.min.apply(Math,[C].concat(g(I)));return new x(F,C-F)}},{key:"normalizeNative",value:function(A){if(!E(this.root,A.startContainer)||!A.collapsed&&!E(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,V=w.scroll.leaf(F),j=s(V,2),P=j[0],N=j[1],k=P.position(N,D!==0),L=s(k,2);U=L[0],N=L[1],I.push(U,N)}),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 V=this.scroll.line(Math.min(w.index+w.length,I)),j=s(V,1);U=j[0]}if(!(D==null||U==null)){var P=A.getBoundingClientRect();S.top<P.top?A.scrollTop-=P.top-S.top:S.bottom>P.bottom&&(A.scrollTop+=S.bottom-P.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,g(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 V;(V=this.emitter).emit.apply(V,U)}}}}]),T}();function E(T,R){try{R.parentNode}catch{return!1}return R instanceof Text&&(R=R.parentNode),T.contains(R)}n.Range=x,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(m,b){for(var v=0;v<b.length;v++){var g=b[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,b,v){return b&&p(m.prototype,b),v&&p(m,v),m}}(),a=function p(m,b,v){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,b);if(g===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:p(_,b,v)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(v)}},o=i(0),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function u(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var d=function(p){u(m,p);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"insertInto",value:function(v,g){v.children.length===0?a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertInto",this).call(this,v,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),m}(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 m=c(p);d.insertBefore(m,d.children.head||void 0)}catch(b){if(b instanceof l.ParchmentError)return;throw b}})},u.prototype.deleteAt=function(d,p){if(d===0&&p===this.length())return this.remove();this.children.forEachAt(d,p,function(m,b,v){m.deleteAt(b,v)})},u.prototype.descendant=function(d,p){var m=this.children.find(p),b=m[0],v=m[1];return d.blotName==null&&d(b)||d.blotName!=null&&b instanceof d?[b,v]:b instanceof u?b.descendant(d,v):[null,-1]},u.prototype.descendants=function(d,p,m){p===void 0&&(p=0),m===void 0&&(m=Number.MAX_VALUE);var b=[],v=m;return this.children.forEachAt(p,m,function(g,_,y){(d.blotName==null&&d(g)||d.blotName!=null&&g instanceof d)&&b.push(g),g instanceof u&&(b=b.concat(g.descendants(d,_,v))),v-=y}),b},u.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),h.prototype.detach.call(this)},u.prototype.formatAt=function(d,p,m,b){this.children.forEachAt(d,p,function(v,g,_){v.formatAt(g,_,m,b)})},u.prototype.insertAt=function(d,p,m){var b=this.children.find(d),v=b[0],g=b[1];if(v)v.insertAt(g,p,m);else{var _=m==null?l.create("text",p):l.create(p,m);this.appendChild(_)}},u.prototype.insertBefore=function(d,p){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(m){return d instanceof m}))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(m){d.insertBefore(m,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 m=this.children.find(d,p),b=m[0],v=m[1],g=[[this,d]];return b instanceof u?g.concat(b.path(v,p)):(b!=null&&g.push([b,v]),g)},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 m=this.clone();return this.parent.insertBefore(m,this.next),this.children.forEachAt(d,this.length(),function(b,v,g){b=b.split(v,p),m.appendChild(b)}),m},u.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},u.prototype.update=function(d,p){var m=this,b=[],v=[];d.forEach(function(g){g.target===m.domNode&&g.type==="childList"&&(b.push.apply(b,g.addedNodes),v.push.apply(v,g.removedNodes))}),v.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var _=l.find(g);_!=null&&(_.domNode.parentNode==null||_.domNode.parentNode===m.domNode)&&_.detach()}}),b.filter(function(g){return g.parentNode==m.domNode}).sort(function(g,_){return g===_?0:g.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var _=null;g.nextSibling!=null&&(_=l.find(g.nextSibling));var y=c(g);(y.next!=_||y.next==null)&&(y.parent!=null&&y.parent.removeChild(m),m.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 m=f.query(d);m instanceof a.default?this.attributes.attribute(m,p):p&&m!=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 m=h.prototype.replaceWith.call(this,d,p);return this.attributes.copy(m),m},u.prototype.update=function(d,p){var m=this;h.prototype.update.call(this,d,p),d.some(function(b){return b.target===m.domNode&&b.type==="attributes"})&&this.attributes.build()},u.prototype.wrap=function(d,p){var m=h.prototype.wrap.call(this,d,p);return m instanceof u&&m.statics.scope===this.statics.scope&&this.attributes.move(m),m},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,m){return u[m]!=null&&(p[m]=u[m]),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(m,b){return b!=null&&m instanceof b}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(m,b,v,g,_){typeof b=="object"&&(v=b.depth,g=b.prototype,_=b.includeNonEnumerable,b=b.circular);var y=[],x=[],O=typeof Buffer<"u";typeof b>"u"&&(b=!0),typeof v>"u"&&(v=1/0);function E(T,R){if(T===null)return null;if(R===0)return T;var A,w;if(typeof T!="object")return T;if(s(T,a))A=new a;else if(s(T,o))A=new o;else if(s(T,l))A=new l(function(P,N){T.then(function(k){P(E(k,R-1))},function(k){N(E(k,R-1))})});else if(f.__isArray(T))A=[];else if(f.__isRegExp(T))A=new RegExp(T.source,p(T)),T.lastIndex&&(A.lastIndex=T.lastIndex);else if(f.__isDate(T))A=new Date(T.getTime());else{if(O&&Buffer.isBuffer(T))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(T.length):A=new Buffer(T.length),T.copy(A),A;s(T,Error)?A=Object.create(T):typeof g>"u"?(w=Object.getPrototypeOf(T),A=Object.create(w)):(A=Object.create(g),w=g)}if(b){var S=y.indexOf(T);if(S!=-1)return x[S];y.push(T),x.push(A)}s(T,a)&&T.forEach(function(P,N){var k=E(N,R-1),L=E(P,R-1);A.set(k,L)}),s(T,o)&&T.forEach(function(P){var N=E(P,R-1);A.add(N)});for(var I in T){var C;w&&(C=Object.getOwnPropertyDescriptor(w,I)),!(C&&C.set==null)&&(A[I]=E(T[I],R-1))}if(Object.getOwnPropertySymbols)for(var F=Object.getOwnPropertySymbols(T),I=0;I<F.length;I++){var D=F[I],U=Object.getOwnPropertyDescriptor(T,D);U&&!U.enumerable&&!_||(A[D]=E(T[D],R-1),U.enumerable||Object.defineProperty(A,D,{enumerable:!1}))}if(_)for(var V=Object.getOwnPropertyNames(T),I=0;I<V.length;I++){var j=V[I],U=Object.getOwnPropertyDescriptor(T,j);U&&U.enumerable||(A[j]=E(T[j],R-1),Object.defineProperty(A,j,{enumerable:!1}))}return A}return E(m,v)}f.clonePrototype=function(b){if(b===null)return null;var v=function(){};return v.prototype=b,new v};function c(m){return Object.prototype.toString.call(m)}f.__objToStr=c;function h(m){return typeof m=="object"&&c(m)==="[object Date]"}f.__isDate=h;function u(m){return typeof m=="object"&&c(m)==="[object Array]"}f.__isArray=u;function d(m){return typeof m=="object"&&c(m)==="[object RegExp]"}f.__isRegExp=d;function p(m){var b="";return m.global&&(b+="g"),m.ignoreCase&&(b+="i"),m.multiline&&(b+="m"),b}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](),V;!(C=(V=U.next()).done)&&(I.push(V.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),m=y(p),b=i(13),v=y(b),g=i(25),_=y(g);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 E(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 T(A){return A instanceof d.default||A instanceof u.BlockEmbed}var R=function(A){E(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],V=D[1],j=this.line(I+C),P=s(j,1),N=P[0];if(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"deleteAt",this).call(this,I,C),N!=null&&U!==N&&V>0){if(U instanceof u.BlockEmbed||N instanceof u.BlockEmbed){this.optimize();return}if(U instanceof v.default){var k=U.newlineIndex(U.length(),!0);if(k>-1&&(U=U.split(k+1),U===N)){this.optimize();return}}else if(N instanceof v.default){var L=N.newlineIndex(0);L>-1&&N.split(L+1)}var $=N.children.head instanceof m.default?null:N.children.head;U.moveChildren(N,$),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(T,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,V,j){var P=[],N=j;return U.children.forEachAt(V,j,function(k,L,$){T(k)?P.push(k):k instanceof f.default.Container&&(P=P.concat(D(k,L,N))),N-=$}),P};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);R.blotName="scroll",R.className="ql-editor",R.tagName="DIV",R.defaultChild="block",R.allowedChildren=[d.default,u.BlockEmbed,_.default],n.default=R},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=[],X=!0,K=!1,et=void 0;try{for(var nt=B[Symbol.iterator](),ot;!(X=(ot=nt.next()).done)&&(H.push(ot.value),!(q&&H.length===q));X=!0);}catch(ut){K=!0,et=ut}finally{try{!X&&nt.return&&nt.return()}finally{if(K)throw et}}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 X=q[H];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(B,X.key,X)}}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),m=A(p),b=i(20),v=A(b),g=i(0),_=A(g),y=i(5),x=A(y),O=i(10),E=A(O),T=i(9),R=A(T);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,E.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,X){return X=G(X),["altKey","ctrlKey","metaKey","shiftKey"].some(function(K){return!!X[K]!==H[K]&&X[K]!==null})?!1:X.key===(H.which||H.keyCode)}}]);function B(q,H){S(this,B);var X=I(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,q,H));return X.bindings={},Object.keys(X.options.bindings).forEach(function(K){K==="list autofill"&&q.scroll.whitelist!=null&&!q.scroll.whitelist.list||X.options.bindings[K]&&X.addBinding(X.options.bindings[K])}),X.addBinding({key:B.keys.ENTER,shiftKey:null},k),X.addBinding({key:B.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(X.addBinding({key:B.keys.BACKSPACE},{collapsed:!0},j),X.addBinding({key:B.keys.DELETE},{collapsed:!0},P)):(X.addBinding({key:B.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),X.addBinding({key:B.keys.DELETE},{collapsed:!0,suffix:/^.?$/},P)),X.addBinding({key:B.keys.BACKSPACE},{collapsed:!1},N),X.addBinding({key:B.keys.DELETE},{collapsed:!1},N),X.addBinding({key:B.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),X.listen(),X}return o(B,[{key:"addBinding",value:function(H){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},et=G(H);if(et==null||et.key==null)return F.warn("Attempted to add invalid keyboard binding",et);typeof X=="function"&&(X={handler:X}),typeof K=="function"&&(K={handler:K}),et=(0,d.default)(et,X,K),this.bindings[et.key]=this.bindings[et.key]||[],this.bindings[et.key].push(et)}},{key:"listen",value:function(){var H=this;this.quill.root.addEventListener("keydown",function(X){if(!X.defaultPrevented){var K=X.which||X.keyCode,et=(H.bindings[K]||[]).filter(function(Tt){return B.match(X,Tt)});if(et.length!==0){var nt=H.quill.getSelection();if(!(nt==null||!H.quill.hasFocus())){var ot=H.quill.getLine(nt.index),ut=a(ot,2),Nt=ut[0],Ot=ut[1],z=H.quill.getLeaf(nt.index),W=a(z,2),Q=W[0],tt=W[1],Y=nt.length===0?[Q,tt]:H.quill.getLeaf(nt.index+nt.length),ft=a(Y,2),Z=ft[0],st=ft[1],At=Q instanceof _.default.Text?Q.value().slice(0,tt):"",qt=Z instanceof _.default.Text?Z.value().slice(st):"",bt={collapsed:nt.length===0,empty:nt.length===0&&Nt.length()<=1,format:H.quill.getFormat(nt),offset:Ot,prefix:At,suffix:qt},Et=et.some(function(Tt){if(Tt.collapsed!=null&&Tt.collapsed!==bt.collapsed||Tt.empty!=null&&Tt.empty!==bt.empty||Tt.offset!=null&&Tt.offset!==bt.offset)return!1;if(Array.isArray(Tt.format)){if(Tt.format.every(function(Lt){return bt.format[Lt]==null}))return!1}else if(s(Tt.format)==="object"&&!Object.keys(Tt.format).every(function(Lt){return Tt.format[Lt]===!0?bt.format[Lt]!=null:Tt.format[Lt]===!1?bt.format[Lt]==null:(0,h.default)(Tt.format[Lt],bt.format[Lt])}))return!1;return Tt.prefix!=null&&!Tt.prefix.test(bt.prefix)||Tt.suffix!=null&&!Tt.suffix.test(bt.suffix)?!1:Tt.handler.call(H,nt,bt)!==!0});Et&&X.preventDefault()}}}})}}]),B}(R.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 m.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),X=H[0],K=H[1],et=(0,d.default)({},X.formats(),{list:"checked"}),nt=new m.default().retain(B.index).insert(`
577
+ `,et).retain(X.length()-K-1).retain(1,{list:"unchecked"});this.quill.updateContents(nt,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),X=a(H,2),K=X[0],et=X[1],nt=new m.default().retain(B.index).insert(`
578
+ `,q.format).retain(K.length()-et-1).retain(1,{header:null});this.quill.updateContents(nt,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,X=this.quill.getLine(B.index),K=a(X,2),et=K[0],nt=K[1];if(nt>H)return!0;var ot=void 0;switch(q.prefix.trim()){case"[]":case"[ ]":ot="unchecked";break;case"[x]":ot="checked";break;case"-":case"*":ot="bullet";break;default:ot="ordered"}this.quill.insertText(B.index," ",x.default.sources.USER),this.quill.history.cutoff();var ut=new m.default().retain(B.index-nt).delete(H+1).retain(et.length()-2-nt).retain(1,{list:ot});this.quill.updateContents(ut,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),X=H[0],K=H[1],et=new m.default().retain(B.index+X.length()-K-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(et,x.default.sources.USER)}},"embed left":V(U.keys.LEFT,!1),"embed left shift":V(U.keys.LEFT,!0),"embed right":V(U.keys.RIGHT,!1),"embed right shift":V(U.keys.RIGHT,!0)}};function V(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(K){var et=K.index;M===U.keys.RIGHT&&(et+=K.length+1);var nt=this.quill.getLeaf(et),ot=a(nt,1),ut=ot[0];return ut instanceof _.default.Embed?(M===U.keys.LEFT?B?this.quill.setSelection(K.index-1,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index-1,x.default.sources.USER):B?this.quill.setSelection(K.index,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index+K.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),X=H[0],K={};if(B.offset===0){var et=this.quill.getLine(M.index-1),nt=a(et,1),ot=nt[0];if(ot!=null&&ot.length()>1){var ut=X.formats(),Nt=this.quill.getFormat(M.index-1,1);K=v.default.attributes.diff(ut,Nt)||{}}}var Ot=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(B.prefix)?2:1;this.quill.deleteText(M.index-Ot,Ot,x.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine(M.index-Ot,Ot,K,x.default.sources.USER),this.quill.focus()}}function P(M,B){var q=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(B.suffix)?2:1;if(!(M.index>=this.quill.getLength()-q)){var H={},X=0,K=this.quill.getLine(M.index),et=a(K,1),nt=et[0];if(B.offset>=nt.length()-1){var ot=this.quill.getLine(M.index+1),ut=a(ot,1),Nt=ut[0];if(Nt){var Ot=nt.formats(),z=this.quill.getFormat(M.index,1);H=v.default.attributes.diff(Ot,z)||{},X=Nt.length()}}this.quill.deleteText(M.index,q,x.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(M.index+X-1,q,H,x.default.sources.USER)}}function N(M){var B=this.quill.getLines(M),q={};if(B.length>1){var H=B[0].formats(),X=B[B.length-1].formats();q=v.default.attributes.diff(X,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 k(M,B){var q=this;M.length>0&&this.quill.scroll.deleteAt(M.index,M.length);var H=Object.keys(B.format).reduce(function(X,K){return _.default.query(K,_.default.Scope.BLOCK)&&!Array.isArray(B.format[K])&&(X[K]=B.format[K]),X},{});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(X){H[X]==null&&(Array.isArray(B.format[X])||X!=="link"&&q.quill.format(X,B.format[X],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"),X=q.index,K=q.length,et=this.quill.scroll.descendant(H,X),nt=a(et,2),ot=nt[0],ut=nt[1];if(ot!=null){var Nt=this.quill.getIndex(ot),Ot=ot.newlineIndex(ut,!0)+1,z=ot.newlineIndex(Nt+ut+K),W=ot.domNode.textContent.slice(Ot,z).split(`
580
+ `);ut=0,W.forEach(function(Q,tt){M?(ot.insertAt(Ot+ut,H.TAB),ut+=H.TAB.length,tt===0?X+=H.TAB.length:K+=H.TAB.length):Q.startsWith(H.TAB)&&(ot.deleteAt(Ot+ut,H.TAB.length),ut-=H.TAB.length,tt===0?X-=H.TAB.length:K-=H.TAB.length),ut+=Q.length+1}),this.quill.update(x.default.sources.USER),this.quill.setSelection(X,K,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 v(g,_){var y=[],x=!0,O=!1,E=void 0;try{for(var T=g[Symbol.iterator](),R;!(x=(R=T.next()).done)&&(y.push(R.value),!(_&&y.length===_));x=!0);}catch(A){O=!0,E=A}finally{try{!x&&T.return&&T.return()}finally{if(O)throw E}}return y}return function(g,_){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return v(g,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function v(g,_,y){g===null&&(g=Function.prototype);var x=Object.getOwnPropertyDescriptor(g,_);if(x===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:v(O,_,y)}else{if("value"in x)return x.value;var E=x.get;return E===void 0?void 0:E.call(y)}},o=function(){function v(g,_){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(g,x.key,x)}}return function(g,_,y){return _&&v(g.prototype,_),y&&v(g,y),g}}(),l=i(0),f=u(l),c=i(7),h=u(c);function u(v){return v&&v.__esModule?v:{default:v}}function d(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function p(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 m(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 b=function(v){m(g,v),o(g,null,[{key:"value",value:function(){}}]);function g(_,y){d(this,g);var x=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,_));return x.selection=y,x.textNode=document.createTextNode(g.CONTENTS),x.domNode.appendChild(x.textNode),x._length=0,x}return o(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(y,x){if(this._length!==0)return a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,y,x);for(var O=this,E=0;O!=null&&O.statics.scope!==f.default.Scope.BLOCK_BLOT;)E+=O.offset(O.parent),O=O.parent;O!=null&&(this._length=g.CONTENTS.length,O.optimize(),O.formatAt(E,g.CONTENTS.length,y,x),this._length=0)}},{key:"index",value:function(y,x){return y===this.textNode?0:a(g.prototype.__proto__||Object.getPrototypeOf(g.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(g.prototype.__proto__||Object.getPrototypeOf(g.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,E=void 0,T=void 0;if(x!=null&&x.start.node===y&&x.end.node===y){var R=[y,x.start.offset,x.end.offset];O=R[0],E=R[1],T=R[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==g.CONTENTS){var A=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof h.default?(O=this.next.domNode,this.next.insertAt(0,A),this.textNode.data=g.CONTENTS):(this.textNode.data=A,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),E!=null){var w=[E,T].map(function(I){return Math.max(0,Math.min(O.data.length,I-1))}),S=s(w,2);return E=S[0],T=S[1],{startNode:O,startOffset:E,endNode:O,endOffset:T}}}}},{key:"update",value:function(y,x){var O=this;if(y.some(function(T){return T.type==="characterData"&&T.target===O.textNode})){var E=this.restore();E&&(x.range=E)}}},{key:"value",value:function(){return""}}]),g}(f.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",n.default=b},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,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function u(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var d=function(p){u(m,p);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(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 b(v,g){for(var _=0;_<g.length;_++){var y=g[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,g,_){return g&&b(v.prototype,g),_&&b(v,_),v}}(),a=function b(v,g,_){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,g);if(y===void 0){var x=Object.getPrototypeOf(v);return x===null?void 0:b(x,g,_)}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(b){return b&&b.__esModule?b:{default:b}}function c(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function h(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function u(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var d=function(b){u(v,b);function v(){return c(this,v),h(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"value",value:function(_){var y=a(v.prototype.__proto__||Object.getPrototypeOf(v.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}}]),v}(l.default.Attributor.Style),p=new l.default.Attributor.Class("color","ql-color",{scope:l.default.Scope.INLINE}),m=new d("color","color",{scope:l.default.Scope.INLINE});n.ColorAttributor=d,n.ColorClass=p,n.ColorStyle=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var s=function(){function m(b,v){for(var g=0;g<v.length;g++){var _=v[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,_.key,_)}}return function(b,v,g){return v&&m(b.prototype,v),g&&m(b,g),b}}(),a=function m(b,v,g){b===null&&(b=Function.prototype);var _=Object.getOwnPropertyDescriptor(b,v);if(_===void 0){var y=Object.getPrototypeOf(b);return y===null?void 0:m(y,v,g)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(g)}},o=i(6),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=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:"format",value:function(g,_){if(g!==this.statics.blotName||!_)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,g,_);_=this.constructor.sanitize(_),this.domNode.setAttribute("href",_)}}],[{key:"create",value:function(g){var _=a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,g);return g=this.sanitize(g),_.setAttribute("href",g),_.setAttribute("rel","noopener noreferrer"),_.setAttribute("target","_blank"),_}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return p(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),b}(l.default);d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function p(m,b){var v=document.createElement("a");v.href=m;var g=v.href.slice(0,v.href.indexOf(":"));return b.indexOf(g)>-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(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},a=function(){function b(v,g){for(var _=0;_<g.length;_++){var y=g[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,g,_){return g&&b(v.prototype,g),_&&b(v,_),v}}(),o=i(23),l=h(o),f=i(107),c=h(f);function h(b){return b&&b.__esModule?b:{default:b}}function u(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}var d=0;function p(b,v){b.setAttribute(v,b.getAttribute(v)!=="true")}var m=function(){function b(v){var g=this;u(this,b),this.select=v,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(){g.togglePicker()}),this.label.addEventListener("keydown",function(_){switch(_.keyCode){case l.default.keys.ENTER:g.togglePicker();break;case l.default.keys.ESCAPE:g.escape(),_.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),p(this.label,"aria-expanded"),p(this.options,"aria-hidden")}},{key:"buildItem",value:function(g){var _=this,y=document.createElement("span");return y.tabIndex="0",y.setAttribute("role","button"),y.classList.add("ql-picker-item"),g.hasAttribute("value")&&y.setAttribute("data-value",g.getAttribute("value")),g.textContent&&y.setAttribute("data-label",g.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 g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=c.default,g.tabIndex="0",g.setAttribute("role","button"),g.setAttribute("aria-expanded","false"),this.container.appendChild(g),g}},{key:"buildOptions",value:function(){var g=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=g.buildItem(y);_.appendChild(x),y.selected===!0&&g.selectItem(x)}),this.container.appendChild(_)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(_){g.container.setAttribute(_.name,_.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var g=this;this.close(),setTimeout(function(){return g.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(g){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=this.container.querySelector(".ql-selected");if(g!==y&&(y!=null&&y.classList.remove("ql-selected"),g!=null&&(g.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(g.parentNode.children,g),g.hasAttribute("data-value")?this.label.setAttribute("data-value",g.getAttribute("data-value")):this.label.removeAttribute("data-value"),g.hasAttribute("data-label")?this.label.setAttribute("data-label",g.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 g=void 0;if(this.select.selectedIndex>-1){var _=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(_)}else this.selectItem(null);var y=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",y)}}]),b}();n.default=m},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),m=i(24),b=F(m),v=i(35),g=F(v),_=i(6),y=F(_),x=i(22),O=F(x),E=i(7),T=F(E),R=i(55),A=F(R),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":b.default,"blots/embed":g.default,"blots/inline":y.default,"blots/scroll":O.default,"blots/text":T.default,"modules/clipboard":A.default,"modules/history":S.default,"modules/keyboard":C.default}),a.default.register(c.default,u.default,b.default,y.default,O.default,T.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(m){var b=l.query(m,l.Scope.ATTRIBUTE);b instanceof s.default&&(h.attributes[b.attrName]=b)})},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 v(g,_){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(g,x.key,x)}}return function(g,_,y){return _&&v(g.prototype,_),y&&v(g,y),g}}(),a=function v(g,_,y){g===null&&(g=Function.prototype);var x=Object.getOwnPropertyDescriptor(g,_);if(x===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:v(O,_,y)}else{if("value"in x)return x.value;var E=x.get;return E===void 0?void 0:E.call(y)}},o=i(0),l=h(o),f=i(7),c=h(f);function h(v){return v&&v.__esModule?v:{default:v}}function u(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function d(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 p(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 m="\uFEFF",b=function(v){p(g,v);function g(_){u(this,g);var y=d(this,(g.__proto__||Object.getPrototypeOf(g)).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(m),y.rightGuard=document.createTextNode(m),y.domNode.appendChild(y.leftGuard),y.domNode.appendChild(y.contentNode),y.domNode.appendChild(y.rightGuard),y}return s(g,[{key:"index",value:function(y,x){return y===this.leftGuard?0:y===this.rightGuard?1:a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,y,x)}},{key:"restore",value:function(y){var x=void 0,O=void 0,E=y.data.split(m).join("");if(y===this.leftGuard)if(this.prev instanceof c.default){var T=this.prev.length();this.prev.insertAt(T,E),x={startNode:this.prev.domNode,startOffset:T+E.length}}else O=document.createTextNode(E),this.parent.insertBefore(l.default.create(O),this),x={startNode:O,startOffset:E.length};else y===this.rightGuard&&(this.next instanceof c.default?(this.next.insertAt(0,E),x={startNode:this.next.domNode,startOffset:E.length}):(O=document.createTextNode(E),this.parent.insertBefore(l.default.create(O),this.next),x={startNode:O,startOffset:E.length}));return y.data=m,x}},{key:"update",value:function(y,x){var O=this;y.forEach(function(E){if(E.type==="characterData"&&(E.target===O.leftGuard||E.target===O.rightGuard)){var T=O.restore(E.target);T&&(x.range=T)}})}}]),g}(l.default.Embed);n.default=b},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 v(g,_){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(g,x.key,x)}}return function(g,_,y){return _&&v(g.prototype,_),y&&v(g,y),g}}(),a=function v(g,_,y){g===null&&(g=Function.prototype);var x=Object.getOwnPropertyDescriptor(g,_);if(x===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:v(O,_,y)}else{if("value"in x)return x.value;var E=x.get;return E===void 0?void 0:E.call(y)}},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={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},p=new l.default.Attributor.Class("font","ql-font",d),m=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:"value",value:function(y){return a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,y).replace(/["']/g,"")}}]),g}(l.default.Attributor.Style),b=new m("font","font-family",d);n.FontStyle=b,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 E=x[O];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(y,E.key,E)}}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 m(_,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 b=function(_){m(y,_);function y(x,O){d(this,y);var E=p(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,x,O));return E.lastRecorded=0,E.ignoreChange=!1,E.clear(),E.quill.on(f.default.events.EDITOR_CHANGE,function(T,R,A,w){T!==f.default.events.TEXT_CHANGE||E.ignoreChange||(!E.options.userOnly||w===f.default.sources.USER?E.record(R,A):E.transform(R))}),E.quill.keyboard.addBinding({key:"Z",shortKey:!0},E.undo.bind(E)),E.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},E.redo.bind(E)),/Win/i.test(navigator.platform)&&E.quill.keyboard.addBinding({key:"Y",shortKey:!0},E.redo.bind(E)),E}return s(y,[{key:"change",value:function(O,E){if(this.stack[O].length!==0){var T=this.stack[O].pop();this.stack[E].push(T),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(T[O],f.default.sources.USER),this.ignoreChange=!1;var R=g(T[O]);this.quill.setSelection(R)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(O,E){if(O.ops.length!==0){this.stack.redo=[];var T=this.quill.getContents().diff(E),R=Date.now();if(this.lastRecorded+this.options.delay>R&&this.stack.undo.length>0){var A=this.stack.undo.pop();T=T.compose(A.undo),O=A.redo.compose(O)}else this.lastRecorded=R;this.stack.undo.push({redo:O,undo:T}),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(E){E.undo=O.transform(E.undo,!0),E.redo=O.transform(E.redo,!0)}),this.stack.redo.forEach(function(E){E.undo=O.transform(E.undo,!0),E.redo=O.transform(E.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),y}(h.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function v(_){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 g(_){var y=_.reduce(function(O,E){return O+=E.delete||0,O},0),x=_.length()-y;return v(_)&&(x-=1),x}n.default=b,n.getLastChangeIndex=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var s=function(){function k(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 $&&k(L.prototype,$),G&&k(L,G),L}}(),a=function k(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:k(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=R(o),f=i(2),c=R(f),h=i(8),u=R(h),d=i(23),p=R(d),m=i(34),b=R(m),v=i(59),g=R(v),_=i(60),y=R(_),x=i(28),O=R(x),E=i(61),T=R(E);function R(k){return k&&k.__esModule?k:{default:k}}function A(k,L){if(!(k instanceof L))throw new TypeError("Cannot call a class as a function")}function w(k,L){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:k}function S(k,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);k.prototype=Object.create(L&&L.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(k,L):k.__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"],V=function(k){S(L,k);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(X){X.container.contains(H.target)||X.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 X=B.value||"";X!=null&&M[H][X]&&(B.innerHTML=M[H][X])}})})}},{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&&N(H,I),new y.default(H,M.align);if(H.classList.contains("ql-background")||H.classList.contains("ql-color")){var X=H.classList.contains("ql-background")?"background":"color";return H.querySelector("option")==null&&N(H,C,X==="background"?"#ffffff":"#000000"),new g.default(H,M[X])}else return H.querySelector("option")==null&&(H.classList.contains("ql-font")?N(H,F):H.classList.contains("ql-header")?N(H,D):H.classList.contains("ql-size")&&N(H,U)),new O.default(H)});var q=function(){B.pickers.forEach(function(X){X.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,q)}}]),L}(b.default);V.DEFAULTS=(0,l.default)(!0,{},b.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(k){S(L,k);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=P(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}(T.default);function P(k){var L=k.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||k.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return L?(L[1]||"https")+"://www.youtube.com/embed/"+L[2]+"?showinfo=0":(L=k.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(L[1]||"https")+"://player.vimeo.com/video/"+L[2]+"/":k}function N(k,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),k.appendChild(M)})}n.BaseTooltip=j,n.default=V},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,m=this.iterator(h);(d=m())&&p<o+l;){var b=d.length();o>p?f(d,o-p,Math.min(l,p+b-o)):f(d,0,Math.min(b,o+l-p)),p+=b}},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(m){p.update(m)}),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(m){m.remove()}):h.prototype.deleteAt.call(this,d,p)},u.prototype.formatAt=function(d,p,m,b){this.update(),h.prototype.formatAt.call(this,d,p,m,b)},u.prototype.insertAt=function(d,p,m){this.update(),h.prototype.insertAt.call(this,d,p,m)},u.prototype.optimize=function(d,p){var m=this;d===void 0&&(d=[]),p===void 0&&(p={}),h.prototype.optimize.call(this,p);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)d.push(b.pop());for(var v=function(x,O){O===void 0&&(O=!0),!(x==null||x===m)&&x.domNode.parentNode!=null&&(x.domNode[o.DATA_KEY].mutations==null&&(x.domNode[o.DATA_KEY].mutations=[]),O&&v(x.parent))},g=function(x){x.domNode[o.DATA_KEY]==null||x.domNode[o.DATA_KEY].mutations==null||(x instanceof a.default&&x.children.forEach(g),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"?(v(o.find(x.previousSibling,!1)),[].forEach.call(x.addedNodes,function(E){var T=o.find(E,!1);v(T,!1),T instanceof a.default&&T.children.forEach(function(R){v(R,!1)})})):x.type==="attributes"&&v(O.prev)),v(O))}),this.children.forEach(g),_=[].slice.call(this.observer.takeRecords()),b=_.slice();b.length>0;)d.push(b.pop())}},u.prototype.update=function(d,p){var m=this;p===void 0&&(p={}),d=d||this.observer.takeRecords(),d.map(function(b){var v=o.find(b.target,!0);return v==null?null:v.domNode[o.DATA_KEY].mutations==null?(v.domNode[o.DATA_KEY].mutations=[b],v):(v.domNode[o.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===m||b.domNode[o.DATA_KEY]==null||b.update(b.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(m){m instanceof a.default||(m=m.wrap(h.blotName,!0)),p.attributes.copy(m)}),this.unwrap()):c.prototype.format.call(this,u,d)},h.prototype.formatAt=function(u,d,p,m){if(this.formats()[p]!=null||o.query(p,o.Scope.ATTRIBUTE)){var b=this.isolate(u,d);b.format(p,m)}else c.prototype.formatAt.call(this,u,d,p,m)},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),m=o.create(u,d);p.parent.insertBefore(m,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 E=h(y,x),T=y.substring(0,E);y=y.substring(E),x=x.substring(E),E=u(y,x);var R=y.substring(y.length-E);y=y.substring(0,y.length-E),x=x.substring(0,x.length-E);var A=l(y,x);return T&&A.unshift([a,T]),R&&A.push([a,R]),p(A),O!=null&&(A=v(A,O)),A=g(A),A}function l(y,x){var O;if(!y)return[[s,x]];if(!x)return[[i,y]];var E=y.length>x.length?y:x,T=y.length>x.length?x:y,R=E.indexOf(T);if(R!=-1)return O=[[s,E.substring(0,R)],[a,T],[s,E.substring(R+T.length)]],y.length>x.length&&(O[0][0]=O[2][0]=i),O;if(T.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,E=x.length,T=Math.ceil((O+E)/2),R=T,A=2*T,w=new Array(A),S=new Array(A),I=0;I<A;I++)w[I]=-1,S[I]=-1;w[R+1]=0,S[R+1]=0;for(var C=O-E,F=C%2!=0,D=0,U=0,V=0,j=0,P=0;P<T;P++){for(var N=-P+D;N<=P-U;N+=2){var k=R+N,L;N==-P||N!=P&&w[k-1]<w[k+1]?L=w[k+1]:L=w[k-1]+1;for(var $=L-N;L<O&&$<E&&y.charAt(L)==x.charAt($);)L++,$++;if(w[k]=L,L>O)U+=2;else if($>E)D+=2;else if(F){var G=R+C-N;if(G>=0&&G<A&&S[G]!=-1){var M=O-S[G];if(L>=M)return c(y,x,L,$)}}}for(var B=-P+V;B<=P-j;B+=2){var G=R+B,M;B==-P||B!=P&&S[G-1]<S[G+1]?M=S[G+1]:M=S[G-1]+1;for(var q=M-B;M<O&&q<E&&y.charAt(O-M-1)==x.charAt(E-q-1);)M++,q++;if(S[G]=M,M>O)j+=2;else if(q>E)V+=2;else if(!F){var k=R+C-B;if(k>=0&&k<A&&w[k]!=-1){var L=w[k],$=R+L-k;if(M=O-M,L>=M)return c(y,x,L,$)}}}}return[[i,y],[s,x]]}function c(y,x,O,E){var T=y.substring(0,O),R=x.substring(0,E),A=y.substring(O),w=x.substring(E),S=o(T,R),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,E=Math.min(y.length,x.length),T=E,R=0;O<T;)y.substring(R,T)==x.substring(R,T)?(O=T,R=O):E=T,T=Math.floor((E-O)/2+O);return T}function u(y,x){if(!y||!x||y.charAt(y.length-1)!=x.charAt(x.length-1))return 0;for(var O=0,E=Math.min(y.length,x.length),T=E,R=0;O<T;)y.substring(y.length-T,y.length-R)==x.substring(x.length-T,x.length-R)?(O=T,R=O):E=T,T=Math.floor((E-O)/2+O);return T}function d(y,x){var O=y.length>x.length?y:x,E=y.length>x.length?x:y;if(O.length<4||E.length*2<O.length)return null;function T(U,V,j){for(var P=U.substring(j,j+Math.floor(U.length/4)),N=-1,k="",L,$,G,M;(N=V.indexOf(P,N+1))!=-1;){var B=h(U.substring(j),V.substring(N)),q=u(U.substring(0,j),V.substring(0,N));k.length<q+B&&(k=V.substring(N-q,N)+V.substring(N,N+B),L=U.substring(0,j-q),$=U.substring(j+B),G=V.substring(0,N-q),M=V.substring(N+B))}return k.length*2>=U.length?[L,$,G,M,k]:null}var R=T(O,E,Math.ceil(O.length/4)),A=T(O,E,Math.ceil(O.length/2)),w;if(!R&&!A)return null;A?R?w=R[4].length>A[4].length?R:A:w=A:w=R;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,E=0,T="",R="",A;x<y.length;)switch(y[x][0]){case s:E++,R+=y[x][1],x++;break;case i:O++,T+=y[x][1],x++;break;case a:O+E>1?(O!==0&&E!==0&&(A=h(R,T),A!==0&&(x-O-E>0&&y[x-O-E-1][0]==a?y[x-O-E-1][1]+=R.substring(0,A):(y.splice(0,0,[a,R.substring(0,A)]),x++),R=R.substring(A),T=T.substring(A)),A=u(R,T),A!==0&&(y[x][1]=R.substring(R.length-A)+y[x][1],R=R.substring(0,R.length-A),T=T.substring(0,T.length-A))),O===0?y.splice(x-E,O+E,[s,R]):E===0?y.splice(x-O,O+E,[i,T]):y.splice(x-O-E,O+E,[i,T],[s,R]),x=x-O-E+(O?1:0)+(E?1:0)+1):x!==0&&y[x-1][0]==a?(y[x-1][1]+=y[x][1],y.splice(x,1)):x++,E=0,O=0,T="",R="";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 m=o;m.INSERT=s,m.DELETE=i,m.EQUAL=a,r.exports=m;function b(y,x){if(x===0)return[a,y];for(var O=0,E=0;E<y.length;E++){var T=y[E];if(T[0]===i||T[0]===a){var R=O+T[1].length;if(x===R)return[E+1,y];if(x<R){y=y.slice();var A=x-O,w=[T[0],T[1].slice(0,A)],S=[T[0],T[1].slice(A)];return y.splice(E,1,w,S),[E+1,y]}else O=R}}throw new Error("cursor_pos is out of bounds!")}function v(y,x){var O=b(y,x),E=O[1],T=O[0],R=E[T],A=E[T+1];if(R==null)return y;if(R[0]!==a)return y;if(A!=null&&R[1]+A[1]===A[1]+R[1])return E.splice(T,2,A,R),_(E,T,2);if(A!=null&&A[1].indexOf(R[1])===0){E.splice(T,2,[A[0],R[1]],[0,R[1]]);var w=A[1].slice(R[1].length);return w.length>0&&E.splice(T+2,0,[A[0],w]),_(E,T,3)}else return y}function g(y){for(var x=!1,O=function(A){return A.charCodeAt(0)>=56320&&A.charCodeAt(0)<=57343},E=function(A){return A.charCodeAt(A.length-1)>=55296&&A.charCodeAt(A.length-1)<=56319},T=2;T<y.length;T+=1)y[T-2][0]===a&&E(y[T-2][1])&&y[T-1][0]===i&&O(y[T-1][1])&&y[T][0]===s&&O(y[T][1])&&(x=!0,y[T-1][1]=y[T-2][1].slice(-1)+y[T-1][1],y[T][1]=y[T-2][1].slice(-1)+y[T][1],y[T-2][1]=y[T-2][1].slice(0,-1));if(!x)return y;for(var R=[],T=0;T<y.length;T+=1)y[T][1].length>0&&R.push(y[T]);return R}function _(y,x,O){for(var E=x+O-1;E>=0&&E>=x-1;E--)if(E+1<y.length){var T=y[E],R=y[E+1];T[0]===R[1]&&y.splice(E,2,[T[0],T[1]+R[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,m=d.length,b=new Array(m);p<m;p++)b[p]=d[p].fn;return b},l.prototype.emit=function(c,h,u,d,p,m){var b=s?s+c:c;if(!this._events[b])return!1;var v=this._events[b],g=arguments.length,_,y;if(v.fn){switch(v.once&&this.removeListener(c,v.fn,void 0,!0),g){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,h),!0;case 3:return v.fn.call(v.context,h,u),!0;case 4:return v.fn.call(v.context,h,u,d),!0;case 5:return v.fn.call(v.context,h,u,d,p),!0;case 6:return v.fn.call(v.context,h,u,d,p,m),!0}for(y=1,_=new Array(g-1);y<g;y++)_[y-1]=arguments[y];v.fn.apply(v.context,_)}else{var x=v.length,O;for(y=0;y<x;y++)switch(v[y].once&&this.removeListener(c,v[y].fn,void 0,!0),g){case 1:v[y].fn.call(v[y].context);break;case 2:v[y].fn.call(v[y].context,h);break;case 3:v[y].fn.call(v[y].context,h,u);break;case 4:v[y].fn.call(v[y].context,h,u,d);break;default:if(!_)for(O=1,_=new Array(g-1);O<g;O++)_[O-1]=arguments[O];v[y].fn.apply(v[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 m=this._events[p];if(m.fn)m.fn===h&&(!d||m.once)&&(!u||m.context===u)&&(--this._eventsCount===0?this._events=new a:delete this._events[p]);else{for(var b=0,v=[],g=m.length;b<g;b++)(m[b].fn!==h||d&&!m[b].once||u&&m[b].context!==u)&&v.push(m[b]);v.length?this._events[p]=v.length===1?v[0]:v:--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(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},a=function(){function z(W,Q){var tt=[],Y=!0,ft=!1,Z=void 0;try{for(var st=W[Symbol.iterator](),At;!(Y=(At=st.next()).done)&&(tt.push(At.value),!(Q&&tt.length===Q));Y=!0);}catch(qt){ft=!0,Z=qt}finally{try{!Y&&st.return&&st.return()}finally{if(ft)throw Z}}return tt}return function(W,Q){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return z(W,Q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function z(W,Q){for(var tt=0;tt<Q.length;tt++){var Y=Q[tt];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(W,Y.key,Y)}}return function(W,Q,tt){return Q&&z(W.prototype,Q),tt&&z(W,tt),W}}(),l=i(3),f=S(l),c=i(2),h=S(c),u=i(0),d=S(u),p=i(5),m=S(p),b=i(10),v=S(b),g=i(9),_=S(g),y=i(36),x=i(37),O=i(13),E=S(O),T=i(26),R=i(38),A=i(39),w=i(40);function S(z){return z&&z.__esModule?z:{default:z}}function I(z,W,Q){return W in z?Object.defineProperty(z,W,{value:Q,enumerable:!0,configurable:!0,writable:!0}):z[W]=Q,z}function C(z,W){if(!(z instanceof W))throw new TypeError("Cannot call a class as a function")}function F(z,W){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W&&(typeof W=="object"||typeof W=="function")?W:z}function D(z,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof W);z.prototype=Object.create(W&&W.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),W&&(Object.setPrototypeOf?Object.setPrototypeOf(z,W):z.__proto__=W)}var U=(0,v.default)("quill:clipboard"),V="__ql-matcher",j=[[Node.TEXT_NODE,Ot],[Node.TEXT_NODE,ot],["br",K],[Node.ELEMENT_NODE,ot],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,ut],[Node.ELEMENT_NODE,H],[Node.ELEMENT_NODE,Nt],["li",nt],["b",q.bind(q,"bold")],["i",q.bind(q,"italic")],["style",et]],P=[y.AlignAttribute,R.DirectionAttribute].reduce(function(z,W){return z[W.keyName]=W,z},{}),N=[y.AlignStyle,x.BackgroundStyle,T.ColorStyle,R.DirectionStyle,A.FontStyle,w.SizeStyle].reduce(function(z,W){return z[W.keyName]=W,z},{}),k=function(z){D(W,z);function W(Q,tt){C(this,W);var Y=F(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,Q,tt));return Y.quill.root.addEventListener("paste",Y.onPaste.bind(Y)),Y.container=Y.quill.addContainer("ql-clipboard"),Y.container.setAttribute("contenteditable",!0),Y.container.setAttribute("tabindex",-1),Y.matchers=[],j.concat(Y.options.matchers).forEach(function(ft){var Z=a(ft,2),st=Z[0],At=Z[1];!tt.matchVisual&&At===ut||Y.addMatcher(st,At)}),Y}return o(W,[{key:"addMatcher",value:function(tt,Y){this.matchers.push([tt,Y])}},{key:"convert",value:function(tt){if(typeof tt=="string")return this.container.innerHTML=tt.replace(/\>\r?\n +\</g,"><"),this.convert();var Y=this.quill.getFormat(this.quill.selection.savedRange.index);if(Y[E.default.blotName]){var ft=this.container.innerText;return this.container.innerHTML="",new h.default().insert(ft,I({},E.default.blotName,Y[E.default.blotName]))}var Z=this.prepareMatching(),st=a(Z,2),At=st[0],qt=st[1],bt=B(this.container,At,qt);return G(bt,`
582
+ `)&&bt.ops[bt.ops.length-1].attributes==null&&(bt=bt.compose(new h.default().retain(bt.length()-1).delete(1))),U.log("convert",this.container.innerHTML,bt),this.container.innerHTML="",bt}},{key:"dangerouslyPasteHTML",value:function(tt,Y){var ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;if(typeof tt=="string")this.quill.setContents(this.convert(tt),Y),this.quill.setSelection(0,m.default.sources.SILENT);else{var Z=this.convert(Y);this.quill.updateContents(new h.default().retain(tt).concat(Z),ft),this.quill.setSelection(tt+Z.length(),m.default.sources.SILENT)}}},{key:"onPaste",value:function(tt){var Y=this;if(!(tt.defaultPrevented||!this.quill.isEnabled())){var ft=this.quill.getSelection(),Z=new h.default().retain(ft.index),st=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(m.default.sources.SILENT),setTimeout(function(){Z=Z.concat(Y.convert()).delete(ft.length),Y.quill.updateContents(Z,m.default.sources.USER),Y.quill.setSelection(Z.length()-ft.length,m.default.sources.SILENT),Y.quill.scrollingContainer.scrollTop=st,Y.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var tt=this,Y=[],ft=[];return this.matchers.forEach(function(Z){var st=a(Z,2),At=st[0],qt=st[1];switch(At){case Node.TEXT_NODE:ft.push(qt);break;case Node.ELEMENT_NODE:Y.push(qt);break;default:[].forEach.call(tt.container.querySelectorAll(At),function(bt){bt[V]=bt[V]||[],bt[V].push(qt)});break}}),[Y,ft]}}]),W}(_.default);k.DEFAULTS={matchers:[],matchVisual:!0};function L(z,W,Q){return(typeof W>"u"?"undefined":s(W))==="object"?Object.keys(W).reduce(function(tt,Y){return L(tt,Y,W[Y])},z):z.reduce(function(tt,Y){return Y.attributes&&Y.attributes[W]?tt.push(Y):tt.insert(Y.insert,(0,f.default)({},I({},W,Q),Y.attributes))},new h.default)}function $(z){if(z.nodeType!==Node.ELEMENT_NODE)return{};var W="__ql-computed-style";return z[W]||(z[W]=window.getComputedStyle(z))}function G(z,W){for(var Q="",tt=z.ops.length-1;tt>=0&&Q.length<W.length;--tt){var Y=z.ops[tt];if(typeof Y.insert!="string")break;Q=Y.insert+Q}return Q.slice(-1*W.length)===W}function M(z){if(z.childNodes.length===0)return!1;var W=$(z);return["block","list-item"].indexOf(W.display)>-1}function B(z,W,Q){return z.nodeType===z.TEXT_NODE?Q.reduce(function(tt,Y){return Y(z,tt)},new h.default):z.nodeType===z.ELEMENT_NODE?[].reduce.call(z.childNodes||[],function(tt,Y){var ft=B(Y,W,Q);return Y.nodeType===z.ELEMENT_NODE&&(ft=W.reduce(function(Z,st){return st(Y,Z)},ft),ft=(Y[V]||[]).reduce(function(Z,st){return st(Y,Z)},ft)),tt.concat(ft)},new h.default):new h.default}function q(z,W,Q){return L(Q,z,!0)}function H(z,W){var Q=d.default.Attributor.Attribute.keys(z),tt=d.default.Attributor.Class.keys(z),Y=d.default.Attributor.Style.keys(z),ft={};return Q.concat(tt).concat(Y).forEach(function(Z){var st=d.default.query(Z,d.default.Scope.ATTRIBUTE);st!=null&&(ft[st.attrName]=st.value(z),ft[st.attrName])||(st=P[Z],st!=null&&(st.attrName===Z||st.keyName===Z)&&(ft[st.attrName]=st.value(z)||void 0),st=N[Z],st!=null&&(st.attrName===Z||st.keyName===Z)&&(st=N[Z],ft[st.attrName]=st.value(z)||void 0))}),Object.keys(ft).length>0&&(W=L(W,ft)),W}function X(z,W){var Q=d.default.query(z);if(Q==null)return W;if(Q.prototype instanceof d.default.Embed){var tt={},Y=Q.value(z);Y!=null&&(tt[Q.blotName]=Y,W=new h.default().insert(tt,Q.formats(z)))}else typeof Q.formats=="function"&&(W=L(W,Q.blotName,Q.formats(z)));return W}function K(z,W){return G(W,`
583
583
  `)||W.insert(`
584
- `),W}function et(){return new f.default}function it(V,W){var Q=d.default.query(V);if(Q==null||Q.blotName!=="list-item"||!$(W,`
585
- `))return W;for(var tt=-1,Y=V.parentNode;!Y.classList.contains("ql-clipboard");)(d.default.query(Y)||{}).blotName==="list"&&(tt+=1),Y=Y.parentNode;return tt<=0?W:W.compose(new f.default().retain(W.length()-1).retain(1,{indent:tt}))}function lt(V,W){return $(W,`
586
- `)||(M(V)||W.length()>0&&V.nextSibling&&M(V.nextSibling))&&W.insert(`
587
- `),W}function ht(V,W){if(M(V)&&V.nextElementSibling!=null&&!$(W,`
584
+ `),W}function et(){return new h.default}function nt(z,W){var Q=d.default.query(z);if(Q==null||Q.blotName!=="list-item"||!G(W,`
585
+ `))return W;for(var tt=-1,Y=z.parentNode;!Y.classList.contains("ql-clipboard");)(d.default.query(Y)||{}).blotName==="list"&&(tt+=1),Y=Y.parentNode;return tt<=0?W:W.compose(new h.default().retain(W.length()-1).retain(1,{indent:tt}))}function ot(z,W){return G(W,`
586
+ `)||(M(z)||W.length()>0&&z.nextSibling&&M(z.nextSibling))&&W.insert(`
587
+ `),W}function ut(z,W){if(M(z)&&z.nextElementSibling!=null&&!G(W,`
588
588
 
589
- `)){var Q=V.offsetHeight+parseFloat(G(V).marginTop)+parseFloat(G(V).marginBottom);V.nextElementSibling.offsetTop>V.offsetTop+Q*1.5&&W.insert(`
590
- `)}return W}function Ct(V,W){var Q={},tt=V.style||{};return tt.fontStyle&&G(V).fontStyle==="italic"&&(Q.italic=!0),tt.fontWeight&&(G(V).fontWeight.startsWith("bold")||parseInt(G(V).fontWeight)>=700)&&(Q.bold=!0),Object.keys(Q).length>0&&(W=L(W,Q)),parseFloat(tt.textIndent||0)>0&&(W=new f.default().insert(" ").concat(W)),W}function It(V,W){var Q=V.data;if(V.parentNode.tagName==="O:P")return W.insert(Q.trim());if(Q.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return W;if(!G(V.parentNode).whiteSpace.startsWith("pre")){var tt=function(ct,Z){return Z=Z.replace(/[^\u00a0]/g,""),Z.length<1&&ct?" ":Z};Q=Q.replace(/\r\n/g," ").replace(/\n/g," "),Q=Q.replace(/\s\s+/g,tt.bind(tt,!0)),(V.previousSibling==null&&M(V.parentNode)||V.previousSibling!=null&&M(V.previousSibling))&&(Q=Q.replace(/^\s+/,tt.bind(tt,!1))),(V.nextSibling==null&&M(V.parentNode)||V.nextSibling!=null&&M(V.nextSibling))&&(Q=Q.replace(/\s+$/,tt.bind(tt,!1)))}return W.insert(Q)}n.default=P,n.matchAttributor=H,n.matchBlot=X,n.matchNewline=lt,n.matchSpacing=ht,n.matchText=It},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){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,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(6),l=h(o);function h(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 f(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),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"optimize",value:function(y){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,y),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 T(O,R){var C=[],F=!0,U=!1,D=void 0;try{for(var z=O[Symbol.iterator](),j;!(F=(j=z.next()).done)&&(C.push(j.value),!(R&&C.length===R));F=!0);}catch(k){U=!0,D=k}finally{try{!F&&z.return&&z.return()}finally{if(U)throw D}}return C}return function(O,R){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return T(O,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function T(O,R){for(var C=0;C<R.length;C++){var F=R[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(O,F.key,F)}}return function(O,R,C){return R&&T(O.prototype,R),C&&T(O,C),O}}(),o=i(2),l=y(o),h=i(0),c=y(h),f=i(5),u=y(f),d=i(10),p=y(d),v=i(9),g=y(v);function y(T){return T&&T.__esModule?T:{default:T}}function b(T,O,R){return O in T?Object.defineProperty(T,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[O]=R,T}function _(T,O){if(!(T instanceof O))throw new TypeError("Cannot call a class as a function")}function m(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")?O:T}function x(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 S=(0,p.default)("quill:toolbar"),w=function(T){x(O,T);function O(R,C){_(this,O);var F=m(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,C));if(Array.isArray(F.options.container)){var U=document.createElement("div");N(U,F.options.container),R.container.parentNode.insertBefore(U,R.container),F.container=U}else typeof F.options.container=="string"?F.container=document.querySelector(F.options.container):F.container=F.options.container;if(!(F.container instanceof HTMLElement)){var D;return D=S.error("Container required for toolbar",F.options),m(F,D)}return F.container.classList.add("ql-toolbar"),F.controls=[],F.handlers={},Object.keys(F.options.handlers).forEach(function(z){F.addHandler(z,F.options.handlers[z])}),[].forEach.call(F.container.querySelectorAll("button, select"),function(z){F.attach(z)}),F.quill.on(u.default.events.EDITOR_CHANGE,function(z,j){z===u.default.events.SELECTION_CHANGE&&F.update(j)}),F.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var z=F.quill.selection.getRange(),j=s(z,1),k=j[0];F.update(k)}),F}return a(O,[{key:"addHandler",value:function(C,F){this.handlers[C]=F}},{key:"attach",value:function(C){var F=this,U=[].find.call(C.classList,function(z){return z.indexOf("ql-")===0});if(U){if(U=U.slice(3),C.tagName==="BUTTON"&&C.setAttribute("type","button"),this.handlers[U]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[U]==null){S.warn("ignoring attaching to disabled format",U,C);return}if(c.default.query(U)==null){S.warn("ignoring attaching to nonexistent format",U,C);return}}var D=C.tagName==="SELECT"?"change":"click";C.addEventListener(D,function(z){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"),z.preventDefault();F.quill.focus();var I=F.quill.selection.getRange(),P=s(I,1),L=P[0];if(F.handlers[U]!=null)F.handlers[U].call(F,j);else if(c.default.query(U).prototype instanceof c.default.Embed){if(j=prompt("Enter "+U),!j)return;F.quill.updateContents(new l.default().retain(L.index).delete(L.length).insert(b({},U,j)),u.default.sources.USER)}else F.quill.format(U,j,u.default.sources.USER);F.update(L)}),this.controls.push([U,C])}}},{key:"update",value:function(C){var F=C==null?{}:this.quill.getFormat(C);this.controls.forEach(function(U){var D=s(U,2),z=D[0],j=D[1];if(j.tagName==="SELECT"){var k=void 0;if(C==null)k=null;else if(F[z]==null)k=j.querySelector("option[selected]");else if(!Array.isArray(F[z])){var I=F[z];typeof I=="string"&&(I=I.replace(/\"/g,'\\"')),k=j.querySelector('option[value="'+I+'"]')}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[z]===j.getAttribute("value")||F[z]!=null&&F[z].toString()===j.getAttribute("value")||F[z]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",P)}else j.classList.toggle("ql-active",F[z]!=null)})}}]),O}(g.default);w.DEFAULTS={};function E(T,O,R){var C=document.createElement("button");C.setAttribute("type","button"),C.classList.add("ql-"+O),R!=null&&(C.value=R),T.appendChild(C)}function N(T,O){Array.isArray(O[0])||(O=[O]),O.forEach(function(R){var C=document.createElement("span");C.classList.add("ql-formats"),R.forEach(function(F){if(typeof F=="string")E(C,F);else{var U=Object.keys(F)[0],D=F[U];Array.isArray(D)?A(C,U,D):E(C,U,D)}}),T.appendChild(C)})}function A(T,O,R){var C=document.createElement("select");C.classList.add("ql-"+O),R.forEach(function(F){var U=document.createElement("option");F!==!1?U.setAttribute("value",F):U.setAttribute("selected","selected"),C.appendChild(U)}),T.appendChild(C)}w.DEFAULTS={container:null,handlers:{clean:function(){var O=this,R=this.quill.getSelection();if(R!=null)if(R.length==0){var C=this.quill.getFormat();Object.keys(C).forEach(function(F){c.default.query(F,c.default.Scope.INLINE)!=null&&O.quill.format(F,!1)})}else this.quill.removeFormat(R,u.default.sources.USER)},direction:function(O){var R=this.quill.getFormat().align;O==="rtl"&&R==null?this.quill.format("align","right",u.default.sources.USER):!O&&R==="right"&&this.quill.format("align",!1,u.default.sources.USER),this.quill.format("direction",O,u.default.sources.USER)},indent:function(O){var R=this.quill.getSelection(),C=this.quill.getFormat(R),F=parseInt(C.indent||0);if(O==="+1"||O==="-1"){var U=O==="+1"?1:-1;C.direction==="rtl"&&(U*=-1),this.quill.format("indent",F+U,u.default.sources.USER)}},link:function(O){O===!0&&(O=prompt("Enter link URL:")),this.quill.format("link",O,u.default.sources.USER)},list:function(O){var R=this.quill.getSelection(),C=this.quill.getFormat(R);O==="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",O,u.default.sources.USER)}}},n.default=w,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 y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){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,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(28),l=h(o);function h(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 f(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,y){c(this,v);var b=f(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return b.label.innerHTML=y,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(y){var b=a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"buildItem",this).call(this,y);return b.style.backgroundColor=y.getAttribute("value")||"",b}},{key:"selectItem",value:function(y,b){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,y,b);var _=this.label.querySelector(".ql-color-label"),m=y&&y.getAttribute("data-value")||"";_&&(_.tagName==="line"?_.style.stroke=m:_.style.fill=m)}}]),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 y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){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,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(28),l=h(o);function h(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 f(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,y){c(this,v);var b=f(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=y[_.getAttribute("data-value")||""]}),b.defaultItem=b.container.querySelector(".ql-selected"),b.selectItem(b.defaultItem),b}return s(v,[{key:"selectItem",value:function(y,b){a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"selectItem",this).call(this,y,b),y=y||this.defaultItem,this.label.innerHTML=y.innerHTML}}]),v}(l.default);n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(h,c){for(var f=0;f<c.length;f++){var u=c[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(h,u.key,u)}}return function(h,c,f){return c&&l(h.prototype,c),f&&l(h,f),h}}();function a(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(h,c){var f=this;a(this,l),this.quill=h,this.boundsContainer=c||document.body,this.root=h.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(l,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(c){var f=c.left+c.width/2-this.root.offsetWidth/2,u=c.bottom+this.quill.root.scrollTop;this.root.style.left=f+"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=f+v+"px"),p.left<d.left&&(v=d.left-p.left,this.root.style.left=f+v+"px"),p.bottom>d.bottom){var g=p.bottom-p.top,y=c.bottom-c.top+g;this.root.style.top=u-y+"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(T,O){var R=[],C=!0,F=!1,U=void 0;try{for(var D=T[Symbol.iterator](),z;!(C=(z=D.next()).done)&&(R.push(z.value),!(O&&R.length===O));C=!0);}catch(j){F=!0,U=j}finally{try{!C&&D.return&&D.return()}finally{if(F)throw U}}return R}return function(T,O){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return A(T,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function A(T,O,R){T===null&&(T=Function.prototype);var C=Object.getOwnPropertyDescriptor(T,O);if(C===void 0){var F=Object.getPrototypeOf(T);return F===null?void 0:A(F,O,R)}else{if("value"in C)return C.value;var U=C.get;return U===void 0?void 0:U.call(R)}},o=function(){function A(T,O){for(var R=0;R<O.length;R++){var C=O[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(T,C.key,C)}}return function(T,O,R){return O&&A(T.prototype,O),R&&A(T,R),T}}(),l=i(3),h=_(l),c=i(8),f=_(c),u=i(43),d=_(u),p=i(27),v=_(p),g=i(15),y=i(41),b=_(y);function _(A){return A&&A.__esModule?A:{default:A}}function m(A,T){if(!(A instanceof T))throw new TypeError("Cannot call a class as a function")}function x(A,T){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:A}function S(A,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);A.prototype=Object.create(T&&T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(A,T):A.__proto__=T)}var w=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],E=function(A){S(T,A);function T(O,R){m(this,T),R.modules.toolbar!=null&&R.modules.toolbar.container==null&&(R.modules.toolbar.container=w);var C=x(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,O,R));return C.quill.container.classList.add("ql-snow"),C}return o(T,[{key:"extendToolbar",value:function(R){R.container.classList.add("ql-snow"),this.buildButtons([].slice.call(R.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(R.container.querySelectorAll("select")),b.default),this.tooltip=new N(this.quill,this.options.bounds),R.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(C,F){R.handlers.link.call(R,!F.format.link)})}}]),T}(d.default);E.DEFAULTS=(0,h.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){if(T){var O=this.quill.getSelection();if(O==null||O.length==0)return;var R=this.quill.getText(O);/^\S+@\S+\.\S+$/.test(R)&&R.indexOf("mailto:")!==0&&(R="mailto:"+R);var C=this.quill.theme.tooltip;C.edit("link",R)}else this.quill.format("link",!1)}}}}});var N=function(A){S(T,A);function T(O,R){m(this,T);var C=x(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,O,R));return C.preview=C.root.querySelector("a.ql-preview"),C}return o(T,[{key:"listen",value:function(){var R=this;a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(C){R.root.classList.contains("ql-editing")?R.save():R.edit("link",R.preview.textContent),C.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(C){if(R.linkRange!=null){var F=R.linkRange;R.restoreFocus(),R.quill.formatText(F,"link",!1,f.default.sources.USER),delete R.linkRange}C.preventDefault(),R.hide()}),this.quill.on(f.default.events.SELECTION_CHANGE,function(C,F,U){if(C!=null){if(C.length===0&&U===f.default.sources.USER){var D=R.quill.scroll.descendant(v.default,C.index),z=s(D,2),j=z[0],k=z[1];if(j!=null){R.linkRange=new g.Range(C.index-k,j.length());var I=v.default.formats(j.domNode);R.preview.textContent=I,R.preview.setAttribute("href",I),R.show(),R.position(R.quill.getBounds(R.linkRange));return}}else delete R.linkRange;R.hide()}})}},{key:"show",value:function(){a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),T}(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=Y(s),o=i(36),l=i(38),h=i(64),c=i(65),f=Y(c),u=i(66),d=Y(u),p=i(67),v=Y(p),g=i(37),y=i(26),b=i(39),_=i(40),m=i(56),x=Y(m),S=i(68),w=Y(S),E=i(27),N=Y(E),A=i(69),T=Y(A),O=i(70),R=Y(O),C=i(71),F=Y(C),U=i(72),D=Y(U),z=i(73),j=Y(z),k=i(13),I=Y(k),P=i(74),L=Y(P),G=i(75),$=Y(G),M=i(57),B=Y(M),q=i(41),H=Y(q),X=i(28),K=Y(X),et=i(59),it=Y(et),lt=i(60),ht=Y(lt),Ct=i(61),It=Y(Ct),V=i(108),W=Y(V),Q=i(62),tt=Y(Q);function Y(ct){return ct&&ct.__esModule?ct:{default:ct}}a.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":g.BackgroundClass,"attributors/class/color":y.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":y.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":h.IndentClass,"formats/background":g.BackgroundStyle,"formats/color":y.ColorStyle,"formats/font":b.FontClass,"formats/size":_.SizeClass,"formats/blockquote":f.default,"formats/code-block":I.default,"formats/header":d.default,"formats/list":v.default,"formats/bold":x.default,"formats/code":k.Code,"formats/italic":w.default,"formats/link":N.default,"formats/script":T.default,"formats/strike":R.default,"formats/underline":F.default,"formats/image":D.default,"formats/video":j.default,"formats/list/item":p.ListItem,"modules/formula":L.default,"modules/syntax":$.default,"modules/toolbar":B.default,"themes/bubble":W.default,"themes/snow":tt.default,"ui/icons":H.default,"ui/picker":K.default,"ui/icon-picker":ht.default,"ui/color-picker":it.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,y){for(var b=0;b<y.length;b++){var _=y[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}return function(g,y,b){return y&&v(g.prototype,y),b&&v(g,b),g}}(),a=function v(g,y,b){g===null&&(g=Function.prototype);var _=Object.getOwnPropertyDescriptor(g,y);if(_===void 0){var m=Object.getPrototypeOf(g);return m===null?void 0:v(m,y,b)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(b)}},o=i(0),l=h(o);function h(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 f(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),f(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"add",value:function(b,_){if(_==="+1"||_==="-1"){var m=this.value(b)||0;_=_==="+1"?m+1:m-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 h(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 f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="blockquote",f.tagName="blockquote",n.default=f},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 y=v[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}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 h(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 f(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){f(p,d);function p(){return h(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 m(x,S){for(var w=0;w<S.length;w++){var E=S[w];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,S,w){return S&&m(x.prototype,S),w&&m(x,w),x}}(),a=function m(x,S,w){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,S);if(E===void 0){var N=Object.getPrototypeOf(x);return N===null?void 0:m(N,S,w)}else{if("value"in E)return E.value;var A=E.get;return A===void 0?void 0:A.call(w)}},o=i(0),l=d(o),h=i(4),c=d(h),f=i(25),u=d(f);function d(m){return m&&m.__esModule?m:{default:m}}function p(m,x,S){return x in m?Object.defineProperty(m,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[x]=S,m}function v(m,x){if(!(m instanceof x))throw new TypeError("Cannot call a class as a function")}function g(m,x){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:m}function y(m,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);m.prototype=Object.create(x&&x.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(m,x):m.__proto__=x)}var b=function(m){y(x,m);function x(){return v(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(w,E){w===_.blotName&&!E?this.replaceWith(l.default.create(this.statics.scope)):a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,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(w,E){return this.parent.isolate(this.offset(this.parent),this.length()),w===this.parent.statics.blotName?(this.parent.replaceWith(w,E),this):(this.parent.unwrap(),a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,w,E))}}],[{key:"formats",value:function(w){return w.tagName===this.tagName?void 0:a(x.__proto__||Object.getPrototypeOf(x),"formats",this).call(this,w)}}]),x}(c.default);b.blotName="list-item",b.tagName="LI";var _=function(m){y(x,m),s(x,null,[{key:"create",value:function(w){var E=w==="ordered"?"OL":"UL",N=a(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,E);return(w==="checked"||w==="unchecked")&&N.setAttribute("data-checked",w==="checked"),N}},{key:"formats",value:function(w){if(w.tagName==="OL")return"ordered";if(w.tagName==="UL")return w.hasAttribute("data-checked")?w.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function x(S){v(this,x);var w=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,S)),E=function(A){if(A.target.parentNode===S){var T=w.statics.formats(S),O=l.default.find(A.target);T==="checked"?O.format("list","unchecked"):T==="unchecked"&&O.format("list","checked")}};return S.addEventListener("touchstart",E),S.addEventListener("mousedown",E),w}return s(x,[{key:"format",value:function(w,E){this.children.length>0&&this.children.tail.format(w,E)}},{key:"formats",value:function(){return p({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(w,E){if(w instanceof b)a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,w,E);else{var N=E==null?this.length():E.offset(this),A=this.split(N);A.parent.insertBefore(w,A)}}},{key:"optimize",value:function(w){a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,w);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(w){if(w.statics.blotName!==this.statics.blotName){var E=l.default.create(this.statics.defaultChild);w.moveChildren(E),this.appendChild(E)}a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,w)}}]),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 h(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 f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="italic",f.tagName=["EM","I"],n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,y){return g&&p(v.prototype,g),y&&p(v,y),v}}(),a=function p(v,g,y){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,y)}else{if("value"in b)return b.value;var m=b.get;return m===void 0?void 0:m.call(y)}},o=i(6),l=h(o);function h(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 f(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),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,null,[{key:"create",value:function(y){return y==="super"?document.createElement("sup"):y==="sub"?document.createElement("sub"):a(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,y)}},{key:"formats",value:function(y){if(y.tagName==="SUB")return"sub";if(y.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 h(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 f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="strike",f.tagName="S",n.default=f},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 h(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 f=function(u){c(d,u);function d(){return l(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(a.default);f.blotName="underline",f.tagName="U",n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(0),l=c(o),h=i(27);function c(g){return g&&g.__esModule?g:{default:g}}function f(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function u(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function d(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var p=["alt","height","width"],v=function(g){d(y,g);function y(){return f(this,y),u(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"format",value:function(_,m){p.indexOf(_)>-1?m?this.domNode.setAttribute(_,m):this.domNode.removeAttribute(_):a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,_,m)}}],[{key:"create",value:function(_){var m=a(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,_);return typeof _=="string"&&m.setAttribute("src",this.sanitize(_)),m}},{key:"formats",value:function(_){return p.reduce(function(m,x){return _.hasAttribute(x)&&(m[x]=_.getAttribute(x)),m},{})}},{key:"match",value:function(_){return/\.(jpe?g|gif|png)$/.test(_)||/^data:image\/.+;base64/.test(_)}},{key:"sanitize",value:function(_){return(0,h.sanitize)(_,["http","https","data"])?_:"//:0"}},{key:"value",value:function(_){return _.getAttribute("src")}}]),y}(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(y,b){for(var _=0;_<b.length;_++){var m=b[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,b,_){return b&&g(y.prototype,b),_&&g(y,_),y}}(),a=function g(y,b,_){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,b);if(m===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:g(x,b,_)}else{if("value"in m)return m.value;var S=m.get;return S===void 0?void 0:S.call(_)}},o=i(4),l=i(27),h=c(l);function c(g){return g&&g.__esModule?g:{default:g}}function f(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function u(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function d(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var p=["height","width"],v=function(g){d(y,g);function y(){return f(this,y),u(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"format",value:function(_,m){p.indexOf(_)>-1?m?this.domNode.setAttribute(_,m):this.domNode.removeAttribute(_):a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,_,m)}}],[{key:"create",value:function(_){var m=a(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,_);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(_)),m}},{key:"formats",value:function(_){return p.reduce(function(m,x){return _.hasAttribute(x)&&(m[x]=_.getAttribute(x)),m},{})}},{key:"sanitize",value:function(_){return h.default.sanitize(_)}},{key:"value",value:function(_){return _.getAttribute("src")}}]),y}(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 _(m,x){for(var S=0;S<x.length;S++){var w=x[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,S){return x&&_(m.prototype,x),S&&_(m,S),m}}(),a=function _(m,x,S){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var E=Object.getPrototypeOf(m);return E===null?void 0:_(E,x,S)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(S)}},o=i(35),l=d(o),h=i(5),c=d(h),f=i(9),u=d(f);function d(_){return _&&_.__esModule?_:{default:_}}function p(_,m){if(!(_ instanceof m))throw new TypeError("Cannot call a class as a function")}function v(_,m){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:_}function g(_,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);_.prototype=Object.create(m&&m.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(_,m):_.__proto__=m)}var y=function(_){g(m,_);function m(){return p(this,m),v(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,null,[{key:"create",value:function(S){var w=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,S);return typeof S=="string"&&(window.katex.render(S,w,{throwOnError:!1,errorColor:"#f00"}),w.setAttribute("data-value",S)),w}},{key:"value",value:function(S){return S.getAttribute("data-value")}}]),m}(l.default);y.blotName="formula",y.className="ql-formula",y.tagName="SPAN";var b=function(_){g(m,_),s(m,null,[{key:"register",value:function(){c.default.register(y,!0)}}]);function m(){p(this,m);var x=v(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return x}return m}(u.default);n.FormulaBlot=y,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 S(w,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(w,A.key,A)}}return function(w,E,N){return E&&S(w.prototype,E),N&&S(w,N),w}}(),a=function S(w,E,N){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,E);if(A===void 0){var T=Object.getPrototypeOf(w);return T===null?void 0:S(T,E,N)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(N)}},o=i(0),l=v(o),h=i(5),c=v(h),f=i(9),u=v(f),d=i(13),p=v(d);function v(S){return S&&S.__esModule?S:{default:S}}function g(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function y(S,w){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:S}function b(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);S.prototype=Object.create(w&&w.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(S,w):S.__proto__=w)}var _=function(S){b(w,S);function w(){return g(this,w),y(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return s(w,[{key:"replaceWith",value:function(N){this.domNode.textContent=this.domNode.textContent,this.attach(),a(w.prototype.__proto__||Object.getPrototypeOf(w.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)}}]),w}(p.default);_.className="ql-syntax";var m=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),x=function(S){b(w,S),s(w,null,[{key:"register",value:function(){c.default.register(m,!0),c.default.register(_,!0)}}]);function w(E,N){g(this,w);var A=y(this,(w.__proto__||Object.getPrototypeOf(w)).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 T=null;return A.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(T),T=setTimeout(function(){A.highlight(),T=null},A.options.interval)}),A.highlight(),A}return s(w,[{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(T){T.highlight(N.options.highlight)}),this.quill.update(c.default.sources.SILENT),A!=null&&this.quill.setSelection(A,c.default.sources.SILENT)}}}]),w}(u.default);x.DEFAULTS={highlight:function(){return window.hljs==null?null:function(S){var w=window.hljs.highlightAuto(S);return w.value}}(),interval:1e3},n.CodeBlock=_,n.CodeToken=m,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 w(E,N,A){E===null&&(E=Function.prototype);var T=Object.getOwnPropertyDescriptor(E,N);if(T===void 0){var O=Object.getPrototypeOf(E);return O===null?void 0:w(O,N,A)}else{if("value"in T)return T.value;var R=T.get;return R===void 0?void 0:R.call(A)}},a=function(){function w(E,N){for(var A=0;A<N.length;A++){var T=N[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,T.key,T)}}return function(E,N,A){return N&&w(E.prototype,N),A&&w(E,A),E}}(),o=i(3),l=g(o),h=i(8),c=g(h),f=i(43),u=g(f),d=i(15),p=i(41),v=g(p);function g(w){return w&&w.__esModule?w:{default:w}}function y(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function _(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],x=function(w){_(E,w);function E(N,A){y(this,E),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=m);var T=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,N,A));return T.quill.container.classList.add("ql-bubble"),T}return a(E,[{key:"extendToolbar",value:function(A){this.tooltip=new S(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 S=function(w){_(E,w);function E(N,A){y(this,E);var T=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,N,A));return T.quill.on(c.default.events.EDITOR_CHANGE,function(O,R,C,F){if(O===c.default.events.SELECTION_CHANGE)if(R!=null&&R.length>0&&F===c.default.sources.USER){T.show(),T.root.style.left="0px",T.root.style.width="",T.root.style.width=T.root.offsetWidth+"px";var U=T.quill.getLines(R.index,R.length);if(U.length===1)T.position(T.quill.getBounds(R));else{var D=U[U.length-1],z=T.quill.getIndex(D),j=Math.min(D.length()-1,R.index+R.length-z),k=T.quill.getBounds(new d.Range(z,j));T.position(k)}}else document.activeElement!==T.textbox&&T.quill.hasFocus()&&T.hide()}),T}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 T=A.quill.getSelection();T!=null&&A.position(A.quill.getBounds(T))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(A){var T=s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"position",this).call(this,A),O=this.root.querySelector(".ql-tooltip-arrow");if(O.style.marginLeft="",T===0)return T;O.style.marginLeft=-1*T-O.offsetWidth/2+"px"}}]),E}(f.BaseTooltip);S.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=S,n.default=x},function(r,n,i){r.exports=i(63)}]).default})})(Lh);var kT=Lh.exports;const PT=or(kT),zT="",MT=e=>{const[t,r]=J.useState(!1);console.log("allProps",e);const n=J.useRef(null),i=J.useRef(null),s=J.useRef(null),a=J.useRef(null),o=J.useRef(16),l=J.useRef(null),{uniqueId:h,text:c,locked:f,transformation:u,onTextUpdate:d,pointerdown:p,pointerup:v,mousedown:g,mouseup:y,pointerover:b,mouseover:_,mouseout:m}=e,{scale:x=[1,1],x:S,y:w,rotation:E=1,fontFamily:N="Arial",fontWeight:A="normal",fontStyle:T="normal",fontSize:O=16,fill:R="black",stroke:C,strokeThickness:F,blurRadius:U=0,blurEnabled:D=!1,dropShadowColor:z=null,wordWrapWidth:j=5e7,leading:k=0,letterSpacing:I}=u;ot.useEffect(()=>{o.current=Number(O)},[O]);const P=["italic","oblique"].includes(T)?T:void 0,L=["bold","lighter","100","200","300"].includes(A)?A:void 0,G=Number(I)>0?I:void 0,$=ot.useMemo(()=>new ne.TextStyle({fontFamily:N,fontSize:O,fill:R||"white",stroke:C,strokeThickness:F,...P&&{fontStyle:P},...L&&{fontWeight:L},...G&&{letterSpacing:G},...D&&{dropShadow:!0,dropShadowBlur:Number(U),dropShadowColor:(z==null?void 0:z.toString())||"black",dropShadowDistance:0},wordWrap:!0,breakWords:!0,wordWrapWidth:j||500,leading:k||0}),[D,U,R,N,O,k,P,L,G,z,C,F,j]);ot.useEffect(()=>{l.current={...u}},[u]);const M=B=>{d&&d({text:B,uniqueId:h,droptype:"titles"})};return ot.useEffect(()=>{if(t&&s.current){let q=document.getElementById("note-editor");if(q){q.style.position="absolute",q.style.zIndex="10",q.style.left=S+"px",q.style.top=w+"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";const H={esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}};var B=new PT("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{...H}}},placeholder:"Compose your text here...",theme:"snow"});B.on("text-change",function(){M(B.root.innerText)}),B.setText(c),B.focus(),B.off("text-change",()=>{console.log("removed")}),B.hasFocus()||(q.style.display="none")}}},[S,w,t]),ft.jsx(Ea,{...e,children:ft.jsxs(yt.Container,{ref:n,children:[t&&ft.jsx(yt.Container,{ref:s}),ft.jsx(yt.Container,{alpha:t?0:1,ref:a,children:ft.jsx(yt.Text,{style:$,x:S,y:w,rotation:E,anchor:.5,text:c,...!t&&!f&&{interactive:!0,buttonMode:!0,pointerdown:p,pointerout:m,pointerover:b,pointerup:v,mousedown:g,mouseup:y,mouseover:_},ref:i,scale:x})})]})})},LT=yt.withFilters(yt.Container,{blur:ne.filters.BlurFilter,adjust:Zs,matrix:ne.filters.ColorMatrixFilter}),FT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],BT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},DT=e=>{const[t,r]=ot.useState(!1),[,n]=J.useState(!1),[,i]=ot.useState({isWaiting:!1,isStalled:!1}),[s,a]=ot.useState(),[o,l]=J.useState(!1),h=J.useRef(null),c=J.useRef(null),f=J.useRef(null),u=J.useRef(null),d=J.useRef(null),p=J.useRef(null),v=J.useRef(BT),{tl:g,playerTimeRef:y,isDragging:b}=J.useContext(Mr),{uniqueId:_,mute:m=!1,locked:x=!1,src:S,startAt:w,endAt:E,frameStartAt:N,frameEndAt:A,initialAlpha:T,transformation:{x:O,y:R,width:C,height:F,scale:U,rotation:D,animation:z,colorCorrection:j,effect:k},pointerdown:I,pointerup:P,mousedown:L,mouseup:G,pointerover:$,mouseover:M,mouseout:B,applyTransformer:q,onAnchorTransformationEnd:H}=e,X=S||"",{contrast:K=1,saturation:et=1,exposure:it=1,blurRadius:lt=0,alpha:ht=1}=j||{},Ct={brightness:it,contrast:K,saturation:et,alpha:ht},It=ot.useCallback(()=>{l(!0)},[]),V=ot.useCallback(Z=>{console.log("changeEnd",Z),H&&(console.log("running onAnchorTransformationEnd"),H(Z))},[]),W=ot.useMemo(()=>{const Z=document.createElement("video");return Z.src=S,Z.crossOrigin="Anonymus",Z.autoplay=!1,Z.currentTime=1e-4,Z},[S]);un(je.PAUSE,Z=>{if(console.log("pause event",Z),p.current){const at=p.current;at.currentTime>0&&!at.paused&&!at.ended&&at.readyState>at.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}}),ot.useEffect(()=>{console.log("current",p.current,b),p.current&&(b?(p.current.pause(),v.current.isPlaying=!1,v.current.isDragging=!0):v.current.isDragging=!1)},[b]);const Q=Z=>{p.current&&(console.log("video gsapOnStart",y.current,b),y.current>=Z&&y.current<=E&&!b&&(p.current.currentTime=Number(N)||Number(Z),p.current.play(),v.current.isPlaying=!0))},tt=()=>{if(console.log("onComplete triggered"),p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}},Y=()=>{},ct=()=>{if(p.current){Math.abs(p.current.currentTime-y.current);const Z=p.current,at=Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA;v.current.isDragging?(console.log("video updating",y.current),p.current.currentTime=y.current,p.current.play(),setTimeout(()=>{v.current.isPlaying=!1,p.current&&p.current.pause()},55),v.current.isPlaying=!1):v.current.isPlaying||(at||p.current.play(),v.current.isPlaying=!0)}};return J.useEffect(()=>{let Z=ye.context(()=>{});if(c.current&&g.current){const at={duration:Number(E)-Number(w),onStart:Q,onComplete:tt,onStartParams:[w],onCompleteParams:[],onInterrupt:Y,onUpdate:ct,onUpdateParams:[]},St=ha(z||"None");Z=ye.context(()=>{var Ht,_t;ee(St.from)?ee(St.to)?ee(St.fromTo)?g.current.to(c.current,{alpha:1,duration:.01},w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.1},Number(E)-.1):g.current.fromTo(c.current,(Ht=St.fromTo)==null?void 0:Ht.from,(_t=St.fromTo)==null?void 0:_t.to,w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.2},E-.2):g.current.to(c.current,{alpha:1,duration:.2,...St.to},w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.2},E-.2):g.current.from(c.current,{...St.from},w).to(u.current,{alpha:1,duration:.2},w).from(u.current,{...at},w).to(c.current,{alpha:0,duration:.2},E-.2)})}return()=>Z.revert()},[z,w,E]),ot.useEffect(()=>{c.current&&r(!0)},[]),ot.useEffect(()=>{p.current&&(p.current.muted=m)},[m]),ot.useEffect(()=>{if(p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&(o||b)&&(p.current.pause(),v.current.isPlaying=!1)}},[o,b]),ot.useEffect(()=>{const Z=Math.round((Number(N)+Number.EPSILON)*100)/100,at=function(){p.current&&(p.current.currentTime=Z)},St=function(){if(p.current){const zt=p.current;zt.currentTime>0&&!zt.paused&&!zt.ended&&zt.readyState>zt.HAVE_CURRENT_DATA&&p.current.pause()}i({isWaiting:!1,isStalled:!1})},Ht=function(){p.current&&p.current.pause(),i({isWaiting:!0,isStalled:!1})},_t=function(){i({isWaiting:!1,isStalled:!1})},Et=function(){i({isWaiting:!1,isStalled:!0})},Tt=Math.round((Number(N)+Number.EPSILON)*100)/100,Bt=Math.round((Number(A)+Number.EPSILON)*100)/100,pe=`${X}#t=${Tt},${Bt}`;return console.log("urlTimestap",pe),ne.Texture.fromLoader(W,pe,_,{pixiIdPrefix:_,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(zt=>{zt&&(a(zt),console.log(zt.baseTexture.resource.source),p.current=zt.baseTexture.resource.source,p.current.id=_,p.current.addEventListener("loadedmetadata",at),p.current.addEventListener("ended",St),p.current.addEventListener("loadstart",Ht),p.current.addEventListener("canplaythrough",_t),p.current.addEventListener("stalled",Et))}),()=>{p.current.removeEventListener("loadedmetadata",at),p.current.removeEventListener("ended",St),p.current.removeEventListener("loadstart",Ht),p.current.removeEventListener("canplaythrough",_t),p.current.removeEventListener("stalled",Et)}},[X,_,N,A,W]),ft.jsxs(yt.Container,{ref:f,children:[ft.jsx(yt.Container,{ref:c,alpha:T,position:[O,R],pivot:[O,R],width:C,height:F,children:ft.jsx(LT,{scale:1,blur:{blur:lt,quality:4},adjust:Ct,apply:({matrix:Z})=>{k==="BlackAndWhite"?Z.desaturate():k==="Sepia"?Z.sepia():k==="RetroVintage"||k==="NightVision"?Z.negative():k==="Normal"&&Z.reset()},matrix:{enabled:!0,matrix:FT},children:ft.jsx(yt.Container,{ref:u,children:s&&ft.jsx(yt.Sprite,{texture:s,width:C,height:F,anchor:.5,x:O,y:R,...!x&&!o&&{interactive:!0,buttonMode:!0,pointerdown:I,pointerover:$,pointerout:B,mousedown:L,mouseover:M,mouseout:B,mouseup:G,pointerup:P},ref:h,scale:U,rotation:D})})})}),q&&ft.jsx(la,{pixiTransformerRef:d,imageRef:c,isMounted:t,transformCommit:V,transformChange:It,mouseoverEvent:n,uniqueId:_})]})};var Fh=(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))(Fh||{}),Bh=(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))(Bh||{});kt.Animations=Fh,kt.BlendModes=Bh,kt.Events=je,kt.GsapPixieContext=Mr,kt.GsapPixieContextProvider=Gy,kt.PixiAnimatedSprite=Mh,kt.PixiAudioSprite=q0,kt.PixiGifSprite=CT,kt.PixiImageSprite=Dg,kt.PixiSvgPathSprite=$0,kt.PixiTextSprite=MT,kt.PixiVideoSprite=DT,kt.Transformer=mu,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})});
589
+ `)){var Q=z.offsetHeight+parseFloat($(z).marginTop)+parseFloat($(z).marginBottom);z.nextElementSibling.offsetTop>z.offsetTop+Q*1.5&&W.insert(`
590
+ `)}return W}function Nt(z,W){var Q={},tt=z.style||{};return tt.fontStyle&&$(z).fontStyle==="italic"&&(Q.italic=!0),tt.fontWeight&&($(z).fontWeight.startsWith("bold")||parseInt($(z).fontWeight)>=700)&&(Q.bold=!0),Object.keys(Q).length>0&&(W=L(W,Q)),parseFloat(tt.textIndent||0)>0&&(W=new h.default().insert(" ").concat(W)),W}function Ot(z,W){var Q=z.data;if(z.parentNode.tagName==="O:P")return W.insert(Q.trim());if(Q.trim().length===0&&z.parentNode.classList.contains("ql-clipboard"))return W;if(!$(z.parentNode).whiteSpace.startsWith("pre")){var tt=function(ft,Z){return Z=Z.replace(/[^\u00a0]/g,""),Z.length<1&&ft?" ":Z};Q=Q.replace(/\r\n/g," ").replace(/\n/g," "),Q=Q.replace(/\s\s+/g,tt.bind(tt,!0)),(z.previousSibling==null&&M(z.parentNode)||z.previousSibling!=null&&M(z.previousSibling))&&(Q=Q.replace(/^\s+/,tt.bind(tt,!1))),(z.nextSibling==null&&M(z.parentNode)||z.nextSibling!=null&&M(z.nextSibling))&&(Q=Q.replace(/\s+$/,tt.bind(tt,!1)))}return W.insert(Q)}n.default=k,n.matchAttributor=H,n.matchBlot=X,n.matchNewline=ot,n.matchSpacing=ut,n.matchText=Ot},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(m,b){for(var v=0;v<b.length;v++){var g=b[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,b,v){return b&&p(m.prototype,b),v&&p(m,v),m}}(),a=function p(m,b,v){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,b);if(g===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:p(_,b,v)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(v)}},o=i(6),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function u(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var d=function(p){u(m,p);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"optimize",value:function(v){a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,v),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),m}(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 V=S[Symbol.iterator](),j;!(F=(j=V.next()).done)&&(C.push(j.value),!(I&&C.length===I));F=!0);}catch(P){D=!0,U=P}finally{try{!F&&V.return&&V.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=v(o),f=i(0),c=v(f),h=i(5),u=v(h),d=i(10),p=v(d),m=i(9),b=v(m);function v(w){return w&&w.__esModule?w:{default:w}}function g(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"),E=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");R(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(V){F.addHandler(V,F.options.handlers[V])}),[].forEach.call(F.container.querySelectorAll("button, select"),function(V){F.attach(V)}),F.quill.on(u.default.events.EDITOR_CHANGE,function(V,j){V===u.default.events.SELECTION_CHANGE&&F.update(j)}),F.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var V=F.quill.selection.getRange(),j=s(V,1),P=j[0];F.update(P)}),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(V){return V.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(V){var j=void 0;if(C.tagName==="SELECT"){if(C.selectedIndex<0)return;var P=C.options[C.selectedIndex];P.hasAttribute("selected")?j=!1:j=P.value||!1}else C.classList.contains("ql-active")?j=!1:j=C.value||!C.hasAttribute("value"),V.preventDefault();F.quill.focus();var N=F.quill.selection.getRange(),k=s(N,1),L=k[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(g({},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),V=U[0],j=U[1];if(j.tagName==="SELECT"){var P=void 0;if(C==null)P=null;else if(F[V]==null)P=j.querySelector("option[selected]");else if(!Array.isArray(F[V])){var N=F[V];typeof N=="string"&&(N=N.replace(/\"/g,'\\"')),P=j.querySelector('option[value="'+N+'"]')}P==null?(j.value="",j.selectedIndex=-1):P.selected=!0}else if(C==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var k=F[V]===j.getAttribute("value")||F[V]!=null&&F[V].toString()===j.getAttribute("value")||F[V]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",k)}else j.classList.toggle("ql-active",F[V]!=null)})}}]),S}(b.default);E.DEFAULTS={};function T(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 R(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")T(C,F);else{var D=Object.keys(F)[0],U=F[D];Array.isArray(U)?A(C,D,U):T(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)}E.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=E,n.addControls=R},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(m,b){for(var v=0;v<b.length;v++){var g=b[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,b,v){return b&&p(m.prototype,b),v&&p(m,v),m}}(),a=function p(m,b,v){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,b);if(g===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:p(_,b,v)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(v)}},o=i(28),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function u(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var d=function(p){u(m,p);function m(b,v){c(this,m);var g=h(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b));return g.label.innerHTML=v,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(_){_.classList.add("ql-primary")}),g}return s(m,[{key:"buildItem",value:function(v){var g=a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"buildItem",this).call(this,v);return g.style.backgroundColor=v.getAttribute("value")||"",g}},{key:"selectItem",value:function(v,g){a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,v,g);var _=this.label.querySelector(".ql-color-label"),y=v&&v.getAttribute("data-value")||"";_&&(_.tagName==="line"?_.style.stroke=y:_.style.fill=y)}}]),m}(l.default);n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(m,b){for(var v=0;v<b.length;v++){var g=b[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,b,v){return b&&p(m.prototype,b),v&&p(m,v),m}}(),a=function p(m,b,v){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,b);if(g===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:p(_,b,v)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(v)}},o=i(28),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function u(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var d=function(p){u(m,p);function m(b,v){c(this,m);var g=h(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(_){_.innerHTML=v[_.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return s(m,[{key:"selectItem",value:function(v,g){a(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,v,g),v=v||this.defaultItem,this.label.innerHTML=v.innerHTML}}]),m}(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(),m=0;if(p.right>d.right&&(m=d.right-p.right,this.root.style.left=h+m+"px"),p.left<d.left&&(m=d.left-p.left,this.root.style.left=h+m+"px"),p.bottom>d.bottom){var b=p.bottom-p.top,v=c.bottom-c.top+b;this.root.style.top=u-v+"px",this.root.classList.add("ql-flip")}return m}},{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](),V;!(C=(V=U.next()).done)&&(I.push(V.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),m=_(p),b=i(15),v=i(41),g=_(v);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 E=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],T=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=E);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")),g.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),g.default),this.tooltip=new R(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);T.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 R=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(m.default,C.index),V=s(U,2),j=V[0],P=V[1];if(j!=null){I.linkRange=new b.Range(C.index-P,j.length());var N=m.default.formats(j.domNode);I.preview.textContent=N,I.preview.setAttribute("href",N),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);R.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=T},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(29),a=Y(s),o=i(36),l=i(38),f=i(64),c=i(65),h=Y(c),u=i(66),d=Y(u),p=i(67),m=Y(p),b=i(37),v=i(26),g=i(39),_=i(40),y=i(56),x=Y(y),O=i(68),E=Y(O),T=i(27),R=Y(T),A=i(69),w=Y(A),S=i(70),I=Y(S),C=i(71),F=Y(C),D=i(72),U=Y(D),V=i(73),j=Y(V),P=i(13),N=Y(P),k=i(74),L=Y(k),$=i(75),G=Y($),M=i(57),B=Y(M),q=i(41),H=Y(q),X=i(28),K=Y(X),et=i(59),nt=Y(et),ot=i(60),ut=Y(ot),Nt=i(61),Ot=Y(Nt),z=i(108),W=Y(z),Q=i(62),tt=Y(Q);function Y(ft){return ft&&ft.__esModule?ft:{default:ft}}a.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":l.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":_.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":l.DirectionStyle,"attributors/style/font":g.FontStyle,"attributors/style/size":_.SizeStyle},!0),a.default.register({"formats/align":o.AlignClass,"formats/direction":l.DirectionClass,"formats/indent":f.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":g.FontClass,"formats/size":_.SizeClass,"formats/blockquote":h.default,"formats/code-block":N.default,"formats/header":d.default,"formats/list":m.default,"formats/bold":x.default,"formats/code":P.Code,"formats/italic":E.default,"formats/link":R.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":K.default,"ui/icon-picker":ut.default,"ui/color-picker":nt.default,"ui/tooltip":Ot.default},!0),n.default=a.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var s=function(){function m(b,v){for(var g=0;g<v.length;g++){var _=v[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,_.key,_)}}return function(b,v,g){return v&&m(b.prototype,v),g&&m(b,g),b}}(),a=function m(b,v,g){b===null&&(b=Function.prototype);var _=Object.getOwnPropertyDescriptor(b,v);if(_===void 0){var y=Object.getPrototypeOf(b);return y===null?void 0:m(y,v,g)}else{if("value"in _)return _.value;var x=_.get;return x===void 0?void 0:x.call(g)}},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=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:"add",value:function(g,_){if(_==="+1"||_==="-1"){var y=this.value(g)||0;_=_==="+1"?y+1:y-1}return _===0?(this.remove(g),!0):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,g,_)}},{key:"canAdd",value:function(g,_){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,g,_)||a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,g,parseInt(_))}},{key:"value",value:function(g){return parseInt(a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,g))||void 0}}]),b}(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,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,v.key,v)}}return function(p,m,b){return m&&d(p.prototype,m),b&&d(p,b),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(b){return this.tagName.indexOf(b.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 E=0;E<O.length;E++){var T=O[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(x,T.key,T)}}return function(x,O,E){return O&&y(x.prototype,O),E&&y(x,E),x}}(),a=function y(x,O,E){x===null&&(x=Function.prototype);var T=Object.getOwnPropertyDescriptor(x,O);if(T===void 0){var R=Object.getPrototypeOf(x);return R===null?void 0:y(R,O,E)}else{if("value"in T)return T.value;var A=T.get;return A===void 0?void 0:A.call(E)}},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 m(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function b(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 v(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 g=function(y){v(x,y);function x(){return m(this,x),b(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(E,T){E===_.blotName&&!T?this.replaceWith(l.default.create(this.statics.scope)):a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,E,T)}},{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(E,T){return this.parent.isolate(this.offset(this.parent),this.length()),E===this.parent.statics.blotName?(this.parent.replaceWith(E,T),this):(this.parent.unwrap(),a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,E,T))}}],[{key:"formats",value:function(E){return E.tagName===this.tagName?void 0:a(x.__proto__||Object.getPrototypeOf(x),"formats",this).call(this,E)}}]),x}(c.default);g.blotName="list-item",g.tagName="LI";var _=function(y){v(x,y),s(x,null,[{key:"create",value:function(E){var T=E==="ordered"?"OL":"UL",R=a(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,T);return(E==="checked"||E==="unchecked")&&R.setAttribute("data-checked",E==="checked"),R}},{key:"formats",value:function(E){if(E.tagName==="OL")return"ordered";if(E.tagName==="UL")return E.hasAttribute("data-checked")?E.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function x(O){m(this,x);var E=b(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,O)),T=function(A){if(A.target.parentNode===O){var w=E.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",T),O.addEventListener("mousedown",T),E}return s(x,[{key:"format",value:function(E,T){this.children.length>0&&this.children.tail.format(E,T)}},{key:"formats",value:function(){return p({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(E,T){if(E instanceof g)a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,E,T);else{var R=T==null?this.length():T.offset(this),A=this.split(R);A.parent.insertBefore(E,A)}}},{key:"optimize",value:function(E){a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,E);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&T.domNode.tagName===this.domNode.tagName&&T.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(T.moveChildren(this),T.remove())}},{key:"replace",value:function(E){if(E.statics.blotName!==this.statics.blotName){var T=l.default.create(this.statics.defaultChild);E.moveChildren(T),this.appendChild(T)}a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,E)}}]),x}(u.default);_.blotName="list",_.scope=l.default.Scope.BLOCK_BLOT,_.tagName=["OL","UL"],_.defaultChild="list-item",_.allowedChildren=[g],n.ListItem=g,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(m,b){for(var v=0;v<b.length;v++){var g=b[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,b,v){return b&&p(m.prototype,b),v&&p(m,v),m}}(),a=function p(m,b,v){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,b);if(g===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:p(_,b,v)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(v)}},o=i(6),l=f(o);function f(p){return p&&p.__esModule?p:{default:p}}function c(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function h(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function u(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var d=function(p){u(m,p);function m(){return c(this,m),h(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,null,[{key:"create",value:function(v){return v==="super"?document.createElement("sup"):v==="sub"?document.createElement("sub"):a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,v)}},{key:"formats",value:function(v){if(v.tagName==="SUB")return"sub";if(v.tagName==="SUP")return"super"}}]),m}(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 b(v,g){for(var _=0;_<g.length;_++){var y=g[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,g,_){return g&&b(v.prototype,g),_&&b(v,_),v}}(),a=function b(v,g,_){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,g);if(y===void 0){var x=Object.getPrototypeOf(v);return x===null?void 0:b(x,g,_)}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(b){return b&&b.__esModule?b:{default:b}}function h(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function u(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function d(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var p=["alt","height","width"],m=function(b){d(v,b);function v(){return h(this,v),u(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"format",value:function(_,y){p.indexOf(_)>-1?y?this.domNode.setAttribute(_,y):this.domNode.removeAttribute(_):a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,_,y)}}],[{key:"create",value:function(_){var y=a(v.__proto__||Object.getPrototypeOf(v),"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")}}]),v}(l.default.Embed);m.blotName="image",m.tagName="IMG",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function b(v,g){for(var _=0;_<g.length;_++){var y=g[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(v,y.key,y)}}return function(v,g,_){return g&&b(v.prototype,g),_&&b(v,_),v}}(),a=function b(v,g,_){v===null&&(v=Function.prototype);var y=Object.getOwnPropertyDescriptor(v,g);if(y===void 0){var x=Object.getPrototypeOf(v);return x===null?void 0:b(x,g,_)}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(b){return b&&b.__esModule?b:{default:b}}function h(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function u(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function d(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var p=["height","width"],m=function(b){d(v,b);function v(){return h(this,v),u(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"format",value:function(_,y){p.indexOf(_)>-1?y?this.domNode.setAttribute(_,y):this.domNode.removeAttribute(_):a(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,_,y)}}],[{key:"create",value:function(_){var y=a(v.__proto__||Object.getPrototypeOf(v),"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")}}]),v}(o.BlockEmbed);m.blotName="video",m.className="ql-video",m.tagName="IFRAME",n.default=m},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 E=x[O];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(y,E.key,E)}}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 E=Object.getOwnPropertyDescriptor(y,x);if(E===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:_(T,x,O)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.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 m(_,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 b(_,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 v=function(_){b(y,_);function y(){return p(this,y),m(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,null,[{key:"create",value:function(O){var E=a(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,O);return typeof O=="string"&&(window.katex.render(O,E,{throwOnError:!1,errorColor:"#f00"}),E.setAttribute("data-value",O)),E}},{key:"value",value:function(O){return O.getAttribute("data-value")}}]),y}(l.default);v.blotName="formula",v.className="ql-formula",v.tagName="SPAN";var g=function(_){b(y,_),s(y,null,[{key:"register",value:function(){c.default.register(v,!0)}}]);function y(){p(this,y);var x=m(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=v,n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var s=function(){function O(E,T){for(var R=0;R<T.length;R++){var A=T[R];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}return function(E,T,R){return T&&O(E.prototype,T),R&&O(E,R),E}}(),a=function O(E,T,R){E===null&&(E=Function.prototype);var A=Object.getOwnPropertyDescriptor(E,T);if(A===void 0){var w=Object.getPrototypeOf(E);return w===null?void 0:O(w,T,R)}else{if("value"in A)return A.value;var S=A.get;return S===void 0?void 0:S.call(R)}},o=i(0),l=m(o),f=i(5),c=m(f),h=i(9),u=m(h),d=i(13),p=m(d);function m(O){return O&&O.__esModule?O:{default:O}}function b(O,E){if(!(O instanceof E))throw new TypeError("Cannot call a class as a function")}function v(O,E){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:O}function g(O,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);O.prototype=Object.create(E&&E.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(O,E):O.__proto__=E)}var _=function(O){g(E,O);function E(){return b(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return s(E,[{key:"replaceWith",value:function(R){this.domNode.textContent=this.domNode.textContent,this.attach(),a(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"replaceWith",this).call(this,R)}},{key:"highlight",value:function(R){var A=this.domNode.textContent;this.cachedText!==A&&((A.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=R(A),this.domNode.normalize(),this.attach()),this.cachedText=A)}}]),E}(p.default);_.className="ql-syntax";var y=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),x=function(O){g(E,O),s(E,null,[{key:"register",value:function(){c.default.register(y,!0),c.default.register(_,!0)}}]);function E(T,R){b(this,E);var A=v(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,T,R));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(E,[{key:"highlight",value:function(){var R=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(R.options.highlight)}),this.quill.update(c.default.sources.SILENT),A!=null&&this.quill.setSelection(A,c.default.sources.SILENT)}}}]),E}(u.default);x.DEFAULTS={highlight:function(){return window.hljs==null?null:function(O){var E=window.hljs.highlightAuto(O);return E.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 E(T,R,A){T===null&&(T=Function.prototype);var w=Object.getOwnPropertyDescriptor(T,R);if(w===void 0){var S=Object.getPrototypeOf(T);return S===null?void 0:E(S,R,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 E(T,R){for(var A=0;A<R.length;A++){var w=R[A];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}return function(T,R,A){return R&&E(T.prototype,R),A&&E(T,A),T}}(),o=i(3),l=b(o),f=i(8),c=b(f),h=i(43),u=b(h),d=i(15),p=i(41),m=b(p);function b(E){return E&&E.__esModule?E:{default:E}}function v(E,T){if(!(E instanceof T))throw new TypeError("Cannot call a class as a function")}function g(E,T){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:E}function _(E,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);E.prototype=Object.create(T&&T.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(E,T):E.__proto__=T)}var y=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],x=function(E){_(T,E);function T(R,A){v(this,T),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=y);var w=g(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,R,A));return w.quill.container.classList.add("ql-bubble"),w}return a(T,[{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")),m.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),m.default)}}]),T}(u.default);x.DEFAULTS=(0,l.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){T?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var O=function(E){_(T,E);function T(R,A){v(this,T);var w=g(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,R,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],V=w.quill.getIndex(U),j=Math.min(U.length()-1,I.index+I.length-V),P=w.quill.getBounds(new d.Range(V,j));w.position(P)}}else document.activeElement!==w.textbox&&w.quill.hasFocus()&&w.hide()}),w}return a(T,[{key:"listen",value:function(){var A=this;s(T.prototype.__proto__||Object.getPrototypeOf(T.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(T.prototype.__proto__||Object.getPrototypeOf(T.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"}}]),T}(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})})(rf);var OT=rf.exports;const IT=nr(OT),jT="",NT=e=>{const[t,r]=J.useState(!1);console.log("allProps",e);const n=J.useRef(null),i=J.useRef(null),s=J.useRef(null),a=J.useRef(null),o=J.useRef(16),l=J.useRef(null),{uniqueId:f,text:c,locked:h,transformation:u,onTextUpdate:d,pointerdown:p,pointerup:m,mousedown:b,mouseup:v,pointerover:g,mouseover:_,mouseout:y}=e,{scale:x=[1,1],x:O,y:E,rotation:T=1,fontFamily:R="Arial",fontWeight:A="normal",fontStyle:w="normal",fontSize:S=16,fill:I="black",stroke:C,strokeThickness:F,blurRadius:D=0,blurEnabled:U=!1,dropShadowColor:V=null,wordWrapWidth:j=5e7,leading:P=0,letterSpacing:N}=u;at.useEffect(()=>{o.current=Number(S)},[S]);const k=["italic","oblique"].includes(w)?w:void 0,L=["bold","lighter","100","200","300"].includes(A)?A:void 0,$=Number(N)>0?N:void 0,G=at.useMemo(()=>new ee.TextStyle({fontFamily:R,fontSize:S,fill:I||"white",stroke:C,strokeThickness:F,...k&&{fontStyle:k},...L&&{fontWeight:L},...$&&{letterSpacing:$},...U&&{dropShadow:!0,dropShadowBlur:Number(D),dropShadowColor:(V==null?void 0:V.toString())||"black",dropShadowDistance:0},wordWrap:!0,breakWords:!0,wordWrapWidth:j||500,leading:P||0}),[U,D,I,R,S,P,k,L,$,V,C,F,j]);at.useEffect(()=>{l.current={...u}},[u]);const M=B=>{d&&d({text:B,uniqueId:f,droptype:"titles"})};return at.useEffect(()=>{if(t&&s.current){let q=document.getElementById("note-editor");if(q){q.style.position="absolute",q.style.zIndex="10",q.style.left=O+"px",q.style.top=E+"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";const H={esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}};var B=new IT("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{...H}}},placeholder:"Compose your text here...",theme:"snow"});B.on("text-change",function(){M(B.root.innerText)}),B.setText(c),B.focus(),B.off("text-change",()=>{console.log("removed")}),B.hasFocus()||(q.style.display="none")}}},[O,E,t]),ct.jsx(Qs,{...e,children:ct.jsxs(vt.Container,{ref:n,children:[t&&ct.jsx(vt.Container,{ref:s}),ct.jsx(vt.Container,{alpha:t?0:1,ref:a,children:ct.jsx(vt.Text,{style:G,x:O,y:E,rotation:T,anchor:.5,text:c,...!t&&!h&&{interactive:!0,buttonMode:!0,pointerdown:p,pointerout:y,pointerover:g,pointerup:m,mousedown:b,mouseup:v,mouseover:_},ref:i,scale:x})})]})})},RT=vt.withFilters(vt.Container,{blur:ee.filters.BlurFilter,adjust:Fs,matrix:ee.filters.ColorMatrixFilter}),CT=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],PT={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},kT=e=>{const[t,r]=at.useState(!1),[,n]=J.useState(!1),[,i]=at.useState({isWaiting:!1,isStalled:!1}),[s,a]=at.useState(),[o,l]=J.useState(!1),f=J.useRef(null),c=J.useRef(null),h=J.useRef(null),u=J.useRef(null),d=J.useRef(null),p=J.useRef(null),m=J.useRef(PT),{tl:b,playerTimeRef:v,isDragging:g}=J.useContext(Ar),{uniqueId:_,mute:y=!1,locked:x=!1,src:O,startAt:E,endAt:T,frameStartAt:R,frameEndAt:A,initialAlpha:w,transformation:{x:S,y:I,width:C,height:F,scale:D,rotation:U,animation:V,colorCorrection:j,effect:P},pointerdown:N,pointerup:k,mousedown:L,mouseup:$,pointerover:G,mouseover:M,mouseout:B,applyTransformer:q,onAnchorTransformationEnd:H}=e,X=O||"",{contrast:K=1,saturation:et=1,exposure:nt=1,blurRadius:ot=0,alpha:ut=1}=j||{},Nt={brightness:nt,contrast:K,saturation:et,alpha:ut},Ot=at.useCallback(()=>{l(!0)},[]),z=at.useCallback(Z=>{console.log("changeEnd",Z),H&&(console.log("running onAnchorTransformationEnd"),H(Z))},[]),W=at.useMemo(()=>{const Z=document.createElement("video");return Z.src=O,Z.crossOrigin="Anonymus",Z.autoplay=!1,Z.currentTime=1e-4,Z},[O]);en(Ue.PAUSE,Z=>{if(console.log("pause event",Z),p.current){const st=p.current;st.currentTime>0&&!st.paused&&!st.ended&&st.readyState>st.HAVE_CURRENT_DATA&&p.current.pause(),m.current.isPlaying=!1}}),at.useEffect(()=>{console.log("current",p.current,g),p.current&&(g?(p.current.pause(),m.current.isPlaying=!1,m.current.isDragging=!0):m.current.isDragging=!1)},[g]);const Q=Z=>{p.current&&(console.log("video gsapOnStart",v.current,g),v.current>=Z&&v.current<=T&&!g&&(p.current.currentTime=Number(R)||Number(Z),p.current.play(),m.current.isPlaying=!0))},tt=()=>{if(console.log("onComplete triggered"),p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&p.current.pause(),m.current.isPlaying=!1}},Y=()=>{},ft=()=>{if(p.current){Math.abs(p.current.currentTime-v.current);const Z=p.current,st=Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA;m.current.isDragging?(console.log("video updating",v.current),p.current.currentTime=v.current,p.current.play(),setTimeout(()=>{m.current.isPlaying=!1,p.current&&p.current.pause()},55),m.current.isPlaying=!1):m.current.isPlaying||(st||p.current.play(),m.current.isPlaying=!0)}};return J.useEffect(()=>{let Z=pe.context(()=>{});if(c.current&&b.current){const st={duration:Number(T)-Number(E),onStart:Q,onComplete:tt,onStartParams:[E],onCompleteParams:[],onInterrupt:Y,onUpdate:ft,onUpdateParams:[]},At=Ds(V||"None");Z=pe.context(()=>{var qt,bt;te(At.from)?te(At.to)?te(At.fromTo)?b.current.to(c.current,{alpha:1,duration:.01},E).from(u.current,{...st},E).to(c.current,{alpha:0,duration:.1},Number(T)-.1):b.current.fromTo(c.current,(qt=At.fromTo)==null?void 0:qt.from,(bt=At.fromTo)==null?void 0:bt.to,E).from(u.current,{...st},E).to(c.current,{alpha:0,duration:.2},T-.2):b.current.to(c.current,{alpha:1,duration:.2,...At.to},E).from(u.current,{...st},E).to(c.current,{alpha:0,duration:.2},T-.2):b.current.from(c.current,{...At.from},E).to(u.current,{alpha:1,duration:.2},E).from(u.current,{...st},E).to(c.current,{alpha:0,duration:.2},T-.2)})}return()=>Z.revert()},[V,E,T]),at.useEffect(()=>{c.current&&r(!0)},[]),at.useEffect(()=>{p.current&&(p.current.muted=y)},[y]),at.useEffect(()=>{if(p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&(o||g)&&(p.current.pause(),m.current.isPlaying=!1)}},[o,g]),at.useEffect(()=>{const Z=Math.round((Number(R)+Number.EPSILON)*100)/100,st=function(){p.current&&(p.current.currentTime=Z)},At=function(){if(p.current){const Ht=p.current;Ht.currentTime>0&&!Ht.paused&&!Ht.ended&&Ht.readyState>Ht.HAVE_CURRENT_DATA&&p.current.pause()}i({isWaiting:!1,isStalled:!1})},qt=function(){p.current&&p.current.pause(),i({isWaiting:!0,isStalled:!1})},bt=function(){i({isWaiting:!1,isStalled:!1})},Et=function(){i({isWaiting:!1,isStalled:!0})},Tt=Math.round((Number(R)+Number.EPSILON)*100)/100,Lt=Math.round((Number(A)+Number.EPSILON)*100)/100,de=`${X}#t=${Tt},${Lt}`;return console.log("urlTimestap",de),ee.Texture.fromLoader(W,de,_,{pixiIdPrefix:_,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(Ht=>{Ht&&(a(Ht),console.log(Ht.baseTexture.resource.source),p.current=Ht.baseTexture.resource.source,p.current.id=_,p.current.addEventListener("loadedmetadata",st),p.current.addEventListener("ended",At),p.current.addEventListener("loadstart",qt),p.current.addEventListener("canplaythrough",bt),p.current.addEventListener("stalled",Et))}),()=>{p.current.removeEventListener("loadedmetadata",st),p.current.removeEventListener("ended",At),p.current.removeEventListener("loadstart",qt),p.current.removeEventListener("canplaythrough",bt),p.current.removeEventListener("stalled",Et)}},[X,_,R,A,W]),ct.jsxs(vt.Container,{ref:h,children:[ct.jsx(vt.Container,{ref:c,alpha:w,position:[S,I],pivot:[S,I],width:C,height:F,children:ct.jsx(RT,{scale:1,blur:{blur:ot,quality:4},adjust:Nt,apply:({matrix:Z})=>{P==="BlackAndWhite"?Z.desaturate():P==="Sepia"?Z.sepia():P==="RetroVintage"||P==="NightVision"?Z.negative():P==="Normal"&&Z.reset()},matrix:{enabled:!0,matrix:CT},children:ct.jsx(vt.Container,{ref:u,children:s&&ct.jsx(vt.Sprite,{texture:s,width:C,height:F,anchor:.5,x:S,y:I,...!x&&!o&&{interactive:!0,buttonMode:!0,pointerdown:N,pointerover:G,pointerout:B,mousedown:L,mouseover:M,mouseout:B,mouseup:$,pointerup:k},ref:f,scale:D,rotation:U})})})}),q&&ct.jsx(Bs,{pixiTransformerRef:d,imageRef:c,isMounted:t,transformCommit:z,transformChange:Ot,mouseoverEvent:n,uniqueId:_})]})};var nf=(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))(nf||{}),sf=(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))(sf||{});Rt.Animations=nf,Rt.BlendModes=sf,Rt.Events=Ue,Rt.GsapPixieContext=Ar,Rt.GsapPixieContextProvider=Ip,Rt.PixiAnimatedSprite=ef,Rt.PixiAudioSprite=Ug,Rt.PixiGifSprite=ST,Rt.PixiImageSprite=Am,Rt.PixiSvgPathSprite=Bg,Rt.PixiTextSprite=NT,Rt.PixiVideoSprite=kT,Object.defineProperty(Rt,Symbol.toStringTag,{value:"Module"})});