reacthub-pixitweenjs 0.2.30 → 0.2.31

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(Nt,tt){typeof exports=="object"&&typeof module<"u"?tt(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"],tt):(Nt=typeof globalThis<"u"?globalThis:Nt||self,tt(Nt["reacthub-pixitweenjs"]={},Nt.React,Nt.PIXIReact,Nt.gsap,Nt.PIXI,Nt.PIXI.sound))})(this,function(Nt,tt,yt,ve,Zh,Qh){"use strict";function qo(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=qo(tt),ne=qo(Zh);var Ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jh(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 zo={exports:{}},Tn={};/**
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 tc=tt,ec=Symbol.for("react.element"),rc=Symbol.for("react.fragment"),nc=Object.prototype.hasOwnProperty,ic=tc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sc={key:!0,ref:!0,__self:!0,__source:!0};function Vo(e,t,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)nc.call(t,n)&&!sc.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:ec,type:e,key:s,ref:o,props:i,_owner:ic.current}}Tn.Fragment=rc,Tn.jsx=Vo,Tn.jsxs=Vo,zo.exports=Tn;var dt=zo.exports,qe=(e=>(e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2",e))(qe||{}),Xo=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS",e))(Xo||{}),qi=(e=>(e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL",e))(qi||{}),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||{}),Me=(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))(Me||{}),nt=(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))(nt||{}),cr=(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))(cr||{}),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||{}),zi=(e=>(e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT",e))(zi||{}),Te=(e=>(e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR",e))(Te||{}),Vr=(e=>(e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e))(Vr||{}),ze=(e=>(e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL",e))(ze||{}),Le=(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))(Le||{}),Ve=(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))(Ve||{}),Vi=(e=>(e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL",e))(Vi||{}),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||{}),me=(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))(me||{});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 Xi=/iPhone/i,Wo=/iPod/i,Yo=/iPad/i,Ko=/\biOS-universal(?:.+)Mac\b/i,Wi=/\bAndroid(?:.+)Mobile\b/i,Zo=/Android/i,fr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,wn=/Silk/i,we=/Windows Phone/i,Qo=/\bWindows(?:.+)ARM\b/i,Jo=/BlackBerry/i,ta=/BB10/i,ea=/Opera Mini/i,ra=/\b(CriOS|Chrome)(?:.+)Mobile/i,na=/Mobile(?:.+)Firefox\b/i,ia=function(e){return typeof e<"u"&&e.platform==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1&&typeof MSStream>"u"};function oc(e){return function(t){return t.test(e)}}function sa(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=oc(r),s={apple:{phone:i(Xi)&&!i(we),ipod:i(Wo),tablet:!i(Xi)&&(i(Yo)||ia(t))&&!i(we),universal:i(Ko),device:(i(Xi)||i(Wo)||i(Yo)||i(Ko)||ia(t))&&!i(we)},amazon:{phone:i(fr),tablet:!i(fr)&&i(wn),device:i(fr)||i(wn)},android:{phone:!i(we)&&i(fr)||!i(we)&&i(Wi),tablet:!i(we)&&!i(fr)&&!i(Wi)&&(i(wn)||i(Zo)),device:!i(we)&&(i(fr)||i(wn)||i(Wi)||i(Zo))||i(/\bokhttp\b/i)},windows:{phone:i(we),tablet:i(Qo),device:i(we)||i(Qo)},other:{blackberry:i(Jo),blackberry10:i(ta),opera:i(ea),firefox:i(na),chrome:i(ra),device:i(Jo)||i(ta)||i(ea)||i(na)||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 dr=(sa.default??sa)(globalThis.navigator);vt.RETINA_PREFIX=/@([0-9\.]+)x/,vt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var oa={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 o(l,h){--l._eventsCount===0?l._events=new n:delete l._events[h]}function a(){this._events=new n,this._eventsCount=0}a.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},a.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},a.prototype.listenerCount=function(h){var c=r?r+h:h,f=this._events[c];return f?f.fn?1:f.length:0},a.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},a.prototype.on=function(h,c,f){return s(this,h,c,f,!1)},a.prototype.once=function(h,c,f){return s(this,h,c,f,!0)},a.prototype.removeListener=function(h,c,f,u){var d=r?r+h:h;if(!this._events[d])return this;if(!c)return o(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!u||p.once)&&(!f||p.context===f)&&o(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:o(this,d)}return this},a.prototype.removeAllListeners=function(h){var c;return h?(c=r?r+h:h,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a})(oa);var ac=oa.exports;const Xr=hr(ac);var Yi={exports:{}};Yi.exports=An,Yi.exports.default=An;function An(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,s=aa(e,0,i,r,!0),o=[];if(!s||s.next===s.prev)return o;var a,l,h,c,f,u,d;if(n&&(s=fc(e,t,s,r)),e.length>80*r){a=h=e[0],l=c=e[1];for(var p=r;p<i;p+=r)f=e[p],u=e[p+1],f<a&&(a=f),u<l&&(l=u),f>h&&(h=f),u>c&&(c=u);d=Math.max(h-a,c-l),d=d!==0?32767/d:0}return Wr(s,o,r,a,l,d,0),o}function aa(e,t,r,n,i){var s,o;if(i===Qi(e,t,r,n)>0)for(s=t;s<r;s+=n)o=ha(s,e[s],e[s+1],o);else for(s=r-n;s>=t;s-=n)o=ha(s,e[s],e[s+1],o);return o&&Sn(o,o.next)&&(Kr(o),o=o.next),o}function Xe(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Sn(r,r.next)||Ct(r.prev,r,r.next)===0)){if(Kr(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function Wr(e,t,r,n,i,s,o){if(e){!o&&s&&mc(e,n,i,s);for(var a=e,l,h;e.prev!==e.next;){if(l=e.prev,h=e.next,s?uc(e,n,i,s):lc(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(h.i/r|0),Kr(e),e=h.next,a=h.next;continue}if(e=h,e===a){o?o===1?(e=hc(Xe(e),t,r),Wr(e,t,r,n,i,s,2)):o===2&&cc(e,t,r,n,i,s):Wr(Xe(e),t,r,n,i,s,1);break}}}}function lc(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,o=n.x,a=t.y,l=r.y,h=n.y,c=i<s?i<o?i:o:s<o?s:o,f=a<l?a<h?a:h:l<h?l:h,u=i>s?i>o?i:o:s>o?s:o,d=a>l?a>h?a:h:l>h?l:h,p=n.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=f&&p.y<=d&&pr(i,a,s,l,o,h,p.x,p.y)&&Ct(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function uc(e,t,r,n){var i=e.prev,s=e,o=e.next;if(Ct(i,s,o)>=0)return!1;for(var a=i.x,l=s.x,h=o.x,c=i.y,f=s.y,u=o.y,d=a<l?a<h?a:h:l<h?l:h,p=c<f?c<u?c:u:f<u?f:u,v=a>l?a>h?a:h:l>h?l:h,g=c>f?c>u?c:u:f>u?f:u,y=Ki(d,p,t,r,n),b=Ki(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&&_!==o&&pr(a,c,l,f,h,u,_.x,_.y)&&Ct(_.prev,_,_.next)>=0||(_=_.prevZ,m.x>=d&&m.x<=v&&m.y>=p&&m.y<=g&&m!==i&&m!==o&&pr(a,c,l,f,h,u,m.x,m.y)&&Ct(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;_&&_.z>=y;){if(_.x>=d&&_.x<=v&&_.y>=p&&_.y<=g&&_!==i&&_!==o&&pr(a,c,l,f,h,u,_.x,_.y)&&Ct(_.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!==o&&pr(a,c,l,f,h,u,m.x,m.y)&&Ct(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function hc(e,t,r){var n=e;do{var i=n.prev,s=n.next.next;!Sn(i,s)&&la(i,n,n.next,s)&&Yr(i,s)&&Yr(s,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(s.i/r|0),Kr(n),Kr(n.next),n=e=s),n=n.next}while(n!==e);return Xe(n)}function cc(e,t,r,n,i,s){var o=e;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&_c(o,a)){var l=ua(o,a);o=Xe(o,o.next),l=Xe(l,l.next),Wr(o,t,r,n,i,s,0),Wr(l,t,r,n,i,s,0);return}a=a.next}o=o.next}while(o!==e)}function fc(e,t,r,n){var i=[],s,o,a,l,h;for(s=0,o=t.length;s<o;s++)a=t[s]*n,l=s<o-1?t[s+1]*n:e.length,h=aa(e,a,l,n,!1),h===h.next&&(h.steiner=!0),i.push(bc(h));for(i.sort(dc),s=0;s<i.length;s++)r=pc(i[s],r);return r}function dc(e,t){return e.x-t.x}function pc(e,t){var r=yc(e,t);if(!r)return t;var n=ua(r,e);return Xe(n,n.next),Xe(r,r.next)}function yc(e,t){var r=t,n=e.x,i=e.y,s=-1/0,o;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s&&(s=a,o=r.x<r.next.x?r:r.next,a===n))return o}r=r.next}while(r!==t);if(!o)return null;var l=o,h=o.x,c=o.y,f=1/0,u;r=o;do n>=r.x&&r.x>=h&&n!==r.x&&pr(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),Yr(r,e)&&(u<f||u===f&&(r.x>o.x||r.x===o.x&&vc(o,r)))&&(o=r,f=u)),r=r.next;while(r!==l);return o}function vc(e,t){return Ct(e.prev,e,t.prev)<0&&Ct(t.next,e,e.next)<0}function mc(e,t,r,n){var i=e;do i.z===0&&(i.z=Ki(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,gc(i)}function gc(e){var t,r,n,i,s,o,a,l,h=1;do{for(r=e,e=null,s=null,o=0;r;){for(o++,n=r,a=0,t=0;t<h&&(a++,n=n.nextZ,!!n);t++);for(l=h;a>0||l>0&&n;)a!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,a--):(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(o>1);return e}function Ki(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 bc(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 pr(e,t,r,n,i,s,o,a){return(i-o)*(t-a)>=(e-o)*(s-a)&&(e-o)*(n-a)>=(r-o)*(t-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function _c(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!xc(e,t)&&(Yr(e,t)&&Yr(t,e)&&Ec(e,t)&&(Ct(e.prev,e,t.prev)||Ct(e,t.prev,t))||Sn(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 Sn(e,t){return e.x===t.x&&e.y===t.y}function la(e,t,r,n){var i=Rn(Ct(e,t,r)),s=Rn(Ct(e,t,n)),o=Rn(Ct(r,n,e)),a=Rn(Ct(r,n,t));return!!(i!==s&&o!==a||i===0&&On(e,r,t)||s===0&&On(e,n,t)||o===0&&On(r,e,n)||a===0&&On(r,t,n))}function On(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 Rn(e){return e>0?1:e<0?-1:0}function xc(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&&la(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Yr(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 Ec(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 ua(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 ha(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 Kr(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}An.deviation=function(e,t,r,n){var i=t&&t.length,s=i?t[0]*r:e.length,o=Math.abs(Qi(e,0,s,r));if(i)for(var a=0,l=t.length;a<l;a++){var h=t[a]*r,c=a<l-1?t[a+1]*r:e.length;o-=Math.abs(Qi(e,h,c,r))}var f=0;for(a=0;a<n.length;a+=3){var u=n[a]*r,d=n[a+1]*r,p=n[a+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 o===0&&f===0?0:Math.abs((f-o)/o)};function Qi(e,t,r,n){for(var i=0,s=t,o=r-n;s<r;s+=n)i+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return i}An.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 o=0;o<t;o++)r.vertices.push(e[i][s][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r};var Tc=Yi.exports;const wc=hr(Tc);var In={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */In.exports,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof Ce=="object"&&Ce;(s.global===s||s.window===s||s.self===s)&&(r=s);var o,a=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,E;function T(N){throw new RangeError(_[N])}function P(N,I){for(var C=N.length,L=[];C--;)L[C]=I(N[C]);return L}function A(N,I){var C=N.split("@"),L="";C.length>1&&(L=C[0]+"@",N=C[1]),N=N.replace(b,".");var G=N.split("."),$=P(G,I).join(".");return L+$}function w(N){for(var I=[],C=0,L=N.length,G,$;C<L;)G=N.charCodeAt(C++),G>=55296&&G<=56319&&C<L?($=N.charCodeAt(C++),($&64512)==56320?I.push(((G&1023)<<10)+($&1023)+65536):(I.push(G),C--)):I.push(G);return I}function O(N){return P(N,function(I){var C="";return I>65535&&(I-=65536,C+=S(I>>>10&1023|55296),I=56320|I&1023),C+=S(I),C}).join("")}function R(N){return N-48<10?N-22:N-65<26?N-65:N-97<26?N-97:l}function k(N,I){return N+22+75*(N<26)-((I!=0)<<5)}function B(N,I,C){var L=0;for(N=C?x(N/u):N>>1,N+=x(N/I);N>m*c>>1;L+=l)N=x(N/m);return x(L+(m+1)*N/(N+f))}function U(N){var I=[],C=N.length,L,G=0,$=p,M=d,F,H,q,X,K,rt,it,lt,ht;for(F=N.lastIndexOf(v),F<0&&(F=0),H=0;H<F;++H)N.charCodeAt(H)>=128&&T("not-basic"),I.push(N.charCodeAt(H));for(q=F>0?F+1:0;q<C;){for(X=G,K=1,rt=l;q>=C&&T("invalid-input"),it=R(N.charCodeAt(q++)),(it>=l||it>x((a-G)/K))&&T("overflow"),G+=it*K,lt=rt<=M?h:rt>=M+c?c:rt-M,!(it<lt);rt+=l)ht=l-lt,K>x(a/ht)&&T("overflow"),K*=ht;L=I.length+1,M=B(G-X,L,X==0),x(G/L)>a-$&&T("overflow"),$+=x(G/L),G%=L,I.splice(G++,0,$)}return O(I)}function D(N){var I,C,L,G,$,M,F,H,q,X,K,rt=[],it,lt,ht,kt;for(N=w(N),it=N.length,I=p,C=0,$=d,M=0;M<it;++M)K=N[M],K<128&&rt.push(S(K));for(L=G=rt.length,G&&rt.push(v);L<it;){for(F=a,M=0;M<it;++M)K=N[M],K>=I&&K<F&&(F=K);for(lt=L+1,F-I>x((a-C)/lt)&&T("overflow"),C+=(F-I)*lt,I=F,M=0;M<it;++M)if(K=N[M],K<I&&++C>a&&T("overflow"),K==I){for(H=C,q=l;X=q<=$?h:q>=$+c?c:q-$,!(H<X);q+=l)kt=H-X,ht=l-X,rt.push(S(k(X+kt%ht,0))),H=x(kt/ht);rt.push(S(k(H,0))),$=B(C,lt,L==G),C=0,++L}++C,++I}return rt.join("")}function z(N){return A(N,function(I){return g.test(I)?U(I.slice(4).toLowerCase()):I})}function j(N){return A(N,function(I){return y.test(I)?"xn--"+D(I):I})}if(o={version:"1.4.1",ucs2:{decode:w,encode:O},decode:U,encode:D,toASCII:j,toUnicode:z},n&&i)if(e.exports==n)i.exports=o;else for(E in o)o.hasOwnProperty(E)&&(n[E]=o[E]);else r.punycode=o})(Ce)}(In,In.exports);var Ac=In.exports,Sc=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 o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},ca=typeof Symbol<"u"&&Symbol,Oc=Sc,Rc=function(){return typeof ca!="function"||typeof Symbol!="function"||typeof ca("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Oc()},fa={foo:{}},Ic=Object,Pc=function(){return{__proto__:fa}.foo===fa.foo&&!({__proto__:null}instanceof Ic)},kc="Function.prototype.bind called on incompatible ",Ji=Array.prototype.slice,Nc=Object.prototype.toString,Cc="[object Function]",Mc=function(t){var r=this;if(typeof r!="function"||Nc.call(r)!==Cc)throw new TypeError(kc+r);for(var n=Ji.call(arguments,1),i,s=function(){if(this instanceof i){var c=r.apply(this,n.concat(Ji.call(arguments)));return Object(c)===c?c:this}else return r.apply(t,n.concat(Ji.call(arguments)))},o=Math.max(0,r.length-n.length),a=[],l=0;l<o;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.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},Lc=Mc,ts=Function.prototype.bind||Lc,Bc=ts,Fc=Bc.call(Function.call,Object.prototype.hasOwnProperty),pt,yr=SyntaxError,da=Function,vr=TypeError,es=function(e){try{return da('"use strict"; return ('+e+").constructor;")()}catch{}},We=Object.getOwnPropertyDescriptor;if(We)try{We({},"")}catch{We=null}var rs=function(){throw new vr},Dc=We?function(){try{return arguments.callee,rs}catch{try{return We(arguments,"callee").get}catch{return rs}}}():rs,mr=Rc(),Uc=Pc(),jt=Object.getPrototypeOf||(Uc?function(e){return e.__proto__}:null),gr={},jc=typeof Uint8Array>"u"||!jt?pt:jt(Uint8Array),Ye={"%AggregateError%":typeof AggregateError>"u"?pt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pt:ArrayBuffer,"%ArrayIteratorPrototype%":mr&&jt?jt([][Symbol.iterator]()):pt,"%AsyncFromSyncIteratorPrototype%":pt,"%AsyncFunction%":gr,"%AsyncGenerator%":gr,"%AsyncGeneratorFunction%":gr,"%AsyncIteratorPrototype%":gr,"%Atomics%":typeof Atomics>"u"?pt:Atomics,"%BigInt%":typeof BigInt>"u"?pt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?pt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pt:FinalizationRegistry,"%Function%":da,"%GeneratorFunction%":gr,"%Int8Array%":typeof Int8Array>"u"?pt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":mr&&jt?jt(jt([][Symbol.iterator]())):pt,"%JSON%":typeof JSON=="object"?JSON:pt,"%Map%":typeof Map>"u"?pt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!mr||!jt?pt:jt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pt:Promise,"%Proxy%":typeof Proxy>"u"?pt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?pt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!mr||!jt?pt:jt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":mr&&jt?jt(""[Symbol.iterator]()):pt,"%Symbol%":mr?Symbol:pt,"%SyntaxError%":yr,"%ThrowTypeError%":Dc,"%TypedArray%":jc,"%TypeError%":vr,"%Uint8Array%":typeof Uint8Array>"u"?pt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?pt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pt:WeakSet};if(jt)try{null.error}catch(e){var Gc=jt(jt(e));Ye["%Error.prototype%"]=Gc}var $c=function e(t){var r;if(t==="%AsyncFunction%")r=es("async function () {}");else if(t==="%GeneratorFunction%")r=es("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=es("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 Ye[t]=r,r},pa={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Zr=ts,Pn=Fc,Hc=Zr.call(Function.call,Array.prototype.concat),qc=Zr.call(Function.apply,Array.prototype.splice),ya=Zr.call(Function.call,String.prototype.replace),kn=Zr.call(Function.call,String.prototype.slice),zc=Zr.call(Function.call,RegExp.prototype.exec),Vc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Xc=/\\(\\)?/g,Wc=function(t){var r=kn(t,0,1),n=kn(t,-1);if(r==="%"&&n!=="%")throw new yr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new yr("invalid intrinsic syntax, expected opening `%`");var i=[];return ya(t,Vc,function(s,o,a,l){i[i.length]=a?ya(l,Xc,"$1"):o||s}),i},Yc=function(t,r){var n=t,i;if(Pn(pa,n)&&(i=pa[n],n="%"+i[0]+"%"),Pn(Ye,n)){var s=Ye[n];if(s===gr&&(s=$c(n)),typeof s>"u"&&!r)throw new vr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new yr("intrinsic "+t+" does not exist!")},ns=function(t,r){if(typeof t!="string"||t.length===0)throw new vr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new vr('"allowMissing" argument must be a boolean');if(zc(/^%?[^%]*%?$/,t)===null)throw new yr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wc(t),i=n.length>0?n[0]:"",s=Yc("%"+i+"%",r),o=s.name,a=s.value,l=!1,h=s.alias;h&&(i=h[0],qc(n,Hc([0,1],h)));for(var c=1,f=!0;c<n.length;c+=1){var u=n[c],d=kn(u,0,1),p=kn(u,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new yr("property names with quotes must have matching quotes");if((u==="constructor"||!f)&&(l=!0),i+="."+u,o="%"+i+"%",Pn(Ye,o))a=Ye[o];else if(a!=null){if(!(u in a)){if(!r)throw new vr("base intrinsic for "+t+" exists, but the property is not available.");return}if(We&&c+1>=n.length){var v=We(a,u);f=!!v,f&&"get"in v&&!("originalValue"in v.get)?a=v.get:a=a[u]}else f=Pn(a,u),a=a[u];f&&!l&&(Ye[o]=a)}}return a},va={exports:{}};(function(e){var t=ts,r=ns,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||t.call(i,n),o=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}e.exports=function(f){var u=s(t,i,arguments);if(o&&a){var d=o(u,"length");d.configurable&&a(u,"length",{value:1+l(0,f.length-(arguments.length-1))})}return u};var h=function(){return s(t,n,arguments)};a?a(e.exports,"apply",{value:h}):e.exports.apply=h})(va);var Kc=va.exports,ma=ns,ga=Kc,Zc=ga(ma("String.prototype.indexOf")),Qc=function(t,r){var n=ma(t,!!r);return typeof n=="function"&&Zc(t,".prototype.")>-1?ga(n):n};const Jc=Jh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var is=typeof Map=="function"&&Map.prototype,ss=Object.getOwnPropertyDescriptor&&is?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Nn=is&&ss&&typeof ss.get=="function"?ss.get:null,ba=is&&Map.prototype.forEach,os=typeof Set=="function"&&Set.prototype,as=Object.getOwnPropertyDescriptor&&os?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cn=os&&as&&typeof as.get=="function"?as.get:null,_a=os&&Set.prototype.forEach,tf=typeof WeakMap=="function"&&WeakMap.prototype,Qr=tf?WeakMap.prototype.has:null,ef=typeof WeakSet=="function"&&WeakSet.prototype,Jr=ef?WeakSet.prototype.has:null,rf=typeof WeakRef=="function"&&WeakRef.prototype,xa=rf?WeakRef.prototype.deref:null,nf=Boolean.prototype.valueOf,sf=Object.prototype.toString,of=Function.prototype.toString,af=String.prototype.match,ls=String.prototype.slice,Be=String.prototype.replace,lf=String.prototype.toUpperCase,Ea=String.prototype.toLowerCase,Ta=RegExp.prototype.test,wa=Array.prototype.concat,ge=Array.prototype.join,uf=Array.prototype.slice,Aa=Math.floor,us=typeof BigInt=="function"?BigInt.prototype.valueOf:null,hs=Object.getOwnPropertySymbols,cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,br=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===br||"symbol")?Symbol.toStringTag:null,Sa=Object.prototype.propertyIsEnumerable,Oa=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Ra(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Ta.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-Aa(-e):Aa(e);if(n!==e){var i=String(n),s=ls.call(t,i.length+1);return Be.call(i,r,"$&_")+"."+Be.call(Be.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Be.call(t,r,"$&_")}var fs=Jc,Ia=fs.custom,Pa=Ca(Ia)?Ia:null,hf=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 o=Fe(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="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 a=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 La(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?Ra(t,l):l}if(typeof t=="bigint"){var h=String(t)+"n";return a?Ra(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 ds(t)?"[Array]":"[Object]";var f=Rf(s,n);if(typeof i>"u")i=[];else if(Ma(i,t)>=0)return"[Circular]";function u(R,k,B){if(k&&(i=uf.call(i),i.push(k)),B){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"&&!Na(t)){var d=bf(t),p=Mn(t,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+ge.call(p,", ")+" }":"")}if(Ca(t)){var v=br?Be.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):cs.call(t);return typeof t=="object"&&!br?tn(v):v}if(Af(t)){for(var g="<"+Ea.call(String(t.nodeName)),y=t.attributes||[],b=0;b<y.length;b++)g+=" "+y[b].name+"="+ka(cf(y[b].value),"double",s);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+Ea.call(String(t.nodeName))+">",g}if(ds(t)){if(t.length===0)return"[]";var _=Mn(t,u);return f&&!Of(_)?"["+ys(_,f)+"]":"[ "+ge.call(_,", ")+" ]"}if(df(t)){var m=Mn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!Sa.call(t,"cause")?"{ ["+String(t)+"] "+ge.call(wa.call("[cause]: "+u(t.cause),m),", ")+" }":m.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ge.call(m,", ")+" }"}if(typeof t=="object"&&o){if(Pa&&typeof t[Pa]=="function"&&fs)return fs(t,{depth:c-n});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(_f(t)){var x=[];return ba&&ba.call(t,function(R,k){x.push(u(k,t,!0)+" => "+u(R,t))}),Ba("Map",Nn.call(t),x,f)}if(Tf(t)){var S=[];return _a&&_a.call(t,function(R){S.push(u(R,t))}),Ba("Set",Cn.call(t),S,f)}if(xf(t))return ps("WeakMap");if(wf(t))return ps("WeakSet");if(Ef(t))return ps("WeakRef");if(yf(t))return tn(u(Number(t)));if(mf(t))return tn(u(us.call(t)));if(vf(t))return tn(nf.call(t));if(pf(t))return tn(u(String(t)));if(!ff(t)&&!Na(t)){var E=Mn(t,u),T=Oa?Oa(t)===Object.prototype:t instanceof Object||t.constructor===Object,P=t instanceof Object?"":"null prototype",A=!T&&Vt&&Object(t)===t&&Vt in t?ls.call(De(t),8,-1):P?"Object":"",w=T||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",O=w+(A||P?"["+ge.call(wa.call([],A||[],P||[]),": ")+"] ":"");return E.length===0?O+"{}":f?O+"{"+ys(E,f)+"}":O+"{ "+ge.call(E,", ")+" }"}return String(t)};function ka(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function cf(e){return Be.call(String(e),/"/g,"&quot;")}function ds(e){return De(e)==="[object Array]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function ff(e){return De(e)==="[object Date]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Na(e){return De(e)==="[object RegExp]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function df(e){return De(e)==="[object Error]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function pf(e){return De(e)==="[object String]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function yf(e){return De(e)==="[object Number]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function vf(e){return De(e)==="[object Boolean]"&&(!Vt||!(typeof e=="object"&&Vt in e))}function Ca(e){if(br)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!cs)return!1;try{return cs.call(e),!0}catch{}return!1}function mf(e){if(!e||typeof e!="object"||!us)return!1;try{return us.call(e),!0}catch{}return!1}var gf=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,t){return gf.call(e,t)}function De(e){return sf.call(e)}function bf(e){if(e.name)return e.name;var t=af.call(of.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Ma(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 _f(e){if(!Nn||!e||typeof e!="object")return!1;try{Nn.call(e);try{Cn.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function xf(e){if(!Qr||!e||typeof e!="object")return!1;try{Qr.call(e,Qr);try{Jr.call(e,Jr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Ef(e){if(!xa||!e||typeof e!="object")return!1;try{return xa.call(e),!0}catch{}return!1}function Tf(e){if(!Cn||!e||typeof e!="object")return!1;try{Cn.call(e);try{Nn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function wf(e){if(!Jr||!e||typeof e!="object")return!1;try{Jr.call(e,Jr);try{Qr.call(e,Qr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Af(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function La(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return La(ls.call(e,0,t.maxStringLength),t)+n}var i=Be.call(Be.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Sf);return ka(i,"single",t)}function Sf(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":"")+lf.call(t.toString(16))}function tn(e){return"Object("+e+")"}function ps(e){return e+" { ? }"}function Ba(e,t,r,n){var i=n?ys(r,n):ge.call(r,", ");return e+" ("+t+") {"+i+"}"}function Of(e){for(var t=0;t<e.length;t++)if(Ma(e[t],`
10
+ `)>=0)return!1;return!0}function Rf(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=ge.call(Array(e.indent+1)," ");else return null;return{base:r,prev:ge.call(Array(t+1),r)}}function ys(e,t){if(e.length===0)return"";var r=`
11
+ `+t.prev+t.base;return r+ge.call(e,","+r)+`
12
+ `+t.prev}function Mn(e,t){var r=ds(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 hs=="function"?hs(e):[],o;if(br){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in e)Fe(e,l)&&(r&&String(Number(l))===l&&l<e.length||br&&o["$"+l]instanceof Symbol||(Ta.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof hs=="function")for(var h=0;h<s.length;h++)Sa.call(e,s[h])&&n.push("["+t(s[h])+"]: "+t(e[s[h]],e));return n}var vs=ns,_r=Qc,If=hf,Pf=vs("%TypeError%"),Ln=vs("%WeakMap%",!0),Bn=vs("%Map%",!0),kf=_r("WeakMap.prototype.get",!0),Nf=_r("WeakMap.prototype.set",!0),Cf=_r("WeakMap.prototype.has",!0),Mf=_r("Map.prototype.get",!0),Lf=_r("Map.prototype.set",!0),Bf=_r("Map.prototype.has",!0),ms=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},Ff=function(e,t){var r=ms(e,t);return r&&r.value},Df=function(e,t,r){var n=ms(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},Uf=function(e,t){return!!ms(e,t)},jf=function(){var t,r,n,i={assert:function(s){if(!i.has(s))throw new Pf("Side channel does not contain "+If(s))},get:function(s){if(Ln&&s&&(typeof s=="object"||typeof s=="function")){if(t)return kf(t,s)}else if(Bn){if(r)return Mf(r,s)}else if(n)return Ff(n,s)},has:function(s){if(Ln&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Cf(t,s)}else if(Bn){if(r)return Bf(r,s)}else if(n)return Uf(n,s);return!1},set:function(s,o){Ln&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Ln),Nf(t,s,o)):Bn?(r||(r=new Bn),Lf(r,s,o)):(n||(n={key:{},next:null}),Df(n,s,o))}};return i},Gf=String.prototype.replace,$f=/%20/g,gs={RFC1738:"RFC1738",RFC3986:"RFC3986"},bs={default:gs.RFC3986,formatters:{RFC1738:function(e){return Gf.call(e,$f,"+")},RFC3986:function(e){return String(e)}},RFC1738:gs.RFC1738,RFC3986:gs.RFC3986},Hf=bs,_s=Object.prototype.hasOwnProperty,Ke=Array.isArray,be=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),qf=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Ke(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},Fa=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},zf=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(Ke(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!_s.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 Ke(t)&&!Ke(r)&&(i=Fa(t,n)),Ke(t)&&Ke(r)?(r.forEach(function(s,o){if(_s.call(t,o)){var a=t[o];a&&typeof a=="object"&&s&&typeof s=="object"?t[o]=e(a,s,n):t.push(s)}else t[o]=s}),t):Object.keys(r).reduce(function(s,o){var a=r[o];return _s.call(s,o)?s[o]=e(s[o],a,n):s[o]=a,s},i)},Vf=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},Xf=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}},Wf=function(t,r,n,i,s){if(t.length===0)return t;var o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var a="",l=0;l<o.length;++l){var h=o.charCodeAt(l);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===Hf.RFC1738&&(h===40||h===41)){a+=o.charAt(l);continue}if(h<128){a=a+be[h];continue}if(h<2048){a=a+(be[192|h>>6]+be[128|h&63]);continue}if(h<55296||h>=57344){a=a+(be[224|h>>12]+be[128|h>>6&63]+be[128|h&63]);continue}l+=1,h=65536+((h&1023)<<10|o.charCodeAt(l)&1023),a+=be[240|h>>18]+be[128|h>>12&63]+be[128|h>>6&63]+be[128|h&63]}return a},Yf=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],a=Object.keys(o),l=0;l<a.length;++l){var h=a[l],c=o[h];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:o,prop:h}),n.push(c))}return qf(r),t},Kf=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Zf=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)},Jf=function(t,r){if(Ke(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},Da={arrayToObject:Fa,assign:Vf,combine:Qf,compact:Yf,decode:Xf,encode:Wf,isBuffer:Zf,isRegExp:Kf,maybeMap:Jf,merge:zf},Ua=jf,Fn=Da,en=bs,td=Object.prototype.hasOwnProperty,ja={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Ae=Array.isArray,ed=Array.prototype.push,Ga=function(e,t){ed.apply(e,Ae(t)?t:[t])},rd=Date.prototype.toISOString,$a=en.default,Xt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Fn.encode,encodeValuesOnly:!1,format:$a,formatter:en.formatters[$a],indices:!1,serializeDate:function(t){return rd.call(t)},skipNulls:!1,strictNullHandling:!1},nd=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},xs={},id=function e(t,r,n,i,s,o,a,l,h,c,f,u,d,p,v,g){for(var y=t,b=g,_=0,m=!1;(b=b.get(xs))!==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(xs)>"u"&&(_=0)}if(typeof l=="function"?y=l(r,y):y instanceof Date?y=f(y):n==="comma"&&Ae(y)&&(y=Fn.maybeMap(y,function(U){return U instanceof Date?f(U):U})),y===null){if(s)return a&&!p?a(r,Xt.encoder,v,"key",u):r;y=""}if(nd(y)||Fn.isBuffer(y)){if(a){var S=p?r:a(r,Xt.encoder,v,"key",u);return[d(S)+"="+d(a(y,Xt.encoder,v,"value",u))]}return[d(r)+"="+d(String(y))]}var E=[];if(typeof y>"u")return E;var T;if(n==="comma"&&Ae(y))p&&a&&(y=Fn.maybeMap(y,a)),T=[{value:y.length>0?y.join(",")||null:void 0}];else if(Ae(l))T=l;else{var P=Object.keys(y);T=h?P.sort(h):P}for(var A=i&&Ae(y)&&y.length===1?r+"[]":r,w=0;w<T.length;++w){var O=T[w],R=typeof O=="object"&&typeof O.value<"u"?O.value:y[O];if(!(o&&R===null)){var k=Ae(y)?typeof n=="function"?n(A,O):A:A+(c?"."+O:"["+O+"]");g.set(t,_);var B=Ua();B.set(xs,g),Ga(E,e(R,k,n,i,s,o,n==="comma"&&p&&Ae(y)?null:a,l,h,c,f,u,d,p,v,B))}}return E},sd=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=en.default;if(typeof t.format<"u"){if(!td.call(en.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=en.formatters[n],s=Xt.filter;return(typeof t.filter=="function"||Ae(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}},od=function(e,t){var r=e,n=sd(t),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Ae(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;t&&t.arrayFormat in ja?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var l=ja[a];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=Ua(),f=0;f<i.length;++f){var u=i[f];n.skipNulls&&r[u]===null||Ga(o,id(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=o.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:""},xr=Da,Es=Object.prototype.hasOwnProperty,ad=Array.isArray,Gt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:xr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ld=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Ha=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},ud="utf8=%26%2310003%3B",hd="utf8=%E2%9C%93",cd=function(t,r){var n={__proto__:null},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,l,h=r.charset;if(r.charsetSentinel)for(l=0;l<o.length;++l)o[l].indexOf("utf8=")===0&&(o[l]===hd?h="utf-8":o[l]===ud&&(h="iso-8859-1"),a=l,l=o.length);for(l=0;l<o.length;++l)if(l!==a){var c=o[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=xr.maybeMap(Ha(c.slice(u+1),r),function(v){return r.decoder(v,Gt.decoder,h,"value")})),p&&r.interpretNumericEntities&&h==="iso-8859-1"&&(p=ld(p)),c.indexOf("[]=")>-1&&(p=ad(p)?[p]:p),Es.call(n,d)?n[d]=xr.combine(n[d],p):n[d]=p}return n},fd=function(e,t,r,n){for(var i=n?t:Ha(t,r),s=e.length-1;s>=0;--s){var o,a=e[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,h=parseInt(l,10);!r.parseArrays&&l===""?o={0:i}:!isNaN(h)&&a!==l&&String(h)===l&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(o=[],o[h]=i):l!=="__proto__"&&(o[l]=i)}i=o}return i},dd=function(t,r,n,i){if(t){var s=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=n.depth>0&&o.exec(s),h=l?s.slice(0,l.index):s,c=[];if(h){if(!n.plainObjects&&Es.call(Object.prototype,h)&&!n.allowPrototypes)return;c.push(h)}for(var f=0;n.depth>0&&(l=a.exec(s))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&Es.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),fd(c,r,n,i)}},pd=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"||xr.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}},yd=function(e,t){var r=pd(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?cd(e,r):e,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o<s.length;++o){var a=s[o],l=dd(a,n[a],r,typeof e=="string");i=xr.merge(i,l,r)}return r.allowSparse===!0?i:xr.compact(i)},vd=od,md=yd,gd=bs,bd={formats:gd,parse:md,stringify:vd},_d=Ac;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 xd=/^([a-z0-9.+-]+:)/i,Ed=/:[0-9]*$/,Td=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,wd=["<",">",'"',"`"," ","\r",`
13
+ `," "],Ad=["{","}","|","\\","^","`"].concat(wd),Ts=["'"].concat(Ad),qa=["%","/","?",";","#"].concat(Ts),za=["/","?","#"],Sd=255,Va=/^[+a-z0-9A-Z_-]{0,63}$/,Od=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Rd={javascript:!0,"javascript:":!0},ws={javascript:!0,"javascript:":!0},Er={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},As=bd;function Dn(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),o=/\\/g;s[0]=s[0].replace(o,"/"),e=s.join(i);var a=e;if(a=a.trim(),!r&&e.split("#").length===1){var l=Td.exec(a);if(l)return this.path=a,this.href=a,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=As.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=xd.exec(a);if(h){h=h[0];var c=h.toLowerCase();this.protocol=c,a=a.substr(h.length)}if(r||h||a.match(/^\/\/[^@/]+@[^@/]+/)){var f=a.substr(0,2)==="//";f&&!(h&&ws[h])&&(a=a.substr(2),this.slashes=!0)}if(!ws[h]&&(f||h&&!Er[h])){for(var u=-1,d=0;d<za.length;d++){var p=a.indexOf(za[d]);p!==-1&&(u===-1||p<u)&&(u=p)}var v,g;u===-1?g=a.lastIndexOf("@"):g=a.lastIndexOf("@",u),g!==-1&&(v=a.slice(0,g),a=a.slice(g+1),this.auth=decodeURIComponent(v)),u=-1;for(var d=0;d<qa.length;d++){var p=a.indexOf(qa[d]);p!==-1&&(u===-1||p<u)&&(u=p)}u===-1&&(u=a.length),this.host=a.slice(0,u),a=a.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(Va)){for(var x="",S=0,E=m.length;S<E;S++)m.charCodeAt(S)>127?x+="x":x+=m[S];if(!x.match(Va)){var T=b.slice(0,d),P=b.slice(d+1),A=m.match(Od);A&&(T.push(A[1]),P.unshift(A[2])),P.length&&(a="/"+P.join(".")+a),this.hostname=T.join(".");break}}}this.hostname.length>Sd?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=_d.toASCII(this.hostname));var w=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+w,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Rd[c])for(var d=0,_=Ts.length;d<_;d++){var R=Ts[d];if(a.indexOf(R)!==-1){var k=encodeURIComponent(R);k===R&&(k=escape(R)),a=a.split(R).join(k)}}var B=a.indexOf("#");B!==-1&&(this.hash=a.substr(B),a=a.slice(0,B));var U=a.indexOf("?");if(U!==-1?(this.search=a.substr(U),this.query=a.substr(U+1),t&&(this.query=As.parse(this.query)),a=a.slice(0,U)):t&&(this.search="",this.query={}),a&&(this.pathname=a),Er[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var w=this.pathname||"",D=this.search||"";this.path=w+D}return this.href=this.format(),this};function Id(e){return typeof e=="string"&&(e=Dn(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=As.stringify(this.query));var o=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||Er[t])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),o&&o.charAt(0)!=="?"&&(o="?"+o),r=r.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),o=o.replace("#","%23"),t+i+r+o+n};function Pd(e,t){return Dn(e,!1,!0).resolve(t)}ie.prototype.resolve=function(e){return this.resolveObject(Dn(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 o=Object.keys(e),a=0;a<o.length;a++){var l=o[a];l!=="protocol"&&(r[l]=e[l])}return Er[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(!Er[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&&!ws[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&&!Er[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],E=(r.host||e.host||b.length>1)&&(S==="."||S==="..")||S==="",T=0,P=b.length;P>=0;P--)S=b[P],S==="."?b.splice(P,1):S===".."?(b.splice(P,1),T++):T&&(b.splice(P,1),T--);if(!g&&!y)for(;T--;T)b.unshift("..");g&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),E&&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=Ed.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 kd=Dn,Nd=Pd,Cd=Id;const Md={parse:kd,format:Cd,resolve:Nd},Xa={};function xt(e,t,r=3){if(Xa[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))),Xa[t]=!0}let Ss;function Ld(){return typeof Ss>"u"&&(Ss=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 o=i.getExtension("WEBGL_lose_context");o&&o.loseContext()}return i=null,s}catch{return!1}}()),Ss}var Bd={grad:.9,turn:360,rad:360/(2*Math.PI)},Se=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},Wa=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ya=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)}},Os=function(e){return{r:$t(e.r),g:$t(e.g),b:$t(e.b),a:$t(e.a,3)}},Fd=/^#([0-9a-f]{3,8})$/i,Un=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ka=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=Math.max(t,r,n),o=s-Math.min(t,r,n),a=o?s===t?(r-n)/o:s===r?2+(n-t)/o:4+(t-r)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},Za=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),o=n*(1-r),a=n*(1-(t-s)*r),l=n*(1-(1-t+s)*r),h=s%6;return{r:255*[n,a,o,o,l,n][h],g:255*[l,n,n,a,o,o][h],b:255*[o,o,l,n,n,a][h],a:i}},Qa=function(e){return{h:Wa(e.h),s:te(e.s,0,100),l:te(e.l,0,100),a:te(e.a)}},Ja=function(e){return{h:$t(e.h),s:$t(e.s),l:$t(e.l),a:$t(e.a,3)}},tl=function(e){return Za((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},rn=function(e){return{h:(t=Ka(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},Dd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ud=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rs={string:[[function(e){var t=Fd.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=jd.exec(e)||Gd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ya({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=Dd.exec(e)||Ud.exec(e);if(!t)return null;var r,n,i=Qa({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Bd[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return tl(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 Se(t)&&Se(r)&&Se(n)?Ya({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(!Se(t)||!Se(r)||!Se(n))return null;var o=Qa({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return tl(o)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,s=i===void 0?1:i;if(!Se(t)||!Se(r)||!Se(n))return null;var o=function(a){return{h:Wa(a.h),s:te(a.s,0,100),v:te(a.v,0,100),a:te(a.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return Za(o)},"hsv"]]},el=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]},$d=function(e){return typeof e=="string"?el(e.trim(),Rs.string):typeof e=="object"&&e!==null?el(e,Rs.object):[null,void 0]},Is=function(e,t){var r=rn(e);return{h:r.h,s:te(r.s+100*t,0,100),l:r.l,a:r.a}},Ps=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},rl=function(e,t){var r=rn(e);return{h:r.h,s:r.s,l:te(r.l+100*t,0,100),a:r.a}},ks=function(){function e(t){this.parsed=$d(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return $t(Ps(this.rgba),2)},e.prototype.isDark=function(){return Ps(this.rgba)<.5},e.prototype.isLight=function(){return Ps(this.rgba)>=.5},e.prototype.toHex=function(){return t=Os(this.rgba),r=t.r,n=t.g,i=t.b,o=(s=t.a)<1?Un($t(255*s)):"","#"+Un(r)+Un(n)+Un(i)+o;var t,r,n,i,s,o},e.prototype.toRgb=function(){return Os(this.rgba)},e.prototype.toRgbString=function(){return t=Os(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 Ja(rn(this.rgba))},e.prototype.toHslString=function(){return t=Ja(rn(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=Ka(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 _e({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),_e(Is(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),_e(Is(this.rgba,-t))},e.prototype.grayscale=function(){return _e(Is(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),_e(rl(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),_e(rl(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"?_e({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=rn(this.rgba);return typeof t=="number"?_e({h:t,s:r.s,l:r.l,a:r.a}):$t(r.h)},e.prototype.isEqual=function(t){return this.toHex()===_e(t).toHex()},e}(),_e=function(e){return e instanceof ks?e:new ks(e)},nl=[],Hd=function(e){e.forEach(function(t){nl.indexOf(t)<0&&(t(ks,Rs),nl.push(t))})};function qd(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(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,h=n[this.toHex()];if(h)return h;if(o!=null&&o.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=(a=c,l=s[p],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));v<f&&(f=v,u=p)}return u}},t.string.push([function(o){var a=o.toLowerCase(),l=a==="transparent"?"#0000":r[a];return l?new e(l).toRgb():null},"name"])}Hd([qd]);const Tr=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 Tr)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(o=>e[o]===t[o])}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]=Tr.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=Tr.HEX_PATTERN.exec(e);n&&(e=`#${n[2]}`)}const r=_e(e);if(r.isValid()){const{r:n,g:i,b:s,a:o}=r.rgba;t=[n/255,i/255,s/255,o]}}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 Yt=Tr;Yt.shared=new Tr,Yt.temp=new Tr,Yt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;function zd(){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 Vd=zd();function il(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 jn(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 sl(e){return!(e&e-1)&&!!e}function ol(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 Gn(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 Xd=0;function nn(){return++Xd}const al={},xe=Object.create(null),Ue=Object.create(null);let $n;function Wd(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,$n||($n=document.createElement("a")),$n.href=e;const r=Md.parse($n.href),n=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!n||r.protocol!==t.protocol?"anonymous":""}function ll(e,t=1){var n;const r=(n=vt.RETINA_PREFIX)==null?void 0:n.exec(e);return r?parseFloat(r[1]):t}var ft=(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))(ft||{});const Ns=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},ul=(e,t)=>Ns(e).priority??t,Et={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(Ns).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(Ns).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(o=>t(o)),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)=>ul(s,r)-ul(i,r)))},n=>{const i=t.indexOf(n.ref);i!==-1&&t.splice(i,1)})}};class Yd{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 Kd=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
19
+ `);function Zd(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=Kd.replace(/%forloop%/gi,Zd(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,Ms=1,Ls=2,Bs=3,Fs=4,Ds=5;let Hn=class Wh{constructor(){this.data=0,this.blendMode=ut.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<<Ms)}set offsets(t){!!(this.data&1<<Ms)!==t&&(this.data^=1<<Ms)}get culling(){return!!(this.data&1<<Ls)}set culling(t){!!(this.data&1<<Ls)!==t&&(this.data^=1<<Ls)}get depthTest(){return!!(this.data&1<<Bs)}set depthTest(t){!!(this.data&1<<Bs)!==t&&(this.data^=1<<Bs)}get depthMask(){return!!(this.data&1<<Ds)}set depthMask(t){!!(this.data&1<<Ds)!==t&&(this.data^=1<<Ds)}get clockwiseFrontFace(){return!!(this.data&1<<Fs)}set clockwiseFrontFace(t){!!(this.data&1<<Fs)!==t&&(this.data^=1<<Fs)}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 Wh;return t.depthTest=!1,t.blend=!0,t}};const Us=[];function hl(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=Us.length-1;n>=0;--n){const i=Us[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,o,a,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,o,a,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 sn{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 js extends sn{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===Le.UNPACK);const s=r.realWidth,o=r.realHeight;return n.width===s&&n.height===o?i.texSubImage2D(r.target,0,0,0,s,o,r.format,n.type,this.data):(n.width=s,n.height=o,i.texImage2D(r.target,0,n.internalFormat,s,o,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 Jd={scaleMode:Te.NEAREST,format:nt.RGBA,alphaMode:Le.NPM},wr=class extends Xr{constructor(e=null,t=null){super(),t=Object.assign({},wr.defaultOptions,t);const{alphaMode:r,mipmap:n,anisotropicLevel:i,scaleMode:s,width:o,height:a,wrapMode:l,format:h,type:c,target:f,resolution:u,resourceOptions:d}=t;e&&!(e instanceof sn)&&(e=hl(e,d),e.internal=!0),this.resolution=u||vt.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((a||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=nn(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&a>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=sl(this.realWidth)&&sl(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 Ue[this.cacheId],delete xe[this.cacheId],this.cacheId=null),this.dispose(),wr.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 o=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${nn()}`}i=e._pixiId}let s=Ue[i];if(n&&r&&!s)throw new Error(`The cacheId "${i}" does not exist in BaseTextureCache.`);return s||(s=new wr(e,t),s.cacheId=i,wr.addToCache(s,i)),s}static fromBuffer(e,t,r,n){e=e||new Float32Array(t*r*4);const i=new js(e,{width:t,height:r}),s=e instanceof Float32Array?mt.FLOAT:mt.UNSIGNED_BYTE;return new wr(i,Object.assign({},Jd,n||{width:t,height:r,type:s}))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Ue[t]&&Ue[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Ue[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Ue[e];if(t){const r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete Ue[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t<e.textureCacheIds.length;++t)delete Ue[e.textureCacheIds[t]];return e.textureCacheIds.length=0,e}return null}};let gt=wr;gt.defaultOptions={mipmap:ze.POW2,anisotropicLevel:0,scaleMode:Te.LINEAR,wrapMode:Vr.CLAMP,alphaMode:Le.UNPACK,target:cr.TEXTURE_2D,format:nt.RGBA,type:mt.UNSIGNED_BYTE},gt._globalBatch=0;class Gs{constructor(){this.texArray=null,this.blend=0,this.type=Me.TRIANGLES,this.start=0,this.size=0,this.data=null}}let tp=0,Kt=class Yh{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=tp++,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?me.ELEMENT_ARRAY_BUFFER:me.ARRAY_BUFFER}get index(){return this.type===me.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new Yh(t)}};class qn{constructor(t,r=0,n=!1,i=mt.FLOAT,s,o,a,l=1){this.buffer=t,this.size=r,this.normalized=n,this.type=i,this.stride=s,this.start=o,this.instance=a,this.divisor=l}destroy(){this.buffer=null}static from(t,r,n,i,s){return new qn(t,r,n,i,s)}}const ep={Float32Array,Uint32Array,Int32Array,Uint8Array};function rp(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 o=null,a=0;for(let l=0;l<e.length;l++){const h=t[l],c=e[l],f=il(c);i[f]||(i[f]=new ep[f](s)),o=i[f];for(let u=0;u<c.length;u++){const d=(u/h|0)*n+a,p=u%h;o[d+p]=c[u]}a+=h}return new Float32Array(s)}const cl={5126:4,5123:2,5121:1};let np=0;const ip={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Ar{constructor(t=[],r={}){this.buffers=t,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=np++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new se("disposeGeometry"),this.refCount=0}addAttribute(t,r,n=0,i=!1,s,o,a,l=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Kt||(r instanceof Array&&(r=new Float32Array(r)),r=new Kt(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 qn(c,n,i,s,o,a,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 Kt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Kt(t)),t.type=me.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 Kt;let i;for(i in this.attributes){const s=this.attributes[i],o=this.buffers[s.buffer];t.push(o.data),r.push(s.size*cl[s.type]/4),s.buffer=0}for(n.data=rp(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 Ar;for(let r=0;r<this.buffers.length;r++)t.buffers[r]=new Kt(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];t.attributes[r]=new qn(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=me.ELEMENT_ARRAY_BUFFER),t}static merge(t){const r=new Ar,n=[],i=[],s=[];let o;for(let a=0;a<t.length;a++){o=t[a];for(let l=0;l<o.buffers.length;l++)i[l]=i[l]||0,i[l]+=o.buffers[l].data.length,s[l]=0}for(let a=0;a<o.buffers.length;a++)n[a]=new ip[il(o.buffers[a].data)](i[a]),r.buffers[a]=new Kt(n[a]);for(let a=0;a<t.length;a++){o=t[a];for(let l=0;l<o.buffers.length;l++)n[l].set(o.buffers[l].data,s[l]),s[l]+=o.buffers[l].data.length}if(r.attributes=o.attributes,o.indexBuffer){r.indexBuffer=r.buffers[o.buffers.indexOf(o.indexBuffer)],r.indexBuffer.type=me.ELEMENT_ARRAY_BUFFER;let a=0,l=0,h=0,c=0;for(let f=0;f<o.buffers.length;f++)if(o.buffers[f]!==o.indexBuffer){c=f;break}for(const f in o.attributes){const u=o.attributes[f];(u.buffer|0)===c&&(l+=u.size*cl[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]+=a;a+=t[f].buffers[c].data.length/l,h+=u.length}}return r}}class fl extends Ar{constructor(t=!1){super(),this._buffer=new Kt(null,t,!1),this._indexBuffer=new Kt(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 zn=Math.PI*2,sp=180/Math.PI,op=Math.PI/180;var Ht=(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))(Ht||{});class J{constructor(t=0,r=0){this.x=0,this.y=0,this.x=t,this.y=r}clone(){return new J(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 Vn=[new J,new J,new J,new J];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=Ht.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 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,o=this.bottom;if(i<=n||o<=s)return!1;const a=Vn[0].set(t.left,t.top),l=Vn[1].set(t.left,t.bottom),h=Vn[2].set(t.right,t.top),c=Vn[3].set(t.right,t.bottom);if(h.x<=a.x||l.y<=a.y)return!1;const f=Math.sign(r.a*r.d-r.b*r.c);if(f===0||(r.apply(a,a),r.apply(l,l),r.apply(h,h),r.apply(c,c),Math.max(a.x,l.x,h.x,c.x)<=n||Math.min(a.x,l.x,h.x,c.x)>=i||Math.max(a.y,l.y,h.y,c.y)<=s||Math.min(a.y,l.y,h.y,c.y)>=o))return!1;const u=f*(l.y-a.y),d=f*(a.x-l.x),p=u*n+d*s,v=u*i+d*s,g=u*n+d*o,y=u*i+d*o;if(Math.max(p,v,g,y)<=u*a.x+d*a.y||Math.min(p,v,g,y)>=u*c.x+d*c.y)return!1;const b=f*(a.y-h.y),_=f*(h.x-a.x),m=b*n+_*s,x=b*i+_*s,S=b*n+_*o,E=b*i+_*o;return!(Math.max(m,x,S,E)<=b*a.x+_*a.y||Math.min(m,x,S,E)>=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 $s{constructor(t=0,r=0,n=0){this.x=t,this.y=r,this.radius=n,this.type=Ht.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 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 ap=class Kh{constructor(t=0,r=0,n=0,i=0){this.x=t,this.y=r,this.width=n,this.height=i,this.type=Ht.ELIP}clone(){return new Kh(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 on{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=Ht.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),r=new on(t);return r.closeStroke=this.closeStroke,r}contains(t,r){let n=!1;const i=this.points.length/2;for(let s=0,o=i-1;s<i;o=s++){const a=this.points[s*2],l=this.points[s*2+1],h=this.points[o*2],c=this.points[o*2+1];l>r!=c>r&&t<(h-a)*((r-l)/(c-l))+a&&(n=!n)}return n}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,r)=>`${t}, ${r}`,"")}]`}}class Hs{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=Ht.RREC}clone(){return new Hs(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 o=n*n;if(i*i+s*s<=o||(i=t-(this.x+this.width-n),i*i+s*s<=o)||(s=r-(this.y+this.height-n),i*i+s*s<=o)||(i=t-(this.x+n),i*i+s*s<=o))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 Hi{constructor(t=1,r=0,n=0,i=1,s=0,o=0){this.array=null,this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=o}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,o){return this.a=t,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=o,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 J;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 J;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,o=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=o*r-this.ty*n,this.ty=o*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,o,a,l,h){return this.a=Math.cos(a+h)*s,this.b=Math.sin(a+h)*s,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,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,o=t.pivot,a=-Math.atan2(-i,s),l=Math.atan2(n,r),h=Math.abs(a+l);return h<1e-5||Math.abs(zn-h)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,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+(o.x*r+o.y*i),t.position.y=this.ty+(o.x*n+o.y*s),t}invert(){const t=this.a,r=this.b,n=this.c,i=this.d,s=this.tx,o=t*i-r*n;return this.a=i/o,this.b=-r/o,this.c=-n/o,this.d=t/o,this.tx=(n*this.ty-i*s)/o,this.ty=-(t*this.ty-r*s)/o,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 Hi;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 Hi}static get TEMP_MATRIX(){return new Hi}};const Ze=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Qe=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Je=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],tr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],qs=[],dl=[],Xn=Math.sign;function lp(){for(let e=0;e<16;e++){const t=[];qs.push(t);for(let r=0;r<16;r++){const n=Xn(Ze[e]*Ze[r]+Je[e]*Qe[r]),i=Xn(Qe[e]*Ze[r]+tr[e]*Qe[r]),s=Xn(Ze[e]*Je[r]+Je[e]*tr[r]),o=Xn(Qe[e]*Je[r]+tr[e]*tr[r]);for(let a=0;a<16;a++)if(Ze[a]===n&&Qe[a]===i&&Je[a]===s&&tr[a]===o){t.push(a);break}}}for(let e=0;e<16;e++){const t=new Ot;t.set(Ze[e],Qe[e],Je[e],tr[e],0,0),dl.push(t)}}lp();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=>Ze[e],uY:e=>Qe[e],vX:e=>Je[e],vY:e=>tr[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>qs[e][t],sub:(e,t)=>qs[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=dl[Mt.inv(t)];i.tx=r,i.ty=n,e.append(i)}};class er{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 er(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 pl=class{constructor(){this.worldTransform=new Ot,this.localTransform=new Ot,this.position=new er(this.onChange,this,0,0),this.scale=new er(this.onChange,this,1,1),this.pivot=new er(this.onChange,this,0,0),this.skew=new er(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 Wn=pl;Wn.IDENTITY=new pl;var up=`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
+ }`,hp=`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 yl(e,t,r){const n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),n}function zs(e){const t=new Array(e);for(let r=0;r<t.length;r++)t[r]=!1;return t}function vl(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 zs(2*t);case"bvec3":return zs(3*t);case"bvec4":return zs(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 Sr=[{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
+ }`}],cp={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
+ }`},fp={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 dp(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 o=e.uniforms[i];let a=!1;for(let l=0;l<Sr.length;l++)if(Sr[l].test(s,o)){r.push(Sr[l].code(i,o)),a=!0;break}if(!a){const h=(s.size===1&&!s.isArray?cp:fp)[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
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(`
308
+ `))}const ml={};let Or=ml;function pp(){if(Or===ml||Or!=null&&Or.isContextLost()){const e=vt.ADAPTER.createCanvas();let t;vt.PREFER_ENV>=qe.WEBGL2&&(t=e.getContext("webgl2",{})),t||(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Or=t}return Or}let Yn;function yp(){if(!Yn){Yn=Jt.MEDIUM;const e=pp();e&&e.getShaderPrecisionFormat&&(Yn=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?Jt.HIGH:Jt.MEDIUM)}return Yn}function gl(e,t){const r=e.getShaderSource(t).split(`
309
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}
310
+ `),s={},o=i.map(h=>parseFloat(h.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(h=>h&&!s[h]?(s[h]=!0,!0):!1),a=[""];o.forEach(h=>{r[h-1]=`%c${r[h-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=r.join(`
311
+ `);a[0]=l,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function vp(e,t,r,n){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||gl(e,r),e.getShaderParameter(n,e.COMPILE_STATUS)||gl(e,n),console.error("PixiJS Error: Could not initialize shader."),e.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(t)))}const mp={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 bl(e){return mp[e]}let Kn=null;const _l={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 xl(e,t){if(!Kn){const r=Object.keys(_l);Kn={};for(let n=0;n<r.length;++n){const i=r[n];Kn[e[i]]=_l[i]}}return Kn[t]}function El(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 an;function gp(){if(typeof an=="boolean")return an;try{an=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{an=!1}return an}let bp=0;const Zn={},Rr=class{constructor(e,t,r="pixi-shader",n={}){this.extra={},this.id=bp++,this.vertexSrc=e||Rr.defaultVertexSrc,this.fragmentSrc=t||Rr.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,"-"),Zn[r]?(Zn[r]++,r+=`-${Zn[r]}`):Zn[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=El(this.vertexSrc,Rr.defaultVertexPrecision,Jt.HIGH),this.fragmentSrc=El(this.fragmentSrc,Rr.defaultFragmentPrecision,yp())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return hp}static get defaultFragmentSrc(){return up}static from(e,t,r){const n=e+t;let i=al[n];return i||(al[n]=i=new Rr(e,t,r)),i}};let Oe=Rr;Oe.defaultVertexPrecision=Jt.HIGH,Oe.defaultFragmentPrecision=dr.apple.device?Jt.HIGH:Jt.MEDIUM;let _p=0;class oe{constructor(t,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=_p++,this.static=!!r,this.ubo=!!n,t instanceof Kt?(this.buffer=t,this.buffer.type=me.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Kt(new Float32Array(1)),this.buffer.type=me.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 oe(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 oe(t,r,n)}static uboFrom(t,r){return new oe(t,r??!0,!0)}}class ln{constructor(t,r){this.uniformBindCount=0,this.program=t,r?r instanceof oe?this.uniformGroup=r:this.uniformGroup=new oe(r):this.uniformGroup=new oe({}),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=Oe.from(t,r);return new ln(i,n)}}class xp{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]=oe.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 Oe(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ot,default:this.defaultGroupCache[t]};return new ln(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 Vs{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 Ep(){return!dr.apple.device}function Tp(e){let t=!0;const r=vt.ADAPTER.getNavigator();if(dr.tablet||dr.phone){if(dr.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(t=!1)}if(dr.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(t=!1)}}return t?e:4}class Tl{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var wp=`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
+ `,Ap=`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 ae=class extends Tl{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=fl,this.vertexSize=6,this.state=Hn.for2d(),this.size=ae.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??Tp(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??Ep(),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 Ap}static get defaultFragmentTemplate(){return wp}setShaderGenerator({vertex:e=ae.defaultVertexSrc,fragment:t=ae.defaultFragmentTemplate}={}){this.shaderGenerator=new xp(e,t)}contextChange(){const e=this.renderer.gl;vt.PREFER_ENV===qe.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),ae.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}=ae,r=this.size/4,n=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new Gs);for(;t.length<n;)t.push(new Vs);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=ae._textureArrayPool,n=this.renderer.batch,i=this._tempBoundTextures,s=this.renderer.textureGC.count;let o=++gt._globalBatch,a=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!==o&&(l.count>=t&&(n.boundArray(l,i,o,t),this.buildDrawCalls(l,h,c),h=c,l=r[++a],++o),f._batchEnabled=o,f.touched=s,l.elements[l.count++]=f)}l.count>0&&(n.boundArray(l,i,o,t),this.buildDrawCalls(l,h,this._bufferSize),++a,++o);for(let c=0;c<i.length;c++)i[c]=null;gt._globalBatch=o}buildDrawCalls(e,t,r){const{_bufferedElements:n,_attributeBuffer:i,_indexBuffer:s,vertexSize:o}=this,a=ae._drawCallPool;let l=this._dcIndex,h=this._aIndex,c=this._iIndex,f=a[l];f.start=this._iIndex,f.texArray=e;for(let u=t;u<r;++u){const d=n[u],p=d._texture.baseTexture,v=Vd[p.alphaMode?1:0][d.blendMode];n[u]=null,t<u&&f.blend!==v&&(f.size=c-f.start,t=u,f=a[++l],f.texArray=e,f.start=c),this.packInterleavedGeometry(d,i,s,h,c),h+=d.vertexData.length/2*o,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;ae.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=ae._drawCallPool;let i=null;for(let s=0;s<e;s++){const{texArray:o,type:a,size:l,start:h,blend:c}=n[s];i!==o&&(i=o,this.bindAndClearTexArray(o)),this.state.blendMode=c,r.set(this.state),t.drawElements(a,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),ae.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=jn(Math.ceil(e/8)),r=ol(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 Yd(n*this.vertexSize*4)),i}getIndexBuffer(e){const t=jn(Math.ceil(e/12)),r=ol(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:o}=t,a=n/this.vertexSize,l=e.uvs,h=e.indices,c=e.vertexData,f=e._texture.baseTexture._batchLocation,u=Math.min(e.worldAlpha,1),d=Yt.shared.setValue(e._tintRGB).toPremultiplied(u);for(let p=0;p<c.length;p+=2)o[n++]=c[p],o[n++]=c[p+1],o[n++]=l[p],o[n++]=l[p+1],s[n++]=d,o[n++]=f;for(let p=0;p<h.length;p++)r[i++]=a+h[p]}};let le=ae;le.defaultBatchSize=4096,le.extension={name:"batch",type:ft.RendererPlugin},le._drawCallPool=[],le._textureArrayPool=[],Et.add(le);var Sp=`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
+ `,Op=`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 un=class extends ln{constructor(e,t,r){const n=Oe.from(e||un.defaultVertexSrc,t||un.defaultFragmentSrc);super(n,r),this.padding=0,this.resolution=un.defaultResolution,this.multisample=un.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Hn}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 Op}static get defaultFragmentSrc(){return Sp}};let Re=un;Re.defaultResolution=1,Re.defaultMultisample=Dt.NONE;class Qn{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Yt(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=t,s=n??r;s!==void 0&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}Qn.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Qn.extension={type:[ft.RendererSystem,ft.CanvasRendererSystem],name:"background"},Et.add(Qn);class wl{constructor(t){this.renderer=t,this.emptyRenderer=new Tl(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:o,count:a}=t;let l=0;for(let h=0;h<a;h++){const c=s[h],f=c._batchLocation;if(f>=0&&f<i&&r[f]===c){o[h]=f;continue}for(;l<i;){const u=r[l];if(u&&u._batchEnabled===n&&u._batchLocation===l){l++;continue}o[h]=l,c._batchLocation=l,r[l]=c;break}}}destroy(){this.renderer=null}}wl.extension={type:ft.RendererSystem,name:"batch"},Et.add(wl);let Al=0;class Jn{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=Al++}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=Al++,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>=qe.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")}}Jn.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Jn.extension={type:ft.RendererSystem,name:"context"},Et.add(Jn);class Rp extends js{upload(t,r,n){const i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Le.UNPACK);const s=r.realWidth,o=r.realHeight;return n.width===s&&n.height===o?i.texSubImage2D(r.target,0,0,0,s,o,r.format,n.type,this.data):(n.width=s,n.height=o,i.texImage2D(r.target,0,n.internalFormat,s,o,0,r.format,n.type,this.data)),!0}}class Xs{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:Te.NEAREST,resolution:1,mipmap:ze.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new gt(new Rp(null,{width:this.width,height:this.height}),{scaleMode:Te.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ze.OFF,format:nt.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 Sl 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=ze.OFF,this.valid=!0,this._clear=new Yt([0,0,0,0]),this.framebuffer=new Xs(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 je extends sn{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=Wd(r):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")}upload(t,r,n,i){const s=t.gl,o=r.realWidth,a=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===Le.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&n.width===o&&n.height===a?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,n.type,i):(n.width=o,n.height=a,s.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)),!0}update(){if(this.destroyed)return;const t=this.source,r=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class Ol extends je{constructor(t,r){if(r=r||{},typeof t=="string"){const n=new Image;je.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=o=>{n(o),this.onError.emit(o)})}),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===Le.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 o in s){const a=s[o];if(a!==n&&a.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 Rl{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 o=t.width/2/i,a=t.height/2/s,l=t.x/i+o,h=t.y/s+a;n=Mt.add(n,Mt.NW),this.x0=l+o*Mt.uX(n),this.y0=h+a*Mt.uY(n),n=Mt.add(n,2),this.x1=l+o*Mt.uX(n),this.y1=h+a*Mt.uY(n),n=Mt.add(n,2),this.x2=l+o*Mt.uX(n),this.y2=h+a*Mt.uY(n),n=Mt.add(n,2),this.x3=l+o*Mt.uX(n),this.y3=h+a*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 Il=new Rl;function ti(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}class bt extends Xr{constructor(t,r,n,i,s,o,a){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=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=o?new J(o.x,o.y):new J(0,0),this.defaultBorders=a,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&&xe[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===Il&&(this._uvs=new Rl),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 a=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t.cacheId=`${a}-${nn()}`,gt.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const a=(r==null?void 0:r.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${nn()}`}s=t._pixiId}let o=xe[s];if(i&&n&&!o)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!o&&!(t instanceof gt)?(r.resolution||(r.resolution=ll(t)),o=new bt(new gt(t,r)),o.baseTexture.cacheId=s,gt.addToCache(o.baseTexture,s),bt.addToCache(o,s)):!o&&t instanceof gt&&(o=new bt(t),bt.addToCache(o,s)),o}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:ll(r)},i)),{resource:o}=s;o instanceof Ol&&(o.url=r);const a=new bt(s);return n||(n=r),gt.addToCache(a.baseTexture,n),bt.addToCache(a,n),n!==r&&(gt.addToCache(a.baseTexture,r),bt.addToCache(a,r)),a.baseTexture.valid?Promise.resolve(a):new Promise(l=>{a.baseTexture.once("loaded",()=>l(a))})}static addToCache(t,r){r&&(t.textureCacheIds.includes(r)||t.textureCacheIds.push(r),xe[r]&&xe[r]!==t&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),xe[r]=t)}static removeFromCache(t){if(typeof t=="string"){const r=xe[t];if(r){const n=r.textureCacheIds.indexOf(t);return n>-1&&r.textureCacheIds.splice(n,1),delete xe[t],r}}else if(t!=null&&t.textureCacheIds){for(let r=0;r<t.textureCacheIds.length;++r)xe[t.textureCacheIds[r]]===t&&delete xe[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,o=r+i>this.baseTexture.width,a=n+s>this.baseTexture.height;if(o||a){const l=o&&a?"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),ti(bt._EMPTY),ti(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)),ti(bt._WHITE),ti(bt._WHITE.baseTexture)}return bt._WHITE}}class ei 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,o=Math.round(r*i)/i;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(s,o),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 ei(new Sl(t))}}class Pl{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 Sl(Object.assign({width:t,height:r,resolution:1,multisample:n},this.textureOptions));return new ei(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=jn(t),r=jn(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 o=this.texturePool[s].pop();return o||(o=this.createTexture(t,r,i)),o.filterPoolKey=s,o.setResolution(n),o}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}}}Pl.SCREEN_KEY=-1;class Ip extends Ar{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class Pp extends Ar{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 Kt(this.vertices),this.uvBuffer=new Kt(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 kp{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 ri=[new J,new J,new J,new J],Ws=new Ot;class kl{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new Pl,this.statePool=[],this.quad=new Ip,this.quadUv=new Pp,this.tempRect=new At,this.activeState={},this.globalUniforms=new oe({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 kp,o=this.renderer.renderTexture;let a=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];a=Math.min(a,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=o.current),i.push(s),s.resolution=a,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(o.sourceFrame);n.projection.transform&&this.transformAABB(Ws.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,o.current?o.current.resolution:n.resolution,o.sourceFrame,o.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,a,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(o.sourceFrame),s.bindingDestinationFrame.copyFrom(o.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,o.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,o=i.inputPixel,a=i.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],o[0]=Math.round(s[0]*r.resolution),o[1]=Math.round(s[1]*r.resolution),o[2]=1/o[0],o[3]=1/o[1],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=r.sourceFrame.width*s[2]-.5*o[2],a[3]=r.sourceFrame.height*s[3]-.5*o[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,Ve.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,Ve.CLEAR,r);const u=h;h=c,c=u}n[f].apply(this,h,l.renderTexture,Ve.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=Ve.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 o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,n.bind(t,t.filterFrame,o)}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===Ve.CLEAR||r===Ve.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(Me.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Me.TRIANGLE_STRIP))}calculateSpriteMatrix(t,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:s}=r._texture,o=t.set(i.width,0,0,i.height,n.x,n.y),a=r.worldTransform.copyTo(Ot.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(r.anchor.x,r.anchor.y),o}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=ri[0],i=ri[1],s=ri[2],o=ri[3];n.set(r.left,r.top),i.set(r.left,r.bottom),s.set(r.right,r.top),o.set(r.right,r.bottom),t.apply(n,n),t.apply(i,i),t.apply(s,s),t.apply(o,o);const a=Math.min(n.x,i.x,s.x,o.x),l=Math.min(n.y,i.y,s.y,o.y),h=Math.max(n.x,i.x,s.x,o.x),c=Math.max(n.y,i.y,s.y,o.y);r.x=a,r.y=l,r.width=h-a,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:o,b:a,c:l,d:h}=s;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(h)>1e-4))return}s=s?Ws.copyFrom(s):Ws.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)}}}kl.extension={type:ft.RendererSystem,name:"filter"},Et.add(kl);class Np{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 Cp=new At;class Nl{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Xs(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===qe.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 o=0;o<t.colorTextures.length;o++){const a=t.colorTextures[o];this.renderer.texture.unbind(a.parentTextureArray||a)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),r){const o=r.width>>n,a=r.height>>n,l=o/r.width;this.setViewport(r.x*l,r.y*l,o,a)}else{const o=t.width>>n,a=t.height>>n;this.setViewport(0,0,o,a)}}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=qi.COLOR|qi.DEPTH){const{gl:o}=this;o.clearColor(t,r,n,i),o.clear(s)}initFramebuffer(t){const{gl:r}=this,n=new Np(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 o=0;o<s;o++){const a=i[o],l=a.parentTextureArray||a;this.renderer.texture.bind(l,0),o===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 o=s.length;n.drawBuffers||(o=Math.min(o,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 a=[];for(let l=0;l<o;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),a.push(n.COLOR_ATTACHMENT0+l))}if(a.length>1&&n.drawBuffers(a),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:o,CONTEXT_UID:a}=this;if(s.context.webGLVersion!==2||!i)return;const l=i.glFramebuffers[a];if(!l)return;if(!t){if(!l.msaaBuffer)return;const c=i.colorTextures[0];if(!c)return;l.blitFramebuffer||(l.blitFramebuffer=new Xs(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=Cp,r.width=i.width,r.height=i.height),n||(n=r);const h=r.width===n.width&&r.height===n.height;this.bind(t),o.bindFramebuffer(o.READ_FRAMEBUFFER,l.framebuffer),o.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,o.COLOR_BUFFER_BIT,h?o.NEAREST:o.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,o=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,o),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,s.DEPTH24_STENCIL8,n,i):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,n,i),r.stencil=o,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,o)}reset(){this.current=this.unknownFramebuffer,this.viewport=new At}destroy(){this.renderer=null}}Nl.extension={type:ft.RendererSystem,name:"framebuffer"},Et.add(Nl);const Ys={5126:4,5123:2,5121:1};class Cl{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===qe.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,o,a,l)=>n.drawElementsInstancedANGLE(i,s,o,a,l),t.drawArraysInstanced=(i,s,o,a)=>n.drawArraysInstancedANGLE(i,s,o,a)):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 o=i[r.program.id]||this.initGeometryVao(t,r,s);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?n.bindVertexArray(o):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 o in n)i[o]&&s.push(o,i[o].location);return s.join("-")}initGeometryVao(t,r,n=!0){const i=this.gl,s=this.CONTEXT_UID,o=this.renderer.buffer,a=r.program;a.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(t,a);const l=this.getSignature(t,a),h=t.glVertexArrayObjects[this.CONTEXT_UID];let c=h[l];if(c)return h[a.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&&a.attributeData[v]?u[v].size=a.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*Ys[u[v].type];for(const v in u){const g=u[v],y=g.size;g.stride===void 0&&(d[g.buffer]===y*Ys[g.type]?g.stride=0:g.stride=d[g.buffer]),g.start===void 0&&(g.start=p[g.buffer],p[g.buffer]+=y*Ys[g.type])}c=i.createVertexArray(),i.bindVertexArray(c);for(let v=0;v<f.length;v++){const g=f[v];o.bind(g),n&&g._glBuffers[s].refCount++}return this.activateVao(t,a),h[a.id]=c,h[l]=c,i.bindVertexArray(null),o.unbind(me.ARRAY_BUFFER),c}disposeGeometry(t,r){var a;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const n=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,o=(a=this.renderer)==null?void 0:a.buffer;if(t.disposeRunner.remove(this),!!n){if(o)for(let l=0;l<s.length;l++){const h=s[l]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&o.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,o=t.buffers,a=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let l=null;for(const h in a){const c=a[h],f=o[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,o=this._activeGeometry;if(o.indexBuffer){const a=o.indexBuffer.data.BYTES_PER_ELEMENT,l=a===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;a===2||a===4&&this.canUseUInt32ElementIndex?o.instanced?s.drawElementsInstanced(t,r||o.indexBuffer.data.length,l,(n||0)*a,i||1):s.drawElements(t,r||o.indexBuffer.data.length,l,(n||0)*a):console.warn("unsupported index buffer type: uint32")}else o.instanced?s.drawArraysInstanced(t,n,r||o.getSize(),i||1):s.drawArrays(t,n,r||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Cl.extension={type:ft.RendererSystem,name:"geometry"},Et.add(Cl);const Ml=new Ot;class Mp{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],o=t[i+1];r[i]=s*n.a+o*n.c+n.tx,r[i+1]=s*n.b+o*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&&(Ml.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Ml));const o=r.baseTexture,a=this.uClampFrame,l=this.clampMargin/o.resolution,h=this.clampOffset;return a[0]=(r._frame.x+l+h)/o.width,a[1]=(r._frame.y+l+h)/o.height,a[2]=(r._frame.x+r._frame.width-l+h)/o.width,a[3]=(r._frame.y+r._frame.height-l+h)/o.height,this.uClampOffset[0]=h/o.realWidth,this.uClampOffset[1]=h/o.realHeight,this.isSimple=r._frame.width===o.width&&r._frame.height===o.height&&r.rotate===0,!0}}var Lp=`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
+ `,Bp=`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 Fp extends Re{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||Bp,r||Lp,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,o=s._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Mp(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,r,n,i))}}class Dp{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=Re.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 Ll{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 Dp;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 Fp]));const s=this.renderer,o=s.renderTexture;let a,l;if(o.current){const c=o.current;a=t.resolution||c.resolution,l=t.multisample??c.multisample}else a=t.resolution||s.resolution,l=t.multisample??s.multisample;i[0].resolution=a,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}}Ll.extension={type:ft.RendererSystem,name:"mask"},Et.add(Ll);class Bl{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 Fl=new Ot,Dl=[],ni=class extends Bl{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,Dl.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()||ni.isMatrixRotated(t.worldTransform)||ni.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){ni.isMatrixRotated(i)||(i=i?Fl.copyFrom(i):Fl.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 Ul=ni;Ul.extension={type:ft.RendererSystem,name:"scissor"},Et.add(Ul);class jl extends Bl{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)}}jl.extension={type:ft.RendererSystem,name:"stencil"},Et.add(jl);class Gl{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}}Gl.extension={type:[ft.RendererSystem,ft.CanvasRendererSystem],name:"_plugin"},Et.add(Gl);class $l{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,o=i?-1:1;s.identity(),s.a=1/r.width*2,s.d=o*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-o-r.y*s.d}setTransform(t){}destroy(){this.renderer=null}}$l.extension={type:ft.RendererSystem,name:"projection"},Et.add($l);const Up=new Wn;class Hl{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 o=ei.create({width:s.width,height:s.height,...i});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const a=t.transform;return t.transform=Up,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=a,o}destroy(){}}Hl.extension={type:[ft.RendererSystem,ft.CanvasRendererSystem],name:"textureGenerator"},Et.add(Hl);const rr=new At,hn=new At;class ql{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,o,a;t?(s=t.baseTexture,a=s.resolution,r||(rr.width=t.frame.width,rr.height=t.frame.height,r=rr),n||(hn.x=t.frame.x,hn.y=t.frame.y,hn.width=r.width,hn.height=r.height,n=hn),o=s.framebuffer):(a=i.resolution,r||(rr.width=i._view.screen.width,rr.height=i._view.screen.height,r=rr),n||(n=rr,n.width=r.width,n.height=r.height));const l=this.viewportFrame;l.x=n.x*a,l.y=n.y*a,l.width=n.width*a,l.height=n.height*a,t||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(o,l),this.renderer.projection.update(n,r,a,!o),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?Yt.shared.setValue(t):n,s=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=s.width!==o.width||s.height!==o.height;if(a){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),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}ql.extension={type:ft.RendererSystem,name:"renderTexture"},Et.add(ql);class jp{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 Gp(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 o=xl(t,s.type),a={type:o,name:s.name,size:bl(o),location:t.getAttribLocation(e,s.name)};r[s.name]=a}return r}function $p(e,t){const r={},n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;i++){const s=t.getActiveUniform(e,i),o=s.name.replace(/\[.*?\]$/,""),a=!!s.name.match(/\[.*?\]$/),l=xl(t,s.type);r[o]={name:o,index:i,type:l,size:s.size,isArray:a,value:vl(l,s.size)}}return r}function Hp(e,t){var l;const r=yl(e,e.VERTEX_SHADER,t.vertexSrc),n=yl(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)||vp(e,i,r,n),t.attributeData=Gp(i,e),t.uniformData=$p(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 o={};for(const h in t.uniformData){const c=t.uniformData[h];o[h]={location:e.getUniformLocation(i,h),value:vl(c.type,c.size)}}return new jp(i,o)}function qp(e,t,r,n,i){r.buffer.update(i)}const zp={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
+ `},zl={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 Vp(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 o=t[s];if(r=zl[o.data.type],o.data.size>1&&(r=Math.max(r,16)*o.data.size),o.dataLen=r,n%r!==0&&n<16){const a=n%r%16;n+=a,i+=a}n+r>16?(i=Math.ceil(i/16)*16,o.offset=i,i+=r,n=r):(o.offset=i,n+=r,i+=r)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function Xp(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 Wp(e,t){if(!e.autoManage)return{size:0,syncFunc:qp};const r=Xp(e.uniforms,t),{uboElements:n,size:i}=Vp(r),s=[`
466
466
  var v = null;
467
467
  var v2 = null;
468
468
  var cv = null;
@@ -470,14 +470,14 @@ 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(`
473
+ `];for(let o=0;o<n.length;o++){const a=n[o],l=e.uniforms[a.data.name],h=a.data.name;let c=!1;for(let f=0;f<Sr.length;f++){const u=Sr[f];if(u.codeUbo&&u.test(a.data,l)){s.push(`offset = ${a.offset/4};`,Sr[f].codeUbo(a.data.name,l)),c=!0;break}}if(!c)if(a.data.size>1){const f=bl(a.data.type),u=Math.max(zl[a.data.type]/16,1),d=f/u,p=(4-d%4)%4;s.push(`
474
474
  cv = ud.${h}.value;
475
475
  v = uv.${h};
476
- offset = ${o.offset/4};
476
+ offset = ${a.offset/4};
477
477
 
478
478
  t = 0;
479
479
 
480
- for(var i=0; i < ${o.data.size*u}; i++)
480
+ for(var i=0; i < ${a.data.size*u}; i++)
481
481
  {
482
482
  for(var j = 0; j < ${d}; j++)
483
483
  {
@@ -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(`
489
+ `)}else{const f=zp[a.data.type];s.push(`
490
490
  cv = ud.${h}.value;
491
491
  v = uv.${h};
492
- offset = ${o.offset/4};
492
+ offset = ${a.offset/4};
493
493
  ${f};
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 Yp=0;const ii={textureCount:0,uboCount:0};class Vl{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=Yp++}systemCheck(){if(!gp())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||(ii.textureCount=0,ii.uboCount=0,this.syncUniformGroup(t.uniformGroup,ii)),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]=dp(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,ii,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 o=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=Wp(t,this.shader.program.uniformData)),t.autoManage){const l=new Float32Array(a.size/4);t.buffer.update(l)}return r.uniformGroups[t.id]=a.syncFunc,r.uniformGroups[t.id]}getSignature(t,r,n){const i=t.uniforms,s=[`${n}-`];for(const o in i)s.push(o),r[o]&&s.push(r[o].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=Hp(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}}Vl.extension={type:ft.RendererSystem,name:"shader"},Et.add(Vl);class si{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(){}}si.defaultOptions={hello:!1},si.extension={type:[ft.RendererSystem,ft.CanvasRendererSystem],name:"startup"},Et.add(si);function Kp(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 Zp=0,Qp=1,Jp=2,ty=3,ey=4,ry=5,Ks=class{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ut.NONE,this._blendEq=!1,this.map=[],this.map[Zp]=this.setBlend,this.map[Qp]=this.setOffset,this.map[Jp]=this.setCullFace,this.map[ty]=this.setDepthTest,this.map[ey]=this.setFrontFace,this.map[ry]=this.setDepthMask,this.checks=[],this.defaultState=new Hn,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=Kp(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(Ks.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Ks.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 Xl=Ks;Xl.extension={type:ft.RendererSystem,name:"state"},Et.add(Xl);class ny extends Xr{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(o=>this._systemsHash[o]===i);i[t.name](r[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const oi=class{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=oi.defaultMaxIdle,this.checkCountMax=oi.defaultCheckCountMax,this.mode=oi.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Vi.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=oi;ue.defaultMode=Vi.AUTO,ue.defaultMaxIdle=60*60,ue.defaultCheckCountMax=60*10,ue.extension={type:ft.RendererSystem,name:"textureGC"},Et.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=nt.RGBA,this.samplerType=0}}function iy(e){let t;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?t={[mt.UNSIGNED_BYTE]:{[nt.RGBA]:e.RGBA8,[nt.RGB]:e.RGB8,[nt.RG]:e.RG8,[nt.RED]:e.R8,[nt.RGBA_INTEGER]:e.RGBA8UI,[nt.RGB_INTEGER]:e.RGB8UI,[nt.RG_INTEGER]:e.RG8UI,[nt.RED_INTEGER]:e.R8UI,[nt.ALPHA]:e.ALPHA,[nt.LUMINANCE]:e.LUMINANCE,[nt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[mt.BYTE]:{[nt.RGBA]:e.RGBA8_SNORM,[nt.RGB]:e.RGB8_SNORM,[nt.RG]:e.RG8_SNORM,[nt.RED]:e.R8_SNORM,[nt.RGBA_INTEGER]:e.RGBA8I,[nt.RGB_INTEGER]:e.RGB8I,[nt.RG_INTEGER]:e.RG8I,[nt.RED_INTEGER]:e.R8I},[mt.UNSIGNED_SHORT]:{[nt.RGBA_INTEGER]:e.RGBA16UI,[nt.RGB_INTEGER]:e.RGB16UI,[nt.RG_INTEGER]:e.RG16UI,[nt.RED_INTEGER]:e.R16UI,[nt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT16},[mt.SHORT]:{[nt.RGBA_INTEGER]:e.RGBA16I,[nt.RGB_INTEGER]:e.RGB16I,[nt.RG_INTEGER]:e.RG16I,[nt.RED_INTEGER]:e.R16I},[mt.UNSIGNED_INT]:{[nt.RGBA_INTEGER]:e.RGBA32UI,[nt.RGB_INTEGER]:e.RGB32UI,[nt.RG_INTEGER]:e.RG32UI,[nt.RED_INTEGER]:e.R32UI,[nt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT24},[mt.INT]:{[nt.RGBA_INTEGER]:e.RGBA32I,[nt.RGB_INTEGER]:e.RGB32I,[nt.RG_INTEGER]:e.RG32I,[nt.RED_INTEGER]:e.R32I},[mt.FLOAT]:{[nt.RGBA]:e.RGBA32F,[nt.RGB]:e.RGB32F,[nt.RG]:e.RG32F,[nt.RED]:e.R32F,[nt.DEPTH_COMPONENT]:e.DEPTH_COMPONENT32F},[mt.HALF_FLOAT]:{[nt.RGBA]:e.RGBA16F,[nt.RGB]:e.RGB16F,[nt.RG]:e.RG16F,[nt.RED]:e.R16F},[mt.UNSIGNED_SHORT_5_6_5]:{[nt.RGB]:e.RGB565},[mt.UNSIGNED_SHORT_4_4_4_4]:{[nt.RGBA]:e.RGBA4},[mt.UNSIGNED_SHORT_5_5_5_1]:{[nt.RGBA]:e.RGB5_A1},[mt.UNSIGNED_INT_2_10_10_10_REV]:{[nt.RGBA]:e.RGB10_A2,[nt.RGBA_INTEGER]:e.RGB10_A2UI},[mt.UNSIGNED_INT_10F_11F_11F_REV]:{[nt.RGB]:e.R11F_G11F_B10F},[mt.UNSIGNED_INT_5_9_9_9_REV]:{[nt.RGB]:e.RGB9_E5},[mt.UNSIGNED_INT_24_8]:{[nt.DEPTH_STENCIL]:e.DEPTH24_STENCIL8},[mt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[nt.DEPTH_STENCIL]:e.DEPTH32F_STENCIL8}}:t={[mt.UNSIGNED_BYTE]:{[nt.RGBA]:e.RGBA,[nt.RGB]:e.RGB,[nt.ALPHA]:e.ALPHA,[nt.LUMINANCE]:e.LUMINANCE,[nt.LUMINANCE_ALPHA]:e.LUMINANCE_ALPHA},[mt.UNSIGNED_SHORT_5_6_5]:{[nt.RGB]:e.RGB},[mt.UNSIGNED_SHORT_4_4_4_4]:{[nt.RGBA]:e.RGBA},[mt.UNSIGNED_SHORT_5_5_5_1]:{[nt.RGBA]:e.RGBA}},t}class Wl{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=iy(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 o=r[s];o&&o._glTextures[i].samplerType!==zi.FLOAT&&this.renderer.texture.unbind(o)}}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!==zi.FLOAT&&(this.hasIntegerTextures=!0);else{const s=t.realWidth,o=t.realHeight,a=n.gl;(r.width!==s||r.height!==o||r.dirtyId<0)&&(r.width=s,r.height=o,a.texImage2D(t.target,0,r.internalFormat,s,o,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&&Gn(this.managedTextures,i,1)}}updateTextureStyle(t){var n;const r=t._glTextures[this.CONTEXT_UID];r&&((t.mipmap===ze.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?r.mipmap=!1:r.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?r.wrapMode=Vr.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!==ze.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===Te.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===Te.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===Te.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===Te.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}Wl.extension={type:ft.RendererSystem,name:"texture"},Et.add(Wl);class Yl{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 o=0;o<t.buffers.length;o++){const a=t.buffers[o];a&&(n.buffer.update(a),a._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,o,a._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 o=0;o<t.buffers.length;o++){const a=t.buffers[o];if(!a)continue;const l=a._glBuffers[this.CONTEXT_UID];l&&(l.refCount--,l.refCount===0&&!r&&s.dispose(a,r))}n&&(r||i.deleteTransformFeedback(n),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Yl.extension={type:ft.RendererSystem,name:"transformFeedback"},Et.add(Yl);class ai{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}}ai.defaultOptions={width:800,height:600,resolution:vt.RESOLUTION,autoDensity:!1},ai.extension={type:[ft.RendererSystem,ft.CanvasRendererSystem],name:"_view"},Et.add(ai),vt.PREFER_ENV=qe.WEBGL2,vt.STRICT_TEXTURE_CACHE=!1,vt.RENDER_OPTIONS={...Jn.defaultOptions,...Qn.defaultOptions,...ai.defaultOptions,...si.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"),Re.defaultResolution},set(e){Re.defaultResolution=e}},FILTER_MULTISAMPLE:{get(){return xt("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Re.defaultMultisample},set(e){Re.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 Oe.defaultVertexPrecision},set(e){xt("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Oe.defaultVertexPrecision=e}},PRECISION_FRAGMENT:{get(){return Oe.defaultFragmentPrecision},set(e){xt("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Oe.defaultFragmentPrecision=e}}});var Ir=(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))(Ir||{});class Qs{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 Zt=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 Qs(null,null,1/0),this.deltaMS=1/Zt.targetFPMS,this.elapsedMS=1/Zt.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=Ir.NORMAL){return this._addListener(new Qs(e,t,r))}addOnce(e,t,r=Ir.NORMAL){return this._addListener(new Qs(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*Zt.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,Zt.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(!Zt._shared){const e=Zt._shared=new Zt;e.autoStart=!0,e._protected=!0}return Zt._shared}static get system(){if(!Zt._system){const e=Zt._system=new Zt;e.autoStart=!0,e._protected=!0}return Zt._system}};let Wt=Zt;Wt.targetFPMS=.06,Object.defineProperties(vt,{TARGET_FPMS:{get(){return Wt.targetFPMS},set(e){xt("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Wt.targetFPMS=e}}});class Kl{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,Ir.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Wt.shared:new Wt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Kl.extension=ft.Application,Et.add(Kl);const sy=[];Et.handleByList(ft.Renderer,sy);class Zl{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(){}}Zl.extension={type:ft.RendererSystem,name:"_multisample"},Et.add(Zl);class oy{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Ql{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 o=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,o.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 oy(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[r]}}Ql.extension={type:ft.RendererSystem,name:"buffer"},Et.add(Ql);class Jl{constructor(t){this.renderer=t}render(t,r){const n=this.renderer;let i,s,o,a;if(r&&(i=r.renderTexture,s=r.clear,o=r.transform,a=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=o,!n.context.isLost){if(i||(this.lastObjectRendered=t),!a){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}}Jl.extension={type:ft.RendererSystem,name:"objectRenderer"},Et.add(Jl);const Js=class extends ny{constructor(e){super(),this.type=Xo.WEBGL,e=Object.assign({},vt.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new oe({projectionMatrix:new Ot},!0);const t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Js.__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=Js.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:Ld()}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 Pr=Js;Pr.extension={type:ft.Renderer,priority:1},Pr.__plugins={},Pr.__systems={},Et.handleByMap(ft.RendererPlugin,Pr.__plugins),Et.handleByMap(ft.RendererSystem,Pr.__systems),Et.add(Pr);class tu extends sn{constructor(t,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let s=0;s<t;s++){const o=new gt;this.items.push(o),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 sn?this.addResourceAt(t[n],n):this.addResourceAt(hl(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 ay extends tu{constructor(t,r){const{width:n,height:i}=r||{};let s,o;Array.isArray(t)?(s=t,o=t.length):o=t,super(o,{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=cr.TEXTURE_2D_ARRAY}upload(t,r,n){const{length:i,itemDirtyIds:s,items:o}=this,{gl:a}=t;n.dirtyId<0&&a.texImage3D(a.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=o[l];s[l]<h.dirtyId&&(s[l]=h.dirtyId,h.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,l,h.resource.width,h.resource.height,1,r.format,n.type,h.resource.source))}return!0}}class ly extends je{constructor(t){super(t)}static test(t){const{OffscreenCanvas:r}=globalThis;return r&&t instanceof r?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const cn=class extends tu{constructor(e,t){const{width:r,height:n,autoLoad:i,linkBaseTexture:s}=t||{};if(e&&e.length!==cn.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:r,height:n});for(let o=0;o<cn.SIDES;o++)this.items[o].target=cr.TEXTURE_CUBE_MAP_POSITIVE_X+o;this.linkBaseTexture=s!==!1,e&&this.initFromArray(e,t),i!==!1&&this.load()}bind(e){super.bind(e),e.target=cr.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=cr.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<cn.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===cn.SIDES}};let eu=cn;eu.SIDES=6;class kr extends je{constructor(t,r){r=r||{};let n,i;typeof t=="string"?(n=kr.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===Le.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 kr._EMPTY=kr._EMPTY??vt.ADAPTER.createCanvas(0,0),kr._EMPTY}}const li=class extends je{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)},li.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;je.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_${nn()}`,s.getContext("2d").drawImage(e,0,0,t,r,0,0,n,i),this._resolve(),this._resolve=null}}static getSize(e){const t=li.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"&&li.SVG_XML.test(e)}};let to=li;to.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,to.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const eo=class extends je{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];je.crossOrigin(r,n,t.crossorigin);for(let i=0;i<e.length;++i){const s=document.createElement("source");let{src:o,mime:a}=e[i];o=o||e[i];const l=o.split("?").shift().toLowerCase(),h=l.slice(l.lastIndexOf(".")+1);a=a||eo.MIME_TYPES[h]||`video/${h}`,s.src=o,s.type=a,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=Wt.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&&(Wt.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(Wt.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&&(Wt.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?(Wt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Wt.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||eo.TYPES.includes(t)}};let ro=eo;ro.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ro.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},Us.push(kr,Ol,ly,ro,to,js,eu,ay);var uy=`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
+ }`,hy=`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 no extends Re{constructor(t){super(uy,hy),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 nr=(e=>(e.BlackAndWhite="BlackAndWhite",e.Sepia="Sepia",e.RetroVintage="RetroVintage",e.NightVision="NightVision",e.Normal="Normal",e.None="Normal",e))(nr||{});class io{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:o,tx:a,ty:l}=t,h=n*r.x+s*r.y+a,c=i*r.x+o*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,o=t[0],a=t[1];r=o<r?o:r,n=a<n?a:n,i=o>i?o:i,s=a>s?a:s,o=t[2],a=t[3],r=o<r?o:r,n=a<n?a:n,i=o>i?o:i,s=a>s?a:s,o=t[4],a=t[5],r=o<r?o:r,n=a<n?a:n,i=o>i?o:i,s=a>s?a:s,o=t[6],a=t[7],r=o<r?o:r,n=a<n?a:n,i=o>i?o:i,s=a>s?a: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 o=t.a,a=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=o*r+l*n+c,y=a*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=o*i+l*n+c,y=a*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=o*r+l*s+c,y=a*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=o*i+l*s+c,y=a*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,o=this.maxX,a=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,o=h>o?h:o,a=c>a?c:a}this.minX=i,this.minY=s,this.maxX=o,this.maxY=a}addVertices(t,r,n,i){this.addVerticesMatrix(t.worldTransform,r,n,i)}addVerticesMatrix(t,r,n,i,s=0,o=s){const a=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=a*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-o),g=Math.max(g,x+o)}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,o=t.maxY<r.maxY?t.maxY:r.maxY;if(n<=s&&i<=o){const a=this.minX,l=this.minY,h=this.maxX,c=this.maxY;this.minX=n<a?n:a,this.minY=i<l?i:l,this.maxX=s>h?s:h,this.maxY=o>c?o: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,o=t.maxY<r.y+r.height?t.maxY:r.y+r.height;if(n<=s&&i<=o){const a=this.minX,l=this.minY,h=this.maxX,c=this.maxY;this.minX=n<a?n:a,this.minY=i<l?i:l,this.maxX=s>h?s:h,this.maxY=o>c?o: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,o){t-=s,r-=o,n+=s,i+=o,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 ir extends Xr{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Wn,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 io,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(ir.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 io);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 o=this.getBounds(!1,t);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-s,o}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,o=0,a=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=o,this.skew.y=a,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 cy),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*sp}set angle(t){this.transform.rotation=t*op}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 cy extends ir{constructor(){super(...arguments),this.sortDirty=null}}ir.prototype.displayObjectUpdateTransform=ir.prototype.updateTransform;const fy=new Ot;function dy(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}const so=class extends ir{constructor(){super(),this.children=[],this.sortableChildren=so.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);Gn(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,Gn(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,Gn(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 o=0;o<s.length;++o)s[o].parent=null,s[o].transform&&(s[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let o=0;o<s.length;++o)s[o].emit("removed",this),this.emit("childRemoved",s[o],this,o);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(dy),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!==so.prototype._render&&(r=this.getBounds(!0));const i=e.projection.transform;if(i&&(n?(n=fy.copyFrom(n),n.prepend(i)):n=i),r&&t.intersects(r,n))this._render(e);else if(this.cullArea)return;for(let s=0,o=this.children.length;s<o;++s){const a=this.children[s],l=a.cullable;a.cullable=l||!this.cullArea,a.render(e),a.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,o;const t=this.filters,r=this._mask;if(t){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let a=0;a<t.length;a++)t[a].enabled&&this._enabledFilters.push(t[a])}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 a=0,l=this.children.length;a<l;++a)this.children[a].render(e)}n&&e.batch.flush(),r&&e.mask.pop(this),t&&((o=this._enabledFilters)!=null&&o.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 sr=so;sr.defaultSortableChildren=!1,sr.prototype.containerUpdateTransform=sr.prototype.updateTransform,Object.defineProperties(vt,{SORTABLE_CHILDREN:{get(){return sr.defaultSortableChildren},set(e){xt("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),sr.defaultSortableChildren=e}}});class ui{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 J,new J,new J,new J],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 ui(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 ru=new J;class hi{constructor(t=0,r=0,n=0,i=0,s=0){t instanceof ui&&(s=r||0,r=t.y,n=t.width,i=t.height,t=t.x),this.innerBounds=new ui(t,r,n,i),this._rotation=s,this._center=new er(this.updateCenter,this),this._hull=[new J,new J,new J,new J],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=ru.set(t,r));const n=this._matrix.applyInverse(t,ru);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,o,a]=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,o),l.apply(t.bottomLeft,a),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 nu{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,o=0;for(let a=this._currentIndex+1;a<i;a++)s=(s+r[a])*n,o=(o+1)*n;for(let a=0;a<=this._currentIndex;a++)s=(s+r[a])*n,o=(o+1)*n;return this._average=s/o,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 ci{constructor(t={}){ci.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 nu(128,this._decayRatio),this._marginAverageProvider=new nu(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,o=Math.min(this._freeCount,n);let a=this._freeCount;for(let l=0;l<o;l++)r[i]=s[a-1],++i,--a;this._freeCount=a}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=Wt.shared){t.add(this._gcTick,null,Ir.UTILITY)}stopGC(t=Wt.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 oo;const iu=new Map;class su{static build(t){let r=iu.get(t);return r||(r=new class extends ci{create(){return new t}},iu.set(t,r),r)}static buildFunctional(t){return new(oo=class extends ci{constructor(...n){super(...n),oo.prototype.__init.call(this)}__init(){this.create=t}},oo)}}const fi={build(e){const t=e.points;let r,n,i,s,o,a;if(e.type===Ht.CIRC){const p=e.shape;r=p.x,n=p.y,o=a=p.radius,i=s=0}else if(e.type===Ht.ELIP){const p=e.shape;r=p.x,n=p.y,o=p.width,a=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,o=a=Math.max(0,Math.min(p.radius,Math.min(v,g))),i=v-o,s=g-a}if(!(o>=0&&a>=0&&i>=0&&s>=0)){t.length=0;return}const l=Math.ceil(2.3*Math.sqrt(o+a)),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+o,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)*o,y=s+Math.sin(v)*a,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+a,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 o=s;let a,l;if(e.type!==Ht.RREC){const c=e.shape;a=c.x,l=c.y}else{const c=e.shape;a=c.x+c.width/2,l=c.y+c.height/2}const h=e.matrix;n.push(e.matrix?h.a*a+h.c*l+h.tx:a,e.matrix?h.b*a+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++,o,s);i.push(o+1,o,s)}};function ou(e,t=!1){const r=e.length;if(r<6)return;let n=0;for(let i=0,s=e[r-2],o=e[r-1];i<r;i+=2){const a=e[i],l=e[i+1];n+=(a-s)*(l+o),s=a,o=l}if(!t&&n>0||t&&n<=0){const i=r/2;for(let s=i+i%2;s<r;s+=2){const o=r-s-2,a=r-s-1,l=s,h=s+1;[e[o],e[l]]=[e[l],e[o]],[e[a],e[h]]=[e[h],e[a]]}}}const au={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){ou(r,!1);const o=[];for(let h=0;h<n.length;h++){const c=n[h];ou(c.points,!0),o.push(r.length/2),r=r.concat(c.points)}const a=wc(r,o,2);if(!a)return;const l=i.length/2;for(let h=0;h<a.length;h+=3)s.push(a[h]+l),s.push(a[h+1]+l),s.push(a[h+2]+l);for(let h=0;h<r.length;h++)i.push(r[h])}}},py={build(e){const t=e.shape,r=t.x,n=t.y,i=t.width,s=t.height,o=e.points;o.length=0,i>=0&&s>=0&&o.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)}},yy={build(e){fi.build(e)},triangulate(e,t){fi.triangulate(e,t)}};var he=(e=>(e.MITER="miter",e.BEVEL="bevel",e.ROUND="round",e))(he||{}),or=(e=>(e.BUTT="butt",e.ROUND="round",e.SQUARE="square",e))(or||{});const Nr={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 lu{static curveTo(t,r,n,i,s,o){const a=o[o.length-2],h=o[o.length-1]-r,c=a-t,f=i-r,u=n-t,d=Math.abs(h*u-c*f);if(d<1e-8||s===0)return(o[o.length-2]!==t||o[o.length-1]!==r)&&o.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,E=c*(b+_),T=h*(b+_),P=u*(y+m),A=f*(y+m),w=Math.atan2(T-S,E-x),O=Math.atan2(A-S,P-x);return{cx:x+t,cy:S+r,radius:s,startAngle:w,endAngle:O,anticlockwise:c*f>u*h}}static arc(t,r,n,i,s,o,a,l,h){const c=a-o,f=Nr._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/zn)*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+o+d*_,x=Math.cos(m),S=-Math.sin(m);h.push((p*x+v*S)*s+n,(p*-S+v*x)*s+i)}}}class vy{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 ao{static curveLength(t,r,n,i,s,o,a,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 E=1;E<=10;++E)f=E/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*a,b=g*r+3*v*f*i+3*p*u*o+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,o,a){const l=a[a.length-2],h=a[a.length-1];a.length-=2;const c=Nr._segmentsCount(ao.curveLength(l,h,t,r,n,i,s,o));let f=0,u=0,d=0,p=0,v=0;a.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,a.push(d*l+3*u*y*t+3*f*p*n+v*s,d*h+3*u*y*r+3*f*p*i+v*o)}}function uu(e,t,r,n,i,s,o,a){const l=e-r*i,h=t-n*i,c=e+r*s,f=t+n*s;let u,d;o?(u=n,d=-r):(u=-n,d=r);const p=l+u,v=h+d,g=c+u,y=f+d;return a.push(p,v,g,y),2}function ar(e,t,r,n,i,s,o,a){const l=r-e,h=n-t;let c=Math.atan2(l,h),f=Math.atan2(i-e,s-t);a&&c<f?c+=Math.PI*2:!a&&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,a){o.push(e,t,r,n);for(let b=1,_=u;b<g;b++,_+=y)o.push(e,t,e+Math.sin(_)*v,t+Math.cos(_)*v);o.push(e,t,i,s)}else{o.push(r,n,e,t);for(let b=1,_=u;b<g;b++,_+=y)o.push(e+Math.sin(_)*v,t+Math.cos(_)*v,e,t);o.push(i,s,e,t)}return g*2}function my(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,o=new J(n[0],n[1]),a=new J(n[n.length-2],n[n.length-1]),l=r.type!==Ht.POLY||r.closeStroke,h=Math.abs(o.x-a.x)<i&&Math.abs(o.y-a.y)<i;if(l){n=n.slice(),h&&(n.pop(),n.pop(),a.set(n[n.length-2],n[n.length-1]));const D=(o.x+a.x)*.5,z=(a.y+o.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,E=-(b-m),T=y-_,P=0,A=0,w=Math.sqrt(E*E+T*T);E/=w,T/=w,E*=p,T*=p;const O=s.alignment,R=(1-O)*2,k=O*2;l||(s.cap===or.ROUND?u+=ar(y-E*(R-k)*.5,b-T*(R-k)*.5,y-E*R,b-T*R,y+E*k,b+T*k,c,!0)+2:s.cap===or.SQUARE&&(u+=uu(y,b,E,T,R,k,!0,c))),c.push(y-E*R,b-T*R,y+E*k,b+T*k);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],E=-(b-m),T=y-_,w=Math.sqrt(E*E+T*T),E/=w,T/=w,E*=p,T*=p,P=-(m-S),A=_-x,w=Math.sqrt(P*P+A*A),P/=w,A/=w,P*=p,A*=p;const z=_-y,j=b-m,N=_-x,I=S-m,C=z*N+j*I,L=j*N-I*z,G=L<0;if(Math.abs(L)<.001*Math.abs(C)){c.push(_-E*R,m-T*R,_+E*k,m+T*k),C>=0&&(s.join===he.ROUND?u+=ar(_,m,_-E*R,m-T*R,_-P*R,m-A*R,c,!1)+4:u+=2,c.push(_-P*k,m-A*k,_+P*R,m+A*R));continue}const $=(-E+y)*(-T+m)-(-E+_)*(-T+b),M=(-P+x)*(-A+m)-(-P+_)*(-A+S),F=(z*M-N*$)/L,H=(I*$-j*M)/L,q=(F-_)*(F-_)+(H-m)*(H-m),X=_+(F-_)*R,K=m+(H-m)*R,rt=_-(F-_)*k,it=m-(H-m)*k,lt=Math.min(z*z+j*j,N*N+I*I),ht=G?R:k,kt=lt+ht*ht*v,It=q<=kt;let V=s.join;if(V===he.MITER&&q/v>g&&(V=he.BEVEL),It)switch(V){case he.MITER:{c.push(X,K,rt,it);break}case he.BEVEL:{G?c.push(X,K,_+E*k,m+T*k,X,K,_+P*k,m+A*k):c.push(_-E*R,m-T*R,rt,it,_-P*R,m-A*R,rt,it),u+=2;break}case he.ROUND:{G?(c.push(X,K,_+E*k,m+T*k),u+=ar(_,m,_+E*k,m+T*k,_+P*k,m+A*k,c,!0)+4,c.push(X,K,_+P*k,m+A*k)):(c.push(_-E*R,m-T*R,rt,it),u+=ar(_,m,_-E*R,m-T*R,_-P*R,m-A*R,c,!1)+4,c.push(_-P*R,m-A*R,rt,it));break}}else{switch(c.push(_-E*R,m-T*R,_+E*k,m+T*k),V){case he.MITER:{G?c.push(rt,it,rt,it):c.push(X,K,X,K),u+=2;break}case he.ROUND:{G?u+=ar(_,m,_+E*k,m+T*k,_+P*k,m+A*k,c,!0)+2:u+=ar(_,m,_-E*R,m-T*R,_-P*R,m-A*R,c,!1)+2;break}}c.push(_-P*R,m-A*R,_+P*k,m+A*k),u+=2}}y=n[(f-2)*2],b=n[(f-2)*2+1],_=n[(f-1)*2],m=n[(f-1)*2+1],E=-(b-m),T=y-_,w=Math.sqrt(E*E+T*T),E/=w,T/=w,E*=p,T*=p,c.push(_-E*R,m-T*R,_+E*k,m+T*k),l||(s.cap===or.ROUND?u+=ar(_-E*(R-k)*.5,m-T*(R-k)*.5,_-E*R,m-T*R,_+E*k,m+T*k,c,!1)+2:s.cap===or.SQUARE&&(u+=uu(_,m,E,T,R,k,!1,c)));const B=t.indices,U=Nr.epsilon*Nr.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)&&B.push(D,D+1,D+2)}function gy(e,t){let r=0;const n=e.shape,i=e.points||n.points,s=n.type!==Ht.POLY||n.closeStroke;if(i.length===0)return;const o=t.points,a=t.indices,l=i.length/2,h=o.length/2;let c=h;for(o.push(i[0],i[1]),r=1;r<l;r++)o.push(i[r*2],i[r*2+1]),a.push(c,c+1),c++;s&&a.push(c,h)}function hu(e,t){e.lineStyle.native?gy(e,t):my(e,t)}class lo{static curveLength(t,r,n,i,s,o){const a=t-2*n+s,l=r-2*i+o,h=2*n-2*t,c=2*i-2*r,f=4*(a*a+l*l),u=4*(a*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 o=s[s.length-2],a=s[s.length-1],l=Nr._segmentsCount(lo.curveLength(o,a,t,r,n,i));let h=0,c=0;for(let f=1;f<=l;++f){const u=f/l;h=o+(t-o)*u,c=a+(r-a)*u,s.push(h+(t+(n-t)*u-h)*u,c+(r+(i-r)*u-c)*u)}}}const uo={[Ht.POLY]:au,[Ht.CIRC]:fi,[Ht.ELIP]:fi,[Ht.RECT]:py,[Ht.RREC]:yy},cu=[],di=[];class pi{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 pi(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 J,fu=class extends fl{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 io,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(),di.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const t=this.batches[e];t.reset(),cu.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 pi(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 pi(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 a=this.shapeIndex;a<t.length;a++){this.shapeIndex++;const l=t[a],h=l.fillStyle,c=l.lineStyle;uo[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=Vr.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=cu.pop()||new vy,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 o=s>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e<t;e++){const r=this.graphicsData[e],n=r.fillStyle,i=r.lineStyle;if(n&&!n.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const e=this.batches;for(let t=0,r=e.length;t<r;t++){const n=e[t];for(let i=0;i<n.size;i++){const s=n.start+i;this.indicesUint16[s]=this.indicesUint16[s]-n.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<fu.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++gt._globalBatch;for(let c=0;c<this.drawCalls.length;c++)this.drawCalls[c].texArray.clear(),di.push(this.drawCalls[c]);this.drawCalls.length=0;const t=this.colors,r=this.textureIds;let n=di.pop();n||(n=new Gs,n.texArray=new Vs),n.texArray.count=0,n.start=0,n.size=0,n.type=Me.TRIANGLES;let i=0,s=null,o=0,a=!1,l=Me.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;a!==!!d.native&&(a=!!d.native,l=a?Me.LINES:Me.TRIANGLES,s=null,i=u,e++),s!==p&&(s=p,p._batchEnabled!==e&&(i===u&&(e++,i=0,n.size>0&&(n=di.pop(),n||(n=new Gs,n.texArray=new Vs),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=Vr.REPEAT,n.texArray.elements[n.texArray.count++]=p,i++)),n.size+=f.size,h+=f.size,o=p._batchLocation,this.addColors(t,d.color,d.alpha,f.attribSize,f.attribStart),this.addTextureIds(r,o,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),o=new Uint32Array(i);let a=0;for(let l=0;l<e.length/2;l++)s[a++]=e[l*2],s[a++]=e[l*2+1],s[a++]=t[l*2],s[a++]=t[l*2+1],o[a++]=r[l],s[a++]=n[l];this._buffer.update(i),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?au.triangulate(e,this):uo[e.type].triangulate(e,this)}processLine(e){hu(e,this);for(let t=0;t<e.holes.length;t++)hu(e.holes[t],this)}processHoles(e){for(let t=0;t<e.length;t++){const r=e[t];uo[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=Yt.shared.setValue(t).toLittleEndianNumber(),o=Yt.shared.setValue(s).toPremultiplied(r);e.length=Math.max(e.length,i+n);for(let a=0;a<n;a++)e[i+a]=o}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 o=0;const a=t.length,l=r.frame;for(;o<i;){let c=e[(n+o)*2],f=e[(n+o)*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}o++,t.push(c/l.width,f/l.height)}const h=r.baseTexture;(l.width<h.width||l.height<h.height)&&this.adjustUvs(t,r,a,i)}adjustUvs(e,t,r,n){const i=t.baseTexture,s=1e-6,o=r+n*2,a=t.frame,l=a.width/i.width,h=a.height/i.height;let c=a.x/a.width,f=a.y/a.height,u=Math.floor(e[r]+s),d=Math.floor(e[r+1]+s);for(let p=r+2;p<o;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<o;p+=2)e[p]=(e[p]+c)*l,e[p+1]=(e[p+1]+f)*h}};let du=fu;du.BATCHABLE_SIZE=100;class yi{constructor(){this.color=16777215,this.alpha=1,this.texture=bt.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new yi;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 ho extends yi{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=or.BUTT,this.join=he.MITER,this.miterLimit=10}clone(){const t=new ho;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 co={},vi=class extends sr{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 yi,this._lineStyle=new ho,this._matrix=null,this._holeMode=!1,this.state=Hn.for2d(),this._geometry=e||new du,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Yt(16777215),this.blendMode=ut.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new vi(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:or.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 on,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new on,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),lo.curveTo(e,t,r,n,i),this}bezierCurveTo(e,t,r,n,i,s){return this._initCurve(),ao.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,o=lu.curveTo(e,t,r,n,i,s);if(o){const{cx:a,cy:l,radius:h,startAngle:c,endAngle:f,anticlockwise:u}=o;this.arc(a,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+=zn:s&&n<=i&&(n+=zn),i-n===0)return this;const a=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]-a),u=Math.abs(c[c.length-1]-l);f<h&&u<h||c.push(a,l)}else this.moveTo(a,l),c=this.currentPath.points;return lu.arc(a,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=Yt.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 Hs(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 ap(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 on(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===Ht.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,o=new Float32Array(this.vertexData.buffer,i.attribStart*4*2,i.attribSize*2),a=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:o,blendMode:t,indices:l,uvs:a,_batchRGB:Yt.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,Yt.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 o=0,a=s.length;o<a;o++)this._renderDrawCallDirect(e,r.drawCalls[o])}_renderDrawCallDirect(e,t){const{texArray:r,type:n,size:i,start:s}=t,o=r.count;for(let a=0;a<o;a++)e.texture.bind(r.elements[a],a);e.geometry.draw(n,i,s)}_resolveDirectShader(e){let t=this.shader;const r=this.pluginName;if(!t){if(!co[r]){const{maxTextures:n}=e.plugins[r],i=new Int32Array(n);for(let a=0;a<n;a++)i[a]=a;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ot,default:oe.from({uSamplers:i},!0)},o=e.plugins[r]._shader.program;co[r]=new ln(o,s)}t=co[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,vi._TEMP_POINT),this._geometry.containsPoint(vi._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=Yt.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,o=t.tx,a=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+o,h[c++]=s*d+n*u+a}}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 Ie=vi;Ie.curves=Nr,Ie._TEMP_POINT=new J;const pu={color:16777215,outlineColor:0,outlineThickness:1,radius:8,shape:"tooth"},by=Ie;class _y extends by{constructor(t,r,n={},i,s,o){super(),this.transformer=t;const a=Object.assign({},pu,n);this._handle=r,this._style=a,this.onHandleDelta=i,this.onHandleCommit=s,this._dirty=!0,this.interactive=!0,this.cursor=o||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new J,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({},pu,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 mi(e,t,r,n){const{x:i,y:s}=r,{x:o,y:a}=n;if(Math.abs(o-i)<.01)return Math.abs(e-i);if(Math.abs(a-s)<.01)return Math.abs(t-s);const l=(a-s)/(o-i);return Math.abs((l*e-t+(a-l*o))/Math.sqrt(l*l+1))}const yu=su.build(J),xy=[new J,new J,new J,new J],Ey=new Ot,Mr=new J,Ty=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],wy=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],Ay=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],Sy=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],fo=new Array(12),Oy=[Ty,wy,Ay,Sy],Ry=Ie;class Iy extends Ry{constructor(t){super(),this.transformer=t,this.boxScalingHandles=[this.addChild(new Ie),this.addChild(new Ie),this.addChild(new Ie),this.addChild(new Ie)],this.boxScalingHandles.forEach(r=>{r.interactive=!0}),this.boxScalingHandles[0].cursor=fn.topCenter,this.boxScalingHandles[1].cursor=fn.middleRight,this.boxScalingHandles[2].cursor=fn.bottomCenter,this.boxScalingHandles[3].cursor=fn.middleLeft}hitHandleType(t,r,n){const{boxRotationEnabled:i,boxRotationTolerance:s,boxScalingEnabled:o,boxScalingTolerance:a}=this.transformer,[l,h,c,f]=t.hull,{x:u,y:d}=r.applyInverse(n,Mr);if(o){const p=mi(u,d,l,h)*r.d,v=mi(u,d,l,f)*r.a,g=mi(u,d,h,c)*r.a,y=mi(u,d,f,c)*r.d,b=Math.min(p,v,g,y);if(b<a)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=xy;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=yu.allocateArray(4);n.forEach((s,o)=>{this.projectToLocal(t.hull[o],s)}),t.innerBounds.pad(2.5*r);const i=yu.allocateArray(4);i.forEach((s,o)=>{this.projectToLocal(t.hull[o],s)}),t.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let s=0;s<4;s++){const o=n[s],a=n[(s+1)%4],l=i[s],h=i[(s+1)%4];this.boxScalingHandles[s].clear().beginFill(16777215,1e-4).drawPolygon(o,l,h,a).endFill()}}drawBoxRotationTolerance(){const{boxRotateTopLeft:t,boxRotateTopRight:r,boxRotateBottomLeft:n,boxRotateBottomRight:i}=this.transformer.handleAnchors,s=this.transformer.boxRotationTolerance*2,o=Ey.identity().scale(s,s).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=Oy[a];let h;switch(a){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];Mr.set(f,u),o.apply(Mr,Mr),fo[c]=Mr.x+h.x,fo[c+1]=Mr.y+h.y}this.drawPolygon(fo.slice())}}projectToLocal(t,r){return this.transformer.projectToLocal(t,r)}}const vu=new Ot;function mu(e){const t=vu.identity();return t.c=Math.tan(e),t}function gu(e){const t=vu.identity();return t.b=Math.tan(e),t}function bu(e,t,r,n=e.pivot){const i=t.a,s=t.b,o=t.c,a=t.d,l=-Math.atan2(-o,a),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(o*o+a*a),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 gi=new Ot,Py=new Ot;function ky(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?Py.copyFrom(e.parent.worldTransform):Ot.IDENTITY;gi.copyFrom(n),gi.prepend(t),gi.prepend(i.invert()),bu(e.transform,gi)}const bi=new Wn,Ny=[new J,new J,new J,new J],Lr=new Ot,Br=new J,po=new hi,Cy=new At,_u=[new J,new J,new J,new J],xu=new J,Eu=new Ot,_i=su.build(J),fn={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},xi=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],Tu={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}},My=[...xi,"rotator","skewHorizontal","skewVertical"],Ly=4,By=16,Fy=[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],Dy=Math.PI/90,Uy=[Math.PI/4,-Math.PI/4],jy=Math.PI/90,wu={color:0,thickness:2},Gy=sr;let $y=class re extends Gy{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||By,this.boxScalingTolerance=t.boxScalingTolerance||Ly,this.centeredScaling=!!t.centeredScaling,this.projectionTransform=new Ot,this.lockAspectRatio=t.lockAspectRatio===!0,this.rotationSnaps=t.rotationSnaps||Fy,this.rotationSnapTolerance=t.rotationSnapTolerance!==void 0?t.rotationSnapTolerance:Dy,this.skewRadius=t.skewRadius||64,this.skewSnaps=t.skewSnaps||Uy,this.skewSnapTolerance=t.skewSnapTolerance!==void 0?t.skewSnapTolerance:jy,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 Iy(this)),this.wireframe.cursor="none",this.stage=t.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._wireframeStyle=Object.assign({},wu,t.wireframeStyle||{});const r=t.handleConstructor||_y,n=t.handleStyle||{};this._handleStyle=n;const i={rotator:this.addChild(new r(this,"rotator",n,a=>{this.rotateGroup("rotator",a)},this.commitGroup))},s=xi.reduce((a,l)=>{const h=new r(this,l,n,null,this.commitGroup,fn[l]);return h.onHandleDelta=c=>{this.scaleGroup(h.handle,c)},h.visible=this._scaleEnabled,a[l]=h,this.addChild(a[l]),a},{}),o={skewHorizontal:this.addChild(new r(this,"skewHorizontal",n,a=>{this.skewGroup("skewHorizontal",a)},this.commitGroup,"pointer")),skewVertical:this.addChild(new r(this,"skewVertical",n,a=>{this.skewGroup("skewVertical",a)},this.commitGroup,"pointer"))};this.handles=Object.assign({},s,i,o),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new J,boxRotateTopLeft:new J,boxRotateTopRight:new J,boxRotateBottomLeft:new J,boxRotateBottomRight:new J,topLeft:new J,topCenter:new J,topRight:new J,middleLeft:new J,middleCenter:new J,middleRight:new J,bottomLeft:new J,bottomCenter:new J,bottomRight:new J,skewHorizontal:new J,skewVertical:new J},this.groupBounds=new hi,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new J,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,My.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,xi.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;xi.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({},wu,t)}getGroupBounds(t=!1){return t&&this.updateGroupBounds(),this.groupBounds}__init(){this.translateGroup=t=>{this._transformHandle=null,this._transformType="translate";const r=Lr.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],Br);this.projectionTransform.applyInverse(i,i),r=this.projectionTransform.applyInverse(r,xu);const s=n.center,o=Math.atan2(i.y-s.y,i.x-s.x);let l=Math.atan2(r.y-s.y,r.x-s.x)-o,h=this.groupBounds.rotation+l;h=this.snapAngle(h,this.rotationSnapTolerance,this.rotationSnaps),l=h-this.groupBounds.rotation;const c=Lr.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=Tu[t].x,i=Tu[t].y,s=this.handles,o=this.groupBounds,a=o.rotation,l=o.innerBounds,h=this.worldTransform.apply(this.handleAnchors[t],Br);this.projectionTransform.applyInverse(h,h),r=this.projectionTransform.applyInverse(r,xu);const c=r.x-h.x,f=r.y-h.y,u=(o.topRight.x-o.topLeft.x)/l.width,d=(o.topRight.y-o.topLeft.y)/l.width,p=(o.bottomLeft.x-o.topLeft.x)/l.height,v=(o.bottomLeft.y-o.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=Lr.identity();if(n!==0&&b!==0){const S=this.centeredScaling?o.center:n===1?o.topLeft:o.topRight;x.translate(-S.x,-S.y).rotate(-a).scale(b,1).rotate(a).translate(S.x,S.y)}if(i!==0&&_!==0){const S=this.centeredScaling?o.center:i===1?o.topLeft:o.bottomLeft;x.translate(-S.x,-S.y).rotate(-a).scale(1,_).rotate(a).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=Br.copyFrom(r);this.projectionTransform.applyInverse(i,i);const s=n.center,o=Lr.identity().translate(-s.x,-s.y);let a=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),o.prepend(gu(-l)),o.prepend(gu(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),o.prepend(mu(l)),o.prepend(mu(-this._skewY)),a-=this._skewY-l}o.translate(s.x,s.y),this.prependTransform(o,!0),this.updateGroupBounds(a)}}__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,o=t.length;s<o&&this.boundingBoxes==="all";s++)this.wireframe.drawBounds(re.calculateOrientedBounds(t[s],po));const i=t.length!==1?re.calculateGroupOrientedBounds(t,this.groupBounds.rotation,po,!0):re.calculateOrientedBounds(t[0],po);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:o,bottomRight:a,center:l}=t,[h,c,f,u]=_u,d=Br;if(this.projectToLocal(i,h),this.projectToLocal(s,c),this.projectToLocal(o,f),this.projectToLocal(a,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,Cy)}}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=_i.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,o=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[a,l,h]=_u;a.set(0,0),l.set(n.x-r.x,n.y-r.y),this.projectionTransform.applyInverse(a,a),this.projectionTransform.applyInverse(l,l),h.set(l.x-a.x,l.y-a.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=o,this._pointerDragging=!0,t.stopPropagation()}_i.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++)ky(n[i],t,!1);Eu.copyFrom(t),r||this.updateGroupBounds(),this.emit("transformchange",Eu)}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,o=r.cursor,a=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(a,h),t.cursor=o,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 J),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 J,new J,new J,new J],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),bu(bi,t.worldTransform),bi.updateLocalTransform();const i=bi.rotation,s=re.calculateTransformedCorners(t,t.worldTransform,Ny),o=(s[0].x+s[1].x+s[2].x+s[3].x)/4,a=(s[0].y+s[1].y+s[2].y+s[3].y)/4,l=Lr.identity().translate(-o,-a).rotate(-bi.rotation).translate(o,a);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 hi,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,o=_i.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,o,u*4)}const a=Lr.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=o.length;u<d;u++){const p=o[u];a.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 _i.releaseArray(o),n=n||new hi,n.innerBounds.x=l,n.innerBounds.y=h,n.innerBounds.width=c-l,n.innerBounds.height=f-h,n.rotation=r,a.applyInverse(n.center,Br),n.center.copyFrom(Br),n}};class Hy{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(Wt.system.add(this.tickerUpdate,this,Ir.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Wt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}}const Ge=new Hy;class Ei{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Ei.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new J,this.page=new J,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,r,n){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,r,n,i,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class Ti extends Ei{constructor(){super(...arguments),this.client=new J,this.movement=new J,this.offset=new J,this.global=new J,this.screen=new J}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,r,n){return t.worldTransform.applyInverse(n||this.global,r)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,r,n,i,s,o,a,l,h,c,f,u,d,p,v){throw new Error("Method not implemented.")}}class ce extends Ti{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Fr extends Ti{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}Fr.DOM_DELTA_PIXEL=0,Fr.DOM_DELTA_LINE=1,Fr.DOM_DELTA_PAGE=2;const qy=2048,zy=new J,yo=new J;class Vy{constructor(t){this.dispatch=new Xr,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,r){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:r,priority:0}),this.mappingTable[t].sort((n,i)=>n.priority-i.priority)}dispatchEvent(t,r){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,r),this.dispatch.emit(r||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const r=this.mappingTable[t.type];if(r)for(let n=0,i=r.length;n<i;n++)r[n].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,r){Ge.pauseUpdate=!0;const i=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",s=this[i](this.rootTarget,this.rootTarget.eventMode,zy.set(t,r),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(t,r){if(!t.target)return;const n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,s=n.length-1;i<s;i++)if(t.currentTarget=n[i],this.notifyTarget(t,r),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,r),!(t.propagationStopped||t.propagationImmediatelyStopped)){t.eventPhase=t.BUBBLING_PHASE;for(let i=n.length-2;i>=0;i--)if(t.currentTarget=n[i],this.notifyTarget(t,r),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,r,n=this._allInteractiveElements){if(n.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(r)?r:[r];for(let s=n.length-1;s>=0;s--)i.forEach(o=>{t.currentTarget=n[s],this.notifyTarget(t,o)})}propagationPath(t){const r=[t];for(let n=0;n<qy&&t!==this.rootTarget;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");r.push(t.parent),t=t.parent}return r.reverse(),r}hitTestMoveRecursive(t,r,n,i,s,o=!1){if(this._interactivePrune(t))return null;if((t.eventMode==="dynamic"||r==="dynamic")&&(Ge.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let c=h.length-1;c>=0;c--){const f=h[c],u=this.hitTestMoveRecursive(f,this._isInteractive(r)?r:f.eventMode,n,i,s,s(t,n));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();(u.length>0||d)&&(d&&this._allInteractiveElements.push(t),u.push(t)),this._hitElements.length===0&&(this._hitElements=u)}}}const a=this._isInteractive(r),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a&&!s(t,n)&&i(t,n)?l?[t]:[]:null}hitTestRecursive(t,r,n,i,s){if(this._interactivePrune(t)||s(t,n))return null;if((t.eventMode==="dynamic"||r==="dynamic")&&(Ge.pauseUpdate=!1),t.interactiveChildren&&t.children){const l=t.children;for(let h=l.length-1;h>=0;h--){const c=l[h],f=this.hitTestRecursive(c,this._isInteractive(r)?r:c.eventMode,n,i,s);if(f){if(f.length>0&&!f[f.length-1].parent)continue;const u=t.isInteractive();return(f.length>0||u)&&f.push(t),f}}}const o=this._isInteractive(r),a=t.isInteractive();return o&&i(t,n)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,r){var n;if(t.hitArea&&(t.worldTransform.applyInverse(r,yo),!t.hitArea.contains(yo.x,yo.y)))return!0;if(t._mask){const i=t._mask.isMaskData?t._mask.maskObject:t._mask;if(i&&!((n=i.containsPoint)!=null&&n.call(i,r)))return!0}return!1}hitTestFn(t,r){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(r):!1}notifyTarget(t,r){var s,o;r=r??t.type;const n=`on${r}`;(o=(s=t.currentTarget)[n])==null||o.call(s,t);const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${r}capture`:r;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,r)}mapPointerDown(t){if(!(t instanceof ce)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.createPointerEvent(t);if(this.dispatchEvent(r,"pointerdown"),r.pointerType==="touch")this.dispatchEvent(r,"touchstart");else if(r.pointerType==="mouse"||r.pointerType==="pen"){const i=r.button===2;this.dispatchEvent(r,i?"rightdown":"mousedown")}const n=this.trackingData(t.pointerId);n.pressTargetsByButton[t.button]=r.composedPath(),this.freeEvent(r)}mapPointerMove(t){var l,h;if(!(t instanceof ce)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const n=r.pointerType==="mouse"||r.pointerType==="pen",i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.overTargets);if(((l=i.overTargets)==null?void 0:l.length)>0&&s!==r.target){const c=t.type==="mousemove"?"mouseout":"pointerout",f=this.createPointerEvent(t,c,s);if(this.dispatchEvent(f,"pointerout"),n&&this.dispatchEvent(f,"mouseout"),!r.composedPath().includes(s)){const u=this.createPointerEvent(t,"pointerleave",s);for(u.eventPhase=u.AT_TARGET;u.target&&!r.composedPath().includes(u.target);)u.currentTarget=u.target,this.notifyTarget(u),n&&this.notifyTarget(u,"mouseleave"),u.target=u.target.parent;this.freeEvent(u)}this.freeEvent(f)}if(s!==r.target){const c=t.type==="mousemove"?"mouseover":"pointerover",f=this.clonePointerEvent(r,c);this.dispatchEvent(f,"pointerover"),n&&this.dispatchEvent(f,"mouseover");let u=s==null?void 0:s.parent;for(;u&&u!==this.rootTarget.parent&&u!==r.target;)u=u.parent;if(!u||u===this.rootTarget.parent){const p=this.clonePointerEvent(r,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==s&&p.target!==this.rootTarget.parent;)p.currentTarget=p.target,this.notifyTarget(p),n&&this.notifyTarget(p,"mouseenter"),p.target=p.target.parent;this.freeEvent(p)}this.freeEvent(f)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(r,"pointermove"),a&&o.push("globalpointermove"),r.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),a&&o.push("globaltouchmove")),n&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(h=r.target)==null?void 0:h.cursor),o.length>0&&this.all(r,o),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(t){var o;if(!(t instanceof ce)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(t.pointerId),n=this.createPointerEvent(t),i=n.pointerType==="mouse"||n.pointerType==="pen";this.dispatchEvent(n,"pointerover"),i&&this.dispatchEvent(n,"mouseover"),n.pointerType==="mouse"&&(this.cursor=(o=n.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(n,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),i&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;r.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof ce)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(t.pointerId);if(r.overTargets){const n=t.pointerType==="mouse"||t.pointerType==="pen",i=this.findMountedTarget(r.overTargets),s=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(s),n&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(t,"pointerleave",i);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),n&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;r.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof ce)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=performance.now(),n=this.createPointerEvent(t);if(this.dispatchEvent(n,"pointerup"),n.pointerType==="touch")this.dispatchEvent(n,"touchend");else if(n.pointerType==="mouse"||n.pointerType==="pen"){const a=n.button===2;this.dispatchEvent(n,a?"rightup":"mouseup")}const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]);let o=s;if(s&&!n.composedPath().includes(s)){let a=s;for(;a&&!n.composedPath().includes(a);){if(n.currentTarget=a,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch")this.notifyTarget(n,"touchendoutside");else if(n.pointerType==="mouse"||n.pointerType==="pen"){const l=n.button===2;this.notifyTarget(n,l?"rightupoutside":"mouseupoutside")}a=a.parent}delete i.pressTargetsByButton[t.button],o=a}if(o){const a=this.clonePointerEvent(n,"click");a.target=o,a.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:r});const l=i.clicksByButton[t.button];if(l.target===a.target&&r-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=a.target,l.timeStamp=r,a.detail=l.clickCount,a.pointerType==="mouse"){const h=a.button===2;this.dispatchEvent(a,h?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(n)}mapPointerUpOutside(t){if(!(t instanceof ce)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(n){let s=n;for(;s;)i.currentTarget=s,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch"?this.notifyTarget(i,"touchendoutside"):(i.pointerType==="mouse"||i.pointerType==="pen")&&this.notifyTarget(i,i.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete r.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof Fr)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const r=this.createWheelEvent(t);this.dispatchEvent(r),this.freeEvent(r)}findMountedTarget(t){if(!t)return null;let r=t[0];for(let n=1;n<t.length&&t[n].parent===r;n++)r=t[n];return r}createPointerEvent(t,r,n){const i=this.allocateEvent(ce);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=n??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],typeof r=="string"&&(i.type=r),i}createWheelEvent(t){const r=this.allocateEvent(Fr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=this.hitTest(r.global.x,r.global.y),r}clonePointerEvent(t,r){const n=this.allocateEvent(ce);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=r??n.type,n}copyWheelData(t,r){r.deltaMode=t.deltaMode,r.deltaX=t.deltaX,r.deltaY=t.deltaY,r.deltaZ=t.deltaZ}copyPointerData(t,r){t instanceof ce&&r instanceof ce&&(r.pointerId=t.pointerId,r.width=t.width,r.height=t.height,r.isPrimary=t.isPrimary,r.pointerType=t.pointerType,r.pressure=t.pressure,r.tangentialPressure=t.tangentialPressure,r.tiltX=t.tiltX,r.tiltY=t.tiltY,r.twist=t.twist)}copyMouseData(t,r){t instanceof Ti&&r instanceof Ti&&(r.altKey=t.altKey,r.button=t.button,r.buttons=t.buttons,r.client.copyFrom(t.client),r.ctrlKey=t.ctrlKey,r.metaKey=t.metaKey,r.movement.copyFrom(t.movement),r.screen.copyFrom(t.screen),r.shiftKey=t.shiftKey,r.global.copyFrom(t.global))}copyData(t,r){r.isTrusted=t.isTrusted,r.srcElement=t.srcElement,r.timeStamp=performance.now(),r.type=t.type,r.detail=t.detail,r.view=t.view,r.which=t.which,r.layer.copyFrom(t.layer),r.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const r=this.eventPool.get(t).pop()||new t(this);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=null,r.target=null,r}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const r=t.constructor;this.eventPool.has(r)||this.eventPool.set(r,[]),this.eventPool.get(r).push(t)}notifyListeners(t,r){const n=t.currentTarget._events[r];if(n&&t.currentTarget.isInteractive())if("fn"in n)n.once&&t.currentTarget.removeListener(r,n.fn,void 0,!0),n.fn.call(n.context,t);else for(let i=0,s=n.length;i<s&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeListener(r,n[i].fn,void 0,!0),n[i].fn.call(n[i].context,t)}}const Xy=1,Wy={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},vo=class{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new Vy(null),Ge.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new ce(null),this.rootWheelEvent=new Fr(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...vo.defaultEventFeatures},{set:(t,r,n)=>(r==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[r]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:r}=this.renderer;this.setTargetElement(t),this.resolution=r,vo._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const r=this.cursorStyles[e];if(r)switch(typeof r){case"string":t&&(this.domElement.style.cursor=r);break;case"function":r(e);break;case"object":t&&Object.assign(this.domElement.style,r);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&e.pointerType==="touch"))return;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let r=0,n=t.length;r<n;r++){const i=t[r],s=this.bootstrapEvent(this.rootPointerEvent,i);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(e){if(!this.features.move||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&e.pointerType==="touch"))return;Ge.pointerMoved();const t=this.normalizeToPointerData(e);for(let r=0,n=t.length;r<n;r++){const i=this.bootstrapEvent(this.rootPointerEvent,t[r]);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(e){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&e.pointerType==="touch"))return;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const r=t!==this.domElement?"outside":"",n=this.normalizeToPointerData(e);for(let i=0,s=n.length;i<s;i++){const o=this.bootstrapEvent(this.rootPointerEvent,n[i]);o.type+=r,this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(e){if(!this.features.click||(this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.supportsTouchEvents&&e.pointerType==="touch"))return;const t=this.normalizeToPointerData(e);for(let r=0,n=t.length;r<n;r++){const i=this.bootstrapEvent(this.rootPointerEvent,t[r]);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this.removeEvents(),this.domElement=e,Ge.domElement=e,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;Ge.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0)),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;Ge.removeTickerListener();const e=this.domElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(e,t,r){let n;this.domElement.parentElement?n=this.domElement.getBoundingClientRect():n={x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0};const i=1/this.resolution;e.x=(t-n.left)*(this.domElement.width/n.width)*i,e.y=(r-n.top)*(this.domElement.height/n.height)*i}normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let r=0,n=e.changedTouches.length;r<n;r++){const i=e.changedTouches[r];typeof i.button>"u"&&(i.button=0),typeof i.buttons>"u"&&(i.buttons=1),typeof i.isPrimary>"u"&&(i.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof i.width>"u"&&(i.width=i.radiusX||1),typeof i.height>"u"&&(i.height=i.radiusY||1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="touch"),typeof i.pointerId>"u"&&(i.pointerId=i.identifier||0),typeof i.pressure>"u"&&(i.pressure=i.force||.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),typeof i.layerX>"u"&&(i.layerX=i.offsetX=i.clientX),typeof i.layerY>"u"&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,i.type=e.type,t.push(i)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const r=e;typeof r.isPrimary>"u"&&(r.isPrimary=!0),typeof r.width>"u"&&(r.width=1),typeof r.height>"u"&&(r.height=1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="mouse"),typeof r.pointerId>"u"&&(r.pointerId=Xy),typeof r.pressure>"u"&&(r.pressure=.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),r.isNormalized=!0,t.push(r)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=Wy[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};let dn=vo;dn.extension={name:"events",type:[ft.RendererSystem,ft.CanvasRendererSystem]},dn.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0},Et.add(dn);function Au(e){return e==="dynamic"||e==="static"}const Yy={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??Au(dn.defaultEventMode)},set interactive(e){xt("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=e,this.eventMode=e?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??dn.defaultEventMode},set eventMode(e){this._internalInteractive=Au(e),this._internalEventMode=e},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(e,t,r){const n=typeof r=="boolean"&&r||typeof r=="object"&&r.capture,i=typeof t=="function"?void 0:t;e=n?`${e}capture`:e,t=typeof t=="function"?t:t.handleEvent,this.on(e,t,i)},removeEventListener(e,t,r){const n=typeof r=="boolean"&&r||typeof r=="object"&&r.capture,i=typeof t=="function"?void 0:t;e=n?`${e}capture`:e,t=typeof t=="function"?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof Ei))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}};ir.mixin(Yy);function Ky(e,t,r,n){for(const i in t){const s=r[i],o=n[i],a=t[i];s!==o&&(s&&e.removeEventListener(a,s),o&&e.addEventListener(a,o))}}const wi={},Zy=Ot.IDENTITY,Qy={transformchange:"transformchange",transformcommit:"transformcommit"},Su=yt.PixiComponent("Transformer",{create:e=>new $y(e),applyProps(e,t,r){if(yt.applyDefaultProps(e,t,r),Ky(e,Qy,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||Zy),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||wi,i=r.handleStyle||wi;(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||wi,o=r.wireframeStyle||wi;(s.color!==o.color||s.thickness!==o.thickness)&&(e.wireframeStyle=o)}}),mo=({pixiTransformerRef:e,imageRef:t,isMounted:r,transformCommit:n,transformChange:i,mouseoverEvent:s,onDoubleClick:o,uniqueId:a=""})=>{const l=ne.utils.string2hex("#F3C409"),h=ne.utils.string2hex("#F3C409"),c=at.useRef({isDragging:!1}),f=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},[]),v=at.useCallback(()=>{c.current.isDragging=!1},[]),g=at.useCallback(()=>{console.log("dobule click in pixi transformer"),o&&o({uniqueId:a})},[o]),y=at.useCallback(_=>{c.current.isDragging=!0,i&&i(_)},[i]),b=at.useCallback(()=>{if(t.current===null)return;const _=t.current.x,m=t.current.y,x=t.current.width,S=t.current.height,E=t.current.rotation,T=[t.current.scale.x,t.current.scale.y];n&&n({uniqueId:a,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(E),scale:T}}),c.current.isDragging=!1},[n]);return at.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))}),[]),dt.jsx(Su,{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 Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});var Jy=tt,go;function Ou(){return go||(go=document.createElement("div")),go}function tv(e,t,r){var n;return Jy.useEffect(function(){n=n||Ou();var i=function(s){var o=s.detail;t(o)};return n.addEventListener(e,i,!1),function(){n==null||n.removeEventListener(e,i,!1)}},r),function(i){n=i}}function ev(e,t){var r=Ou(),n=new CustomEvent(e,{detail:t});r.dispatchEvent(n)}function rv(){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 Ru=Ai.emitCustomEvent=ev;Ai.newCustomEventEmitter=rv;var pn=Ai.useCustomEventListener=tv;const Dr=at.createContext({}),$e={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"},nv=({children:e})=>{const[t,r]=tt.useState(!1),[n,i]=tt.useState(!1),s=tt.useRef(),o=tt.useRef(),a=tt.useRef(.001);tt.useLayoutEffect(()=>(o.current=ve.context(()=>{s.current&&s.current.progress(0).kill(),s.current=ve.timeline({paused:!0,defaults:{duration:0}})}),()=>o.current.revert()),[]);const l=tt.useCallback(()=>{let b=s.current.time();a.current=b},[]);tt.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=tt.useCallback(()=>{s.current.revert()},[]),c=tt.useCallback(()=>{s.current.restart(),r(!0)},[]),f=tt.useCallback(()=>{const y=s.current;y.repeat(1),y.restart()},[]),u=tt.useCallback(y=>{s.current.seek(y)},[]),d=tt.useCallback(()=>{s.current.seek(4)},[]),p=tt.useCallback(()=>{const y=s.current;return y?y.totalDuration():0},[]),v=()=>{s.current.pause(),Ru($e.PAUSE),r(!1)},g=()=>{const y=s.current;r(!0),y.resume(),Ru($e.RESUME)};return pn($e.DRAGGING_START,()=>{console.log("dragging start"),i(!0)}),pn($e.DRAGGING_END,()=>{i(!1),console.log("dragging end")}),console.log("set play updated",t),dt.jsx(Dr.Provider,{value:{gsapCtx:o,tl:s,handlePlay:g,handlePause:v,handleReset:h,handleSeek:u,handleSeekTest:d,handleRestart:c,handleRepeat:f,playerTimeRef:a,isDragging:n,getTimelineDuration:p},children:e})},bo=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 iv=Object.prototype;function sv(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||iv;return e===r}var Iu=sv;function ov(e,t){return function(r){return e(t(r))}}var av=ov,lv=av,uv=lv(Object.keys,Object),hv=uv,cv=Iu,fv=hv,dv=Object.prototype,pv=dv.hasOwnProperty;function yv(e){if(!cv(e))return fv(e);var t=[];for(var r in Object(e))pv.call(e,r)&&r!="constructor"&&t.push(r);return t}var Pu=yv,vv=typeof Ce=="object"&&Ce&&Ce.Object===Object&&Ce,ku=vv,mv=ku,gv=typeof self=="object"&&self&&self.Object===Object&&self,bv=mv||gv||Function("return this")(),Pe=bv,_v=Pe,xv=_v.Symbol,Si=xv,Nu=Si,Cu=Object.prototype,Ev=Cu.hasOwnProperty,Tv=Cu.toString,yn=Nu?Nu.toStringTag:void 0;function wv(e){var t=Ev.call(e,yn),r=e[yn];try{e[yn]=void 0;var n=!0}catch{}var i=Tv.call(e);return n&&(t?e[yn]=r:delete e[yn]),i}var Av=wv,Sv=Object.prototype,Ov=Sv.toString;function Rv(e){return Ov.call(e)}var Iv=Rv,Mu=Si,Pv=Av,kv=Iv,Nv="[object Null]",Cv="[object Undefined]",Lu=Mu?Mu.toStringTag:void 0;function Mv(e){return e==null?e===void 0?Cv:Nv:Lu&&Lu in Object(e)?Pv(e):kv(e)}var vn=Mv;function Lv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var _o=Lv,Bv=vn,Fv=_o,Dv="[object AsyncFunction]",Uv="[object Function]",jv="[object GeneratorFunction]",Gv="[object Proxy]";function $v(e){if(!Fv(e))return!1;var t=Bv(e);return t==Uv||t==jv||t==Dv||t==Gv}var Bu=$v,Hv=Pe,qv=Hv["__core-js_shared__"],zv=qv,xo=zv,Fu=function(){var e=/[^.]+$/.exec(xo&&xo.keys&&xo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Vv(e){return!!Fu&&Fu in e}var Xv=Vv,Wv=Function.prototype,Yv=Wv.toString;function Kv(e){if(e!=null){try{return Yv.call(e)}catch{}try{return e+""}catch{}}return""}var Du=Kv,Zv=Bu,Qv=Xv,Jv=_o,tm=Du,em=/[\\^$.*+?()[\]{}|]/g,rm=/^\[object .+?Constructor\]$/,nm=Function.prototype,im=Object.prototype,sm=nm.toString,om=im.hasOwnProperty,am=RegExp("^"+sm.call(om).replace(em,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lm(e){if(!Jv(e)||Qv(e))return!1;var t=Zv(e)?am:rm;return t.test(tm(e))}var um=lm;function hm(e,t){return e==null?void 0:e[t]}var cm=hm,fm=um,dm=cm;function pm(e,t){var r=dm(e,t);return fm(r)?r:void 0}var Ur=pm,ym=Ur,vm=Pe,mm=ym(vm,"DataView"),gm=mm,bm=Ur,_m=Pe,xm=bm(_m,"Map"),Eo=xm,Em=Ur,Tm=Pe,wm=Em(Tm,"Promise"),Am=wm,Sm=Ur,Om=Pe,Rm=Sm(Om,"Set"),Im=Rm,Pm=Ur,km=Pe,Nm=Pm(km,"WeakMap"),Cm=Nm,To=gm,wo=Eo,Ao=Am,So=Im,Oo=Cm,Uu=vn,jr=Du,ju="[object Map]",Mm="[object Object]",Gu="[object Promise]",$u="[object Set]",Hu="[object WeakMap]",qu="[object DataView]",Lm=jr(To),Bm=jr(wo),Fm=jr(Ao),Dm=jr(So),Um=jr(Oo),lr=Uu;(To&&lr(new To(new ArrayBuffer(1)))!=qu||wo&&lr(new wo)!=ju||Ao&&lr(Ao.resolve())!=Gu||So&&lr(new So)!=$u||Oo&&lr(new Oo)!=Hu)&&(lr=function(e){var t=Uu(e),r=t==Mm?e.constructor:void 0,n=r?jr(r):"";if(n)switch(n){case Lm:return qu;case Bm:return ju;case Fm:return Gu;case Dm:return $u;case Um:return Hu}return t});var zu=lr;function jm(e){return e!=null&&typeof e=="object"}var mn=jm,Gm=vn,$m=mn,Hm="[object Arguments]";function qm(e){return $m(e)&&Gm(e)==Hm}var zm=qm,Vu=zm,Vm=mn,Xu=Object.prototype,Xm=Xu.hasOwnProperty,Wm=Xu.propertyIsEnumerable,Ym=Vu(function(){return arguments}())?Vu:function(e){return Vm(e)&&Xm.call(e,"callee")&&!Wm.call(e,"callee")},Ro=Ym,Km=Array.isArray,Ee=Km,Zm=9007199254740991;function Qm(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Zm}var Io=Qm,Jm=Bu,tg=Io;function eg(e){return e!=null&&tg(e.length)&&!Jm(e)}var Oi=eg,Ri={exports:{}};function rg(){return!1}var ng=rg;Ri.exports,function(e,t){var r=Pe,n=ng,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,a=o?r.Buffer:void 0,l=a?a.isBuffer:void 0,h=l||n;e.exports=h}(Ri,Ri.exports);var Po=Ri.exports,ig=vn,sg=Io,og=mn,ag="[object Arguments]",lg="[object Array]",ug="[object Boolean]",hg="[object Date]",cg="[object Error]",fg="[object Function]",dg="[object Map]",pg="[object Number]",yg="[object Object]",vg="[object RegExp]",mg="[object Set]",gg="[object String]",bg="[object WeakMap]",_g="[object ArrayBuffer]",xg="[object DataView]",Eg="[object Float32Array]",Tg="[object Float64Array]",wg="[object Int8Array]",Ag="[object Int16Array]",Sg="[object Int32Array]",Og="[object Uint8Array]",Rg="[object Uint8ClampedArray]",Ig="[object Uint16Array]",Pg="[object Uint32Array]",Rt={};Rt[Eg]=Rt[Tg]=Rt[wg]=Rt[Ag]=Rt[Sg]=Rt[Og]=Rt[Rg]=Rt[Ig]=Rt[Pg]=!0,Rt[ag]=Rt[lg]=Rt[_g]=Rt[ug]=Rt[xg]=Rt[hg]=Rt[cg]=Rt[fg]=Rt[dg]=Rt[pg]=Rt[yg]=Rt[vg]=Rt[mg]=Rt[gg]=Rt[bg]=!1;function kg(e){return og(e)&&sg(e.length)&&!!Rt[ig(e)]}var Ng=kg;function Cg(e){return function(t){return e(t)}}var Mg=Cg,Ii={exports:{}};Ii.exports,function(e,t){var r=ku,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=a}(Ii,Ii.exports);var Lg=Ii.exports,Bg=Ng,Fg=Mg,Wu=Lg,Yu=Wu&&Wu.isTypedArray,Dg=Yu?Fg(Yu):Bg,ko=Dg,Ug=Pu,jg=zu,Gg=Ro,$g=Ee,Hg=Oi,qg=Po,zg=Iu,Vg=ko,Xg="[object Map]",Wg="[object Set]",Yg=Object.prototype,Kg=Yg.hasOwnProperty;function Zg(e){if(e==null)return!0;if(Hg(e)&&($g(e)||typeof e=="string"||typeof e.splice=="function"||qg(e)||Vg(e)||Gg(e)))return!e.length;var t=jg(e);if(t==Xg||t==Wg)return!e.size;if(zg(e))return!Ug(e).length;for(var r in e)if(Kg.call(e,r))return!1;return!0}var Qg=Zg;const ee=hr(Qg),Jg=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],No=e=>{const[t,r]=at.useState(!1),[,n]=tt.useState(!1),[,i]=tt.useState(!1),s=tt.useRef(null),o=tt.useRef(null),a=tt.useRef(null),l=tt.useRef(null),{tl:h}=tt.useContext(Dr),{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:E=1,brightness:T=1,alpha:P=1,blurRadius:A=0}=b||{},w={...T>1&&{brightness:T},...S>1&&{contrast:S},...E>1&&{saturation:E},...P!==0&&{alpha:P}};at.useEffect(()=>{s.current&&r(!0)},[]),at.useEffect(()=>{let U=ve.context(()=>{});if(s.current&&h.current){const D={duration:Number(u)-Number(f)},z=bo(_||"None");U=ve.context(()=>{var j,N;ee(z.from)?ee(z.to)?ee(z.fromTo)?h.current.to(s.current,{alpha:1,duration:.01},f).from(a.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,(N=z.fromTo)==null?void 0:N.to,f).from(a.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(a.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2):h.current.from(s.current,{...z.from},f).to(a.current,{alpha:1,duration:.2},f).from(a.current,{...D},f).to(s.current,{alpha:0,duration:.2},u-.2)})}return()=>U.revert()},[_,f,u]);const O=at.useCallback(()=>{n(!0)},[]),R=at.useCallback(U=>{console.log("changeEnd",U),e.onAnchorTransformationEnd&&(console.log("running onAnchorTransformationEnd"),e.onAnchorTransformationEnd(U))},[]),k=yt.withFilters(yt.Container,{...A>0&&{blur:ne.filters.BlurFilter},...!ee(w)&&{adjust:no},matrix:ne.filters.ColorMatrixFilter}),B=(b==null?void 0:b.enabled)||m&&m!==nr.Normal;return dt.jsxs(yt.Container,{ref:o,children:[dt.jsxs(yt.Container,{ref:s,alpha:d,position:[p,v],pivot:[p,v],width:g,height:y,children:[B&&dt.jsx(k,{scale:1,blur:{blur:A,quality:4},adjust:w,apply:({matrix:U})=>{m===nr.BlackAndWhite?U.desaturate():m===nr.Sepia?U.sepia():m===nr.RetroVintage||m===nr.NightVision?U.negative():m===nr.Normal&&U.reset()},matrix:{enabled:!0,matrix:Jg},children:dt.jsx(yt.Container,{ref:a,children:e.children})}),!B&&dt.jsx(yt.Container,{ref:a,children:e.children})]}),x&&dt.jsx(mo,{pixiTransformerRef:l,imageRef:s,isMounted:t,transformCommit:R,transformChange:O,mouseoverEvent:i,uniqueId:c})]})},t0=e=>{const t=tt.useRef(null),r=tt.useRef(null),{src:n,transformation:{x:i,y:s,width:o,height:a,anchor:l},pointerdown:h,pointerup:c,mousedown:f,mouseup:u,pointerover:d,mouseover:p,mouseout:v}=e;return dt.jsx(No,{...e,children:dt.jsx(yt.Container,{ref:r,children:dt.jsx(yt.Sprite,{image:n,width:o,height:a,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 e0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={},r0={get exports(){return Co},set exports(e){Co=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()})(e0,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}}},o=0,a=[];o<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 "+o);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 "+o);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}a.push.apply(a,f)}return a;function u(v){return v.code=l,v.relative=c,v}function d(v,g){i[v].lastIndex=o;var y=i[v].exec(n);if(!y||y.index!==o){if(!g)return null;throw Error("Expected "+v+" at position "+o)}return o=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}}})})(r0);const n0=/^\s+/,i0=/\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=s0(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,o;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?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*s+.0722*o},setAlpha:function(e){return this._a=eh(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Zu(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Zu(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=Ku(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Ku(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 u0(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(Pt(this._r,255)*100)+"%",g:Math.round(Pt(this._g,255)*100)+"%",b:Math.round(Pt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Pt(this._r,255)*100)+"%, "+Math.round(Pt(this._g,255)*100)+"%, "+Math.round(Pt(this._b,255)*100)+"%)":"rgba("+Math.round(Pt(this._r,255)*100)+"%, "+Math.round(Pt(this._g,255)*100)+"%, "+Math.round(Pt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:x0[Qu(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+Ju(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=st(e);r="#"+Ju(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(d0,arguments)},brighten:function(){return this._applyModification(p0,arguments)},darken:function(){return this._applyModification(y0,arguments)},desaturate:function(){return this._applyModification(h0,arguments)},saturate:function(){return this._applyModification(c0,arguments)},greyscale:function(){return this._applyModification(f0,arguments)},spin:function(){return this._applyModification(v0,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(b0,arguments)},complement:function(){return this._applyCombination(m0,arguments)},monochromatic:function(){return this._applyCombination(_0,arguments)},splitcomplement:function(){return this._applyCombination(g0,arguments)},triad:function(){return this._applyCombination(th,[3])},tetrad:function(){return this._applyCombination(th,[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]=gn(e[n]));e=r}return st(e,t)};function s0(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,o=!1,a=!1;return typeof e=="string"&&(e=A0(e)),typeof e=="object"&&(ke(e.r)&&ke(e.g)&&ke(e.b)?(t=o0(e.r,e.g,e.b),o=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ke(e.h)&&ke(e.s)&&ke(e.v)?(n=gn(e.s),i=gn(e.v),t=l0(e.h,n,i),o=!0,a="hsv"):ke(e.h)&&ke(e.s)&&ke(e.l)&&(n=gn(e.s),s=gn(e.l),t=a0(e.h,n,s),o=!0,a="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=eh(r),{ok:o,format:e.format||a,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 o0(e,t,r){return{r:Pt(e,255)*255,g:Pt(t,255)*255,b:Pt(r,255)*255}}function Ku(e,t,r){e=Pt(e,255),t=Pt(t,255),r=Pt(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,o,a=(n+i)/2;if(n==i)s=o=0;else{var l=n-i;switch(o=a>.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:o,l:a}}function a0(e,t,r){var n,i,s;e=Pt(e,360),t=Pt(t,100),r=Pt(r,100);function o(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 a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;n=o(l,a,e+1/3),i=o(l,a,e),s=o(l,a,e-1/3)}return{r:n*255,g:i*255,b:s*255}}function Zu(e,t,r){e=Pt(e,255),t=Pt(t,255),r=Pt(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,o,a=n,l=n-i;if(o=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:o,v:a}}function l0(e,t,r){e=Pt(e,360)*6,t=Pt(t,100),r=Pt(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),o=r*(1-i*t),a=r*(1-(1-i)*t),l=n%6,h=[r,o,s,s,a,r][l],c=[a,r,r,o,s,s][l],f=[s,s,a,r,r,o][l];return{r:h*255,g:c*255,b:f*255}}function Qu(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 u0(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(rh(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 Ju(e,t,r,n){var i=[fe(rh(n)),fe(Math.round(e).toString(16)),fe(Math.round(t).toString(16)),fe(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 h0(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.s-=t/100,r.s=Pi(r.s),st(r)}function c0(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.s+=t/100,r.s=Pi(r.s),st(r)}function f0(e){return st(e).desaturate(100)}function d0(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.l+=t/100,r.l=Pi(r.l),st(r)}function p0(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 y0(e,t){t=t===0?0:t||10;var r=st(e).toHsl();return r.l-=t/100,r.l=Pi(r.l),st(r)}function v0(e,t){var r=st(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,st(r)}function m0(e){var t=st(e).toHsl();return t.h=(t.h+180)%360,st(t)}function th(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 g0(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 b0(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 _0(e,t){t=t||6;for(var r=st(e).toHsv(),n=r.h,i=r.s,s=r.v,o=[],a=1/t;t--;)o.push(st({h:n,s:i,v:s})),s=(s+a)%1;return o}st.mix=function(e,t,r){r=r===0?0:r||50;var n=st(e).toRgb(),i=st(t).toRgb(),s=r/100,o={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(o)},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=S0(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,o,a,l;r=r||{},o=r.includeFallbackColors,a=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:a,size:l})||!o?n:(r.includeFallbackColors=!1,st.mostReadable(e,["#fff","#000"],r))};var Mo=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"},x0=st.hexNames=E0(Mo);function E0(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function eh(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Pt(e,t){T0(e)&&(e="100%");var r=w0(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 Pi(e){return Math.min(1,Math.max(0,e))}function Qt(e){return parseInt(e,16)}function T0(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function w0(e){return typeof e=="string"&&e.indexOf("%")!=-1}function fe(e){return e.length==1?"0"+e:""+e}function gn(e){return e<=1&&(e=e*100+"%"),e}function rh(e){return Math.round(parseFloat(e)*255).toString(16)}function nh(e){return Qt(e)/255}var de=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 ke(e){return!!de.CSS_UNIT.exec(e)}function A0(e){e=e.replace(n0,"").replace(i0,"").toLowerCase();var t=!1;if(Mo[e])e=Mo[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=de.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=de.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=de.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=de.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=de.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=de.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=de.hex8.exec(e))?{r:Qt(r[1]),g:Qt(r[2]),b:Qt(r[3]),a:nh(r[4]),format:t?"name":"hex8"}:(r=de.hex6.exec(e))?{r:Qt(r[1]),g:Qt(r[2]),b:Qt(r[3]),format:t?"name":"hex"}:(r=de.hex4.exec(e))?{r:Qt(r[1]+""+r[1]),g:Qt(r[2]+""+r[2]),b:Qt(r[3]+""+r[3]),a:nh(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=de.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 S0(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 O0=function(){function e(t,r){var n=[],i=!0,s=!1,o=void 0;try{for(var a=t[Symbol.iterator](),l;!(i=(l=a.next()).done)&&(n.push(l.value),!(r&&n.length===r));i=!0);}catch(h){s=!0,o=h}finally{try{!i&&a.return&&a.return()}finally{if(s)throw o}}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")}}(),bn=Math.PI*2,Lo=function(t,r,n,i,s,o,a){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+o,y:f+a}},R0=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),o=Math.cos(t+r),a=Math.sin(t+r);return[{x:i-s*n,y:s+i*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},ih=function(t,r,n,i){var s=t*i-r*n<0?-1:1,o=t*n+r*i;return o>1&&(o=1),o<-1&&(o=-1),s*Math.acos(o)},I0=function(t,r,n,i,s,o,a,l,h,c,f,u){var d=Math.pow(s,2),p=Math.pow(o,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)*(a===l?-1:1);var b=y*s/o*u,_=y*-o/s*f,m=c*b-h*_+(t+n)/2,x=h*b+c*_+(r+i)/2,S=(f-b)/s,E=(u-_)/o,T=(-f-b)/s,P=(-u-_)/o,A=ih(1,0,S,E),w=ih(S,E,T,P);return l===0&&w>0&&(w-=bn),l===1&&w<0&&(w+=bn),[m,x,A,w]},sh=function(t){var r=t.px,n=t.py,i=t.cx,s=t.cy,o=t.rx,a=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(o===0||a===0)return[];var v=Math.sin(h*bn/360),g=Math.cos(h*bn/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[];o=Math.abs(o),a=Math.abs(a);var _=Math.pow(y,2)/Math.pow(o,2)+Math.pow(b,2)/Math.pow(a,2);_>1&&(o*=Math.sqrt(_),a*=Math.sqrt(_));var m=I0(r,n,i,s,o,a,f,d,v,g,y,b),x=O0(m,4),S=x[0],E=x[1],T=x[2],P=x[3],A=Math.abs(P)/(bn/4);Math.abs(1-A)<1e-7&&(A=1);var w=Math.max(Math.ceil(A),1);P/=w;for(var O=0;O<w;O++)p.push(R0(T,P)),T+=P;return p.map(function(R){var k=Lo(R[0],o,a,g,v,S,E),B=k.x,U=k.y,D=Lo(R[1],o,a,g,v,S,E),z=D.x,j=D.y,N=Lo(R[2],o,a,g,v,S,E),I=N.x,C=N.y;return{x1:B,y1:U,x2:z,y2:j,x:I,y:C}})};class P0 extends Ie{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)),o=parseFloat(t.getAttribute(r)),a=t.getAttribute("cx"),l=t.getAttribute("cy");let h=0,c=0;a!==null&&(h=parseFloat(a)),l!==null&&(c=parseFloat(l)),i?this.drawEllipse(h,c,s,o):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")),o=parseFloat(t.getAttribute("rx"));o?this.drawRoundedRect(r,n,i,s,o):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[o,a]=s.split(":");if(o){const l=this._convertStyleName(o);i[l]||(i[l]=a.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:o,strokeWidth:a,cap:l,join:h,miterLimit:c}=this._svgStyle(t),u=a!==null?parseFloat(a):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&&a===null&&r?this.line.width:u,alpha:o===null?this.line.alpha:parseFloat(o),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=Co(r.trim());for(let o=0;o<s.length;o++){const a=s[o];switch(a.code){case"m":{this.moveTo(n+=a.end.x,i+=a.end.y);break}case"M":{this.moveTo(n=a.end.x,i=a.end.y);break}case"H":{this.lineTo(n=a.value,i);break}case"h":{this.lineTo(n+=a.value,i);break}case"V":{this.lineTo(n,i=a.value);break}case"v":{this.lineTo(n,i+=a.value);break}case"Z":{this.closePath();break}case"L":{this.lineTo(n=a.end.x,i=a.end.y);break}case"l":{this.lineTo(n+=a.end.x,i+=a.end.y);break}case"C":{this.bezierCurveTo(a.cp1.x,a.cp1.y,a.cp2.x,a.cp2.y,n=a.end.x,i=a.end.y);break}case"c":{const l=n,h=i;this.bezierCurveTo(l+a.cp1.x,h+a.cp1.y,l+a.cp2.x,h+a.cp2.y,n+=a.end.x,i+=a.end.y);break}case"s":case"q":{const l=n,h=i;this.quadraticCurveTo(l+a.cp.x,h+a.cp.y,n+=a.end.x,i+=a.end.y);break}case"S":case"Q":{this.quadraticCurveTo(a.cp.x,a.cp.y,n=a.end.x,i=a.end.y);break}case"a":{sh({px:n,py:i,cx:n+=a.end.x,cy:i+=a.end.y,rx:a.radii.x,ry:a.radii.y,xAxisRotation:a.rotation,largeArcFlag:a.large?1:0,sweepFlag:a.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":{sh({px:n,py:i,cx:n=a.end.x,cy:i=a.end.y,rx:a.radii.x,ry:a.radii.y,xAxisRotation:a.rotation,largeArcFlag:a.large?1:0,sweepFlag:a.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:",a.code,a);break}}}}}var ki={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},k0=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function N0(e){return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&k0.indexOf(e)>=0}function C0(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 M0(e){return(e|32)===97}function Gr(e){return e>=48&&e<=57}function L0(e){return e>=48&&e<=57||e===43||e===45||e===46}function B0(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function Ni(e){for(;e.index<e.max&&N0(e.path.charCodeAt(e.index));)e.index++}function F0(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 D0(e){var t=e.index,r=t,n=e.max,i=!1,s=!1,o=!1,a=!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),!Gr(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&&Gr(l)){e.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+t+")";return}for(;r<n&&Gr(e.path.charCodeAt(r));)r++,s=!0;l=r<n?e.path.charCodeAt(r):0}if(l===46){for(a=!0,r++;Gr(e.path.charCodeAt(r));)r++,o=!0;l=r<n?e.path.charCodeAt(r):0}if(l===101||l===69){if(a&&!s&&!o){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&&Gr(e.path.charCodeAt(r)))for(;r<n&&Gr(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 Bo(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>=ki[r]&&(e.result.push([t].concat(n.splice(0,ki[r]))),!!ki[r]););}function U0(e){var t=e.max,r,n,i,s,o;if(e.segmentStart=e.index,r=e.path.charCodeAt(e.index),n=M0(r),!C0(r)){e.err="SvgPath: bad command "+e.path[e.index]+" (at pos "+e.index+")";return}if(s=ki[e.path[e.index].toLowerCase()],e.index++,Ni(e),e.data=[],!s){Bo(e);return}for(i=!1;;){for(o=s;o>0;o--){if(n&&(o===3||o===4)?F0(e):D0(e),e.err.length){Bo(e);return}e.data.push(e.param),Ni(e),i=!1,e.index<t&&e.path.charCodeAt(e.index)===44&&(e.index++,Ni(e),i=!0)}if(!i&&(e.index>=e.max||!L0(e.path.charCodeAt(e.index))))break}Bo(e)}var j0=function(t){var r=new B0(t),n=r.max;for(Ni(r);r.index<n&&!r.err.length;)U0(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 G0(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 pe(){if(!(this instanceof pe))return new pe;this.queue=[],this.cache=null}pe.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)},pe.prototype.translate=function(e,t){return(e!==0||t!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},pe.prototype.scale=function(e,t){return(e!==1||t!==1)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},pe.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},pe.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},pe.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},pe.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=G0(this.cache,this.queue[e]);return this.cache},pe.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 oh=pe,$0=oh,H0={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},q0=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,z0=/[\s,]+/,V0=function(t){var r=new $0,n,i;return t.split(q0).forEach(function(s){if(s.length){if(typeof H0[s]<"u"){n=s;return}switch(i=s.split(z0).map(function(o){return+o||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},_n=Math.PI*2;function ah(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 X0(e,t,r,n,i,s,o,a,l,h){var c=h*(e-r)/2+l*(t-n)/2,f=-l*(e-r)/2+h*(t-n)/2,u=o*o,d=a*a,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*o/a*f,b=g*-a/o*c,_=h*y-l*b+(e+r)/2,m=l*y+h*b+(t+n)/2,x=(c-y)/o,S=(f-b)/a,E=(-c-y)/o,T=(-f-b)/a,P=ah(1,0,x,S),A=ah(x,S,E,T);return s===0&&A>0&&(A-=_n),s===1&&A<0&&(A+=_n),[_,m,P,A]}function W0(e,t){var r=1.3333333333333333*Math.tan(t/4),n=Math.cos(e),i=Math.sin(e),s=Math.cos(e+t),o=Math.sin(e+t);return[n,i,n-i*r,i+n*r,s+o*r,o-s*r,s,o]}var Y0=function(t,r,n,i,s,o,a,l,h){var c=Math.sin(h*_n/360),f=Math.cos(h*_n/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(a===0||l===0)return[];a=Math.abs(a),l=Math.abs(l);var p=u*u/(a*a)+d*d/(l*l);p>1&&(a*=Math.sqrt(p),l*=Math.sqrt(p));var v=X0(t,r,n,i,s,o,a,l,c,f),g=[],y=v[2],b=v[3],_=Math.max(Math.ceil(Math.abs(b)/(_n/4)),1);b/=_;for(var m=0;m<_;m++)g.push(W0(y,b)),y+=b;return g.map(function(x){for(var S=0;S<x.length;S+=2){var E=x[S+0],T=x[S+1];E*=a,T*=l;var P=f*E-c*T,A=c*E+f*T;x[S+0]=P+v[0],x[S+1]=A+v[1]}return x})},xn=1e-10,lh=Math.PI/180;function En(e,t,r){if(!(this instanceof En))return new En(e,t,r);this.rx=e,this.ry=t,this.ax=r}En.prototype.transform=function(e){var t=Math.cos(this.ax*lh),r=Math.sin(this.ax*lh),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],o=((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])),a=(i+s)/2;if(o<xn*a)return this.rx=this.ry=Math.sqrt(a),this.ax=0,this;var l=n[0]*n[1]+n[2]*n[3];o=Math.sqrt(o);var h=a+o/2,c=a-o/2;return this.ax=Math.abs(l)<xn&&Math.abs(h-s)<xn?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},En.prototype.isDegenerate=function(){return this.rx<xn*this.ry||this.ry<xn*this.rx};var K0=En,Z0=j0,Q0=V0,He=oh,J0=Y0,tb=K0;function Lt(e){if(!(this instanceof Lt))return new Lt(e);var t=Z0(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 He().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,o){var a,l,h,c;switch(n[0]){case"v":a=e.calc(0,n[1],!0),l=a[0]===0?["v",a[1]]:["l",a[0],a[1]];break;case"V":a=e.calc(s,n[1],!1),l=a[0]===e.calc(s,o,!1)[0]?["V",a[1]]:["L",a[0],a[1]];break;case"h":a=e.calc(n[1],0,!0),l=a[1]===0?["h",a[0]]:["l",a[0],a[1]];break;case"H":a=e.calc(n[1],o,!1),l=a[1]===e.calc(s,o,!1)[1]?["H",a[0]]:["L",a[0],a[1]];break;case"a":case"A":var f=e.toArray(),u=tb(n[1],n[2],n[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(n[5]=n[5]?"0":"1"),a=e.calc(n[6],n[7],n[0]==="a"),n[0]==="A"&&n[6]===s&&n[7]===o||n[0]==="a"&&n[6]===0&&n[7]===0){l=[n[0]==="a"?"l":"L",a[0],a[1]];break}u.isDegenerate()?l=[n[0]==="a"?"l":"L",a[0],a[1]]:l=[n[0],u.rx,u.ry,u.ax,n[4],n[5],a[0],a[1]];break;case"m":c=i>0,a=e.calc(n[1],n[2],c),l=["m",a[0],a[1]];break;default:for(h=n[0],l=[h],c=h.toLowerCase()===h,r=1;r<n.length;r+=2)a=e.calc(n[r],n[r+1],c),l.push(a[0],a[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=He(),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],o=s[0];o!==t||o==="m"||o==="M"?(o==="m"&&t==="z"&&(e+=" "),e+=o,r=!1):r=!0;for(var a=1;a<s.length;a++){var l=s[a];a===1?r&&l>=0&&(e+=" "):l>=0&&(e+=" "),e+=l}t=o}return e},Lt.prototype.translate=function(e,t){return this.__stack.push(He().translate(e,t||0)),this},Lt.prototype.scale=function(e,t){return this.__stack.push(He().scale(e,!t&&t!==0?e:t)),this},Lt.prototype.rotate=function(e,t,r){return this.__stack.push(He().rotate(e,t||0,r||0)),this},Lt.prototype.skewX=function(e){return this.__stack.push(He().skewX(e)),this},Lt.prototype.skewY=function(e){return this.__stack.push(He().skewY(e)),this},Lt.prototype.matrix=function(e){return this.__stack.push(He().matrix(e)),this},Lt.prototype.transform=function(e){return e.trim()?(this.__stack.push(Q0(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(o){var a=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":a&&(o[1]+=n),n=o[1]-o[1].toFixed(e),o[1]=+o[1].toFixed(e);return;case"V":case"v":a&&(o[1]+=i),i=o[1]-o[1].toFixed(e),o[1]=+o[1].toFixed(e);return;case"Z":case"z":n=t,i=r;return;case"M":case"m":a&&(o[1]+=n,o[2]+=i),n=o[1]-o[1].toFixed(e),i=o[2]-o[2].toFixed(e),t=n,r=i,o[1]=+o[1].toFixed(e),o[2]=+o[2].toFixed(e);return;case"A":case"a":a&&(o[6]+=n,o[7]+=i),n=o[6]-o[6].toFixed(e),i=o[7]-o[7].toFixed(e),o[1]=+o[1].toFixed(e),o[2]=+o[2].toFixed(e),o[3]=+o[3].toFixed(e+2),o[6]=+o[6].toFixed(e),o[7]=+o[7].toFixed(e);return;default:s=o.length,a&&(o[s-2]+=n,o[s-1]+=i),n=o[s-2]-o[s-2].toFixed(e),i=o[s-1]-o[s-1].toFixed(e),o.forEach(function(l,h){h&&(o[h]=+o[h].toFixed(e))});return}}),this},Lt.prototype.iterate=function(e,t){var r=this.segments,n={},i=!1,s=0,o=0,a=0,l=0,h,c,f;if(t||this.__evaluateStack(),r.forEach(function(u,d){var p=e(u,d,s,o);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),o=u[2]+(v?o:0),a=s,l=o;return;case"h":case"H":s=u[1]+(v?s:0);return;case"v":case"V":o=u[1]+(v?o:0);return;case"z":case"Z":s=a,o=l;return;default:s=u[u.length-2]+(v?s:0),o=u[u.length-1]+(v?o: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(),o;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(o=1;o<e.length;o++)e[o]+=o%2?r:n}},!0),this},Lt.prototype.rel=function(){return this.iterate(function(e,t,r,n){var i=e[0],s=i.toLowerCase(),o;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(o=1;o<e.length;o++)e[o]-=o%2?r:n}},!0),this},Lt.prototype.unarc=function(){return this.iterate(function(e,t,r,n){var i,s,o,a=[],l=e[0];return l!=="A"&&l!=="a"?null:(l==="a"?(s=r+e[6],o=n+e[7]):(s=e[6],o=e[7]),i=J0(r,n,s,o,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){a.push(["C",h[2],h[3],h[4],h[5],h[6],h[7]])}),a))}),this},Lt.prototype.unshort=function(){var e=this.segments,t,r,n,i,s;return this.iterate(function(o,a,l,h){var c=o[0],f=c.toUpperCase(),u;a&&(f==="T"?(u=c==="t",n=e[a-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[a]=[u?"q":"Q",i,s,o[1],o[2]]):f==="S"&&(u=c==="s",n=e[a-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[a]=[u?"c":"C",i,s,o[1],o[2],o[3],o[4]]))}),this};var eb=Lt,rb=eb;const nb=hr(rb),ib=e=>{const[t,r]=at.useState(null),n=tt.useRef(null),i=tt.useRef(null),s=tt.useRef(null),{path:o,transformation:{x:a,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 at.useEffect(()=>{const E=nb(o).scale(5).translate(0,0).toString(),T=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" 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>`,P=new P0(T),A=S.renderer.generateTexture(P);return r(A),()=>{}},[S,o,d,p,u]),dt.jsx(No,{...e,children:dt.jsx(yt.Container,{ref:i,children:dt.jsx(yt.Container,{ref:s,children:t&&dt.jsx(yt.Sprite,{texture:t,width:h,height:c,anchor:f,ref:n,x:a,y:l,interactive:!0,pointerdown:v,pointerup:g,pointerover:_,mousedown:y,mouseup:b,mouseover:m,mouseout:x})})})})},sb=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=tt.useRef(t);console.log("allProps",e);const i=tt.useRef(null),s=tt.useRef(null),{tl:o,playerTimeRef:a}=tt.useContext(Dr),{uniqueId:l,src:h,startAt:c,endAt:f,mute:u,speed:d}=e,p=at.useRef(null);pn($e.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),a.current>=m&&a.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,E;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(),(E=p.current)==null||E.resume(),n.current.isPlaying=!0)},b=()=>{};tt.useEffect(()=>{let m=ve.context(()=>{});if(i.current&&o.current){const x={duration:Number(f)-Number(c),onStart:v,onComplete:g,onStartParams:[c],onCompleteParams:[],onInterrupt:b,onUpdate:y,onUpdateParams:[]};m=ve.context(()=>{o.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]),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((m,x)=>{p.current=x,n.current.loaded=!0},[]);return at.useEffect(()=>(ee(h)||(p.current=Qh.Sound.from({url:h,preload:!0,singleInstance:!0,loaded:_})),()=>{}),[l,h,_]),dt.jsx(yt.Container,{ref:i})};function ob(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 uh=ob;function ab(){this.__data__=[],this.size=0}var lb=ab;function ub(e,t){return e===t||e!==e&&t!==t}var hh=ub,hb=hh;function cb(e,t){for(var r=e.length;r--;)if(hb(e[r][0],t))return r;return-1}var Ci=cb,fb=Ci,db=Array.prototype,pb=db.splice;function yb(e){var t=this.__data__,r=fb(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():pb.call(t,r,1),--this.size,!0}var vb=yb,mb=Ci;function gb(e){var t=this.__data__,r=mb(t,e);return r<0?void 0:t[r][1]}var bb=gb,_b=Ci;function xb(e){return _b(this.__data__,e)>-1}var Eb=xb,Tb=Ci;function wb(e,t){var r=this.__data__,n=Tb(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Ab=wb,Sb=lb,Ob=vb,Rb=bb,Ib=Eb,Pb=Ab;function $r(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])}}$r.prototype.clear=Sb,$r.prototype.delete=Ob,$r.prototype.get=Rb,$r.prototype.has=Ib,$r.prototype.set=Pb;var Mi=$r,kb=Mi;function Nb(){this.__data__=new kb,this.size=0}var Cb=Nb;function Mb(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Lb=Mb;function Bb(e){return this.__data__.get(e)}var Fb=Bb;function Db(e){return this.__data__.has(e)}var Ub=Db,jb=Ur,Gb=jb(Object,"create"),Li=Gb,ch=Li;function $b(){this.__data__=ch?ch(null):{},this.size=0}var Hb=$b;function qb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zb=qb,Vb=Li,Xb="__lodash_hash_undefined__",Wb=Object.prototype,Yb=Wb.hasOwnProperty;function Kb(e){var t=this.__data__;if(Vb){var r=t[e];return r===Xb?void 0:r}return Yb.call(t,e)?t[e]:void 0}var Zb=Kb,Qb=Li,Jb=Object.prototype,t_=Jb.hasOwnProperty;function e_(e){var t=this.__data__;return Qb?t[e]!==void 0:t_.call(t,e)}var r_=e_,n_=Li,i_="__lodash_hash_undefined__";function s_(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n_&&t===void 0?i_:t,this}var o_=s_,a_=Hb,l_=zb,u_=Zb,h_=r_,c_=o_;function Hr(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])}}Hr.prototype.clear=a_,Hr.prototype.delete=l_,Hr.prototype.get=u_,Hr.prototype.has=h_,Hr.prototype.set=c_;var f_=Hr,fh=f_,d_=Mi,p_=Eo;function y_(){this.size=0,this.__data__={hash:new fh,map:new(p_||d_),string:new fh}}var v_=y_;function m_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var g_=m_,b_=g_;function __(e,t){var r=e.__data__;return b_(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Bi=__,x_=Bi;function E_(e){var t=x_(this,e).delete(e);return this.size-=t?1:0,t}var T_=E_,w_=Bi;function A_(e){return w_(this,e).get(e)}var S_=A_,O_=Bi;function R_(e){return O_(this,e).has(e)}var I_=R_,P_=Bi;function k_(e,t){var r=P_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var N_=k_,C_=v_,M_=T_,L_=S_,B_=I_,F_=N_;function qr(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])}}qr.prototype.clear=C_,qr.prototype.delete=M_,qr.prototype.get=L_,qr.prototype.has=B_,qr.prototype.set=F_;var Fo=qr,D_=Mi,U_=Eo,j_=Fo,G_=200;function $_(e,t){var r=this.__data__;if(r instanceof D_){var n=r.__data__;if(!U_||n.length<G_-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new j_(n)}return r.set(e,t),this.size=r.size,this}var H_=$_,q_=Mi,z_=Cb,V_=Lb,X_=Fb,W_=Ub,Y_=H_;function zr(e){var t=this.__data__=new q_(e);this.size=t.size}zr.prototype.clear=z_,zr.prototype.delete=V_,zr.prototype.get=X_,zr.prototype.has=W_,zr.prototype.set=Y_;var dh=zr,K_="__lodash_hash_undefined__";function Z_(e){return this.__data__.set(e,K_),this}var Q_=Z_;function J_(e){return this.__data__.has(e)}var t1=J_,e1=Fo,r1=Q_,n1=t1;function Fi(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new e1;++t<r;)this.add(e[t])}Fi.prototype.add=Fi.prototype.push=r1,Fi.prototype.has=n1;var i1=Fi;function s1(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 o1=s1;function a1(e,t){return e.has(t)}var l1=a1,u1=i1,h1=o1,c1=l1,f1=1,d1=2;function p1(e,t,r,n,i,s){var o=r&f1,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))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&d1?new u1:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var p=e[f],v=t[f];if(n)var g=o?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(!h1(t,function(y,b){if(!c1(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 ph=p1,y1=Pe,v1=y1.Uint8Array,m1=v1;function g1(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var b1=g1;function _1(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var x1=_1,yh=Si,vh=m1,E1=hh,T1=ph,w1=b1,A1=x1,S1=1,O1=2,R1="[object Boolean]",I1="[object Date]",P1="[object Error]",k1="[object Map]",N1="[object Number]",C1="[object RegExp]",M1="[object Set]",L1="[object String]",B1="[object Symbol]",F1="[object ArrayBuffer]",D1="[object DataView]",mh=yh?yh.prototype:void 0,Do=mh?mh.valueOf:void 0;function U1(e,t,r,n,i,s,o){switch(r){case D1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F1:return!(e.byteLength!=t.byteLength||!s(new vh(e),new vh(t)));case R1:case I1:case N1:return E1(+e,+t);case P1:return e.name==t.name&&e.message==t.message;case C1:case L1:return e==t+"";case k1:var a=w1;case M1:var l=n&S1;if(a||(a=A1),e.size!=t.size&&!l)return!1;var h=o.get(e);if(h)return h==t;n|=O1,o.set(e,t);var c=T1(a(e),a(t),n,i,s,o);return o.delete(e),c;case B1:if(Do)return Do.call(e)==Do.call(t)}return!1}var j1=U1;function G1(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var $1=G1,H1=$1,q1=Ee;function z1(e,t,r){var n=t(e);return q1(e)?n:H1(n,r(e))}var V1=z1;function X1(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var W1=X1;function Y1(){return[]}var K1=Y1,Z1=W1,Q1=K1,J1=Object.prototype,tx=J1.propertyIsEnumerable,gh=Object.getOwnPropertySymbols,ex=gh?function(e){return e==null?[]:(e=Object(e),Z1(gh(e),function(t){return tx.call(e,t)}))}:Q1,rx=ex;function nx(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var ix=nx,sx=9007199254740991,ox=/^(?:0|[1-9]\d*)$/;function ax(e,t){var r=typeof e;return t=t??sx,!!t&&(r=="number"||r!="symbol"&&ox.test(e))&&e>-1&&e%1==0&&e<t}var bh=ax,lx=ix,ux=Ro,hx=Ee,cx=Po,fx=bh,dx=ko,px=Object.prototype,yx=px.hasOwnProperty;function vx(e,t){var r=hx(e),n=!r&&ux(e),i=!r&&!n&&cx(e),s=!r&&!n&&!i&&dx(e),o=r||n||i||s,a=o?lx(e.length,String):[],l=a.length;for(var h in e)(t||yx.call(e,h))&&!(o&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||fx(h,l)))&&a.push(h);return a}var mx=vx,gx=mx,bx=Pu,_x=Oi;function xx(e){return _x(e)?gx(e):bx(e)}var Uo=xx,Ex=V1,Tx=rx,wx=Uo;function Ax(e){return Ex(e,wx,Tx)}var Sx=Ax,_h=Sx,Ox=1,Rx=Object.prototype,Ix=Rx.hasOwnProperty;function Px(e,t,r,n,i,s){var o=r&Ox,a=_h(e),l=a.length,h=_h(t),c=h.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var u=a[f];if(!(o?u in t:Ix.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=o;++f<l;){u=a[f];var y=e[u],b=t[u];if(n)var _=o?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 kx=Px,jo=dh,Nx=ph,Cx=j1,Mx=kx,xh=zu,Eh=Ee,Th=Po,Lx=ko,Bx=1,wh="[object Arguments]",Ah="[object Array]",Di="[object Object]",Fx=Object.prototype,Sh=Fx.hasOwnProperty;function Dx(e,t,r,n,i,s){var o=Eh(e),a=Eh(t),l=o?Ah:xh(e),h=a?Ah:xh(t);l=l==wh?Di:l,h=h==wh?Di:h;var c=l==Di,f=h==Di,u=l==h;if(u&&Th(e)){if(!Th(t))return!1;o=!0,c=!1}if(u&&!c)return s||(s=new jo),o||Lx(e)?Nx(e,t,r,n,i,s):Cx(e,t,l,r,n,i,s);if(!(r&Bx)){var d=c&&Sh.call(e,"__wrapped__"),p=f&&Sh.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,g=p?t.value():t;return s||(s=new jo),i(v,g,r,n,s)}}return u?(s||(s=new jo),Mx(e,t,r,n,i,s)):!1}var Ux=Dx,jx=Ux,Oh=mn;function Rh(e,t,r,n,i){return e===t?!0:e==null||t==null||!Oh(e)&&!Oh(t)?e!==e&&t!==t:jx(e,t,r,n,Rh,i)}var Ih=Rh,Gx=dh,$x=Ih,Hx=1,qx=2;function zx(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var l=a[0],h=e[l],c=a[1];if(o&&a[2]){if(h===void 0&&!(l in e))return!1}else{var f=new Gx;if(n)var u=n(h,c,l,e,t,f);if(!(u===void 0?$x(c,h,Hx|qx,n,f):u))return!1}}return!0}var Vx=zx,Xx=_o;function Wx(e){return e===e&&!Xx(e)}var Ph=Wx,Yx=Ph,Kx=Uo;function Zx(e){for(var t=Kx(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Yx(i)]}return t}var Qx=Zx;function Jx(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var kh=Jx,tE=Vx,eE=Qx,rE=kh;function nE(e){var t=eE(e);return t.length==1&&t[0][2]?rE(t[0][0],t[0][1]):function(r){return r===e||tE(r,e,t)}}var iE=nE,sE=vn,oE=mn,aE="[object Symbol]";function lE(e){return typeof e=="symbol"||oE(e)&&sE(e)==aE}var Go=lE,uE=Ee,hE=Go,cE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fE=/^\w*$/;function dE(e,t){if(uE(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||hE(e)?!0:fE.test(e)||!cE.test(e)||t!=null&&e in Object(t)}var $o=dE,Nh=Fo,pE="Expected a function";function Ho(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(pE);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 o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Ho.Cache||Nh),r}Ho.Cache=Nh;var yE=Ho,vE=yE,mE=500;function gE(e){var t=vE(e,function(n){return r.size===mE&&r.clear(),n}),r=t.cache;return t}var bE=gE,_E=bE,xE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,EE=/\\(\\)?/g,TE=_E(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(xE,function(r,n,i,s){t.push(i?s.replace(EE,"$1"):n||r)}),t}),wE=TE,Ch=Si,AE=uh,SE=Ee,OE=Go,RE=1/0,Mh=Ch?Ch.prototype:void 0,Lh=Mh?Mh.toString:void 0;function Bh(e){if(typeof e=="string")return e;if(SE(e))return AE(e,Bh)+"";if(OE(e))return Lh?Lh.call(e):"";var t=e+"";return t=="0"&&1/e==-RE?"-0":t}var IE=Bh,PE=IE;function kE(e){return e==null?"":PE(e)}var NE=kE,CE=Ee,ME=$o,LE=wE,BE=NE;function FE(e,t){return CE(e)?e:ME(e,t)?[e]:LE(BE(e))}var Fh=FE,DE=Go,UE=1/0;function jE(e){if(typeof e=="string"||DE(e))return e;var t=e+"";return t=="0"&&1/e==-UE?"-0":t}var Ui=jE,GE=Fh,$E=Ui;function HE(e,t){t=GE(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[$E(t[r++])];return r&&r==n?e:void 0}var Dh=HE,qE=Dh;function zE(e,t,r){var n=e==null?void 0:qE(e,t);return n===void 0?r:n}var VE=zE;function XE(e,t){return e!=null&&t in Object(e)}var WE=XE,YE=Fh,KE=Ro,ZE=Ee,QE=bh,JE=Io,tT=Ui;function eT(e,t,r){t=YE(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=tT(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&JE(i)&&QE(o,i)&&(ZE(e)||KE(e)))}var rT=eT,nT=WE,iT=rT;function sT(e,t){return e!=null&&iT(e,t,nT)}var oT=sT,aT=Ih,lT=VE,uT=oT,hT=$o,cT=Ph,fT=kh,dT=Ui,pT=1,yT=2;function vT(e,t){return hT(e)&&cT(t)?fT(dT(e),t):function(r){var n=lT(r,e);return n===void 0&&n===t?uT(r,e):aT(t,n,pT|yT)}}var mT=vT;function gT(e){return e}var bT=gT;function _T(e){return function(t){return t==null?void 0:t[e]}}var xT=_T,ET=Dh;function TT(e){return function(t){return ET(t,e)}}var wT=TT,AT=xT,ST=wT,OT=$o,RT=Ui;function IT(e){return OT(e)?AT(RT(e)):ST(e)}var PT=IT,kT=iE,NT=mT,CT=bT,MT=Ee,LT=PT;function BT(e){return typeof e=="function"?e:e==null?CT:typeof e=="object"?MT(e)?NT(e[0],e[1]):kT(e):LT(e)}var FT=BT;function DT(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),a=o.length;a--;){var l=o[e?a:++i];if(r(s[l],l,s)===!1)break}return t}}var UT=DT,jT=UT,GT=jT(),$T=GT,HT=$T,qT=Uo;function zT(e,t){return e&&HT(e,t,qT)}var VT=zT,XT=Oi;function WT(e,t){return function(r,n){if(r==null)return r;if(!XT(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Object(r);(t?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}var YT=WT,KT=VT,ZT=YT,QT=ZT(KT),JT=QT,tw=JT,ew=Oi;function rw(e,t){var r=-1,n=ew(e)?Array(e.length):[];return tw(e,function(i,s,o){n[++r]=t(i,s,o)}),n}var nw=rw,iw=uh,sw=FT,ow=nw,aw=Ee;function lw(e,t){var r=aw(e)?iw:ow;return r(e,sw(t))}var uw=lw;const hw=hr(uw);var ur={},Uh={},Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.loop=Ne.conditional=Ne.parse=void 0;var cw=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(o){return e(t,o,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=cw;var fw=function(t,r){return function(n,i,s,o){r(n,i,s)&&o(n,t,i,s)}};Ne.conditional=fw;var dw=function(t,r){return function(n,i,s,o){for(var a=[],l=n.pos;r(n,i,s);){var h={};if(o(n,t,i,h),n.pos===l)break;l=n.pos,a.push(h)}return a}};Ne.loop=dw;var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.readBits=Bt.readArray=Bt.readUnsigned=Bt.readString=Bt.peekBytes=Bt.readBytes=Bt.peekByte=Bt.readByte=Bt.buildStream=void 0;var pw=function(t){return{data:t,pos:0}};Bt.buildStream=pw;var jh=function(){return function(t){return t.data[t.pos++]}};Bt.readByte=jh;var yw=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+t]}};Bt.peekByte=yw;var ji=function(t){return function(r){return r.data.subarray(r.pos,r.pos+=t)}};Bt.readBytes=ji;var vw=function(t){return function(r){return r.data.subarray(r.pos,r.pos+t)}};Bt.peekBytes=vw;var mw=function(t){return function(r){return Array.from(ji(t)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};Bt.readString=mw;var gw=function(t){return function(r){var n=ji(2)(r);return t?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};Bt.readUnsigned=gw;var bw=function(t,r){return function(n,i,s){for(var o=typeof r=="function"?r(n,i,s):r,a=ji(t),l=new Array(o),h=0;h<o;h++)l[h]=a(n);return l}};Bt.readArray=bw;var _w=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},xw=function(t){return function(r){for(var n=jh()(r),i=new Array(8),s=0;s<8;s++)i[7-s]=!!(n&1<<s);return Object.keys(t).reduce(function(o,a){var l=t[a];return l.length?o[a]=_w(i,l.index,l.length):o[a]=i[l.index],o},{})}};Bt.readBits=xw,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Ne,r=Bt,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}),o=(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}),a=(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,a,l,s,o],function(f){var u=(0,r.peekByte)()(f);return u===33||u===44})}],c=h;e.default=c}(Uh);var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.deinterlace=void 0;var Ew=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))},o=[0,4,2,1],a=[8,8,4,2],l=0,h=0;h<4;h++)for(var c=o[h];c<i;c+=a[h])s(c,l),l++;return n};Gi.deinterlace=Ew;var $i={};Object.defineProperty($i,"__esModule",{value:!0}),$i.lzw=void 0;var Tw=function(t,r,n){var i=4096,s=-1,o=n,a,l,h,c,f,u,d,S,p,v,x,g,E,T,A,P,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,a=l+2,d=s,c=g+1,h=(1<<c)-1,p=0;p<l;p++)b[p]=0,_[p]=p;var x,S,E,T,P,A;for(x=S=E=T=P=A=0,v=0;v<o;){if(T===0){if(S<c){x+=r[A]<<S,S+=8,A++;continue}if(p=x&h,x>>=c,S-=c,p>a||p==f)break;if(p==l){c=g+1,h=(1<<c)-1,a=l+2,d=s;continue}if(d==s){m[T++]=_[p],d=p,E=p;continue}for(u=p,p==a&&(m[T++]=E,p=d);p>l;)m[T++]=_[p],p=b[p];E=_[p]&255,m[T++]=E,a<i&&(b[a]=d,_[a]=E,a++,!(a&h)&&a<i&&(c++,h+=a)),d=u}T--,y[P++]=m[T],v++}for(v=P;v<o;v++)y[v]=0;return y};$i.lzw=Tw,Object.defineProperty(ur,"__esModule",{value:!0}),ur.decompressFrames=ur.decompressFrame=ur.parseGIF=void 0;var ww=Iw(Uh),Aw=Ne,Sw=Bt,Ow=Gi,Rw=$i;function Iw(e){return e&&e.__esModule?e:{default:e}}var Pw=function(t){var r=new Uint8Array(t);return(0,Aw.parse)((0,Sw.buildStream)(r),ww.default)};ur.parseGIF=Pw;var kw=function(t){for(var r=t.pixels.length,n=new Uint8ClampedArray(r*4),i=0;i<r;i++){var s=i*4,o=t.pixels[i],a=t.colorTable[o]||[0,0,0];n[s]=a[0],n[s+1]=a[1],n[s+2]=a[2],n[s+3]=o!==t.transparentIndex?255:0}return n},Gh=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,o=(0,Rw.lzw)(i.data.minCodeSize,i.data.blocks,s);i.descriptor.lct.interlaced&&(o=(0,Ow.deinterlace)(o,i.descriptor.width));var a={pixels:o,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?a.colorTable=i.lct:a.colorTable=r,t.gce&&(a.delay=(t.gce.delay||10)*10,a.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(a.transparentIndex=t.gce.transparentColorIndex)),n&&(a.patch=kw(a)),a};ur.decompressFrame=Gh;var Nw=function(t,r){return t.frames.filter(function(n){return n.image}).map(function(n){return Gh(n,t.gct,r)})};ur.decompressFrames=Nw;const $h=(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},Cw=e=>$h({autoPlay:!0,playing:!1,frames:[],delays:[],index:0,length:0,loaded:!1},e),Mw=e=>tt.useReducer($h,e,Cw);var Lw='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 Bw(e){const t=new Blob([Lw],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r,e);return URL.revokeObjectURL(r),n}const Fw=e=>({...e,frames:e.frames.map(t=>{const r=new ImageData(e.width,e.height);return r.data.set(new Uint8ClampedArray(t)),r})}),Dw=(e,t)=>{const r={};return()=>(r.instance||(r.instance=e()),tt.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)},Uw=e=>{const t=tt.useRef(e);return tt.useEffect(()=>{t.current=e},[e]),t},jw=e=>{const t=Uw(e);return tt.useCallback(r=>t.current&&t.current(r),[])},Gw=Dw(()=>new Bw,e=>e.terminate()),$w=(e,t)=>{const r=jw(t),n=Gw();tt.useEffect(()=>{if(typeof e=="string"){const i=s=>{const o=s.data||s;if(o.src===e){const a=o.error?o:Fw(o);r(a)}};return n.addEventListener("message",i),n.postMessage({src:e,type:"parse"}),()=>{n.postMessage({src:e,type:"cancel"}),n.removeEventListener("message",i)}}},[n,e])},Hw=({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]),dt.jsx(yt.AnimatedSprite,{ref:n,...r,isPlaying:e})},Hh=at.memo(Hw),qw=yt.withFilters(yt.Container,{blur:ne.filters.BlurFilter,adjust:no,matrix:ne.filters.ColorMatrixFilter}),zw=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Vw={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},Xw=e=>{const[t,r]=at.useState([]),[,n]=at.useState(0),[i,s]=at.useState([]),[,o]=tt.useState(0),[,a]=tt.useState(!1),[l,h]=tt.useState(!1),[,c]=tt.useState(!1),[f,u]=Mw({autoPlay:!1}),d=at.useRef(null),p=tt.useRef(null),v=tt.useRef(null),g=tt.useRef(null),y=tt.useRef(null),b=tt.useRef(null),_=tt.useRef(Vw),{tl:m}=tt.useContext(Dr),{frames:x,delays:S,loaded:E}=f,{uniqueId:T,src:P,startAt:A,endAt:w,initialAlpha:O,locked:R,loop:k,transformation:{width:B=0,height:U=0,x:D,y:z,rotation:j=0,scale:N,animation:I,colorCorrection:C,effect:L},pointerdown:G,pointerup:$,mousedown:M,mouseup:F,pointerover:H,mouseover:q,mouseout:X,pointerout:K,applyTransformer:rt,onAnchorTransformationEnd:it}=e,{contrast:lt=1,saturation:ht=1,exposure:kt=1,blurRadius:It=0,alpha:V=1}=C||{},W={brightness:kt,contrast:lt,saturation:ht,alpha:V},Q=yt.useApp();$w(P,u),pn($e.PAUSE,Tt=>{console.log("pause event",Tt),p.current&&(p.current.stop(),_.current.isPlaying=!1)});const et=at.useCallback(Tt=>{console.log("changeEnd",Tt),it&&it(Tt)},[]);at.useEffect(()=>{if(!ee(x)){const Tt=hw(x,ye=>{const{data:zt,width:Xh,height:eA}=ye,rA=new Uint8Array(zt);return ne.Texture.fromBuffer(rA,Xh,eA)}),wt=Tt.map((ye,zt)=>({texture:ye,time:S[zt]}));r(Tt),s(wt);let Ft=0;S.forEach(ye=>{Ft+=ye*10}),n(Ft)}},[x,S]);const Y=Tt=>{p.current&&(p.current.gotoAndPlay(Tt||0),_.current.isPlaying=!0)},ct=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},Z=()=>{p.current&&(p.current.stop(),_.current.isPlaying=!1)},ot=()=>{p.current&&!_.current.isPlaying&&(p.current.play(),_.current.isPlaying=!0)},St=()=>{a(!0)};tt.useEffect(()=>{let Tt=ve.context(()=>{});if(v.current&&m.current){const wt={duration:Number(w)-Number(A),onStart:Y,onComplete:ct,onStartParams:[A],onCompleteParams:[],onInterrupt:Z,onUpdate:ot,onUpdateParams:[]},Ft=bo(I||"None");Tt=ve.context(()=>{var ye,zt;ee(Ft.from)?ee(Ft.to)?ee(Ft.fromTo)?m.current.to(v.current,{alpha:1,duration:.01},A).from(y.current,{...wt},A).to(v.current,{alpha:0,duration:.1},Number(w)-.1):m.current.fromTo(v.current,(ye=Ft.fromTo)==null?void 0:ye.from,(zt=Ft.fromTo)==null?void 0:zt.to,A).from(y.current,{...wt},A).to(v.current,{alpha:0,duration:.2},w-.2):m.current.to(v.current,{alpha:1,duration:.2,...Ft.to},A).from(y.current,{...wt},A).to(v.current,{alpha:0,duration:.2},w-.2):m.current.from(v.current,{...Ft.from},A).to(y.current,{alpha:1,duration:.2},A).from(y.current,{...wt},A).to(v.current,{alpha:0,duration:.2},w-.2)})}return()=>Tt.revert()},[I,A,w]);const qt=at.useCallback(()=>{h(!0)},[]);Q.ticker.add(Tt=>{d.current&&(d.current.rotation+=.01*Tt,d.current.clear().lineStyle(4,16777215,1).moveTo(40,0).arc(0,0,40,0,Math.PI*2*.6,!1))});const _t=at.useCallback(Tt=>{Tt.clear()},[]);return dt.jsxs(yt.Container,{ref:g,children:[dt.jsx(yt.Container,{ref:v,alpha:O,position:[D,z],pivot:[D,z],width:B,height:U,children:dt.jsxs(yt.Container,{ref:y,children:[!E&&dt.jsx(yt.Container,{anchor:.5,position:[B/2,U/2],children:dt.jsx(yt.Graphics,{x:D,y:z,ref:d,draw:_t})}),t&&t.length>0&&dt.jsx(qw,{scale:1,blur:{blur:It,quality:4},adjust:W,apply:({matrix:Tt})=>{L==="BlackAndWhite"?Tt.desaturate():L==="Sepia"?Tt.sepia():L==="RetroVintage"||L==="NightVision"?Tt.negative():L==="Normal"&&Tt.reset()},matrix:{enabled:!0,matrix:zw},children:dt.jsx(Hh,{x:D,y:z,width:B,height:U,rotation:j,animationSpeed:1,loop:k,textures:i,onComplete:St,onFrameChange:Tt=>o(Tt),anchor:.5,...!R&&!l&&{interactive:!0,buttonMode:!0,pointerdown:G,pointerover:H,pointerout:K,pointerup:$,mousedown:M,mouseup:F,mouseover:q,mouseout:X},forwardRef:p,scale:N})})]})}),rt&&dt.jsx(mo,{pixiTransformerRef:b,imageRef:v,isMounted:E,transformCommit:et,transformChange:qt,mouseoverEvent:c,uniqueId:T})]})};var qh={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(`
555
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Ce,function(){return function(r){var n={};function i(s){if(n[s])return n[s].exports;var o=n[s]={i:s,l:!1,exports:{}};return r[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(s,o,a){i.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:a})},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(17),o=i(18),a=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:o.default,Leaf:a.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 o=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=o;var a={},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 o("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]||a[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 o("Invalid definition");if(b.blotName==="abstract")throw new o("Cannot register abstract class");if(c[b.blotName||b.attrName]=b,typeof b.keyName=="string")a[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),o=i(11),a=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=a(!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(o(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()&&o(y.ops[y.ops.length-1],x)){var E=new c(u.rest());return y.concat(E).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);o(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,o=Object.defineProperty,a=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){o&&p.name==="__proto__"?o(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(a)return a(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 w(O,R){for(var k=0;k<R.length;k++){var B=R[k];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(O,B.key,B)}}return function(O,R,k){return R&&w(O.prototype,R),k&&w(O,k),O}}(),o=function w(O,R,k){O===null&&(O=Function.prototype);var B=Object.getOwnPropertyDescriptor(O,R);if(B===void 0){var U=Object.getPrototypeOf(O);return U===null?void 0:w(U,R,k)}else{if("value"in B)return B.value;var D=B.get;return D===void 0?void 0:D.call(k)}},a=i(3),l=_(a),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 _(w){return w&&w.__esModule?w:{default:w}}function m(w,O){if(!(w instanceof O))throw new TypeError("Cannot call a class as a function")}function x(w,O){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:w}function S(w,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);w.prototype=Object.create(O&&O.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(w,O):w.__proto__=O)}var E=1,T=function(w){S(O,w);function O(){return m(this,O),x(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return s(O,[{key:"attach",value:function(){o(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(k,B){var U=u.default.query(k,u.default.Scope.BLOCK_ATTRIBUTE);U!=null&&this.attributes.attribute(U,B)}},{key:"formatAt",value:function(k,B,U,D){this.format(U,D)}},{key:"insertAt",value:function(k,B,U){if(typeof B=="string"&&B.endsWith(`
557
+ `)){var D=u.default.create(P.blotName);this.parent.insertBefore(D,k===0?this:this.next),D.insertAt(0,B.slice(0,-1))}else o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,k,B,U)}}]),O}(u.default.Embed);T.scope=u.default.Scope.BLOCK_BLOT;var P=function(w){S(O,w);function O(R){m(this,O);var k=x(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R));return k.cache={},k}return s(O,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(u.default.Leaf).reduce(function(k,B){return B.length()===0?k:k.insert(B.value(),A(B))},new c.default).insert(`
558
+ `,A(this))),this.cache.delta}},{key:"deleteAt",value:function(k,B){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,k,B),this.cache={}}},{key:"formatAt",value:function(k,B,U,D){B<=0||(u.default.query(U,u.default.Scope.BLOCK)?k+B===this.length()&&this.format(U,D):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,k,Math.min(B,this.length()-k-1),U,D),this.cache={})}},{key:"insertAt",value:function(k,B,U){if(U!=null)return o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,k,B,U);if(B.length!==0){var D=B.split(`
559
+ `),z=D.shift();z.length>0&&(k<this.length()-1||this.children.tail==null?o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,Math.min(k,this.length()-1),z):this.children.tail.insertAt(this.children.tail.length(),z),this.cache={});var j=this;D.reduce(function(N,I){return j=j.split(N,!0),j.insertAt(0,I),I.length},k+z.length)}}},{key:"insertBefore",value:function(k,B){var U=this.children.head;o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,k,B),U instanceof p.default&&U.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"length",this).call(this)+E),this.cache.length}},{key:"moveChildren",value:function(k,B){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"moveChildren",this).call(this,k,B),this.cache={}}},{key:"optimize",value:function(k){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,k),this.cache={}}},{key:"path",value:function(k){return o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,k,!0)}},{key:"removeChild",value:function(k){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"removeChild",this).call(this,k),this.cache={}}},{key:"split",value:function(k){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(B&&(k===0||k>=this.length()-E)){var U=this.clone();return k===0?(this.parent.insertBefore(U,this),this):(this.parent.insertBefore(U,this.next),U)}else{var D=o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"split",this).call(this,k,B);return this.cache={},D}}}]),O}(u.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[g.default,u.default.Embed,b.default];function A(w){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return w==null||(typeof w.formats=="function"&&(O=(0,l.default)(O,w.formats())),w.parent==null||w.parent.blotName=="scroll"||w.parent.statics.scope!==w.statics.scope)?O:A(w.parent,O)}n.bubbleFormats=A,n.BlockEmbed=T,n.default=P},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},o=function(){function j(N,I){var C=[],L=!0,G=!1,$=void 0;try{for(var M=N[Symbol.iterator](),F;!(L=(F=M.next()).done)&&(C.push(F.value),!(I&&C.length===I));L=!0);}catch(H){G=!0,$=H}finally{try{!L&&M.return&&M.return()}finally{if(G)throw $}}return C}return function(N,I){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return j(N,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function j(N,I){for(var C=0;C<I.length;C++){var L=I[C];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(N,L.key,L)}}return function(N,I,C){return I&&j(N.prototype,I),C&&j(N,C),N}}();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),E=A(S),T=i(34),P=A(T);function A(j){return j&&j.__esModule?j:{default:j}}function w(j,N,I){return N in j?Object.defineProperty(j,N,{value:I,enumerable:!0,configurable:!0,writable:!0}):j[N]=I,j}function O(j,N){if(!(j instanceof N))throw new TypeError("Cannot call a class as a function")}var R=(0,E.default)("quill"),k=function(){a(j,null,[{key:"debug",value:function(I){I===!0&&(I="log"),E.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,C){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,C):Object.keys(I).forEach(function(M){L.register(M,I[M],C)})}else this.imports[I]!=null&&!G&&R.warn("Overwriting "+I+" with",C),this.imports[I]=C,(I.startsWith("blots/")||I.startsWith("formats/"))&&C.blotName!=="abstract"?y.default.register(C):I.startsWith("modules")&&typeof C.register=="function"&&C.register()}}]);function j(N){var I=this,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(O(this,j),this.options=B(N,C),this.container=this.options.container,this.container==null)return R.error("Invalid Quill container",N);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 F=I.selection.lastRange,H=F&&F.length===0?F.index:void 0;U.call(I,function(){return I.editor.update(null,M,H)},$)});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 a(j,[{key:"addContainer",value:function(I){var C=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,C),I}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(I,C,L){var G=this,$=D(I,C,L),M=o($,4);return I=M[0],C=M[1],L=M[3],U.call(this,function(){return G.editor.deleteText(I,C)},L,I,-1*C)}},{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,C){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,w({},I,C));else{if($.length===0)return L.selection.format(I,C),M;M=L.editor.formatText($.index,$.length,w({},I,C))}return L.setSelection($,d.default.sources.SILENT),M},G)}},{key:"formatLine",value:function(I,C,L,G,$){var M=this,F=void 0,H=D(I,C,L,G,$),q=o(H,4);return I=q[0],C=q[1],F=q[2],$=q[3],U.call(this,function(){return M.editor.formatLine(I,C,F)},$,I,0)}},{key:"formatText",value:function(I,C,L,G,$){var M=this,F=void 0,H=D(I,C,L,G,$),q=o(H,4);return I=q[0],C=q[1],F=q[2],$=q[3],U.call(this,function(){return M.editor.formatText(I,C,F)},$,I,0)}},{key:"getBounds",value:function(I){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=void 0;typeof I=="number"?L=this.selection.getBounds(I,C):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,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,L=D(I,C),G=o(L,2);return I=G[0],C=G[1],this.editor.getContents(I,C)}},{key:"getFormat",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof I=="number"?this.editor.getFormat(I,C):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,C=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,C)}},{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,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,L=D(I,C),G=o(L,2);return I=G[0],C=G[1],this.editor.getText(I,C)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(I,C,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,C,L)},$,I)}},{key:"insertText",value:function(I,C,L,G,$){var M=this,F=void 0,H=D(I,0,L,G,$),q=o(H,4);return I=q[0],F=q[2],$=q[3],U.call(this,function(){return M.editor.insertText(I,C,F)},$,I,C.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(I,C,L){this.clipboard.dangerouslyPasteHTML(I,C,L)}},{key:"removeFormat",value:function(I,C,L){var G=this,$=D(I,C,L),M=o($,4);return I=M[0],C=M[1],L=M[3],U.call(this,function(){return G.editor.removeFormat(I,C)},L,I)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(I){var C=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=C.getLength(),$=C.editor.deleteText(0,G),M=C.editor.applyDelta(I),F=M.ops[M.ops.length-1];F!=null&&typeof F.insert=="string"&&F.insert[F.insert.length-1]===`
560
+ `&&(C.editor.deleteText(C.getLength()-1,1),M.delete(1));var H=$.compose(M);return H},L)}},{key:"setSelection",value:function(I,C,L){if(I==null)this.selection.setRange(null,C||j.sources.API);else{var G=D(I,C,L),$=o(G,4);I=$[0],C=$[1],L=$[3],this.selection.setRange(new b.Range(I,C),L),L!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(I){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,L=new h.default().insert(I);return this.setContents(L,C)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,C=this.scroll.update(I);return this.selection.update(I),C}},{key:"updateContents",value:function(I){var C=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),C.editor.applyDelta(I,L)},L,!0)}}]),j}();k.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},k.events=d.default.events,k.sources=d.default.sources,k.version="1.3.7",k.imports={delta:h.default,parchment:y.default,"core/module":v.default,"core/theme":P.default};function B(j,N){if(N=(0,x.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},N),!N.theme||N.theme===k.DEFAULTS.theme)N.theme=P.default;else if(N.theme=k.import("themes/"+N.theme),N.theme==null)throw new Error("Invalid theme "+N.theme+". Did you register it?");var I=(0,x.default)(!0,{},N.theme.DEFAULTS);[I,N].forEach(function(G){G.modules=G.modules||{},Object.keys(G.modules).forEach(function($){G.modules[$]===!0&&(G.modules[$]={})})});var C=Object.keys(I.modules).concat(Object.keys(N.modules)),L=C.reduce(function(G,$){var M=k.import("modules/"+$);return M==null?R.error("Cannot load "+$+" module. Are you sure you registered it?"):G[$]=M.DEFAULTS||{},G},{});return N.modules!=null&&N.modules.toolbar&&N.modules.toolbar.constructor!==Object&&(N.modules.toolbar={container:N.modules.toolbar}),N=(0,x.default)(!0,{},k.DEFAULTS,{modules:L},I,N),["bounds","container","scrollingContainer"].forEach(function(G){typeof N[G]=="string"&&(N[G]=document.querySelector(N[G]))}),N.modules=Object.keys(N.modules).reduce(function(G,$){return N.modules[$]&&(G[$]=N.modules[$]),G},{}),N}function U(j,N,I,C){if(this.options.strict&&!this.isEnabled()&&N===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),C==null?L=z(L,$,N):C!==0&&(L=z(L,I,C,N)),this.setSelection(L,d.default.sources.SILENT)),$.length()>0){var M,F=[d.default.events.TEXT_CHANGE,$,G,N];if((M=this.emitter).emit.apply(M,[d.default.events.EDITOR_CHANGE].concat(F)),N!==d.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,F)}}return $}function D(j,N,I,C,L){var G={};return typeof j.index=="number"&&typeof j.length=="number"?typeof N!="number"?(L=C,C=I,I=N,N=j.length,j=j.index):(N=j.length,j=j.index):typeof N!="number"&&(L=C,C=I,I=N,N=0),(typeof I>"u"?"undefined":s(I))==="object"?(G=I,L=C):typeof I=="string"&&(C!=null?G[I]=C:L=I),L=L||d.default.sources.API,[j,N,G,L]}function z(j,N,I,C){if(j==null)return null;var L=void 0,G=void 0;if(N instanceof h.default){var $=[j.index,j.index+j.length].map(function(q){return N.transformPosition(q,C!==d.default.sources.USER)}),M=o($,2);L=M[0],G=M[1]}else{var F=[j.index,j.index+j.length].map(function(q){return q<N||q===N&&C===d.default.sources.USER?q:I>=0?q+I:Math.max(N,q+I)}),H=o(F,2);L=H[0],G=H[1]}return new b.Range(L,G-L)}n.expandConfig=B,n.overload=D,n.default=k},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}}(),o=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(_)}},a=i(7),l=f(a),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 E=this.isolate(_,m);S&&E.wrap(x,S)}else o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,_,m,x,S)}},{key:"optimize",value:function(_){if(o(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),o=a(s);function a(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}(o.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),_}}(),o=function b(_,m,x){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,m);if(S===void 0){var E=Object.getPrototypeOf(_);return E===null?void 0:b(E,m,x)}else{if("value"in S)return S.value;var T=S.get;return T===void 0?void 0:T.call(x)}},a=i(54),l=f(a),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 E;(E=S.__quill.emitter).handleDOM.apply(E,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),o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(x){for(var S=arguments.length,E=Array(S>1?S-1:0),T=1;T<S;T++)E[T-1]=arguments[T];(this.listeners[x.type]||[]).forEach(function(P){var A=P.node,w=P.handler;(x.target===A||A.contains(x.target))&&w.apply(void 0,[x].concat(E))})}},{key:"listenDOM",value:function(x,S,E){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push({node:S,handler:E})}}]),_}(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(a,l){if(!(a instanceof l))throw new TypeError("Cannot call a class as a function")}var o=function a(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,a),this.quill=l,this.options=h};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=["error","warn","log","info"],o="warn";function a(h){if(s.indexOf(h)<=s.indexOf(o)){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]=a.bind(console,f,h),c},{})}a.level=l.level=function(h){o=h},n.default=l},function(r,n,i){var s=Array.prototype.slice,o=i(52),a=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(a(u))return a(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=o(u),b=o(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),o=function(){function a(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 a.keys=function(l){return[].map.call(l.attributes,function(h){return h.name})},a.prototype.add=function(l,h){return this.canAdd(l,h)?(l.setAttribute(this.keyName,h),!0):!1},a.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},a.prototype.remove=function(l){l.removeAttribute(this.keyName)},a.prototype.value=function(l){var h=l.getAttribute(this.keyName);return this.canAdd(l,h)&&h?h:""},a}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var s=function(){function T(P,A){var w=[],O=!0,R=!1,k=void 0;try{for(var B=P[Symbol.iterator](),U;!(O=(U=B.next()).done)&&(w.push(U.value),!(A&&w.length===A));O=!0);}catch(D){R=!0,k=D}finally{try{!O&&B.return&&B.return()}finally{if(R)throw k}}return w}return function(P,A){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return T(P,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(P,A){for(var w=0;w<A.length;w++){var O=A[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(P,O.key,O)}}return function(P,A,w){return A&&T(P.prototype,A),w&&T(P,w),P}}(),a=function T(P,A,w){P===null&&(P=Function.prototype);var O=Object.getOwnPropertyDescriptor(P,A);if(O===void 0){var R=Object.getPrototypeOf(P);return R===null?void 0:T(R,A,w)}else{if("value"in O)return O.value;var k=O.get;return k===void 0?void 0:k.call(w)}},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(T){return T&&T.__esModule?T:{default:T}}function _(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}function m(T,P){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:T}function x(T,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);T.prototype=Object.create(P&&P.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(T,P):T.__proto__=P)}var S=function(T){x(P,T);function P(){return _(this,P),m(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return P}(v.default);S.blotName="code",S.tagName="CODE";var E=function(T){x(P,T);function P(){return _(this,P),m(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return o(P,[{key:"delta",value:function(){var w=this,O=this.domNode.textContent;return O.endsWith(`
561
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(`
562
+ `).reduce(function(R,k){return R.insert(k).insert(`
563
+ `,w.formats())},new h.default)}},{key:"format",value:function(w,O){if(!(w===this.statics.blotName&&O)){var R=this.descendant(y.default,this.length()-1),k=s(R,1),B=k[0];B!=null&&B.deleteAt(B.length()-1,1),a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,w,O)}}},{key:"formatAt",value:function(w,O,R,k){if(O!==0&&!(f.default.query(R,f.default.Scope.BLOCK)==null||R===this.statics.blotName&&k===this.statics.formats(this.domNode))){var B=this.newlineIndex(w);if(!(B<0||B>=w+O)){var U=this.newlineIndex(w,!0)+1,D=B-U+1,z=this.isolate(U,D),j=z.next;z.format(R,k),j instanceof P&&j.formatAt(0,w-U+O-D,R,k)}}}},{key:"insertAt",value:function(w,O,R){if(R==null){var k=this.descendant(y.default,w),B=s(k,2),U=B[0],D=B[1];U.insertAt(D,O)}}},{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 O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(O)return this.domNode.textContent.slice(0,w).lastIndexOf(`
565
+ `);var R=this.domNode.textContent.slice(w).indexOf(`
566
+ `);return R>-1?w+R:-1}},{key:"optimize",value:function(w){this.domNode.textContent.endsWith(`
567
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,`
568
+ `)),a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,w);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(w),O.moveChildren(this),O.remove())}},{key:"replace",value:function(w){a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,w),[].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(w){var O=a(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,w);return O.setAttribute("spellcheck",!1),O}},{key:"formats",value:function(){return!0}}]),P}(d.default);E.blotName="code-block",E.tagName="PRE",E.TAB=" ",n.Code=S,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},o=function(){function j(N,I){var C=[],L=!0,G=!1,$=void 0;try{for(var M=N[Symbol.iterator](),F;!(L=(F=M.next()).done)&&(C.push(F.value),!(I&&C.length===I));L=!0);}catch(H){G=!0,$=H}finally{try{!L&&M.return&&M.return()}finally{if(G)throw $}}return C}return function(N,I){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return j(N,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function j(N,I){for(var C=0;C<I.length;C++){var L=I[C];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(N,L.key,L)}}return function(N,I,C){return I&&j(N.prototype,I),C&&j(N,C),N}}(),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),E=O(S),T=i(11),P=O(T),A=i(3),w=O(A);function O(j){return j&&j.__esModule?j:{default:j}}function R(j,N,I){return N in j?Object.defineProperty(j,N,{value:I,enumerable:!0,configurable:!0,writable:!0}):j[N]=I,j}function k(j,N){if(!(j instanceof N))throw new TypeError("Cannot call a class as a function")}var B=/^[ -~]*$/,U=function(){function j(N){k(this,j),this.scroll=N,this.delta=this.getDelta()}return a(j,[{key:"applyDelta",value:function(I){var C=this,L=!1;this.scroll.update();var G=this.scroll.length();return this.scroll.batchStart(),I=z(I),I.reduce(function($,M){var F=M.retain||M.delete||M.insert.length||1,H=M.attributes||{};if(M.insert!=null){if(typeof M.insert=="string"){var q=M.insert;q.endsWith(`
569
+ `)&&L&&(L=!1,q=q.slice(0,-1)),$>=G&&!q.endsWith(`
570
+ `)&&(L=!0),C.scroll.insertAt($,q);var X=C.scroll.line($),K=o(X,2),rt=K[0],it=K[1],lt=(0,w.default)({},(0,b.bubbleFormats)(rt));if(rt instanceof _.default){var ht=rt.descendant(d.default.Leaf,it),kt=o(ht,1),It=kt[0];lt=(0,w.default)(lt,(0,b.bubbleFormats)(It))}H=f.default.attributes.diff(lt,H)||{}}else if(s(M.insert)==="object"){var V=Object.keys(M.insert)[0];if(V==null)return $;C.scroll.insertAt($,V,M.insert[V])}G+=F}return Object.keys(H).forEach(function(W){C.scroll.formatAt($,F,W,H[W])}),$+F},0),I.reduce(function($,M){return typeof M.delete=="number"?(C.scroll.deleteAt($,M.delete),$):$+(M.retain||M.insert.length||1)},0),this.scroll.batchEnd(),this.update(I)}},{key:"deleteText",value:function(I,C){return this.scroll.deleteAt(I,C),this.update(new h.default().retain(I).delete(C))}},{key:"formatLine",value:function(I,C){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(C,1)),F=C;M.forEach(function(H){var q=H.length();if(!(H instanceof v.default))H.format($,G[$]);else{var X=I-H.offset(L.scroll),K=H.newlineIndex(X+F)-X+1;H.formatAt(X,K,$,G[$])}F-=q})}}),this.scroll.optimize(),this.update(new h.default().retain(I).retain(C,(0,E.default)(G)))}},{key:"formatText",value:function(I,C){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(G).forEach(function($){L.scroll.formatAt(I,C,$,G[$])}),this.update(new h.default().retain(I).retain(C,(0,E.default)(G)))}},{key:"getContents",value:function(I,C){return this.delta.slice(I,I+C)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(I,C){return I.concat(C.delta())},new h.default)}},{key:"getFormat",value:function(I){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=[],G=[];C===0?this.scroll.path(I).forEach(function(M){var F=o(M,1),H=F[0];H instanceof _.default?L.push(H):H instanceof d.default.Leaf&&G.push(H)}):(L=this.scroll.lines(I,C),G=this.scroll.descendants(d.default.Leaf,I,C));var $=[L,G].map(function(M){if(M.length===0)return{};for(var F=(0,b.bubbleFormats)(M.shift());Object.keys(F).length>0;){var H=M.shift();if(H==null)return F;F=D((0,b.bubbleFormats)(H),F)}return F});return w.default.apply(w.default,$)}},{key:"getText",value:function(I,C){return this.getContents(I,C).filter(function(L){return typeof L.insert=="string"}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(I,C,L){return this.scroll.insertAt(I,C,L),this.update(new h.default().retain(I).insert(R({},C,L)))}},{key:"insertText",value:function(I,C){var L=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return C=C.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(I,C),Object.keys(G).forEach(function($){L.scroll.formatAt(I,C.length,$,G[$])}),this.update(new h.default().retain(I).insert(C,(0,E.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,C){var L=this.getText(I,C),G=this.scroll.line(I+C),$=o(G,2),M=$[0],F=$[1],H=0,q=new h.default;M!=null&&(M instanceof v.default?H=M.newlineIndex(F)-F+1:H=M.length()-F,q=M.delta().slice(F,F+H-1).insert(`
573
+ `));var X=this.getContents(I,C+H),K=X.diff(new h.default().insert(L).concat(q)),rt=new h.default().retain(I).concat(K);return this.applyDelta(rt)}},{key:"update",value:function(I){var C=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(C.length===1&&C[0].type==="characterData"&&C[0].target.data.match(B)&&d.default.find(C[0].target)){var $=d.default.find(C[0].target),M=(0,b.bubbleFormats)($),F=$.offset(this.scroll),H=C[0].oldValue.replace(y.default.CONTENTS,""),q=new h.default().insert(H),X=new h.default().insert($.value()),K=new h.default().retain(F).concat(q.diff(X,L));I=K.reduce(function(rt,it){return it.insert?rt.insert(it.insert,M):rt.push(it)},new h.default),this.delta=G.compose(I)}else this.delta=this.getDelta(),(!I||!(0,P.default)(G.compose(I),this.delta))&&(I=G.diff(this.delta,L));return I}}]),j}();function D(j,N){return Object.keys(N).reduce(function(I,C){return j[C]==null||(N[C]===j[C]?I[C]=N[C]:Array.isArray(N[C])?N[C].indexOf(j[C])<0&&(I[C]=N[C].concat([j[C]])):I[C]=[N[C],j[C]]),I},{})}function z(j){return j.reduce(function(N,I){if(I.insert===1){var C=(0,E.default)(I.attributes);return delete C.image,N.insert({image:I.attributes.image},C)}if(I.attributes!=null&&(I.attributes.list===!0||I.attributes.bullet===!0)&&(I=(0,E.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,`
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 N.insert(L,I.attributes)}return N.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 T(P,A){var w=[],O=!0,R=!1,k=void 0;try{for(var B=P[Symbol.iterator](),U;!(O=(U=B.next()).done)&&(w.push(U.value),!(A&&w.length===A));O=!0);}catch(D){R=!0,k=D}finally{try{!O&&B.return&&B.return()}finally{if(R)throw k}}return w}return function(P,A){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return T(P,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(P,A){for(var w=0;w<A.length;w++){var O=A[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(P,O.key,O)}}return function(P,A,w){return A&&T(P.prototype,A),w&&T(P,w),P}}(),a=i(0),l=y(a),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(T){return T&&T.__esModule?T:{default:T}}function b(T){if(Array.isArray(T)){for(var P=0,A=Array(T.length);P<T.length;P++)A[P]=T[P];return A}else return Array.from(T)}function _(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}var m=(0,g.default)("quill:selection"),x=function T(P){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_(this,T),this.index=P,this.length=A},S=function(){function T(P,A){var w=this;_(this,T),this.emitter=A,this.scroll=P,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(O,R){O===p.default.events.TEXT_CHANGE&&R.length()>0&&w.update(p.default.sources.SILENT)}),this.emitter.on(p.default.events.SCROLL_BEFORE_UPDATE,function(){if(w.hasFocus()){var O=w.getNativeRange();O!=null&&O.start.node!==w.cursor.textNode&&w.emitter.once(p.default.events.SCROLL_UPDATE,function(){try{w.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 k=R.range,B=k.startNode,U=k.startOffset,D=k.endNode,z=k.endOffset;w.setNativeRange(B,U,D,z)}}),this.update(p.default.sources.SILENT)}return o(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 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 k=R.split(O.start.offset);R.parent.insertBefore(this.cursor,k)}else R.insertBefore(this.cursor,O.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,O=this.scroll.length();A=Math.min(A,O-1),w=Math.min(A+w,O-1)-A;var R=void 0,k=this.scroll.leaf(A),B=s(k,2),U=B[0],D=B[1];if(U==null)return null;var z=U.position(D,!0),j=s(z,2);R=j[0],D=j[1];var N=document.createRange();if(w>0){N.setStart(R,D);var I=this.scroll.leaf(A+w),C=s(I,2);if(U=C[0],D=C[1],U==null)return null;var L=U.position(D,!0),G=s(L,2);return R=G[0],D=G[1],N.setEnd(R,D),N.getBoundingClientRect()}else{var $="left",M=void 0;return R instanceof Text?(D<R.data.length?(N.setStart(R,D),N.setEnd(R,D+1)):(N.setStart(R,D-1),N.setEnd(R,D),$="right"),M=N.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 w=A.getRangeAt(0);if(w==null)return null;var O=this.normalizeNative(w);return m.info("getNativeRange",O),O}},{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,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],N=l.default.find(z,!0),I=N.offset(w.scroll);return j===0?I:N instanceof l.default.Container?I+N.length():I+N.index(z,j)}),k=Math.min(Math.max.apply(Math,b(R)),this.scroll.length()-1),B=Math.min.apply(Math,[k].concat(b(R)));return new x(B,k-B)}},{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(O){for(var R=O.node,k=O.offset;!(R instanceof Text)&&R.childNodes.length>0;)if(R.childNodes.length>k)R=R.childNodes[k],k=0;else if(R.childNodes.length===k)R=R.lastChild,k=R instanceof Text?R.data.length:R.childNodes.length+1;else break;O.node=R,O.offset=k}),w}},{key:"rangeToNative",value:function(A){var w=this,O=A.collapsed?[A.index]:[A.index,A.index+A.length],R=[],k=this.scroll.length();return O.forEach(function(B,U){B=Math.min(k-1,B);var D=void 0,z=w.scroll.leaf(B),j=s(z,2),N=j[0],I=j[1],C=N.position(I,U!==0),L=s(C,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 w=this.lastRange;if(w!=null){var O=this.getBounds(w.index,w.length);if(O!=null){var R=this.scroll.length()-1,k=this.scroll.line(Math.min(w.index,R)),B=s(k,1),U=B[0],D=U;if(w.length>0){var z=this.scroll.line(Math.min(w.index+w.length,R)),j=s(z,1);D=j[0]}if(!(U==null||D==null)){var N=A.getBoundingClientRect();O.top<N.top?A.scrollTop-=N.top-O.top:O.bottom>N.bottom&&(A.scrollTop+=O.bottom-N.bottom)}}}}},{key:"setNativeRange",value:function(A,w){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A,R=arguments.length>3&&arguments[3]!==void 0?arguments[3]:w,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",A,w,O,R),!(A!=null&&(this.root.parentNode==null||A.parentNode==null||O.parentNode==null))){var B=document.getSelection();if(B!=null)if(A!=null){this.hasFocus()||this.root.focus();var U=(this.getNativeRange()||{}).native;if(U==null||k||A!==U.startContainer||w!==U.startOffset||O!==U.endContainer||R!==U.endOffset){A.tagName=="BR"&&(w=[].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,w),D.setEnd(O,R),B.removeAllRanges(),B.addRange(D)}}else B.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(A){var w=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 w=="string"&&(O=w,w=!1),m.info("setRange",A),A!=null){var R=this.rangeToNative(A);this.setNativeRange.apply(this,b(R).concat([w]))}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,w=this.lastRange,O=this.getRange(),R=s(O,2),k=R[0],B=R[1];if(this.lastRange=k,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,u.default)(w,this.lastRange)){var U;!this.composing&&B!=null&&B.native.collapsed&&B.start.node!==this.cursor.textNode&&this.cursor.restore();var D=[p.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(w),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)}}}}]),T}();function E(T,P){try{P.parentNode}catch{return!1}return P instanceof Text&&(P=P.parentNode),T.contains(P)}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}}(),o=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)}},a=i(0),l=h(a);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?o(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 o=i(44),a=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 o.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}(a.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 o=i(12),a=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 a.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 o.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 o=i(30),a=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=a.Scope.INLINE_BLOT,c}(o.default);n.default=l},function(r,n,i){var s=i(11),o=i(3),a={attributes:{compose:function(h,c,f){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var u=o(!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=a.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]?a.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=a},function(r,n){var i=function(){function s(v,g){return g!=null&&v instanceof g}var o;try{o=Map}catch{o=function(){}}var a;try{a=Set}catch{a=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 E(T,P){if(T===null)return null;if(P===0)return T;var A,w;if(typeof T!="object")return T;if(s(T,o))A=new o;else if(s(T,a))A=new a;else if(s(T,l))A=new l(function(N,I){T.then(function(C){N(E(C,P-1))},function(C){I(E(C,P-1))})});else if(h.__isArray(T))A=[];else if(h.__isRegExp(T))A=new RegExp(T.source,p(T)),T.lastIndex&&(A.lastIndex=T.lastIndex);else if(h.__isDate(T))A=new Date(T.getTime());else{if(S&&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 b>"u"?(w=Object.getPrototypeOf(T),A=Object.create(w)):(A=Object.create(b),w=b)}if(g){var O=m.indexOf(T);if(O!=-1)return x[O];m.push(T),x.push(A)}s(T,o)&&T.forEach(function(N,I){var C=E(I,P-1),L=E(N,P-1);A.set(C,L)}),s(T,a)&&T.forEach(function(N){var I=E(N,P-1);A.add(I)});for(var R in T){var k;w&&(k=Object.getOwnPropertyDescriptor(w,R)),!(k&&k.set==null)&&(A[R]=E(T[R],P-1))}if(Object.getOwnPropertySymbols)for(var B=Object.getOwnPropertySymbols(T),R=0;R<B.length;R++){var U=B[R],D=Object.getOwnPropertyDescriptor(T,U);D&&!D.enumerable&&!_||(A[U]=E(T[U],P-1),D.enumerable||Object.defineProperty(A,U,{enumerable:!1}))}if(_)for(var z=Object.getOwnPropertyNames(T),R=0;R<z.length;R++){var j=z[R],D=Object.getOwnPropertyDescriptor(T,j);D&&D.enumerable||(A[j]=E(T[j],P-1),Object.defineProperty(A,j,{enumerable:!1}))}return A}return E(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(w,O){var R=[],k=!0,B=!1,U=void 0;try{for(var D=w[Symbol.iterator](),z;!(k=(z=D.next()).done)&&(R.push(z.value),!(O&&R.length===O));k=!0);}catch(j){B=!0,U=j}finally{try{!k&&D.return&&D.return()}finally{if(B)throw U}}return R}return function(w,O){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return A(w,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(w,O){for(var R=0;R<O.length;R++){var k=O[R];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(w,k.key,k)}}return function(w,O,R){return O&&A(w.prototype,O),R&&A(w,R),w}}(),a=function A(w,O,R){w===null&&(w=Function.prototype);var k=Object.getOwnPropertyDescriptor(w,O);if(k===void 0){var B=Object.getPrototypeOf(w);return B===null?void 0:A(B,O,R)}else{if("value"in k)return k.value;var U=k.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,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}function S(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 P=function(A){E(w,A);function w(O,R){x(this,w);var k=S(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,O));return k.emitter=R.emitter,Array.isArray(R.whitelist)&&(k.whitelist=R.whitelist.reduce(function(B,U){return B[U]=!0,B},{})),k.domNode.addEventListener("DOMNodeInserted",function(){}),k.optimize(),k.enable(),k}return o(w,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(R,k){var B=this.line(R),U=s(B,2),D=U[0],z=U[1],j=this.line(R+k),N=s(j,1),I=N[0];if(a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"deleteAt",this).call(this,R,k),I!=null&&D!==I&&z>0){if(D instanceof u.BlockEmbed||I instanceof u.BlockEmbed){this.optimize();return}if(D instanceof y.default){var C=D.newlineIndex(D.length(),!0);if(C>-1&&(D=D.split(C+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,k,B,U){this.whitelist!=null&&!this.whitelist[B]||(a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"formatAt",this).call(this,R,k,B,U),this.optimize())}},{key:"insertAt",value:function(R,k,B){if(!(B!=null&&this.whitelist!=null&&!this.whitelist[k])){if(R>=this.length())if(B==null||h.default.query(k,h.default.Scope.BLOCK)==null){var U=h.default.create(this.statics.defaultChild);this.appendChild(U),B==null&&k.endsWith(`
576
+ `)&&(k=k.slice(0,-1)),U.insertAt(0,k,B)}else{var D=h.default.create(k,B);this.appendChild(D)}else a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertAt",this).call(this,R,k,B);this.optimize()}}},{key:"insertBefore",value:function(R,k){if(R.statics.scope===h.default.Scope.INLINE_BLOT){var B=h.default.create(this.statics.defaultChild);B.appendChild(R),R=B}a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertBefore",this).call(this,R,k)}},{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(T,R)}},{key:"lines",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,B=function U(D,z,j){var N=[],I=j;return D.children.forEachAt(z,j,function(C,L,G){T(C)?N.push(C):C instanceof h.default.Container&&(N=N.concat(U(C,L,I))),I-=G}),N};return B(this,R,k)}},{key:"optimize",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,R,k),R.length>0&&this.emitter.emit(f.default.events.SCROLL_OPTIMIZE,R,k))}},{key:"path",value:function(R){return a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"path",this).call(this,R).slice(1)}},{key:"update",value:function(R){if(this.batch!==!0){var k=f.default.sources.USER;typeof R=="string"&&(k=R),Array.isArray(R)||(R=this.observer.takeRecords()),R.length>0&&this.emitter.emit(f.default.events.SCROLL_BEFORE_UPDATE,k,R),a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"update",this).call(this,R.concat([])),R.length>0&&this.emitter.emit(f.default.events.SCROLL_UPDATE,k,R)}}}]),w}(h.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[d.default,u.BlockEmbed,_.default],n.default=P},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},o=function(){function M(F,H){var q=[],X=!0,K=!1,rt=void 0;try{for(var it=F[Symbol.iterator](),lt;!(X=(lt=it.next()).done)&&(q.push(lt.value),!(H&&q.length===H));X=!0);}catch(ht){K=!0,rt=ht}finally{try{!X&&it.return&&it.return()}finally{if(K)throw rt}}return q}return function(F,H){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function M(F,H){for(var q=0;q<H.length;q++){var X=H[q];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(F,X.key,X)}}return function(F,H,q){return H&&M(F.prototype,H),q&&M(F,q),F}}(),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),E=A(S),T=i(9),P=A(T);function A(M){return M&&M.__esModule?M:{default:M}}function w(M,F,H){return F in M?Object.defineProperty(M,F,{value:H,enumerable:!0,configurable:!0,writable:!0}):M[F]=H,M}function O(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}function R(M,F){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:M}function k(M,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);M.prototype=Object.create(F&&F.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(M,F):M.__proto__=F)}var B=(0,E.default)("quill:keyboard"),U=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",D=function(M){k(F,M),a(F,null,[{key:"match",value:function(q,X){return X=$(X),["altKey","ctrlKey","metaKey","shiftKey"].some(function(K){return!!X[K]!==q[K]&&X[K]!==null})?!1:X.key===(q.which||q.keyCode)}}]);function F(H,q){O(this,F);var X=R(this,(F.__proto__||Object.getPrototypeOf(F)).call(this,H,q));return X.bindings={},Object.keys(X.options.bindings).forEach(function(K){K==="list autofill"&&H.scroll.whitelist!=null&&!H.scroll.whitelist.list||X.options.bindings[K]&&X.addBinding(X.options.bindings[K])}),X.addBinding({key:F.keys.ENTER,shiftKey:null},C),X.addBinding({key:F.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(X.addBinding({key:F.keys.BACKSPACE},{collapsed:!0},j),X.addBinding({key:F.keys.DELETE},{collapsed:!0},N)):(X.addBinding({key:F.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),X.addBinding({key:F.keys.DELETE},{collapsed:!0,suffix:/^.?$/},N)),X.addBinding({key:F.keys.BACKSPACE},{collapsed:!1},I),X.addBinding({key:F.keys.DELETE},{collapsed:!1},I),X.addBinding({key:F.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),X.listen(),X}return a(F,[{key:"addBinding",value:function(q){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},rt=$(q);if(rt==null||rt.key==null)return B.warn("Attempted to add invalid keyboard binding",rt);typeof X=="function"&&(X={handler:X}),typeof K=="function"&&(K={handler:K}),rt=(0,d.default)(rt,X,K),this.bindings[rt.key]=this.bindings[rt.key]||[],this.bindings[rt.key].push(rt)}},{key:"listen",value:function(){var q=this;this.quill.root.addEventListener("keydown",function(X){if(!X.defaultPrevented){var K=X.which||X.keyCode,rt=(q.bindings[K]||[]).filter(function(wt){return F.match(X,wt)});if(rt.length!==0){var it=q.quill.getSelection();if(!(it==null||!q.quill.hasFocus())){var lt=q.quill.getLine(it.index),ht=o(lt,2),kt=ht[0],It=ht[1],V=q.quill.getLeaf(it.index),W=o(V,2),Q=W[0],et=W[1],Y=it.length===0?[Q,et]:q.quill.getLeaf(it.index+it.length),ct=o(Y,2),Z=ct[0],ot=ct[1],St=Q instanceof _.default.Text?Q.value().slice(0,et):"",qt=Z instanceof _.default.Text?Z.value().slice(ot):"",_t={collapsed:it.length===0,empty:it.length===0&&kt.length()<=1,format:q.quill.getFormat(it),offset:It,prefix:St,suffix:qt},Tt=rt.some(function(wt){if(wt.collapsed!=null&&wt.collapsed!==_t.collapsed||wt.empty!=null&&wt.empty!==_t.empty||wt.offset!=null&&wt.offset!==_t.offset)return!1;if(Array.isArray(wt.format)){if(wt.format.every(function(Ft){return _t.format[Ft]==null}))return!1}else if(s(wt.format)==="object"&&!Object.keys(wt.format).every(function(Ft){return wt.format[Ft]===!0?_t.format[Ft]!=null:wt.format[Ft]===!1?_t.format[Ft]==null:(0,f.default)(wt.format[Ft],_t.format[Ft])}))return!1;return wt.prefix!=null&&!wt.prefix.test(_t.prefix)||wt.suffix!=null&&!wt.suffix.test(_t.suffix)?!1:wt.handler.call(q,it,_t)!==!0});Tt&&X.preventDefault()}}}})}}]),F}(P.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(F,H){if(H.collapsed&&H.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(F,H){if(H.collapsed&&H.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(F,H){H.format.indent!=null?this.quill.format("indent","-1",x.default.sources.USER):H.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(F){this.quill.deleteText(F.index-1,1,x.default.sources.USER)}},tab:{key:D.keys.TAB,handler:function(F){this.quill.history.cutoff();var H=new v.default().retain(F.index).delete(F.length).insert(" ");this.quill.updateContents(H,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index+1,x.default.sources.SILENT)}},"list empty enter":{key:D.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(F,H){this.quill.format("list",!1,x.default.sources.USER),H.format.indent&&this.quill.format("indent",!1,x.default.sources.USER)}},"checklist enter":{key:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(F){var H=this.quill.getLine(F.index),q=o(H,2),X=q[0],K=q[1],rt=(0,d.default)({},X.formats(),{list:"checked"}),it=new v.default().retain(F.index).insert(`
577
+ `,rt).retain(X.length()-K-1).retain(1,{list:"unchecked"});this.quill.updateContents(it,x.default.sources.USER),this.quill.setSelection(F.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(F,H){var q=this.quill.getLine(F.index),X=o(q,2),K=X[0],rt=X[1],it=new v.default().retain(F.index).insert(`
578
+ `,H.format).retain(K.length()-rt-1).retain(1,{header:null});this.quill.updateContents(it,x.default.sources.USER),this.quill.setSelection(F.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(F,H){var q=H.prefix.length,X=this.quill.getLine(F.index),K=o(X,2),rt=K[0],it=K[1];if(it>q)return!0;var lt=void 0;switch(H.prefix.trim()){case"[]":case"[ ]":lt="unchecked";break;case"[x]":lt="checked";break;case"-":case"*":lt="bullet";break;default:lt="ordered"}this.quill.insertText(F.index," ",x.default.sources.USER),this.quill.history.cutoff();var ht=new v.default().retain(F.index-it).delete(q+1).retain(rt.length()-2-it).retain(1,{list:lt});this.quill.updateContents(ht,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index-q,x.default.sources.SILENT)}},"code exit":{key:D.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(F){var H=this.quill.getLine(F.index),q=o(H,2),X=q[0],K=q[1],rt=new v.default().retain(F.index+X.length()-K-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(rt,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,F){var H,q=M===D.keys.LEFT?"prefix":"suffix";return H={key:M,shiftKey:F,altKey:null},w(H,q,/^$/),w(H,"handler",function(K){var rt=K.index;M===D.keys.RIGHT&&(rt+=K.length+1);var it=this.quill.getLeaf(rt),lt=o(it,1),ht=lt[0];return ht instanceof _.default.Embed?(M===D.keys.LEFT?F?this.quill.setSelection(K.index-1,K.length+1,x.default.sources.USER):this.quill.setSelection(K.index-1,x.default.sources.USER):F?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}),H}function j(M,F){if(!(M.index===0||this.quill.getLength()<=1)){var H=this.quill.getLine(M.index),q=o(H,1),X=q[0],K={};if(F.offset===0){var rt=this.quill.getLine(M.index-1),it=o(rt,1),lt=it[0];if(lt!=null&&lt.length()>1){var ht=X.formats(),kt=this.quill.getFormat(M.index-1,1);K=y.default.attributes.diff(ht,kt)||{}}}var It=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(F.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 N(M,F){var H=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(F.suffix)?2:1;if(!(M.index>=this.quill.getLength()-H)){var q={},X=0,K=this.quill.getLine(M.index),rt=o(K,1),it=rt[0];if(F.offset>=it.length()-1){var lt=this.quill.getLine(M.index+1),ht=o(lt,1),kt=ht[0];if(kt){var It=it.formats(),V=this.quill.getFormat(M.index,1);q=y.default.attributes.diff(It,V)||{},X=kt.length()}}this.quill.deleteText(M.index,H,x.default.sources.USER),Object.keys(q).length>0&&this.quill.formatLine(M.index+X-1,H,q,x.default.sources.USER)}}function I(M){var F=this.quill.getLines(M),H={};if(F.length>1){var q=F[0].formats(),X=F[F.length-1].formats();H=y.default.attributes.diff(X,q)||{}}this.quill.deleteText(M,x.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(M.index,1,H,x.default.sources.USER),this.quill.setSelection(M.index,x.default.sources.SILENT),this.quill.focus()}function C(M,F){var H=this;M.length>0&&this.quill.scroll.deleteAt(M.index,M.length);var q=Object.keys(F.format).reduce(function(X,K){return _.default.query(K,_.default.Scope.BLOCK)&&!Array.isArray(F.format[K])&&(X[K]=F.format[K]),X},{});this.quill.insertText(M.index,`
579
+ `,q,x.default.sources.USER),this.quill.setSelection(M.index+1,x.default.sources.SILENT),this.quill.focus(),Object.keys(F.format).forEach(function(X){q[X]==null&&(Array.isArray(F.format[X])||X!=="link"&&H.quill.format(X,F.format[X],x.default.sources.USER))})}function L(M){return{key:D.keys.TAB,shiftKey:!M,format:{"code-block":!0},handler:function(H){var q=_.default.query("code-block"),X=H.index,K=H.length,rt=this.quill.scroll.descendant(q,X),it=o(rt,2),lt=it[0],ht=it[1];if(lt!=null){var kt=this.quill.getIndex(lt),It=lt.newlineIndex(ht,!0)+1,V=lt.newlineIndex(kt+ht+K),W=lt.domNode.textContent.slice(It,V).split(`
580
+ `);ht=0,W.forEach(function(Q,et){M?(lt.insertAt(It+ht,q.TAB),ht+=q.TAB.length,et===0?X+=q.TAB.length:K+=q.TAB.length):Q.startsWith(q.TAB)&&(lt.deleteAt(It+ht,q.TAB.length),ht-=q.TAB.length,et===0?X-=q.TAB.length:K-=q.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(H,q){this.quill.format(M,!q.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,E=void 0;try{for(var T=b[Symbol.iterator](),P;!(x=(P=T.next()).done)&&(m.push(P.value),!(_&&m.length===_));x=!0);}catch(A){S=!0,E=A}finally{try{!x&&T.return&&T.return()}finally{if(S)throw E}}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")}}(),o=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 E=x.get;return E===void 0?void 0:E.call(m)}},a=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),a(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 a(b,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,x){if(this._length!==0)return o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,m,x);for(var S=this,E=0;S!=null&&S.statics.scope!==h.default.Scope.BLOCK_BLOT;)E+=S.offset(S.parent),S=S.parent;S!=null&&(this._length=b.CONTENTS.length,S.optimize(),S.formatAt(E,b.CONTENTS.length,m,x),this._length=0)}},{key:"index",value:function(m,x){return m===this.textNode?0:o(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(){o(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,E=void 0,T=void 0;if(x!=null&&x.start.node===m&&x.end.node===m){var P=[m,x.start.offset,x.end.offset];S=P[0],E=P[1],T=P[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(),E!=null){var w=[E,T].map(function(R){return Math.max(0,Math.min(S.data.length,R-1))}),O=s(w,2);return E=O[0],T=O[1],{startNode:S,startOffset:E,endNode:S,endOffset:T}}}}},{key:"update",value:function(m,x){var S=this;if(m.some(function(T){return T.type==="characterData"&&T.target===S.textNode})){var E=this.restore();E&&(x.range=E)}}},{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),o=h(s),a=i(4),l=h(a);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}(o.default.Container);d.allowedChildren=[l.default,a.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}}(),o=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(_)}},a=i(0),l=h(a);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=o(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}}(),o=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)}},a=i(6),l=h(a);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 o(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 _=o(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},o=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=i(23),l=f(a),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 o(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),o=B(s),a=i(5),l=B(a),h=i(4),c=B(h),f=i(16),u=B(f),d=i(25),p=B(d),v=i(24),g=B(v),y=i(35),b=B(y),_=i(6),m=B(_),x=i(22),S=B(x),E=i(7),T=B(E),P=i(55),A=B(P),w=i(42),O=B(w),R=i(23),k=B(R);function B(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":T.default,"modules/clipboard":A.default,"modules/history":O.default,"modules/keyboard":k.default}),o.default.register(c.default,u.default,g.default,m.default,S.default,T.default),n.default=l.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),o=function(){function a(l){this.domNode=l,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(a.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),a.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},a.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},a.prototype.clone=function(){var l=this.domNode.cloneNode(!1);return s.create(l)},a.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},a.prototype.deleteAt=function(l,h){var c=this.isolate(l,h);c.remove()},a.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)}},a.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)},a.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()},a.prototype.isolate=function(l,h){var c=this.split(l);return c.split(h),c},a.prototype.length=function(){return 1},a.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)},a.prototype.optimize=function(l){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},a.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},a.prototype.replace=function(l){l.parent!=null&&(l.parent.insertBefore(this,l.next),l.remove())},a.prototype.replaceWith=function(l,h){var c=typeof l=="string"?s.create(l,h):l;return c.replace(this),c},a.prototype.split=function(l,h){return l===0?this:this.next},a.prototype.update=function(l,h){},a.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},a.blotName="abstract",a}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(12),o=i(32),a=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=o.default.keys(this.domNode),p=a.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 o=i(12);function a(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=a(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=a(f,this.keyName)[0]||"",d=u.slice(this.keyName.length+1);return this.canAdd(f,d)?d:""},c}(o.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 o=i(12);function a(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[a(this.keyName)]=u,!0):!1},c.prototype.remove=function(f){f.style[a(this.keyName)]="",f.getAttribute("style")||f.removeAttribute("style")},c.prototype.value=function(f){var u=f.style[a(this.keyName)];return this.canAdd(f,u)?u:""},c}(o.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 o(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var a=function(){function l(h,c){o(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}();a.DEFAULTS={modules:{}},a.themes={default:a},n.default=a},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}}(),o=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 E=x.get;return E===void 0?void 0:E.call(m)}},a=i(0),l=f(a),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:o(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,E=m.data.split(v).join("");if(m===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 S=document.createTextNode(E),this.parent.insertBefore(l.default.create(S),this),x={startNode:S,startOffset:E.length};else m===this.rightGuard&&(this.next instanceof c.default?(this.next.insertAt(0,E),x={startNode:this.next.domNode,startOffset:E.length}):(S=document.createTextNode(E),this.parent.insertBefore(l.default.create(S),this.next),x={startNode:S,startOffset:E.length}));return m.data=v,x}},{key:"update",value:function(m,x){var S=this;m.forEach(function(E){if(E.type==="characterData"&&(E.target===S.leftGuard||E.target===S.rightGuard)){var T=S.restore(E.target);T&&(x.range=T)}})}}]),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),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}var l={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new o.default.Attributor.Attribute("align","align",l),c=new o.default.Attributor.Class("align","ql-align",l),f=new o.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),o=l(s),a=i(26);function l(f){return f&&f.__esModule?f:{default:f}}var h=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),c=new a.ColorAttributor("background","background-color",{scope:o.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),o=a(s);function a(u){return u&&u.__esModule?u:{default:u}}var l={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},h=new o.default.Attributor.Attribute("direction","dir",l),c=new o.default.Attributor.Class("direction","ql-direction",l),f=new o.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}}(),o=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 E=x.get;return E===void 0?void 0:E.call(m)}},a=i(0),l=h(a);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 o(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),o=a(s);function a(c){return c&&c.__esModule?c:{default:c}}var l=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new o.default.Attributor.Style("size","font-size",{scope:o.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 E=x[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(m,E.key,E)}}return function(m,x,S){return x&&_(m.prototype,x),S&&_(m,S),m}}(),o=i(0),a=u(o),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 E=p(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,x,S));return E.lastRecorded=0,E.ignoreChange=!1,E.clear(),E.quill.on(h.default.events.EDITOR_CHANGE,function(T,P,A,w){T!==h.default.events.TEXT_CHANGE||E.ignoreChange||(!E.options.userOnly||w===h.default.sources.USER?E.record(P,A):E.transform(P))}),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(m,[{key:"change",value:function(S,E){if(this.stack[S].length!==0){var T=this.stack[S].pop();this.stack[E].push(T),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(T[S],h.default.sources.USER),this.ignoreChange=!1;var P=b(T[S]);this.quill.setSelection(P)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(S,E){if(S.ops.length!==0){this.stack.redo=[];var T=this.quill.getContents().diff(E),P=Date.now();if(this.lastRecorded+this.options.delay>P&&this.stack.undo.length>0){var A=this.stack.undo.pop();T=T.compose(A.undo),S=A.redo.compose(S)}else this.lastRecorded=P;this.stack.undo.push({redo:S,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(S){this.stack.undo.forEach(function(E){E.undo=S.transform(E.undo,!0),E.redo=S.transform(E.redo,!0)}),this.stack.redo.forEach(function(E){E.undo=S.transform(E.undo,!0),E.redo=S.transform(E.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 a.default.query(x,a.default.Scope.BLOCK)!=null}):!1}function b(_){var m=_.reduce(function(S,E){return S+=E.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 C(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&&C(L.prototype,G),$&&C(L,$),L}}(),o=function C(L,G,$){L===null&&(L=Function.prototype);var M=Object.getOwnPropertyDescriptor(L,G);if(M===void 0){var F=Object.getPrototypeOf(L);return F===null?void 0:C(F,G,$)}else{if("value"in M)return M.value;var H=M.get;return H===void 0?void 0:H.call($)}},a=i(3),l=P(a),h=i(2),c=P(h),f=i(8),u=P(f),d=i(23),p=P(d),v=i(34),g=P(v),y=i(59),b=P(y),_=i(60),m=P(_),x=i(28),S=P(x),E=i(61),T=P(E);function P(C){return C&&C.__esModule?C:{default:C}}function A(C,L){if(!(C instanceof L))throw new TypeError("Cannot call a class as a function")}function w(C,L){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:C}function O(C,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);C.prototype=Object.create(L&&L.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(C,L):C.__proto__=L)}var R=[!1,"center","right","justify"],k=["#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"],B=[!1,"serif","monospace"],U=["1","2","3",!1],D=["small",!1,"large","huge"],z=function(C){O(L,C);function L(G,$){A(this,L);var M=w(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,G,$)),F=function H(q){if(!document.body.contains(G.root))return document.body.removeEventListener("click",H);M.tooltip!=null&&!M.tooltip.root.contains(q.target)&&document.activeElement!==M.tooltip.textbox&&!M.quill.hasFocus()&&M.tooltip.hide(),M.pickers!=null&&M.pickers.forEach(function(X){X.container.contains(q.target)||X.close()})};return G.emitter.listenDOM("click",document.body,F),M}return s(L,[{key:"addModule",value:function($){var M=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"addModule",this).call(this,$);return $==="toolbar"&&this.extendToolbar(M),M}},{key:"buildButtons",value:function($,M){$.forEach(function(F){var H=F.getAttribute("class")||"";H.split(/\s+/).forEach(function(q){if(q.startsWith("ql-")&&(q=q.slice(3),M[q]!=null))if(q==="direction")F.innerHTML=M[q][""]+M[q].rtl;else if(typeof M[q]=="string")F.innerHTML=M[q];else{var X=F.value||"";X!=null&&M[q][X]&&(F.innerHTML=M[q][X])}})})}},{key:"buildPickers",value:function($,M){var F=this;this.pickers=$.map(function(q){if(q.classList.contains("ql-align"))return q.querySelector("option")==null&&I(q,R),new m.default(q,M.align);if(q.classList.contains("ql-background")||q.classList.contains("ql-color")){var X=q.classList.contains("ql-background")?"background":"color";return q.querySelector("option")==null&&I(q,k,X==="background"?"#ffffff":"#000000"),new b.default(q,M[X])}else return q.querySelector("option")==null&&(q.classList.contains("ql-font")?I(q,B):q.classList.contains("ql-header")?I(q,U):q.classList.contains("ql-size")&&I(q,D)),new S.default(q)});var H=function(){F.pickers.forEach(function(X){X.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,H)}}]),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 F=L.quill.getSelection(!0);L.quill.updateContents(new c.default().retain(F.index).delete(F.length).insert({image:M.target.result}),u.default.sources.USER),L.quill.setSelection(F.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(C){O(L,C);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 $=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":$=N($);case"formula":{if(!$)break;var F=this.quill.getSelection(!0);if(F!=null){var H=F.index+F.length;this.quill.insertEmbed(H,this.root.getAttribute("data-mode"),$,u.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(H+1," ",u.default.sources.USER),this.quill.setSelection(H+2,u.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),L}(T.default);function N(C){var L=C.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||C.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return L?(L[1]||"https")+"://www.youtube.com/embed/"+L[2]+"?showinfo=0":(L=C.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(L[1]||"https")+"://player.vimeo.com/video/"+L[2]+"/":C}function I(C,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",$),C.appendChild(M)})}n.BaseTooltip=j,n.default=z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];this.insertBefore(a[0],null),a.length>1&&this.append.apply(this,a.slice(1))},o.prototype.contains=function(a){for(var l,h=this.iterator();l=h();)if(l===a)return!0;return!1},o.prototype.insertBefore=function(a,l){a&&(a.next=l,l!=null?(a.prev=l.prev,l.prev!=null&&(l.prev.next=a),l.prev=a,l===this.head&&(this.head=a)):this.tail!=null?(this.tail.next=a,a.prev=this.tail,this.tail=a):(a.prev=null,this.head=this.tail=a),this.length+=1)},o.prototype.offset=function(a){for(var l=0,h=this.head;h!=null;){if(h===a)return l;l+=h.length(),h=h.next}return-1},o.prototype.remove=function(a){this.contains(a)&&(a.prev!=null&&(a.prev.next=a.next),a.next!=null&&(a.next.prev=a.prev),a===this.head&&(this.head=a.next),a===this.tail&&(this.tail=a.prev),this.length-=1)},o.prototype.iterator=function(a){return a===void 0&&(a=this.head),function(){var l=a;return a!=null&&(a=a.next),l}},o.prototype.find=function(a,l){l===void 0&&(l=!1);for(var h,c=this.iterator();h=c();){var f=h.length();if(a<f||l&&a===f&&(h.next==null||h.next.length()!==0))return[h,a];a-=f}return[null,0]},o.prototype.forEach=function(a){for(var l,h=this.iterator();l=h();)a(l)},o.prototype.forEachAt=function(a,l,h){if(!(l<=0))for(var c=this.find(a),f=c[0],u=c[1],d,p=a-u,v=this.iterator(f);(d=v())&&p<a+l;){var g=d.length();a>p?h(d,a-p,Math.min(l,p+g-a)):h(d,0,Math.min(g,a+l-p)),p+=g}},o.prototype.map=function(a){return this.reduce(function(l,h){return l.push(a(h)),l},[])},o.prototype.reduce=function(a,l){for(var h,c=this.iterator();h=c();)l=a(l,h);return l},o}();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 o=i(17),a=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[a.DATA_KEY].mutations==null&&(x.domNode[a.DATA_KEY].mutations=[]),S&&y(x.parent))},b=function(x){x.domNode[a.DATA_KEY]==null||x.domNode[a.DATA_KEY].mutations==null||(x instanceof o.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=a.find(x.target,!0);S!=null&&(S.domNode===x.target&&(x.type==="childList"?(y(a.find(x.previousSibling,!1)),[].forEach.call(x.addedNodes,function(E){var T=a.find(E,!1);y(T,!1),T instanceof o.default&&T.children.forEach(function(P){y(P,!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=a.find(g.target,!0);return y==null?null:y.domNode[a.DATA_KEY].mutations==null?(y.domNode[a.DATA_KEY].mutations=[g],y):(y.domNode[a.DATA_KEY].mutations.push(g),null)}).forEach(function(g){g==null||g===v||g.domNode[a.DATA_KEY]==null||g.update(g.domNode[a.DATA_KEY].mutations||[],p)}),this.domNode[a.DATA_KEY].mutations!=null&&f.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,p),this.optimize(d,p)},u.blotName="scroll",u.defaultChild="block",u.scope=a.Scope.BLOCK_BLOT,u.tagName="DIV",u}(o.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 o=i(18),a=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 o.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||a.query(p,a.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=a.Scope.INLINE_BLOT,f.tagName="SPAN",f}(o.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 o=i(18),a=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=a.query(c.blotName).tagName;if(f.tagName!==u)return h.formats.call(this,f)},c.prototype.format=function(f,u){a.query(f,a.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){a.query(d,a.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||a.query(u,a.Scope.INLINE)!=null)h.prototype.insertAt.call(this,f,u,d);else{var p=this.split(f),v=a.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=a.Scope.BLOCK_BLOT,c.tagName="P",c}(o.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 o=i(19),a=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}(o.default);n.default=a},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 o=i(19),a=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=a.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=a.Scope.INLINE_BLOT,c}(o.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 o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(a,l){return arguments.length>1&&!this.contains(a)==!l?l:o.call(this,a)}}String.prototype.startsWith||(String.prototype.startsWith=function(a,l){return l=l||0,this.substr(l,a.length)===a}),String.prototype.endsWith||(String.prototype.endsWith=function(a,l){var h=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>h.length)&&(l=h.length),l-=a.length;var c=h.indexOf(a,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,o=0;function a(m,x,S){if(m==x)return m?[[o,m]]:[];(S<0||m.length<S)&&(S=null);var E=f(m,x),T=m.substring(0,E);m=m.substring(E),x=x.substring(E),E=u(m,x);var P=m.substring(m.length-E);m=m.substring(0,m.length-E),x=x.substring(0,x.length-E);var A=l(m,x);return T&&A.unshift([o,T]),P&&A.push([o,P]),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 E=m.length>x.length?m:x,T=m.length>x.length?x:m,P=E.indexOf(T);if(P!=-1)return S=[[s,E.substring(0,P)],[o,T],[s,E.substring(P+T.length)]],m.length>x.length&&(S[0][0]=S[2][0]=i),S;if(T.length==1)return[[i,m],[s,x]];var A=d(m,x);if(A){var w=A[0],O=A[1],R=A[2],k=A[3],B=A[4],U=a(w,R),D=a(O,k);return U.concat([[o,B]],D)}return h(m,x)}function h(m,x){for(var S=m.length,E=x.length,T=Math.ceil((S+E)/2),P=T,A=2*T,w=new Array(A),O=new Array(A),R=0;R<A;R++)w[R]=-1,O[R]=-1;w[P+1]=0,O[P+1]=0;for(var k=S-E,B=k%2!=0,U=0,D=0,z=0,j=0,N=0;N<T;N++){for(var I=-N+U;I<=N-D;I+=2){var C=P+I,L;I==-N||I!=N&&w[C-1]<w[C+1]?L=w[C+1]:L=w[C-1]+1;for(var G=L-I;L<S&&G<E&&m.charAt(L)==x.charAt(G);)L++,G++;if(w[C]=L,L>S)D+=2;else if(G>E)U+=2;else if(B){var $=P+k-I;if($>=0&&$<A&&O[$]!=-1){var M=S-O[$];if(L>=M)return c(m,x,L,G)}}}for(var F=-N+z;F<=N-j;F+=2){var $=P+F,M;F==-N||F!=N&&O[$-1]<O[$+1]?M=O[$+1]:M=O[$-1]+1;for(var H=M-F;M<S&&H<E&&m.charAt(S-M-1)==x.charAt(E-H-1);)M++,H++;if(O[$]=M,M>S)j+=2;else if(H>E)z+=2;else if(!B){var C=P+k-F;if(C>=0&&C<A&&w[C]!=-1){var L=w[C],G=P+L-C;if(M=S-M,L>=M)return c(m,x,L,G)}}}}return[[i,m],[s,x]]}function c(m,x,S,E){var T=m.substring(0,S),P=x.substring(0,E),A=m.substring(S),w=x.substring(E),O=a(T,P),R=a(A,w);return O.concat(R)}function f(m,x){if(!m||!x||m.charAt(0)!=x.charAt(0))return 0;for(var S=0,E=Math.min(m.length,x.length),T=E,P=0;S<T;)m.substring(P,T)==x.substring(P,T)?(S=T,P=S):E=T,T=Math.floor((E-S)/2+S);return T}function u(m,x){if(!m||!x||m.charAt(m.length-1)!=x.charAt(x.length-1))return 0;for(var S=0,E=Math.min(m.length,x.length),T=E,P=0;S<T;)m.substring(m.length-T,m.length-P)==x.substring(x.length-T,x.length-P)?(S=T,P=S):E=T,T=Math.floor((E-S)/2+S);return T}function d(m,x){var S=m.length>x.length?m:x,E=m.length>x.length?x:m;if(S.length<4||E.length*2<S.length)return null;function T(D,z,j){for(var N=D.substring(j,j+Math.floor(D.length/4)),I=-1,C="",L,G,$,M;(I=z.indexOf(N,I+1))!=-1;){var F=f(D.substring(j),z.substring(I)),H=u(D.substring(0,j),z.substring(0,I));C.length<H+F&&(C=z.substring(I-H,I)+z.substring(I,I+F),L=D.substring(0,j-H),G=D.substring(j+F),$=z.substring(0,I-H),M=z.substring(I+F))}return C.length*2>=D.length?[L,G,$,M,C]:null}var P=T(S,E,Math.ceil(S.length/4)),A=T(S,E,Math.ceil(S.length/2)),w;if(!P&&!A)return null;A?P?w=P[4].length>A[4].length?P:A:w=A:w=P;var O,R,k,B;m.length>x.length?(O=w[0],R=w[1],k=w[2],B=w[3]):(k=w[0],B=w[1],O=w[2],R=w[3]);var U=w[4];return[O,R,k,B,U]}function p(m){m.push([o,""]);for(var x=0,S=0,E=0,T="",P="",A;x<m.length;)switch(m[x][0]){case s:E++,P+=m[x][1],x++;break;case i:S++,T+=m[x][1],x++;break;case o:S+E>1?(S!==0&&E!==0&&(A=f(P,T),A!==0&&(x-S-E>0&&m[x-S-E-1][0]==o?m[x-S-E-1][1]+=P.substring(0,A):(m.splice(0,0,[o,P.substring(0,A)]),x++),P=P.substring(A),T=T.substring(A)),A=u(P,T),A!==0&&(m[x][1]=P.substring(P.length-A)+m[x][1],P=P.substring(0,P.length-A),T=T.substring(0,T.length-A))),S===0?m.splice(x-E,S+E,[s,P]):E===0?m.splice(x-S,S+E,[i,T]):m.splice(x-S-E,S+E,[i,T],[s,P]),x=x-S-E+(S?1:0)+(E?1:0)+1):x!==0&&m[x-1][0]==o?(m[x-1][1]+=m[x][1],m.splice(x,1)):x++,E=0,S=0,T="",P="";break}m[m.length-1][1]===""&&m.pop();var w=!1;for(x=1;x<m.length-1;)m[x-1][0]==o&&m[x+1][0]==o&&(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),w=!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),w=!0)),x++;w&&p(m)}var v=a;v.INSERT=s,v.DELETE=i,v.EQUAL=o,r.exports=v;function g(m,x){if(x===0)return[o,m];for(var S=0,E=0;E<m.length;E++){var T=m[E];if(T[0]===i||T[0]===o){var P=S+T[1].length;if(x===P)return[E+1,m];if(x<P){m=m.slice();var A=x-S,w=[T[0],T[1].slice(0,A)],O=[T[0],T[1].slice(A)];return m.splice(E,1,w,O),[E+1,m]}else S=P}}throw new Error("cursor_pos is out of bounds!")}function y(m,x){var S=g(m,x),E=S[1],T=S[0],P=E[T],A=E[T+1];if(P==null)return m;if(P[0]!==o)return m;if(A!=null&&P[1]+A[1]===A[1]+P[1])return E.splice(T,2,A,P),_(E,T,2);if(A!=null&&A[1].indexOf(P[1])===0){E.splice(T,2,[A[0],P[1]],[0,P[1]]);var w=A[1].slice(P[1].length);return w.length>0&&E.splice(T+2,0,[A[0],w]),_(E,T,3)}else return m}function b(m){for(var x=!1,S=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<m.length;T+=1)m[T-2][0]===o&&E(m[T-2][1])&&m[T-1][0]===i&&S(m[T-1][1])&&m[T][0]===s&&S(m[T][1])&&(x=!0,m[T-1][1]=m[T-2][1].slice(-1)+m[T-1][1],m[T][1]=m[T-2][1].slice(-1)+m[T][1],m[T-2][1]=m[T-2][1].slice(0,-1));if(!x)return m;for(var P=[],T=0;T<m.length;T+=1)m[T][1].length>0&&P.push(m[T]);return P}function _(m,x,S){for(var E=x+S-1;E>=0&&E>=x-1;E--)if(E+1<m.length){var T=m[E],P=m[E+1];T[0]===P[1]&&m.splice(E,2,[T[0],T[1]+P[1]])}return m}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(s){var o=[];for(var a in s)o.push(a);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?s:o,n.supported=s;function s(a){return Object.prototype.toString.call(a)=="[object Arguments]"}n.unsupported=o;function o(a){return a&&typeof a=="object"&&typeof a.length=="number"&&Object.prototype.hasOwnProperty.call(a,"callee")&&!Object.prototype.propertyIsEnumerable.call(a,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,s="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(s=!1));function a(h,c,f){this.fn=h,this.context=c,this.once=f||!1}function l(){this._events=new o,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 a(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 a(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 o: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 o: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 o: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 o:delete this._events[f])):(this._events=new o,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},o=function(){function V(W,Q){var et=[],Y=!0,ct=!1,Z=void 0;try{for(var ot=W[Symbol.iterator](),St;!(Y=(St=ot.next()).done)&&(et.push(St.value),!(Q&&et.length===Q));Y=!0);}catch(qt){ct=!0,Z=qt}finally{try{!Y&&ot.return&&ot.return()}finally{if(ct)throw Z}}return et}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")}}(),a=function(){function V(W,Q){for(var et=0;et<Q.length;et++){var Y=Q[et];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(W,Y.key,Y)}}return function(W,Q,et){return Q&&V(W.prototype,Q),et&&V(W,et),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),E=O(S),T=i(26),P=i(38),A=i(39),w=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 k(V,W){if(!(V instanceof W))throw new TypeError("Cannot call a class as a function")}function B(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,q],[Node.ELEMENT_NODE,kt],["li",it],["b",H.bind(H,"bold")],["i",H.bind(H,"italic")],["style",rt]],N=[m.AlignAttribute,P.DirectionAttribute].reduce(function(V,W){return V[W.keyName]=W,V},{}),I=[m.AlignStyle,x.BackgroundStyle,T.ColorStyle,P.DirectionStyle,A.FontStyle,w.SizeStyle].reduce(function(V,W){return V[W.keyName]=W,V},{}),C=function(V){U(W,V);function W(Q,et){k(this,W);var Y=B(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,Q,et));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=o(ct,2),ot=Z[0],St=Z[1];!et.matchVisual&&St===ht||Y.addMatcher(ot,St)}),Y}return a(W,[{key:"addMatcher",value:function(et,Y){this.matchers.push([et,Y])}},{key:"convert",value:function(et){if(typeof et=="string")return this.container.innerHTML=et.replace(/\>\r?\n +\</g,"><"),this.convert();var Y=this.quill.getFormat(this.quill.selection.savedRange.index);if(Y[E.default.blotName]){var ct=this.container.innerText;return this.container.innerHTML="",new f.default().insert(ct,R({},E.default.blotName,Y[E.default.blotName]))}var Z=this.prepareMatching(),ot=o(Z,2),St=ot[0],qt=ot[1],_t=F(this.container,St,qt);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(et,Y){var ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof et=="string")this.quill.setContents(this.convert(et),Y),this.quill.setSelection(0,v.default.sources.SILENT);else{var Z=this.convert(Y);this.quill.updateContents(new f.default().retain(et).concat(Z),ct),this.quill.setSelection(et+Z.length(),v.default.sources.SILENT)}}},{key:"onPaste",value:function(et){var Y=this;if(!(et.defaultPrevented||!this.quill.isEnabled())){var ct=this.quill.getSelection(),Z=new f.default().retain(ct.index),ot=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=ot,Y.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var et=this,Y=[],ct=[];return this.matchers.forEach(function(Z){var ot=o(Z,2),St=ot[0],qt=ot[1];switch(St){case Node.TEXT_NODE:ct.push(qt);break;case Node.ELEMENT_NODE:Y.push(qt);break;default:[].forEach.call(et.container.querySelectorAll(St),function(_t){_t[z]=_t[z]||[],_t[z].push(qt)});break}}),[Y,ct]}}]),W}(_.default);C.DEFAULTS={matchers:[],matchVisual:!0};function L(V,W,Q){return(typeof W>"u"?"undefined":s(W))==="object"?Object.keys(W).reduce(function(et,Y){return L(et,Y,W[Y])},V):V.reduce(function(et,Y){return Y.attributes&&Y.attributes[W]?et.push(Y):et.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="",et=V.ops.length-1;et>=0&&Q.length<W.length;--et){var Y=V.ops[et];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 F(V,W,Q){return V.nodeType===V.TEXT_NODE?Q.reduce(function(et,Y){return Y(V,et)},new f.default):V.nodeType===V.ELEMENT_NODE?[].reduce.call(V.childNodes||[],function(et,Y){var ct=F(Y,W,Q);return Y.nodeType===V.ELEMENT_NODE&&(ct=W.reduce(function(Z,ot){return ot(Y,Z)},ct),ct=(Y[z]||[]).reduce(function(Z,ot){return ot(Y,Z)},ct)),et.concat(ct)},new f.default):new f.default}function H(V,W,Q){return L(Q,V,!0)}function q(V,W){var Q=d.default.Attributor.Attribute.keys(V),et=d.default.Attributor.Class.keys(V),Y=d.default.Attributor.Style.keys(V),ct={};return Q.concat(et).concat(Y).forEach(function(Z){var ot=d.default.query(Z,d.default.Scope.ATTRIBUTE);ot!=null&&(ct[ot.attrName]=ot.value(V),ct[ot.attrName])||(ot=N[Z],ot!=null&&(ot.attrName===Z||ot.keyName===Z)&&(ct[ot.attrName]=ot.value(V)||void 0),ot=I[Z],ot!=null&&(ot.attrName===Z||ot.keyName===Z)&&(ot=I[Z],ct[ot.attrName]=ot.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 et={},Y=Q.value(V);Y!=null&&(et[Q.blotName]=Y,W=new f.default().insert(et,Q.formats(V)))}else typeof Q.formats=="function"&&(W=L(W,Q.blotName,Q.formats(V)));return W}function K(V,W){return $(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,`
584
+ `),W}function rt(){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 et=-1,Y=V.parentNode;!Y.classList.contains("ql-clipboard");)(d.default.query(Y)||{}).blotName==="list"&&(et+=1),Y=Y.parentNode;return et<=0?W:W.compose(new f.default().retain(W.length()-1).retain(1,{indent:et}))}function lt(V,W){return $(W,`
586
586
  `)||(M(V)||W.length()>0&&V.nextSibling&&M(V.nextSibling))&&W.insert(`
587
587
  `),W}function ht(V,W){if(M(V)&&V.nextElementSibling!=null&&!$(W,`
588
588
 
589
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"})});
590
+ `)}return W}function kt(V,W){var Q={},et=V.style||{};return et.fontStyle&&G(V).fontStyle==="italic"&&(Q.italic=!0),et.fontWeight&&(G(V).fontWeight.startsWith("bold")||parseInt(G(V).fontWeight)>=700)&&(Q.bold=!0),Object.keys(Q).length>0&&(W=L(W,Q)),parseFloat(et.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 et=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,et.bind(et,!0)),(V.previousSibling==null&&M(V.parentNode)||V.previousSibling!=null&&M(V.previousSibling))&&(Q=Q.replace(/^\s+/,et.bind(et,!1))),(V.nextSibling==null&&M(V.parentNode)||V.nextSibling!=null&&M(V.nextSibling))&&(Q=Q.replace(/\s+$/,et.bind(et,!1)))}return W.insert(Q)}n.default=C,n.matchAttributor=q,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}}(),o=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)}},a=i(6),l=h(a);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){o(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 o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),v}(l.default);d.blotName="bold",d.tagName=["STRONG","B"],n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var s=function(){function w(O,R){var k=[],B=!0,U=!1,D=void 0;try{for(var z=O[Symbol.iterator](),j;!(B=(j=z.next()).done)&&(k.push(j.value),!(R&&k.length===R));B=!0);}catch(N){U=!0,D=N}finally{try{!B&&z.return&&z.return()}finally{if(U)throw D}}return k}return function(O,R){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return w(O,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function w(O,R){for(var k=0;k<R.length;k++){var B=R[k];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(O,B.key,B)}}return function(O,R,k){return R&&w(O.prototype,R),k&&w(O,k),O}}(),a=i(2),l=y(a),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(w){return w&&w.__esModule?w:{default:w}}function b(w,O,R){return O in w?Object.defineProperty(w,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[O]=R,w}function _(w,O){if(!(w instanceof O))throw new TypeError("Cannot call a class as a function")}function m(w,O){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:w}function x(w,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);w.prototype=Object.create(O&&O.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(w,O):w.__proto__=O)}var S=(0,p.default)("quill:toolbar"),E=function(w){x(O,w);function O(R,k){_(this,O);var B=m(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,k));if(Array.isArray(B.options.container)){var U=document.createElement("div");P(U,B.options.container),R.container.parentNode.insertBefore(U,R.container),B.container=U}else typeof B.options.container=="string"?B.container=document.querySelector(B.options.container):B.container=B.options.container;if(!(B.container instanceof HTMLElement)){var D;return D=S.error("Container required for toolbar",B.options),m(B,D)}return B.container.classList.add("ql-toolbar"),B.controls=[],B.handlers={},Object.keys(B.options.handlers).forEach(function(z){B.addHandler(z,B.options.handlers[z])}),[].forEach.call(B.container.querySelectorAll("button, select"),function(z){B.attach(z)}),B.quill.on(u.default.events.EDITOR_CHANGE,function(z,j){z===u.default.events.SELECTION_CHANGE&&B.update(j)}),B.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var z=B.quill.selection.getRange(),j=s(z,1),N=j[0];B.update(N)}),B}return o(O,[{key:"addHandler",value:function(k,B){this.handlers[k]=B}},{key:"attach",value:function(k){var B=this,U=[].find.call(k.classList,function(z){return z.indexOf("ql-")===0});if(U){if(U=U.slice(3),k.tagName==="BUTTON"&&k.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,k);return}if(c.default.query(U)==null){S.warn("ignoring attaching to nonexistent format",U,k);return}}var D=k.tagName==="SELECT"?"change":"click";k.addEventListener(D,function(z){var j=void 0;if(k.tagName==="SELECT"){if(k.selectedIndex<0)return;var N=k.options[k.selectedIndex];N.hasAttribute("selected")?j=!1:j=N.value||!1}else k.classList.contains("ql-active")?j=!1:j=k.value||!k.hasAttribute("value"),z.preventDefault();B.quill.focus();var I=B.quill.selection.getRange(),C=s(I,1),L=C[0];if(B.handlers[U]!=null)B.handlers[U].call(B,j);else if(c.default.query(U).prototype instanceof c.default.Embed){if(j=prompt("Enter "+U),!j)return;B.quill.updateContents(new l.default().retain(L.index).delete(L.length).insert(b({},U,j)),u.default.sources.USER)}else B.quill.format(U,j,u.default.sources.USER);B.update(L)}),this.controls.push([U,k])}}},{key:"update",value:function(k){var B=k==null?{}:this.quill.getFormat(k);this.controls.forEach(function(U){var D=s(U,2),z=D[0],j=D[1];if(j.tagName==="SELECT"){var N=void 0;if(k==null)N=null;else if(B[z]==null)N=j.querySelector("option[selected]");else if(!Array.isArray(B[z])){var I=B[z];typeof I=="string"&&(I=I.replace(/\"/g,'\\"')),N=j.querySelector('option[value="'+I+'"]')}N==null?(j.value="",j.selectedIndex=-1):N.selected=!0}else if(k==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var C=B[z]===j.getAttribute("value")||B[z]!=null&&B[z].toString()===j.getAttribute("value")||B[z]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",C)}else j.classList.toggle("ql-active",B[z]!=null)})}}]),O}(g.default);E.DEFAULTS={};function T(w,O,R){var k=document.createElement("button");k.setAttribute("type","button"),k.classList.add("ql-"+O),R!=null&&(k.value=R),w.appendChild(k)}function P(w,O){Array.isArray(O[0])||(O=[O]),O.forEach(function(R){var k=document.createElement("span");k.classList.add("ql-formats"),R.forEach(function(B){if(typeof B=="string")T(k,B);else{var U=Object.keys(B)[0],D=B[U];Array.isArray(D)?A(k,U,D):T(k,U,D)}}),w.appendChild(k)})}function A(w,O,R){var k=document.createElement("select");k.classList.add("ql-"+O),R.forEach(function(B){var U=document.createElement("option");B!==!1?U.setAttribute("value",B):U.setAttribute("selected","selected"),k.appendChild(U)}),w.appendChild(k)}E.DEFAULTS={container:null,handlers:{clean:function(){var O=this,R=this.quill.getSelection();if(R!=null)if(R.length==0){var k=this.quill.getFormat();Object.keys(k).forEach(function(B){c.default.query(B,c.default.Scope.INLINE)!=null&&O.quill.format(B,!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(),k=this.quill.getFormat(R),B=parseInt(k.indent||0);if(O==="+1"||O==="-1"){var U=O==="+1"?1:-1;k.direction==="rtl"&&(U*=-1),this.quill.format("indent",B+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(),k=this.quill.getFormat(R);O==="check"?k.list==="checked"||k.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=E,n.addControls=P},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}}(),o=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)}},a=i(28),l=h(a);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=o(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){o(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}}(),o=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)}},a=i(28),l=h(a);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){o(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 o(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}var a=function(){function l(h,c){var f=this;o(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=a},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function A(w,O){var R=[],k=!0,B=!1,U=void 0;try{for(var D=w[Symbol.iterator](),z;!(k=(z=D.next()).done)&&(R.push(z.value),!(O&&R.length===O));k=!0);}catch(j){B=!0,U=j}finally{try{!k&&D.return&&D.return()}finally{if(B)throw U}}return R}return function(w,O){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return A(w,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function A(w,O,R){w===null&&(w=Function.prototype);var k=Object.getOwnPropertyDescriptor(w,O);if(k===void 0){var B=Object.getPrototypeOf(w);return B===null?void 0:A(B,O,R)}else{if("value"in k)return k.value;var U=k.get;return U===void 0?void 0:U.call(R)}},a=function(){function A(w,O){for(var R=0;R<O.length;R++){var k=O[R];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(w,k.key,k)}}return function(w,O,R){return O&&A(w.prototype,O),R&&A(w,R),w}}(),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,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 S(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){S(w,A);function w(O,R){m(this,w),R.modules.toolbar!=null&&R.modules.toolbar.container==null&&(R.modules.toolbar.container=E);var k=x(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,O,R));return k.quill.container.classList.add("ql-snow"),k}return a(w,[{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 P(this.quill,this.options.bounds),R.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(k,B){R.handlers.link.call(R,!B.format.link)})}}]),w}(d.default);T.DEFAULTS=(0,h.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(w){if(w){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 k=this.quill.theme.tooltip;k.edit("link",R)}else this.quill.format("link",!1)}}}}});var P=function(A){S(w,A);function w(O,R){m(this,w);var k=x(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,O,R));return k.preview=k.root.querySelector("a.ql-preview"),k}return a(w,[{key:"listen",value:function(){var R=this;o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(k){R.root.classList.contains("ql-editing")?R.save():R.edit("link",R.preview.textContent),k.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(k){if(R.linkRange!=null){var B=R.linkRange;R.restoreFocus(),R.quill.formatText(B,"link",!1,f.default.sources.USER),delete R.linkRange}k.preventDefault(),R.hide()}),this.quill.on(f.default.events.SELECTION_CHANGE,function(k,B,U){if(k!=null){if(k.length===0&&U===f.default.sources.USER){var D=R.quill.scroll.descendant(v.default,k.index),z=s(D,2),j=z[0],N=z[1];if(j!=null){R.linkRange=new g.Range(k.index-N,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(){o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),w}(u.BaseTooltip);P.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),o=Y(s),a=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),E=Y(S),T=i(27),P=Y(T),A=i(69),w=Y(A),O=i(70),R=Y(O),k=i(71),B=Y(k),U=i(72),D=Y(U),z=i(73),j=Y(z),N=i(13),I=Y(N),C=i(74),L=Y(C),G=i(75),$=Y(G),M=i(57),F=Y(M),H=i(41),q=Y(H),X=i(28),K=Y(X),rt=i(59),it=Y(rt),lt=i(60),ht=Y(lt),kt=i(61),It=Y(kt),V=i(108),W=Y(V),Q=i(62),et=Y(Q);function Y(ct){return ct&&ct.__esModule?ct:{default:ct}}o.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":a.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":a.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),o.default.register({"formats/align":a.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":N.Code,"formats/italic":E.default,"formats/link":P.default,"formats/script":w.default,"formats/strike":R.default,"formats/underline":B.default,"formats/image":D.default,"formats/video":j.default,"formats/list/item":p.ListItem,"modules/formula":L.default,"modules/syntax":$.default,"modules/toolbar":F.default,"themes/bubble":W.default,"themes/snow":et.default,"ui/icons":q.default,"ui/picker":K.default,"ui/icon-picker":ht.default,"ui/color-picker":it.default,"ui/tooltip":It.default},!0),n.default=o.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}}(),o=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)}},a=i(0),l=h(a);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):o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"add",this).call(this,b,_)}},{key:"canAdd",value:function(b,_){return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,b,_)||o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,b,parseInt(_))}},{key:"value",value:function(b){return parseInt(o(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),o=a(s);function a(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}(o.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}}(),o=i(4),a=l(o);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}(a.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 E=0;E<S.length;E++){var T=S[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(x,T.key,T)}}return function(x,S,E){return S&&m(x.prototype,S),E&&m(x,E),x}}(),o=function m(x,S,E){x===null&&(x=Function.prototype);var T=Object.getOwnPropertyDescriptor(x,S);if(T===void 0){var P=Object.getPrototypeOf(x);return P===null?void 0:m(P,S,E)}else{if("value"in T)return T.value;var A=T.get;return A===void 0?void 0:A.call(E)}},a=i(0),l=d(a),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(E,T){E===_.blotName&&!T?this.replaceWith(l.default.create(this.statics.scope)):o(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():o(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(),o(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:o(x.__proto__||Object.getPrototypeOf(x),"formats",this).call(this,E)}}]),x}(c.default);b.blotName="list-item",b.tagName="LI";var _=function(m){y(x,m),s(x,null,[{key:"create",value:function(E){var T=E==="ordered"?"OL":"UL",P=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,T);return(E==="checked"||E==="unchecked")&&P.setAttribute("data-checked",E==="checked"),P}},{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(S){v(this,x);var E=g(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,S)),T=function(A){if(A.target.parentNode===S){var w=E.statics.formats(S),O=l.default.find(A.target);w==="checked"?O.format("list","unchecked"):w==="unchecked"&&O.format("list","checked")}};return S.addEventListener("touchstart",T),S.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 b)o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,E,T);else{var P=T==null?this.length():T.offset(this),A=this.split(P);A.parent.insertBefore(E,A)}}},{key:"optimize",value:function(E){o(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)}o(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=[b],n.ListItem=b,n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(56),o=a(s);function a(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}(o.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}}(),o=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)}},a=i(6),l=h(a);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"):o(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),o=a(s);function a(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}(o.default);f.blotName="strike",f.tagName="S",n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),o=a(s);function a(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}(o.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}}(),o=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(_)}},a=i(0),l=c(a),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(_):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,_,m)}}],[{key:"create",value:function(_){var m=o(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}}(),o=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(_)}},a=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(_):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,_,m)}}],[{key:"create",value:function(_){var m=o(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}(a.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 E=x[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(m,E.key,E)}}return function(m,x,S){return x&&_(m.prototype,x),S&&_(m,S),m}}(),o=function _(m,x,S){m===null&&(m=Function.prototype);var E=Object.getOwnPropertyDescriptor(m,x);if(E===void 0){var T=Object.getPrototypeOf(m);return T===null?void 0:_(T,x,S)}else{if("value"in E)return E.value;var P=E.get;return P===void 0?void 0:P.call(S)}},a=i(35),l=d(a),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 E=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,S);return typeof S=="string"&&(window.katex.render(S,E,{throwOnError:!1,errorColor:"#f00"}),E.setAttribute("data-value",S)),E}},{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(E,T){for(var P=0;P<T.length;P++){var A=T[P];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}return function(E,T,P){return T&&S(E.prototype,T),P&&S(E,P),E}}(),o=function S(E,T,P){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:S(w,T,P)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(P)}},a=i(0),l=v(a),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,E){if(!(S instanceof E))throw new TypeError("Cannot call a class as a function")}function y(S,E){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:S}function b(S,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);S.prototype=Object.create(E&&E.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(S,E):S.__proto__=E)}var _=function(S){b(E,S);function E(){return g(this,E),y(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return s(E,[{key:"replaceWith",value:function(P){this.domNode.textContent=this.domNode.textContent,this.attach(),o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"replaceWith",this).call(this,P)}},{key:"highlight",value:function(P){var A=this.domNode.textContent;this.cachedText!==A&&((A.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=P(A),this.domNode.normalize(),this.attach()),this.cachedText=A)}}]),E}(p.default);_.className="ql-syntax";var m=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),x=function(S){b(E,S),s(E,null,[{key:"register",value:function(){c.default.register(m,!0),c.default.register(_,!0)}}]);function E(T,P){g(this,E);var A=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,T,P));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 P=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(P.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(S){var E=window.hljs.highlightAuto(S);return E.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 E(T,P,A){T===null&&(T=Function.prototype);var w=Object.getOwnPropertyDescriptor(T,P);if(w===void 0){var O=Object.getPrototypeOf(T);return O===null?void 0:E(O,P,A)}else{if("value"in w)return w.value;var R=w.get;return R===void 0?void 0:R.call(A)}},o=function(){function E(T,P){for(var A=0;A<P.length;A++){var w=P[A];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}return function(T,P,A){return P&&E(T.prototype,P),A&&E(T,A),T}}(),a=i(3),l=g(a),h=i(8),c=g(h),f=i(43),u=g(f),d=i(15),p=i(41),v=g(p);function g(E){return E&&E.__esModule?E:{default:E}}function y(E,T){if(!(E instanceof T))throw new TypeError("Cannot call a class as a function")}function b(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 m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],x=function(E){_(T,E);function T(P,A){y(this,T),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=m);var w=b(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,P,A));return w.quill.container.classList.add("ql-bubble"),w}return o(T,[{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)}}]),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 S=function(E){_(T,E);function T(P,A){y(this,T);var w=b(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,P,A));return w.quill.on(c.default.events.EDITOR_CHANGE,function(O,R,k,B){if(O===c.default.events.SELECTION_CHANGE)if(R!=null&&R.length>0&&B===c.default.sources.USER){w.show(),w.root.style.left="0px",w.root.style.width="",w.root.style.width=w.root.offsetWidth+"px";var U=w.quill.getLines(R.index,R.length);if(U.length===1)w.position(w.quill.getBounds(R));else{var D=U[U.length-1],z=w.quill.getIndex(D),j=Math.min(D.length()-1,R.index+R.length-z),N=w.quill.getBounds(new d.Range(z,j));w.position(N)}}else document.activeElement!==w.textbox&&w.quill.hasFocus()&&w.hide()}),w}return o(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),O=this.root.querySelector(".ql-tooltip-arrow");if(O.style.marginLeft="",w===0)return w;O.style.marginLeft=-1*w-O.offsetWidth/2+"px"}}]),T}(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})})(qh);var Ww=qh.exports;const Yw=hr(Ww),aA="",Kw=e=>{const[t,r]=tt.useState(!1);console.log("allProps",e);const n=tt.useRef(null),i=tt.useRef(null),s=tt.useRef(null),o=tt.useRef(null),a=tt.useRef(16),l=tt.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:E,rotation:T=1,fontFamily:P="Arial",fontWeight:A="normal",fontStyle:w="normal",fontSize:O=16,fill:R="black",stroke:k,strokeThickness:B,blurRadius:U=0,blurEnabled:D=!1,dropShadowColor:z=null,wordWrapWidth:j=5e7,leading:N=0,letterSpacing:I}=u;at.useEffect(()=>{a.current=Number(O)},[O]);const C=["italic","oblique"].includes(w)?w:void 0,L=["bold","lighter","100","200","300"].includes(A)?A:void 0,G=Number(I)>0?I:void 0,$=at.useMemo(()=>new ne.TextStyle({fontFamily:P,fontSize:O,fill:R||"white",stroke:k,strokeThickness:B,...C&&{fontStyle:C},...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:N||0}),[D,U,R,P,O,N,C,L,G,z,k,B,j]);at.useEffect(()=>{l.current={...u}},[u]);const M=F=>{d&&d({text:F,uniqueId:h,droptype:"titles"})};return at.useEffect(()=>{if(t&&s.current){let H=document.getElementById("note-editor");if(H){H.style.position="absolute",H.style.zIndex="10",H.style.left=S+"px",H.style.top=E+"px",H.style.backgroundColor="var(--chakra-color-darkShark)",H.style.transform="scale(1.5)",H.style.width="300px",H.style.height="100px",H.style.color="#fff",H.style.fontSize="20px",H.style.border="1px solid #CBCEE0";const q={esc:{key:27,handler:function(){r(!1)}},enter:{key:13,handler:function(){r(!1)}}};var F=new Yw("#note-editor",{modules:{toolbar:!1,keyboard:{bindings:{...q}}},placeholder:"Compose your text here...",theme:"snow"});F.on("text-change",function(){M(F.root.innerText)}),F.setText(c),F.focus(),F.off("text-change",()=>{console.log("removed")}),F.hasFocus()||(H.style.display="none")}}},[S,E,t]),dt.jsx(No,{...e,children:dt.jsxs(yt.Container,{ref:n,children:[t&&dt.jsx(yt.Container,{ref:s}),dt.jsx(yt.Container,{alpha:t?0:1,ref:o,children:dt.jsx(yt.Text,{style:$,x:S,y:E,rotation:T,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})})]})})},Zw=yt.withFilters(yt.Container,{blur:ne.filters.BlurFilter,adjust:no,matrix:ne.filters.ColorMatrixFilter}),Qw=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Jw={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1},tA=e=>{const[t,r]=at.useState(!1),[,n]=tt.useState(!1),[,i]=at.useState({isWaiting:!1,isStalled:!1}),[s,o]=at.useState(),[a,l]=tt.useState(!1),h=tt.useRef(null),c=tt.useRef(null),f=tt.useRef(null),u=tt.useRef(null),d=tt.useRef(null),p=tt.useRef(null),v=tt.useRef(Jw),{tl:g,playerTimeRef:y,isDragging:b}=tt.useContext(Dr),{uniqueId:_,mute:m=!1,locked:x=!1,src:S,startAt:E,endAt:T,frameStartAt:P,frameEndAt:A,initialAlpha:w,transformation:{x:O,y:R,width:k,height:B,scale:U,rotation:D,animation:z,colorCorrection:j,effect:N},pointerdown:I,pointerup:C,mousedown:L,mouseup:G,pointerover:$,mouseover:M,mouseout:F,applyTransformer:H,onAnchorTransformationEnd:q}=e,X=S||"",{contrast:K=1,saturation:rt=1,exposure:it=1,blurRadius:lt=0,alpha:ht=1}=j||{},kt={brightness:it,contrast:K,saturation:rt,alpha:ht},It=at.useCallback(()=>{l(!0)},[]),V=at.useCallback(Z=>{console.log("changeEnd",Z),q&&(console.log("running onAnchorTransformationEnd"),q(Z))},[]),W=at.useMemo(()=>{const Z=document.createElement("video");return Z.src=S,Z.crossOrigin="Anonymus",Z.autoplay=!1,Z.currentTime=1e-4,Z},[S]);pn($e.PAUSE,Z=>{if(console.log("pause event",Z),p.current){const ot=p.current;ot.currentTime>0&&!ot.paused&&!ot.ended&&ot.readyState>ot.HAVE_CURRENT_DATA&&p.current.pause(),v.current.isPlaying=!1}}),at.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<=T&&!b&&(p.current.currentTime=Number(P)||Number(Z),p.current.play(),v.current.isPlaying=!0))},et=()=>{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,ot=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||(ot||p.current.play(),v.current.isPlaying=!0)}};return tt.useEffect(()=>{let Z=ve.context(()=>{});if(c.current&&g.current){const ot={duration:Number(T)-Number(E),onStart:Q,onComplete:et,onStartParams:[E],onCompleteParams:[],onInterrupt:Y,onUpdate:ct,onUpdateParams:[]},St=bo(z||"None");Z=ve.context(()=>{var qt,_t;ee(St.from)?ee(St.to)?ee(St.fromTo)?g.current.to(c.current,{alpha:1,duration:.01},E).from(u.current,{...ot},E).to(c.current,{alpha:0,duration:.1},Number(T)-.1):g.current.fromTo(c.current,(qt=St.fromTo)==null?void 0:qt.from,(_t=St.fromTo)==null?void 0:_t.to,E).from(u.current,{...ot},E).to(c.current,{alpha:0,duration:.2},T-.2):g.current.to(c.current,{alpha:1,duration:.2,...St.to},E).from(u.current,{...ot},E).to(c.current,{alpha:0,duration:.2},T-.2):g.current.from(c.current,{...St.from},E).to(u.current,{alpha:1,duration:.2},E).from(u.current,{...ot},E).to(c.current,{alpha:0,duration:.2},T-.2)})}return()=>Z.revert()},[z,E,T]),at.useEffect(()=>{c.current&&r(!0)},[]),at.useEffect(()=>{p.current&&(p.current.muted=m)},[m]),at.useEffect(()=>{if(p.current){const Z=p.current;Z.currentTime>0&&!Z.paused&&!Z.ended&&Z.readyState>Z.HAVE_CURRENT_DATA&&(a||b)&&(p.current.pause(),v.current.isPlaying=!1)}},[a,b]),at.useEffect(()=>{const Z=Math.round((Number(P)+Number.EPSILON)*100)/100,ot=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})},qt=function(){p.current&&p.current.pause(),i({isWaiting:!0,isStalled:!1})},_t=function(){i({isWaiting:!1,isStalled:!1})},Tt=function(){i({isWaiting:!1,isStalled:!0})},wt=Math.round((Number(P)+Number.EPSILON)*100)/100,Ft=Math.round((Number(A)+Number.EPSILON)*100)/100,ye=`${X}#t=${wt},${Ft}`;return console.log("urlTimestap",ye),ne.Texture.fromLoader(W,ye,_,{pixiIdPrefix:_,resourceOptions:{autoPlay:!1,crossorigin:"Anonymus",updateFPS:30}}).then(zt=>{zt&&(o(zt),console.log(zt.baseTexture.resource.source),p.current=zt.baseTexture.resource.source,p.current.id=_,p.current.addEventListener("loadedmetadata",ot),p.current.addEventListener("ended",St),p.current.addEventListener("loadstart",qt),p.current.addEventListener("canplaythrough",_t),p.current.addEventListener("stalled",Tt))}),()=>{p.current.removeEventListener("loadedmetadata",ot),p.current.removeEventListener("ended",St),p.current.removeEventListener("loadstart",qt),p.current.removeEventListener("canplaythrough",_t),p.current.removeEventListener("stalled",Tt)}},[X,_,P,A,W]),dt.jsxs(yt.Container,{ref:f,children:[dt.jsx(yt.Container,{ref:c,alpha:w,position:[O,R],pivot:[O,R],width:k,height:B,children:dt.jsx(Zw,{scale:1,blur:{blur:lt,quality:4},adjust:kt,apply:({matrix:Z})=>{N==="BlackAndWhite"?Z.desaturate():N==="Sepia"?Z.sepia():N==="RetroVintage"||N==="NightVision"?Z.negative():N==="Normal"&&Z.reset()},matrix:{enabled:!0,matrix:Qw},children:dt.jsx(yt.Container,{ref:u,children:s&&dt.jsx(yt.Sprite,{texture:s,width:k,height:B,anchor:.5,x:O,y:R,...!x&&!a&&{interactive:!0,buttonMode:!0,pointerdown:I,pointerover:$,pointerout:F,mousedown:L,mouseover:M,mouseout:F,mouseup:G,pointerup:C},ref:h,scale:U,rotation:D})})})}),H&&dt.jsx(mo,{pixiTransformerRef:d,imageRef:c,isMounted:t,transformCommit:V,transformChange:It,mouseoverEvent:n,uniqueId:_})]})};var zh=(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))(zh||{}),Vh=(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))(Vh||{});Nt.Animations=zh,Nt.BlendModes=Vh,Nt.Events=$e,Nt.GsapPixieContext=Dr,Nt.GsapPixieContextProvider=nv,Nt.PixiAnimatedSprite=Hh,Nt.PixiAudioSprite=sb,Nt.PixiGifSprite=Xw,Nt.PixiImageSprite=t0,Nt.PixiSvgPathSprite=ib,Nt.PixiTextSprite=Kw,Nt.PixiVideoSprite=tA,Nt.Transformer=Su,Object.defineProperty(Nt,Symbol.toStringTag,{value:"Module"})});