modern-canvas 0.2.5 → 0.3.0

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.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(d,Me){typeof exports=="object"&&typeof module<"u"?Me(exports):typeof define=="function"&&define.amd?define(["exports"],Me):(d=typeof globalThis<"u"?globalThis:d||self,Me(d.modernCanvas={}))})(this,function(d){"use strict";var Dp=Object.defineProperty;var Rp=(d,Me,le)=>Me in d?Dp(d,Me,{enumerable:!0,configurable:!0,writable:!0,value:le}):d[Me]=le;var u=(d,Me,le)=>Rp(d,typeof Me!="symbol"?Me+"":Me,le);var Xt,Bt;const Me=Math.PI,le=Me*2;let gl=0;function gn(n){var r;return((r=n==null?void 0:n.__SPECTOR_Object_TAG)==null?void 0:r.id)??++gl}function Zi(n){return!(n&n-1)&&!!n}const ml=/([\w-]+)\((.+?)\)/g,yl=/[^,]+/g,_l=/([-e.\d]+)(.*)/;function Ki(n){return Array.isArray(n)?n.map(r=>({name:r.name,args:r.args.map(e=>({...e,normalizedIntValue:e.normalizedDefaultIntValue}))})):{...n,normalizedIntValue:n.normalizedDefaultIntValue}}function mr(n,r,e={}){const t=yr(r,e);return t.length?t:mn(n,r,e)}function yr(n,r={}){const e=[];let t;for(;(t=ml.exec(n))!==null;){const[,i,s]=t;i&&e.push({name:i,args:vl(i,s,r)})}return e}function vl(n,r,e={}){const t=[];let i,s=0;for(;(i=yl.exec(r))!==null;)t.push(mn(n,i[0],{...e,index:s++}));return t}function mn(n,r,e={}){const{width:t=1,height:i=1,index:s=0}=e,o=r.match(_l),a={unit:(o==null?void 0:o[2])??null,value:r,intValue:Number(o==null?void 0:o[1]),normalizedIntValue:0,normalizedDefaultIntValue:0};switch(n){case"scale":case"scaleX":case"scaleY":case"scale3d":a.normalizedDefaultIntValue=1;break}switch(a.unit){case"%":a.normalizedIntValue=a.intValue/100;break;case"rad":a.normalizedIntValue=a.intValue/le;break;case"deg":a.normalizedIntValue=a.intValue/360;break;case"px":switch(s){case 0:a.normalizedIntValue=a.intValue/t;break;case 1:a.normalizedIntValue=a.intValue/i;break}break;case"turn":case"em":case"rem":default:a.normalizedIntValue=a.intValue;break}return a}const yn="WebGL2RenderingContext"in globalThis,_n="ImageBitmap"in globalThis,vn="ResizeObserver"in globalThis,Yt="PointerEvent"in globalThis,bn="WheelEvent"in globalThis,bl="MouseEvent"in globalThis,gt="ontouchstart"in globalThis,wn="onclick"in globalThis,Ji="createImageBitmap"in globalThis,Qi="AudioContext"in globalThis,es="webkitAudioContext"in globalThis,ts="OfflineAudioContext"in globalThis,xn="webkitOfflineAudioContext"in globalThis,Pn=Qi||es,_r=typeof window<"u",rs=globalThis.devicePixelRatio||1,is=n=>n!==null&&typeof n=="object"&&n.nodeType===1,Cn=n=>is(n)&&n.tagName==="VIDEO",wl=n=>is(n)&&n.tagName==="IMG";function Tn(n){return typeof n=="object"&&n!==null&&n.nodeType===1&&n.tagName==="CANVAS"}function Sn(n){return yn&&n instanceof globalThis.WebGL2RenderingContext}function En(){if(_r)return globalThis.document.createElement("canvas")}function Mn(n,r=globalThis.location){if(n.startsWith("data:"))return"";r=r||globalThis.location;const e=new URL(n,document.baseURI);return e.hostname!==r.hostname||e.port!==r.port||e.protocol!==r.protocol?"anonymous":""}function An(n,r,e){e===null&&!r.startsWith("data:")?n.crossOrigin=Mn(r):e!==!1&&(n.crossOrigin=typeof e=="string"?e:"anonymous")}class Zt{constructor(){u(this,"_map",new WeakMap)}_toRaw(r){if(r&&typeof r=="object"){const e=r.__v_raw;e&&(r=this._toRaw(e))}return r}delete(r){return this._map.delete(this._toRaw(r))}get(r){return this._map.get(this._toRaw(r))}has(r){return this._map.has(this._toRaw(r))}set(r,e){return this._map.set(this._toRaw(r),this._toRaw(e)),this}}const On=new Zt;function Qr(n){let r=On.get(n);if(!r){const e=Object.getPrototypeOf(n);r=new Map(e?Qr(e):void 0),On.set(n,r)}return r}function vr(n,r,e={}){Qr(n).set(r,e);const{default:t,alias:i}=e;let s=Object.getOwnPropertyDescriptor(n.prototype,r);if(!s){const o=i??Symbol.for(String(r));s={get(){return this[o]},set(a){this[o]=a}}}Object.defineProperty(n.prototype,r,{get(){var o;return((o=s.get)==null?void 0:o.call(this))??t},set(o){var l,h,c;const a=((l=s.get)==null?void 0:l.call(this))??t;(h=s.set)==null||h.call(this,o),(c=this.requestUpdate)==null||c.call(this,r,a,e)},configurable:!0,enumerable:!0})}function M(n){return function(r,e){vr(r.constructor,e,n)}}const ei=new Map;function j(n,r){return function(e){Object.defineProperty(e.prototype,"tag",{value:n,enumerable:!0,configurable:!0}),r&&Object.keys(r).forEach(t=>{vr(e,t,{default:r[t]})}),ei.set(n,e)}}function ue(n){return M({...n,protected:!0})}function xl(n="node",r={}){const e=ei.get(n);if(!e)throw new Error(`Failed to createNode, tag: ${n}`);return new e().setProperties(r)}class fe{static get currentTime(){return this._currentTime}static get elapsed(){return this._elapsed}static on(r,e={}){const{sort:t=0,once:i=!1}=e;this._queue[t]||(this._queue[t]=[]),this._queue[t].push({cb:r,once:i})}static off(r,e={}){const{sort:t=0}=e,i=this._queue[t];if(!i)return;const s=[];for(let o=i.length,a=0;a<o;a++){const l=i[a];l.cb!==r&&s.push(l)}s.length?this._queue[t]=s:this._queue.splice(t,1)}static start(){"requestAnimationFrame"in globalThis&&(this._currentTime=performance.now(),this._requestId=requestAnimationFrame(r=>this._update(r)))}static stop(){this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0)}static _update(r){this._elapsed=r-this._currentTime,this._currentTime=r,this._requestId=requestAnimationFrame(e=>this._update(e)),this._performUpdate()}static _performUpdate(){const r=this._queue,e=[];for(let t=r.length,i=t;i>=0;i--){const s=r[i];if(!s)continue;const o=[];for(let a=s.length,l=0;l<a;l++){const h=s[l];try{h.cb()}catch(c){console.warn(c)}h.once||o.push(h)}o.length&&(e[i]=o)}this._queue=e}}u(fe,"_queue",[]),u(fe,"_currentTime",0),u(fe,"_elapsed",0),u(fe,"_requestId"),fe.start();async function ss(n){return new Promise(r=>{fe.on(()=>{n==null||n(),r()},{sort:1,once:!0})})}let mt=class{constructor(){u(this,"eventListeners",new Map)}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(r){return this.eventListeners.has(r)}on(r,e,t){const i={value:e,options:t},s=this.eventListeners.get(r);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(r,[s,i]):this.eventListeners.set(r,i),this}once(r,e){return this.on(r,e,{once:!0})}off(r,e,t){var s,o;if(!e)return this.eventListeners.delete(r),this;const i=this.eventListeners.get(r);if(!i)return this;if(Array.isArray(i)){const a=[];for(let l=0,h=i.length;l<h;l++){const c=i[l];(c.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof c.options=="boolean"||!((s=c.options)!=null&&s.once)))&&a.push(c)}a.length?this.eventListeners.set(r,a.length===1?a[0]:a):this.eventListeners.delete(r)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(o=i.options)!=null&&o.once)&&this.eventListeners.delete(r);return this}emit(r,...e){var i,s;const t=this.eventListeners.get(r);if(t){if(Array.isArray(t))for(let o=t.length,a=0;a<o;a++){const l=t[a];typeof l.options=="object"&&((i=l.options)!=null&&i.once)&&this.off(r,l.value,l.options),l.value.apply(this,e)}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(r,t.value,t.options),t.value.apply(this,e);return!0}else return!1}},Pl=0;class ti extends mt{constructor(){super(...arguments);u(this,"instanceId",++Pl);u(this,"_defaultProperties");u(this,"_updatedProperties",new Map);u(this,"_changedProperties",new Set);u(this,"_updatingPromise",Promise.resolve());u(this,"_updating",!1)}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(e){Promise.reject(e)}await ss(),this._performUpdate()}_performUpdate(){this._updating&&(this._onUpdate(this._updatedProperties),this._updatedProperties=new Map,this._updating=!1)}_onUpdate(e){}_updateProperty(e,t,i,s){}isDirty(e){return this._updatedProperties.has(e)}getPropertyDeclarations(){return Qr(this.constructor)}getPropertyDeclaration(e){return this.getPropertyDeclarations().get(e)}getDefaultProperties(){if(!this._defaultProperties){this._defaultProperties={};for(const[e,t]of this.getPropertyDeclarations())!t.protected&&!t.alias&&(this._defaultProperties[e]=t.default)}return this._defaultProperties}getProperty(e){return this[e]}setProperty(e,t){return this[e]=t,this}getProperties(e){const t={};for(const[i,s]of this.getPropertyDeclarations())!s.protected&&!s.alias&&(!e||e.includes(i))&&(t[i]=this.getProperty(i));return t}setProperties(e){if(e)for(const[t]of this.getPropertyDeclarations())t in e&&this.setProperty(t,e[t]);return this}requestUpdate(e,t,i){if(e!==void 0){const s=this[e];if(!Object.is(s,t))this._updatedProperties.set(e,t),this._changedProperties.add(e),i??(i=this.getPropertyDeclaration(e)),this._updateProperty(e,s,t,i),this.emit("updateProperty",e,s,t,i);else return}this._updating||(this._updatingPromise=this._enqueueUpdate())}toJSON(){return this.getProperties(Array.from(this._changedProperties))}clone(){return new this.constructor(this.toJSON())}destroy(){this.removeAllListeners()}}class Un extends ti{}class ri{constructor(){u(this,"bubbles",!0);u(this,"cancelable",!1);u(this,"which");u(this,"cancelBubble",!0);u(this,"returnValue");u(this,"srcElement");u(this,"composed",!1);u(this,"currentTarget");u(this,"defaultPrevented",!1);u(this,"eventPhase",ri.prototype.NONE);u(this,"isTrusted");u(this,"target");u(this,"timeStamp");u(this,"type");u(this,"nativeEvent");u(this,"originalEvent");u(this,"propagationStopped",!1);u(this,"propagationImmediatelyStopped",!1);u(this,"path");u(this,"detail");u(this,"view");u(this,"layer",{x:0,y:0});u(this,"page",{x:0,y:0});u(this,"NONE",0);u(this,"CAPTURING_PHASE",1);u(this,"AT_TARGET",2);u(this,"BUBBLING_PHASE",3)}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}initEvent(...r){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(...r){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}composedPath(){return this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class ns extends ri{constructor(){super(...arguments);u(this,"altKey");u(this,"button");u(this,"buttons");u(this,"ctrlKey");u(this,"metaKey");u(this,"relatedTarget");u(this,"shiftKey");u(this,"client",{x:0,y:0});u(this,"movement",{x:0,y:0});u(this,"offset",{x:0,y:0});u(this,"global",{x:0,y:0});u(this,"screen",{x:0,y:0})}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}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(...e){throw new Error("Method not implemented.")}}class In extends ns{constructor(){super(...arguments);u(this,"width",0);u(this,"height",0);u(this,"isPrimary",!1);u(this,"pointerType");u(this,"pressure");u(this,"tangentialPressure");u(this,"tiltX");u(this,"tiltY");u(this,"twist")}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class br extends ns{constructor(){super(...arguments);u(this,"deltaMode");u(this,"deltaX");u(this,"deltaY");u(this,"deltaZ");u(this,"DOM_DELTA_PIXEL",0);u(this,"DOM_DELTA_LINE",1);u(this,"DOM_DELTA_PAGE",2)}}u(br,"DOM_DELTA_PIXEL",0),u(br,"DOM_DELTA_LINE",1),u(br,"DOM_DELTA_PAGE",2);const Cl={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Dn extends mt{constructor(){super(...arguments);u(this,"target");u(this,"cursor","default");u(this,"cursorStyles",{default:"inherit",pointer:"pointer"});u(this,"setuped",!1);u(this,"event");u(this,"enableMoveEvent",!0);u(this,"enableWheelEvent",!0);u(this,"enableClickEvent",!0);u(this,"onPointerDown",e=>{if(gt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerdown",this.event=this.clonePointerEvent(t[i]));this.setCursor(this.cursor)});u(this,"onPointerOver",e=>{if(!this.enableClickEvent||gt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerover",this.event=this.clonePointerEvent(t[i]))});u(this,"onPointerMove",e=>{if(!this.enableMoveEvent||gt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointermove",this.event=this.clonePointerEvent(t[i]))});u(this,"onPointerUp",e=>{if(!this.enableClickEvent||gt&&e.pointerType==="touch")return;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.target?"outside":"",s=this.normalize(e);for(let o=0,a=s.length;o<a;o++){const l=this.clonePointerEvent(s[o]);l.type+=i,this.emit("pointerup",this.event=l)}});u(this,"onWheel",e=>{if(!this.enableWheelEvent)return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("wheel",this.event=this.cloneWheelEvent(t[i]))})}setTarget(e){this.removeEventListeners(),this.target=e,this.addEventListeners()}removeEventListeners(){if(!this.setuped||!this.target)return;const e=this.target.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):Yt&&(e.touchAction=""),Yt?(this.target.removeEventListener("pointerdown",this.onPointerDown),this.target.removeEventListener("pointerleave",this.onPointerOver),this.target.removeEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.removeEventListener("pointerup",this.onPointerUp)):(this.target.removeEventListener("mousedown",this.onPointerDown),this.target.removeEventListener("mouseout",this.onPointerOver),this.target.removeEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.removeEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.removeEventListener("mouseup",this.onPointerUp)),gt&&(this.target.removeEventListener("touchstart",this.onPointerDown),this.target.removeEventListener("touchmove",this.onPointerMove),this.target.removeEventListener("touchend",this.onPointerUp)),this.target.removeEventListener("wheel",this.onWheel),this.target=void 0,this.setuped=!1}addEventListeners(){if(this.setuped||!this.target)return;const e=this.target.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):Yt&&(e.touchAction="none")),Yt?(this.target.addEventListener("pointerdown",this.onPointerDown),this.target.addEventListener("pointerleave",this.onPointerOver),this.target.addEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.addEventListener("pointerup",this.onPointerUp)):(this.target.addEventListener("mousedown",this.onPointerDown),this.target.addEventListener("mouseout",this.onPointerOver),this.target.addEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.addEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.addEventListener("mouseup",this.onPointerUp)),gt&&(this.target.addEventListener("touchstart",this.onPointerDown),this.target.addEventListener("touchmove",this.onPointerMove),this.target.addEventListener("touchend",this.onPointerUp)),this.target.addEventListener("wheel",this.onWheel),this.setuped=!0}normalize(e){const t=[];if(gt&&e instanceof globalThis.TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){const o=e.changedTouches[i];typeof o.button>"u"&&(o.button=0),typeof o.buttons>"u"&&(o.buttons=1),typeof o.isPrimary>"u"&&(o.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof o.width>"u"&&(o.width=o.radiusX||1),typeof o.height>"u"&&(o.height=o.radiusY||1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="touch"),typeof o.pointerId>"u"&&(o.pointerId=o.identifier||0),typeof o.pressure>"u"&&(o.pressure=o.force||.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),typeof o.layerX>"u"&&(o.layerX=o.offsetX=o.clientX),typeof o.layerY>"u"&&(o.layerY=o.offsetY=o.clientY),o.type=e.type,t.push(o)}else if(bn&&e instanceof globalThis.WheelEvent)t.push(e);else if(Yt&&e instanceof globalThis.PointerEvent)t.push(e);else{const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=1),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),t.push(i)}return t}cloneWheelEvent(e){const t=new br;return this.copyMouseEvent(t,e),t.wheelDeltaY=e.wheelDeltaY,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.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.nativeEvent=e,t.type=e.type,t}clonePointerEvent(e){const t=new In;return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,t.isTrusted=e.isTrusted,this.copyMouseEvent(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.type==="pointerleave"?t.type="pointerout":t.type.startsWith("mouse")?t.type=t.type.replace("mouse","pointer"):t.type.startsWith("touch")&&(t.type=Cl[t.type]||t.type),t}copyMouseEvent(e,t){e.preventDefault=t.preventDefault.bind(t),e.stopPropagation=t.stopPropagation.bind(t),e.isTrusted=t.isTrusted,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}setCursor(e){if(!this.target||(e=e||"default",this.cursor===e))return;this.cursor=e;const t=!(globalThis.OffscreenCanvas&&this.target instanceof OffscreenCanvas),i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.target.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.target.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.target.style.cursor=e)}mapPositionToPoint(e,t,i){if(!this.target)return;const s=Number(this.target.getAttribute("width"))||0,o=Number(this.target.getAttribute("height"))||0,a=Number(this.target.getAttribute("data-pixel-ratio"))||1,l=this.target.isConnected?this.target.getBoundingClientRect():{x:0,y:0,width:s,height:o,left:0,top:0},h=1/a;e.x=(t-l.left)*(s/l.width)*h,e.y=(i-l.top)*(o/l.height)*h}}class yt extends Un{}var Tl={grad:.9,turn:360,rad:360/(2*Math.PI)},_t=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},ye=function(n,r,e){return r===void 0&&(r=0),e===void 0&&(e=Math.pow(10,r)),Math.round(e*n)/e+0},Xe=function(n,r,e){return r===void 0&&(r=0),e===void 0&&(e=1),n>e?e:n>r?n:r},Rn=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},Bn=function(n){return{r:Xe(n.r,0,255),g:Xe(n.g,0,255),b:Xe(n.b,0,255),a:Xe(n.a)}},os=function(n){return{r:ye(n.r),g:ye(n.g),b:ye(n.b),a:ye(n.a,3)}},Sl=/^#([0-9a-f]{3,8})$/i,ii=function(n){var r=n.toString(16);return r.length<2?"0"+r:r},kn=function(n){var r=n.r,e=n.g,t=n.b,i=n.a,s=Math.max(r,e,t),o=s-Math.min(r,e,t),a=o?s===r?(e-t)/o:s===e?2+(t-r)/o:4+(r-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},Ln=function(n){var r=n.h,e=n.s,t=n.v,i=n.a;r=r/360*6,e/=100,t/=100;var s=Math.floor(r),o=t*(1-e),a=t*(1-(r-s)*e),l=t*(1-(1-r+s)*e),h=s%6;return{r:255*[t,a,o,o,l,t][h],g:255*[l,t,t,a,o,o][h],b:255*[o,o,l,t,t,a][h],a:i}},Nn=function(n){return{h:Rn(n.h),s:Xe(n.s,0,100),l:Xe(n.l,0,100),a:Xe(n.a)}},Fn=function(n){return{h:ye(n.h),s:ye(n.s),l:ye(n.l),a:ye(n.a,3)}},$n=function(n){return Ln((e=(r=n).s,{h:r.h,s:(e*=((t=r.l)<50?t:100-t)/100)>0?2*e/(t+e)*100:0,v:t+e,a:r.a}));var r,e,t},wr=function(n){return{h:(r=kn(n)).h,s:(i=(200-(e=r.s))*(t=r.v)/100)>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0,l:i/2,a:r.a};var r,e,t,i},El=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ml=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Al=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ol=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,as={string:[[function(n){var r=Sl.exec(n);return r?(n=r[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?ye(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?ye(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var r=Al.exec(n)||Ol.exec(n);return r?r[2]!==r[4]||r[4]!==r[6]?null:Bn({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:r[7]===void 0?1:Number(r[7])/(r[8]?100:1)}):null},"rgb"],[function(n){var r=El.exec(n)||Ml.exec(n);if(!r)return null;var e,t,i=Nn({h:(e=r[1],t=r[2],t===void 0&&(t="deg"),Number(e)*(Tl[t]||1)),s:Number(r[3]),l:Number(r[4]),a:r[5]===void 0?1:Number(r[5])/(r[6]?100:1)});return $n(i)},"hsl"]],object:[[function(n){var r=n.r,e=n.g,t=n.b,i=n.a,s=i===void 0?1:i;return _t(r)&&_t(e)&&_t(t)?Bn({r:Number(r),g:Number(e),b:Number(t),a:Number(s)}):null},"rgb"],[function(n){var r=n.h,e=n.s,t=n.l,i=n.a,s=i===void 0?1:i;if(!_t(r)||!_t(e)||!_t(t))return null;var o=Nn({h:Number(r),s:Number(e),l:Number(t),a:Number(s)});return $n(o)},"hsl"],[function(n){var r=n.h,e=n.s,t=n.v,i=n.a,s=i===void 0?1:i;if(!_t(r)||!_t(e)||!_t(t))return null;var o=function(a){return{h:Rn(a.h),s:Xe(a.s,0,100),v:Xe(a.v,0,100),a:Xe(a.a)}}({h:Number(r),s:Number(e),v:Number(t),a:Number(s)});return Ln(o)},"hsv"]]},zn=function(n,r){for(var e=0;e<r.length;e++){var t=r[e][0](n);if(t)return[t,r[e][1]]}return[null,void 0]},Ul=function(n){return typeof n=="string"?zn(n.trim(),as.string):typeof n=="object"&&n!==null?zn(n,as.object):[null,void 0]},ls=function(n,r){var e=wr(n);return{h:e.h,s:Xe(e.s+100*r,0,100),l:e.l,a:e.a}},hs=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},Vn=function(n,r){var e=wr(n);return{h:e.h,s:e.s,l:Xe(e.l+100*r,0,100),a:e.a}},cs=function(){function n(r){this.parsed=Ul(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return ye(hs(this.rgba),2)},n.prototype.isDark=function(){return hs(this.rgba)<.5},n.prototype.isLight=function(){return hs(this.rgba)>=.5},n.prototype.toHex=function(){return r=os(this.rgba),e=r.r,t=r.g,i=r.b,o=(s=r.a)<1?ii(ye(255*s)):"","#"+ii(e)+ii(t)+ii(i)+o;var r,e,t,i,s,o},n.prototype.toRgb=function(){return os(this.rgba)},n.prototype.toRgbString=function(){return r=os(this.rgba),e=r.r,t=r.g,i=r.b,(s=r.a)<1?"rgba("+e+", "+t+", "+i+", "+s+")":"rgb("+e+", "+t+", "+i+")";var r,e,t,i,s},n.prototype.toHsl=function(){return Fn(wr(this.rgba))},n.prototype.toHslString=function(){return r=Fn(wr(this.rgba)),e=r.h,t=r.s,i=r.l,(s=r.a)<1?"hsla("+e+", "+t+"%, "+i+"%, "+s+")":"hsl("+e+", "+t+"%, "+i+"%)";var r,e,t,i,s},n.prototype.toHsv=function(){return r=kn(this.rgba),{h:ye(r.h),s:ye(r.s),v:ye(r.v),a:ye(r.a,3)};var r},n.prototype.invert=function(){return nt({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},n.prototype.saturate=function(r){return r===void 0&&(r=.1),nt(ls(this.rgba,r))},n.prototype.desaturate=function(r){return r===void 0&&(r=.1),nt(ls(this.rgba,-r))},n.prototype.grayscale=function(){return nt(ls(this.rgba,-1))},n.prototype.lighten=function(r){return r===void 0&&(r=.1),nt(Vn(this.rgba,r))},n.prototype.darken=function(r){return r===void 0&&(r=.1),nt(Vn(this.rgba,-r))},n.prototype.rotate=function(r){return r===void 0&&(r=15),this.hue(this.hue()+r)},n.prototype.alpha=function(r){return typeof r=="number"?nt({r:(e=this.rgba).r,g:e.g,b:e.b,a:r}):ye(this.rgba.a,3);var e},n.prototype.hue=function(r){var e=wr(this.rgba);return typeof r=="number"?nt({h:r,s:e.s,l:e.l,a:e.a}):ye(e.h)},n.prototype.isEqual=function(r){return this.toHex()===nt(r).toHex()},n}(),nt=function(n){return n instanceof cs?n:new cs(n)},jn=[],Il=function(n){n.forEach(function(r){jn.indexOf(r)<0&&(r(cs,as),jn.push(r))})};function Dl(n,r){var e={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"},t={};for(var i in e)t[e[i]]=i;var s={};n.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,h=t[this.toHex()];if(h)return h;if(o!=null&&o.closest){var c=this.toRgb(),f=1/0,p="black";if(!s.length)for(var m in e)s[m]=new n(e[m]).toRgb();for(var g in e){var _=(a=c,l=s[g],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));_<f&&(f=_,p=g)}return p}},r.string.push([function(o){var a=o.toLowerCase(),l=a==="transparent"?"#0000":e[a];return l?new n(l).toRgb():null},"name"])}Il([Dl]);class Ct{get value(){return this._value}set value(r){if(r===void 0||this._value===r)return;this._value=r;let e;typeof r=="number"?e={r:r>>24&255,g:r>>16&255,b:r>>8&255,a:(r&255)/255}:e=r;const t=nt(e);t.isValid()?this._colord=t:console.warn(`Unable to convert color ${r}`)}get r8(){return this._colord.rgba.r}get g8(){return this._colord.rgba.g}get b8(){return this._colord.rgba.b}get a8(){return this._colord.rgba.a*255&255}get r(){return this.r8/255}get g(){return this.g8/255}get b(){return this.b8/255}get a(){return this._colord.rgba.a}get rgb(){return(this.r8<<16)+(this.g8<<8)+this.b8}get bgr(){return(this.b8<<16)+(this.g8<<8)+this.r8}get abgr(){return(this.a8<<24)+this.bgr}constructor(r=0){this.value=r}toArgb(r=this.a,e=!0){if(r===1)return(255<<24)+this.rgb;if(r===0)return e?0:this.rgb;let t=this.r8,i=this.g8,s=this.b8;return e&&(t=t*r+.5|0,i=i*r+.5|0,s=s*r+.5|0),(r*255<<24)+(t<<16)+(i<<8)+s}toHex(){return this._colord.toHex()}toArray(){return[this.r,this.g,this.b,this.a]}}class Qe extends mt{constructor(e){super();u(this,"_array",[]);this.dim=e}get length(){return this.dim}_operate(e,t,i){const{dim:s,_array:o}=this;let a;typeof t=="number"?a=Array.from({length:s},()=>t):t instanceof ot||t instanceof Qe?a=t.toArray():a=t;let l,h=[];if(i?i instanceof Qe?l=i:h=i:l=this,t instanceof ot){const{cols:c}=t;switch(e){case"*":for(let f=0;f<s;f++){let p=0;for(let m=0;m<s;m++)p+=o[f]*a[m*c+f];h[f]=p}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"+":for(let c=0;c<s;c++)h[c]=o[c]+a[c];break;case"-":for(let c=0;c<s;c++)h[c]=o[c]-a[c];break;case"*":for(let c=0;c<s;c++)h[c]=o[c]*a[c];break;case"/":for(let c=0;c<s;c++)h[c]=o[c]/a[c];break;case"rot":{const c=Math.cos(a[0]),f=Math.sin(a[0]);h[0]=o[0]*c-o[1]*f,h[1]=o[1]*c+o[0]*f;break}case"==":{let c=!0;for(let f=0;f<s;f++)c=c&&o[f]===a[f];return c}case"=":for(let c=0;c<s;c++){const f=a[c];f!==void 0&&(o[c]=f)}return this._emitUpdate(o),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Vector'`)}return(l==null?void 0:l.set(h))??h}add(e,t){return this._operate("+",e,t)}sub(e,t){return this._operate("-",e,t)}multiply(e,t){return this._operate("*",e,t)}divide(e,t){return this._operate("/",e,t)}rotate(e){return this._operate("rot",e)}set(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this._operate("=",e)}equals(e){return this._operate("==",e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}_emitUpdate(e){this._onUpdate(e),this.emit("update",e)}_onUpdate(e){}toArray(){return this._array.slice()}toName(){return`Vector${this.dim}`}}class ot extends mt{constructor(e,t,i){super();u(this,"_array",[]);this.rows=e,this.cols=t,i?this.set(i):this.identity()}get length(){return this.cols*this.rows}_operate(e,t,i){const{cols:s,rows:o,length:a,_array:l}=this;let h;typeof t=="number"?h=Array.from({length:a},()=>t):t instanceof Qe||t instanceof ot?h=t.toArray():h=t;let c,f=[];if(i?i instanceof Qe||i instanceof ot?c=i:f=i:t instanceof Qe?c=new t.constructor:c=this,t instanceof Qe){const{dim:p}=t;switch(e){case"*":for(let m=0;m<p;m++){let g=0;for(let _=0;_<s;_++)_<p&&(g+=l[m*s+_]*(h[_]??0));f[m]=g}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"*":for(let p=0;p<s;p++)for(let m=0;m<o;m++){const g=m*s;let _=0;for(let y=0;y<o;y++){const E=g+y,T=y*s+p;_+=l[E]*(h[T]??0)}f[g+p]=_}break;case"=":for(let p=0;p<a;p++){const m=h[p];m!==void 0&&(l[p]=m)}return this._emitUpdate(l),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Matrix2'`)}return(c==null?void 0:c.set(f))??f}identity(){const{cols:e,rows:t}=this,i=[];for(let s=0;s<e;s++)for(let o=0;o<t;o++){const a=o*e,l=s+a;i[l]=o+a===l?1:0}return this.set(i)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}set(e){return this._operate("=",e)}multiply(e){return this._operate("*",e)}onUpdate(e){return this.on("update",e),this}offUpdate(e){return this.off("update",e),this}_emitUpdate(e){this._onUpdate(e),this.emit("update",e)}_onUpdate(e){}toArray(e=!1){const{cols:t,rows:i,_array:s}=this;if(e){const o=[];for(let a=0;a<i;a++)for(let l=0;l<t;l++)o[a+l*t]=s[l+a*t];return o}return s.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array}}class Gn extends ot{constructor(r){super(4,4,r)}}const qn=Me/180,Rl=180/Me;function at(n,r,e){return Math.max(n,Math.min(r,e))}function de(n,r,e){return(1-e)*n+e*r}const Bl={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(n,r=20){if(!this.adaptive||!n||Number.isNaN(n))return r;let e=Math.ceil(n/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class Wn extends Qe{constructor(r=0,e=0,t=0,i=0){super(4),this.set([r,e,t,i])}}class us extends ot{constructor(r){super(4,5,r)}hueRotate(r=0){const e=Math.sin(r),t=Math.cos(r),i=.213,s=.715,o=.072;return this.multiply([i+t*(1-i)+e*-.213,s+t*-.715+e*-.715,o+t*-.072+e*(1-o),0,0,i+t*-.213+e*.143,s+t*(1-s)+e*.14,o+t*-.072+e*-.283,0,0,i+t*-.213+e*-.787,s+t*-.715+e*s,o+t*(1-o)+e*o,0,0,0,0,0,1,0])}saturate(r=1){const e=(r-1)*2/3+1,t=(e-1)*-.5;return this.multiply([e,t,t,0,0,t,e,t,0,0,t,t,e,0,0,0,0,0,1,0])}brightness(r=1){const e=r;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0])}contrast(r=1){const e=r,t=-128*(e-1);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}invert(r=1){const e=de(1,-1,r),t=de(0,255,r);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}sepia(r=1){const e=at(0,r,1);return this.multiply([de(1,.393,e),de(0,.7689999,e),de(0,.18899999,e),0,0,de(0,.349,e),de(1,.6859999,e),de(0,.16799999,e),0,0,de(0,.272,e),de(0,.5339999,e),de(1,.13099999,e),0,0,0,0,0,1,0])}opacity(r=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,r,0])}grayscale(r=1){const e=at(0,r,1),t=de(1,.3,e),i=de(0,.3,e),s=de(1,.59,e),o=de(0,.59,e),a=de(1,.11,e),l=de(0,.11,e);return this.multiply([t,o,l,0,0,i,s,l,0,0,i,o,a,0,0,0,0,0,1,0])}multiply(r){const e=r,t=this._array;return this.set([t[0]*e[0]+t[1]*e[5]+t[2]*e[10]+t[3]*e[15],t[0]*e[1]+t[1]*e[6]+t[2]*e[11]+t[3]*e[16],t[0]*e[2]+t[1]*e[7]+t[2]*e[12]+t[3]*e[17],t[0]*e[3]+t[1]*e[8]+t[2]*e[13]+t[3]*e[18],t[0]*e[4]+t[1]*e[9]+t[2]*e[14]+t[3]*e[19]+t[4],t[5]*e[0]+t[6]*e[5]+t[7]*e[10]+t[8]*e[15],t[5]*e[1]+t[6]*e[6]+t[7]*e[11]+t[8]*e[16],t[5]*e[2]+t[6]*e[7]+t[7]*e[12]+t[8]*e[17],t[5]*e[3]+t[6]*e[8]+t[7]*e[13]+t[8]*e[18],t[5]*e[4]+t[6]*e[9]+t[7]*e[14]+t[8]*e[19]+t[9],t[10]*e[0]+t[11]*e[5]+t[12]*e[10]+t[13]*e[15],t[10]*e[1]+t[11]*e[6]+t[12]*e[11]+t[13]*e[16],t[10]*e[2]+t[11]*e[7]+t[12]*e[12]+t[13]*e[17],t[10]*e[3]+t[11]*e[8]+t[12]*e[13]+t[13]*e[18],t[10]*e[4]+t[11]*e[9]+t[12]*e[14]+t[13]*e[19]+t[14],t[15]*e[0]+t[16]*e[5]+t[17]*e[10]+t[18]*e[15],t[15]*e[1]+t[16]*e[6]+t[17]*e[11]+t[18]*e[16],t[15]*e[2]+t[16]*e[7]+t[17]*e[12]+t[18]*e[17],t[15]*e[3]+t[16]*e[8]+t[17]*e[13]+t[18]*e[18],t[15]*e[4]+t[16]*e[9]+t[17]*e[14]+t[18]*e[19]+t[19]])}toMatrix4(){const r=this._array;return new Gn([r[0],r[1],r[2],r[3],r[5],r[6],r[7],r[8],r[10],r[11],r[12],r[13],r[15],r[16],r[17],r[18]])}toVector4(){const r=this._array;return new Wn(r[4]/255,r[9]/255,r[14]/255,r[19]/255)}}class kl extends ot{constructor(r){super(2,2,r)}}let fs=class extends ot{constructor(r){super(3,3,r)}invert(){const[r,e,t,i,s,o,a,l,h]=this._array,c=h*s-o*l,f=o*a-h*i,p=l*i-s*a,m=r*c+e*f+t*p;if(m===0)return this.set([0,0,0,0,0,0,0,0,0]);const g=1/m;return this.set([c*g,(t*l-h*e)*g,(o*e-t*s)*g,f*g,(h*r-t*a)*g,(t*i-o*r)*g,p*g,(e*a-l*r)*g,(s*r-e*i)*g])}};class Xn extends fs{constructor(r=0,e=0,t=0,i=0,s=!1){super(),this._x=r,this._y=e,this._width=t,this._height=i,this._flipY=s,this._performUpdateArray()}flipY(r){return this._flipY!==r&&(this._flipY=r,this._performUpdateArray()),this}translate(r,e){return(this._x!==r||this._y!==e)&&(this._x=r,this._y=e,this._performUpdateArray()),this}resize(r,e){return(this._width!==r||this._height!==e)&&(this._width=r,this._height=e,this._performUpdateArray()),this}_performUpdateArray(){const r=this._width,e=this._height;if(!r||!e)return;const t=this._x,i=this._y,s=this._flipY?-1:1,o=1/r*2,a=s*(1/e*2),l=-1-t*o,h=-s-i*a;this.set([o,0,l,0,a,h,0,0,1])}}let si=class Yi extends Qe{get x(){return this._array[0]}set x(r){const[e,t]=this._array;e!==r&&this.set(r,t)}get y(){return this._array[1]}set y(r){const[e,t]=this._array;t!==r&&this.set(e,r)}get width(){return this.x}set width(r){this.x=r}get height(){return this.y}set height(r){this.y=r}constructor(r=0,e){super(2),this.set(typeof r=="number"?[r,e??r]:r)}update(r,e){const[t,i]=this._array;return(t!==r||i!==e)&&this.set(r,e),this}getLength(){const[r,e]=this._array;return Math.sqrt(r*r+e*e)}getAngle(){const[r,e]=this._array;return Math.atan2(-r,-e)+Math.PI}distanceTo(r){return Math.hypot(r.x-this.x,r.y-this.y)}normalize(){const[r,e]=this._array,t=1/(this.getLength()||1);return this.set(r*t,e*t),this}static lerp(r,e,t){return new Yi(e).clone().sub(new Yi(r)).multiply(t).add(new Yi(r))}};class ni{constructor(...r){u(this,"end",new si);u(this,"position");u(this,"size");const e=new si,t=new si;switch(r.length){case 0:break;case 1:e.set(r[0].position),t.set(r[0].size);break;case 2:e.set(r[0]),t.set(r[1]);break;default:e.set(r[0],r[1]),t.set(r[2],r[3]);break}this.update=this.update.bind(this),this.position=e.on("update",this.update),this.size=t.on("update",this.update),this.update()}get x(){return this.position.x}get y(){return this.position.y}get left(){return this.position.x}get top(){return this.position.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get width(){return this.size.x}get height(){return this.size.y}update(){return this.end.set(this.position.x+this.size.x,this.position.y+this.size.y),this}toArray(){return[this.x,this.y,this.width,this.height]}}class et extends fs{constructor(e=!0){super();u(this,"_cx",1);u(this,"_sx",0);u(this,"_cy",0);u(this,"_sy",1);u(this,"_translateX",0);u(this,"_translateY",0);u(this,"_translateZ",1);u(this,"_scaleX",1);u(this,"_scaleY",1);u(this,"_skewX",0);u(this,"_skewY",0);u(this,"_rotate",0);u(this,"dirtyId",0);u(this,"_needsUpdateArray",!1);u(this,"_needsUpdateFields",!1);this.autoUpdate=e}_onUpdate(e){super._onUpdate(e),this._requestUpdateFields()}_updateSkew(){this._cx=Math.cos(this._rotate+this._skewY),this._sx=Math.sin(this._rotate+this._skewY),this._cy=-Math.sin(this._rotate-this._skewX),this._sy=Math.cos(this._rotate-this._skewX)}_requestUpdateArray(){this.autoUpdate?this._performUpdateArray():this._needsUpdateArray=!0}_requestUpdateFields(){this.autoUpdate?this._performUpdateFields():this._needsUpdateFields=!0}_performUpdateArray(){const e=this._cx*this._scaleX,t=this._sx*this._scaleX,i=this._cy*this._scaleY,s=this._sy*this._scaleY,o=this._translateX,a=this._translateY,l=this._translateZ,h=this._array;this._array=[e,i,o,t,s,a,h[6],h[7],l],this.dirtyId++}_performUpdateFields(){const{a:e,c:t,tx:i,b:s,d:o,ty:a,tz:l}=this.toObject(),h=-Math.atan2(-t,o),c=Math.atan2(s,e),f=Math.abs(h+c);f<1e-5||Math.abs(le-f)<1e-5?(this._rotate=c,this._skewX=this._skewY=0):(this._rotate=0,this._skewX=h,this._skewY=c),this._scaleX=Math.sqrt(e*e+s*s),this._scaleY=Math.sqrt(t*t+o*o),this._translateX=i,this._translateY=a,this._translateZ=l,this.dirtyId++}skew(e,t){return this._skewX=e,this._skewY=t,this._updateSkew(),this._requestUpdateArray(),this}skewX(e){return this.skew(e,this._skewY)}skewY(e){return this.skew(this._skewX,e)}translate(e,t,i=1){return this._translateX=e,this._translateY=t,this._translateZ=i,this._requestUpdateArray(),this}translateX(e){return this.translate(e,this._translateY)}translateY(e){return this.translate(this._translateX,e)}translateZ(e){return this.translate(this._translateX,this._translateY,e)}translate3d(e,t,i){return this.translate(e,t,i)}scale(e,t,i=1){return this._scaleX=e,this._scaleY=t,this._requestUpdateArray(),this}scaleX(e){return this.scale(e,this._scaleY)}scaleY(e){return this.scale(this._scaleX,e)}scale3d(e,t,i){return this.scale(e,t,i)}rotate(e){return this._rotate=e,this._updateSkew(),this._requestUpdateArray(),this}rotateX(e){return this.scaleY(this._rotateToScale(e))}rotateY(e){return this.scaleX(this._rotateToScale(e))}rotateZ(e){return this.rotate(e)}rotate3d(e,t,i,s){const[o,a,l]=this._rotate3d(e,t,i,s);return o&&this.rotateX(o),a&&this.rotateY(a),l&&this.rotateZ(l),this}_rotateToScale(e){const t=e/le;return t<=.5?t*-4+1:(t-1)*4+1}_rotate3d(e,t,i,s){if(e===1&&t===0&&i===0)return[s,0,0];if(e===0&&t===1&&i===0)return[0,s,0];if(e===0&&t===0)return[0,0,s];{const o=Math.cos(s),a=Math.sin(s),l=o+e*e*(1-o),h=e*t*(1-o)-i*a,c=e*i*(1-o)+t*a,f=o+t*t*(1-o),p=t*i*(1-o)-e*a,m=o+i*i*(1-o),g=-Math.atan2(-p,f),_=-Math.atan2(c,Math.sqrt(p*p+m*m)),y=-Math.atan2(-h,l);return[g,_,y]}}applyToPoint(e,t){const{a:i,c:s,tx:o,b:a,d:l,ty:h}=this.toObject();return[i*e+s*t+o,a*e+l*t+h]}inverse(){return this.clone().invert()}update(){let e=!1;return this._needsUpdateArray&&(this._needsUpdateArray=!1,this._performUpdateArray(),e=!0),this._needsUpdateFields&&(this._needsUpdateFields=!1,this._performUpdateFields(),e=!0),e}isIdentity(){const{a:e,b:t,c:i,d:s,tx:o,ty:a}=this.toObject();return e===1&&t===0&&i===0&&s===1&&o===0&&a===0}toObject(){const[e,t,i,s,o,a,,,l]=this._array;return{a:e,c:t,tx:i,b:s,d:o,ty:a,tz:l}}}class Ll extends Qe{constructor(){super(3)}}var Nl=Object.defineProperty,Hn=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&Nl(r,e,i),i};class oi extends ti{constructor(){super();u(this,"_starting",!1);u(this,"_nextDeltaTime",0);this._onNextTick=this._onNextTick.bind(this)}get starting(){return this._starting}get spf(){return this.fps?Math.floor(1e3/this.fps):0}start(e){return this._starting||(this._starting=!0,this.removeAllListeners(),this.on("process",e),fe.on(this._onNextTick,{sort:0})),this}stop(){return this._starting&&(this._starting=!1,fe.off(this._onNextTick,{sort:0})),this}_onNextTick(){const e=fe.elapsed*this.speed;if((this._nextDeltaTime-=e)<=0){const i=(this._nextDeltaTime=this.spf)||e;this.emit("process",i)}}}Hn([M({default:24})],oi.prototype,"fps"),Hn([M({default:1})],oi.prototype,"speed");class Yn{constructor(){u(this,"view");u(this,"pixelRatio",rs);u(this,"screen",{x:0,y:0,width:0,height:0});u(this,"related",new Zt)}getRelated(r,e){let t=this.related.get(r);return t||(e?(this.related.set(r,t=e()),t):(console.warn("Failed to get related",r),null))}resize(r,e,t=!0){const i=Math.floor(r*this.pixelRatio),s=Math.floor(e*this.pixelRatio),o=i/this.pixelRatio,a=s/this.pixelRatio;this.view&&(this.view.width=i,this.view.height=s),this.screen.width=o,this.screen.height=a,t&&this.view&&(this.view.style.width=`${o}px`,this.view.style.height=`${a}px`)}}var Kt=(n=>(n.NORMAL="normal",n.ADD="add",n.MULTIPLY="multiply",n.SCREEN="screen",n.NONE="none",n.NORMAL_NPM="normal_npm",n.ADD_NPM="add_npm",n.SCREEN_NPM="screen_npm",n.SRC_IN="src_in",n.SRC_OUT="src_out",n.SRC_ATOP="src_atop",n.DST_OVER="dst_over",n.DST_IN="dst_in",n.DST_OUT="dst_out",n.DST_ATOP="dst_atop",n.XOR="xor",n.SUBTRACT="subtract",n))(Kt||{});function Zn(n){return{normal:[n.ONE,n.ONE_MINUS_SRC_ALPHA],add:[n.ONE,n.ONE],multiply:[n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],screen:[n.ONE,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],none:[0,0],normal_npm:[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],add_npm:[n.SRC_ALPHA,n.ONE,n.ONE,n.ONE],screen_npm:[n.SRC_ALPHA,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],src_in:[n.DST_ALPHA,n.ZERO],src_out:[n.ONE_MINUS_DST_ALPHA,n.ZERO],src_atop:[n.DST_ALPHA,n.ONE_MINUS_SRC_ALPHA],dst_over:[n.ONE_MINUS_DST_ALPHA,n.ONE],dst_in:[n.ZERO,n.SRC_ALPHA],dst_out:[n.ZERO,n.ONE_MINUS_SRC_ALPHA],dst_atop:[n.ONE_MINUS_DST_ALPHA,n.SRC_ALPHA],xor:[n.ONE_MINUS_DST_ALPHA,n.ONE_MINUS_SRC_ALPHA],subtract:[n.ONE,n.ONE,n.ONE,n.ONE,n.FUNC_REVERSE_SUBTRACT,n.FUNC_ADD]}}class He{get gl(){return this._renderer.gl}install(r){this._renderer=r}onUpdateContext(){}flush(){}reset(){}destroy(){}}const Gi=class Gi{constructor(r){u(this,"_blendMode",Kt.NORMAL);u(this,"_polygonOffset",0);u(this,"bitmap",0);if(r)for(const e in r)this[e]=r[e]}static _init(){this._properties.forEach((r,e)=>{Object.defineProperty(this.prototype,r,{get(){return!!(this.bitmap&1<<e)},set(t){!!(this.bitmap&1<<e)!==t&&(this.bitmap^=1<<e)},enumerable:!0,configurable:!0})})}static for2D(){const r=new Gi;return r.depthTest=!1,r.blend=!0,r}get blendMode(){return this._blendMode}set blendMode(r){this.blend=r!==Kt.NONE,this._blendMode=r}get polygonOffset(){return this._polygonOffset}set polygonOffset(r){this.offsets=!!r,this._polygonOffset=r}};u(Gi,"_properties",["blend","offsets","culling","depthTest","clockwiseFrontFace","depthMask"]);let kt=Gi;kt._init();class Kn extends He{constructor(){super(...arguments);u(this,"_blendEq",!1);u(this,"_setters",kt._properties.map(e=>this[`set${e.replace(/^\S/,t=>t.toUpperCase())}`]));u(this,"boundStateBitmap",0);u(this,"boundBlendMode");u(this,"blendModes");u(this,"defaultState",new kt({blend:!0}))}install(e){super.install(e),e.state=this}onUpdateContext(){super.onUpdateContext(),this.blendModes=Zn(this._renderer.gl)}toggle(e,t){this._renderer.gl[t?"enable":"disable"](e)}setBlend(e){this.toggle(this._renderer.gl.BLEND,e)}setOffsets(e){this.toggle(this._renderer.gl.POLYGON_OFFSET_FILL,e)}setCulling(e){this.toggle(this._renderer.gl.CULL_FACE,e)}setDepthTest(e){this.toggle(this._renderer.gl.DEPTH_TEST,e)}setDepthMask(e){this._renderer.gl.depthMask(e)}setClockwiseFrontFace(e){const t=this._renderer.gl;t.frontFace(t[e?"CW":"CCW"])}setBlendMode(e){if(e===this.boundBlendMode)return;this.boundBlendMode=e;const t=this.blendModes[e],i=this._renderer.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(e,t){this._renderer.gl.polygonOffset(e,t)}bind(e){var t;if(this.boundStateBitmap!==e.bitmap){let i=this.boundStateBitmap^e.bitmap,s=0;for(;i;)i&1&&((t=this._setters[s])==null||t.call(this,!!(e.bitmap&1<<s))),i=i>>1,s++;this.boundStateBitmap=e.bitmap}e.blend&&this.setBlendMode(e.blendMode),e.offsets&&this.setPolygonOffset(1,e.polygonOffset)}reset(){super.reset();const e=this._renderer.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.bind(this.defaultState),this._blendEq=!0,this.setBlendMode(Kt.NORMAL)}}class Jn extends He{constructor(){super(...arguments);u(this,"_state",kt.for2D());u(this,"_batchSize",4096*4);u(this,"_vertexSize",27);u(this,"_drawCallUid",0);u(this,"_defaultModulate",4294967295);u(this,"_defaultBackgroundColor",0);u(this,"_defaultColorMatrixOffset",[0,0,0,0]);u(this,"_defaultColorMatrix",[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);u(this,"_batchables",[]);u(this,"_vertexCount",0);u(this,"_indexCount",0);u(this,"_attributeBuffer",[]);u(this,"_indexBuffers",[]);u(this,"_shaders",new Map);u(this,"_attributes",{aTextureId:{size:1,normalized:!0,type:"float"},aPosition:{size:2,normalized:!1,type:"float"},aUv:{size:2,normalized:!1,type:"float"},aModulate:{size:4,normalized:!0,type:"unsigned_byte"},aBackgroundColor:{size:4,normalized:!0,type:"unsigned_byte"},aColorMatrixOffset:{size:4,normalized:!1,type:"float"},aColorMatrix:{size:4,normalized:!1,type:"float"}})}install(e){super.install(e),e.batch2D=this}_getShader(e){let t=this._shaders.get(e);return t||this._shaders.set(e,t=this._createShader(e)),t}_createShader(e){const t=this._renderer,i=t.program.create({vert:`precision highp float;
1
+ (function(f,st){typeof exports=="object"&&typeof module<"u"?st(exports):typeof define=="function"&&define.amd?define(["exports"],st):(f=typeof globalThis<"u"?globalThis:f||self,st(f.modernCanvas={}))})(this,function(f){"use strict";var ZI=Object.defineProperty;var $I=(f,st,Jt)=>st in f?ZI(f,st,{enumerable:!0,configurable:!0,writable:!0,value:Jt}):f[st]=Jt;var g=(f,st,Jt)=>$I(f,typeof st!="symbol"?st+"":st,Jt);var xA,uA;var st=typeof document<"u"?document.currentScript:null;const Jt=Math.PI,Ce=Jt*2;let ql=0;function Nn(r){var A;return((A=r==null?void 0:r.__SPECTOR_Object_TAG)==null?void 0:A.id)??++ql}function $r(r){return!(r&r-1)&&!!r}const zl=/([\w-]+)\((.+?)\)/g,jl=/[^,]+/g,Zl=/([-e.\d]+)(.*)/;function es(r){return Array.isArray(r)?r.map(A=>({name:A.name,args:A.args.map(e=>({...e,normalizedIntValue:e.normalizedDefaultIntValue}))})):{...r,normalizedIntValue:r.normalizedDefaultIntValue}}function ni(r,A,e={}){const t=IA(A,e);return t.length?t:Fn(r,A,e)}function IA(r,A={}){const e=[];let t;for(;(t=zl.exec(r))!==null;){const[,i,s]=t;i&&e.push({name:i,args:$l(i,s,A)})}return e}function $l(r,A,e={}){const t=[];let i,s=0;for(;(i=jl.exec(A))!==null;)t.push(Fn(r,i[0],{...e,index:s++}));return t}function Fn(r,A,e={}){const{width:t=1,height:i=1,index:s=0}=e,n=A.match(Zl),o={unit:(n==null?void 0:n[2])??null,value:A,intValue:Number(n==null?void 0:n[1]),normalizedIntValue:0,normalizedDefaultIntValue:0};switch(r){case"scale":case"scaleX":case"scaleY":case"scale3d":o.normalizedDefaultIntValue=1;break}switch(o.unit){case"%":o.normalizedIntValue=o.intValue/100;break;case"rad":o.normalizedIntValue=o.intValue/Ce;break;case"deg":o.normalizedIntValue=o.intValue/360;break;case"px":switch(s){case 0:o.normalizedIntValue=o.intValue/t;break;case 1:o.normalizedIntValue=o.intValue/i;break}break;case"turn":case"em":case"rem":default:o.normalizedIntValue=o.intValue;break}return o}const Tn="WebGL2RenderingContext"in globalThis,Ln="ImageBitmap"in globalThis,Gn="ResizeObserver"in globalThis,MA="PointerEvent"in globalThis,On="WheelEvent"in globalThis,eh="MouseEvent"in globalThis,Kt="ontouchstart"in globalThis,Hn="onclick"in globalThis,ts="createImageBitmap"in globalThis,As="AudioContext"in globalThis,is="webkitAudioContext"in globalThis,rs="OfflineAudioContext"in globalThis,Jn="webkitOfflineAudioContext"in globalThis,Kn=As||is,oi=typeof window<"u",ss=globalThis.devicePixelRatio||1,ns=r=>r!==null&&typeof r=="object"&&r.nodeType===1,Yn=r=>ns(r)&&r.tagName==="VIDEO",th=r=>ns(r)&&r.tagName==="IMG";function Wn(r){return typeof r=="object"&&r!==null&&r.nodeType===1&&r.tagName==="CANVAS"}function Vn(r){return Tn&&r instanceof globalThis.WebGL2RenderingContext}function Xn(){if(oi)return globalThis.document.createElement("canvas")}function qn(r,A=globalThis.location){if(r.startsWith("data:"))return"";A=A||globalThis.location;const e=new URL(r,document.baseURI);return e.hostname!==A.hostname||e.port!==A.port||e.protocol!==A.protocol?"anonymous":""}function zn(r,A,e){e===null&&!A.startsWith("data:")?r.crossOrigin=qn(A):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}class RA{constructor(){g(this,"_map",new WeakMap)}_toRaw(A){if(A&&typeof A=="object"){const e=A.__v_raw;e&&(A=this._toRaw(e))}return A}delete(A){return this._map.delete(this._toRaw(A))}get(A){return this._map.get(this._toRaw(A))}has(A){return this._map.has(this._toRaw(A))}set(A,e){return this._map.set(this._toRaw(A),this._toRaw(e)),this}}const jn=new RA;function Ki(r){let A=jn.get(r);if(!A){const e=Object.getPrototypeOf(r);A=new Map(e?Ki(e):void 0),jn.set(r,A)}return A}function BA(r,A,e={}){Ki(r).set(A,e);const{default:t,alias:i}=e;let s=Object.getOwnPropertyDescriptor(r.prototype,A);if(!s){const n=i??Symbol.for(String(A));s={get(){return this[n]},set(o){this[n]=o}}}Object.defineProperty(r.prototype,A,{get(){var n;return((n=s.get)==null?void 0:n.call(this))??t},set(n){var a,l,h;const o=((a=s.get)==null?void 0:a.call(this))??t;(l=s.set)==null||l.call(this,n),(h=this.requestUpdate)==null||h.call(this,A,o,e)},configurable:!0,enumerable:!0})}function _(r){return function(A,e){BA(A.constructor,e,r)}}const Yi=new Map;function ae(r,A){return function(e){Object.defineProperty(e.prototype,"tag",{value:r,enumerable:!0,configurable:!0}),A&&Object.keys(A).forEach(t=>{BA(e,t,{default:A[t]})}),Yi.set(r,e)}}function Me(r){return _({...r,protected:!0})}function Ah(r="node",A={}){const e=Yi.get(r);if(!e)throw new Error(`Failed to createNode, tag: ${r}`);return new e().setProperties(A)}class Re{static get currentTime(){return this._currentTime}static get elapsed(){return this._elapsed}static on(A,e={}){const{sort:t=0,once:i=!1}=e;this._queue[t]||(this._queue[t]=[]),this._queue[t].push({cb:A,once:i})}static off(A,e={}){const{sort:t=0}=e,i=this._queue[t];if(!i)return;const s=[];for(let n=i.length,o=0;o<n;o++){const a=i[o];a.cb!==A&&s.push(a)}s.length?this._queue[t]=s:this._queue.splice(t,1)}static start(){"requestAnimationFrame"in globalThis&&(this._currentTime=performance.now(),this._requestId=requestAnimationFrame(A=>this._update(A)))}static stop(){this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0)}static _update(A){this._elapsed=A-this._currentTime,this._currentTime=A,this._requestId=requestAnimationFrame(e=>this._update(e)),this._performUpdate()}static _performUpdate(){const A=this._queue,e=[];for(let t=A.length,i=t;i>=0;i--){const s=A[i];if(!s)continue;const n=[];for(let o=s.length,a=0;a<o;a++){const l=s[a];try{l.cb()}catch(h){console.warn(h)}l.once||n.push(l)}n.length&&(e[i]=n)}this._queue=e}}g(Re,"_queue",[]),g(Re,"_currentTime",0),g(Re,"_elapsed",0),g(Re,"_requestId"),Re.start();async function os(r){return new Promise(A=>{Re.on(()=>{r==null||r(),A()},{sort:1,once:!0})})}let Yt=class{constructor(){g(this,"eventListeners",new Map)}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(A){return this.eventListeners.has(A)}on(A,e,t){const i={value:e,options:t},s=this.eventListeners.get(A);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(A,[s,i]):this.eventListeners.set(A,i),this}once(A,e){return this.on(A,e,{once:!0})}off(A,e,t){var s,n;if(!e)return this.eventListeners.delete(A),this;const i=this.eventListeners.get(A);if(!i)return this;if(Array.isArray(i)){const o=[];for(let a=0,l=i.length;a<l;a++){const h=i[a];(h.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof h.options=="boolean"||!((s=h.options)!=null&&s.once)))&&o.push(h)}o.length?this.eventListeners.set(A,o.length===1?o[0]:o):this.eventListeners.delete(A)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(n=i.options)!=null&&n.once)&&this.eventListeners.delete(A);return this}emit(A,...e){var i,s;const t=this.eventListeners.get(A);if(t){if(Array.isArray(t))for(let n=t.length,o=0;o<n;o++){const a=t[o];typeof a.options=="object"&&((i=a.options)!=null&&i.once)&&this.off(A,a.value,a.options),a.value.apply(this,e)}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(A,t.value,t.options),t.value.apply(this,e);return!0}else return!1}},ih=0;class Wi extends Yt{constructor(){super(...arguments);g(this,"instanceId",++ih);g(this,"_defaultProperties");g(this,"_updatedProperties",new Map);g(this,"_changedProperties",new Set);g(this,"_updatingPromise",Promise.resolve());g(this,"_updating",!1)}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(e){Promise.reject(e)}await os(),this._performUpdate()}_performUpdate(){this._updating&&(this._update(this._updatedProperties),this._updatedProperties=new Map,this._updating=!1)}_update(e){}_updateProperty(e,t,i,s){}isDirty(e){return this._updatedProperties.has(e)}getPropertyDeclarations(){return Ki(this.constructor)}getPropertyDeclaration(e){return this.getPropertyDeclarations().get(e)}getDefaultProperties(){if(!this._defaultProperties){this._defaultProperties={};for(const[e,t]of this.getPropertyDeclarations())!t.protected&&!t.alias&&(this._defaultProperties[e]=t.default)}return this._defaultProperties}getProperty(e){return this[e]}setProperty(e,t){return this[e]=t,this}getProperties(e){const t={};for(const[i,s]of this.getPropertyDeclarations())!s.protected&&!s.alias&&(!e||e.includes(i))&&(t[i]=this.getProperty(i));return t}setProperties(e){if(e)for(const[t]of this.getPropertyDeclarations())t in e&&this.setProperty(t,e[t]);return this}requestUpdate(e,t,i){if(e!==void 0){const s=this[e];if(!Object.is(s,t))this._updatedProperties.set(e,t),this._changedProperties.add(e),i??(i=this.getPropertyDeclaration(e)),this._updateProperty(e,s,t,i),this.emit("updateProperty",e,s,t,i);else return}this._updating||(this._updatingPromise=this._enqueueUpdate())}toJSON(){return this.getProperties(Array.from(this._changedProperties))}clone(){return new this.constructor(this.toJSON())}destroy(){this.removeAllListeners()}}class Zn extends Wi{}class Vi{constructor(){g(this,"bubbles",!0);g(this,"cancelable",!1);g(this,"which");g(this,"cancelBubble",!0);g(this,"returnValue");g(this,"srcElement");g(this,"composed",!1);g(this,"currentTarget");g(this,"defaultPrevented",!1);g(this,"eventPhase",Vi.prototype.NONE);g(this,"isTrusted");g(this,"target");g(this,"timeStamp");g(this,"type");g(this,"nativeEvent");g(this,"originalEvent");g(this,"propagationStopped",!1);g(this,"propagationImmediatelyStopped",!1);g(this,"path");g(this,"detail");g(this,"view");g(this,"layer",{x:0,y:0});g(this,"page",{x:0,y:0});g(this,"NONE",0);g(this,"CAPTURING_PHASE",1);g(this,"AT_TARGET",2);g(this,"BUBBLING_PHASE",3)}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}initEvent(...A){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(...A){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}composedPath(){return this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class as extends Vi{constructor(){super(...arguments);g(this,"altKey");g(this,"button");g(this,"buttons");g(this,"ctrlKey");g(this,"metaKey");g(this,"relatedTarget");g(this,"shiftKey");g(this,"client",{x:0,y:0});g(this,"movement",{x:0,y:0});g(this,"offset",{x:0,y:0});g(this,"global",{x:0,y:0});g(this,"screen",{x:0,y:0})}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}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(...e){throw new Error("Method not implemented.")}}class $n extends as{constructor(){super(...arguments);g(this,"width",0);g(this,"height",0);g(this,"isPrimary",!1);g(this,"pointerType");g(this,"pressure");g(this,"tangentialPressure");g(this,"tiltX");g(this,"tiltY");g(this,"twist")}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class ai extends as{constructor(){super(...arguments);g(this,"deltaMode");g(this,"deltaX");g(this,"deltaY");g(this,"deltaZ");g(this,"DOM_DELTA_PIXEL",0);g(this,"DOM_DELTA_LINE",1);g(this,"DOM_DELTA_PAGE",2)}}g(ai,"DOM_DELTA_PIXEL",0),g(ai,"DOM_DELTA_LINE",1),g(ai,"DOM_DELTA_PAGE",2);const rh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class eo extends Yt{constructor(){super(...arguments);g(this,"target");g(this,"cursor","default");g(this,"cursorStyles",{default:"inherit",pointer:"pointer"});g(this,"setuped",!1);g(this,"event");g(this,"enableMoveEvent",!0);g(this,"enableWheelEvent",!0);g(this,"enableClickEvent",!0);g(this,"onPointerDown",e=>{if(Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerdown",this.event=this.clonePointerEvent(t[i]));this.setCursor(this.cursor)});g(this,"onPointerOver",e=>{if(!this.enableClickEvent||Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointerover",this.event=this.clonePointerEvent(t[i]))});g(this,"onPointerMove",e=>{if(!this.enableMoveEvent||Kt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("pointermove",this.event=this.clonePointerEvent(t[i]))});g(this,"onPointerUp",e=>{if(!this.enableClickEvent||Kt&&e.pointerType==="touch")return;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.target?"outside":"",s=this.normalize(e);for(let n=0,o=s.length;n<o;n++){const a=this.clonePointerEvent(s[n]);a.type+=i,this.emit("pointerup",this.event=a)}});g(this,"onWheel",e=>{if(!this.enableWheelEvent)return;const t=this.normalize(e);for(let i=0,s=t.length;i<s;i++)this.emit("wheel",this.event=this.cloneWheelEvent(t[i]))})}setTarget(e){this.removeEventListeners(),this.target=e,this.addEventListeners()}removeEventListeners(){if(!this.setuped||!this.target)return;const e=this.target.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):MA&&(e.touchAction=""),MA?(this.target.removeEventListener("pointerdown",this.onPointerDown),this.target.removeEventListener("pointerleave",this.onPointerOver),this.target.removeEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.removeEventListener("pointerup",this.onPointerUp)):(this.target.removeEventListener("mousedown",this.onPointerDown),this.target.removeEventListener("mouseout",this.onPointerOver),this.target.removeEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.removeEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.removeEventListener("mouseup",this.onPointerUp)),Kt&&(this.target.removeEventListener("touchstart",this.onPointerDown),this.target.removeEventListener("touchmove",this.onPointerMove),this.target.removeEventListener("touchend",this.onPointerUp)),this.target.removeEventListener("wheel",this.onWheel),this.target=void 0,this.setuped=!1}addEventListeners(){if(this.setuped||!this.target)return;const e=this.target.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):MA&&(e.touchAction="none")),MA?(this.target.addEventListener("pointerdown",this.onPointerDown),this.target.addEventListener("pointerleave",this.onPointerOver),this.target.addEventListener("pointerover",this.onPointerOver),this.target.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.target.ownerDocument.addEventListener("pointerup",this.onPointerUp)):(this.target.addEventListener("mousedown",this.onPointerDown),this.target.addEventListener("mouseout",this.onPointerOver),this.target.addEventListener("mouseover",this.onPointerOver),this.target.ownerDocument.addEventListener("mousemove",this.onPointerMove),this.target.ownerDocument.addEventListener("mouseup",this.onPointerUp)),Kt&&(this.target.addEventListener("touchstart",this.onPointerDown),this.target.addEventListener("touchmove",this.onPointerMove),this.target.addEventListener("touchend",this.onPointerUp)),this.target.addEventListener("wheel",this.onWheel),this.setuped=!0}normalize(e){const t=[];if(Kt&&e instanceof globalThis.TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){const n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.type=e.type,t.push(n)}else if(On&&e instanceof globalThis.WheelEvent)t.push(e);else if(MA&&e instanceof globalThis.PointerEvent)t.push(e);else{const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=1),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),t.push(i)}return t}cloneWheelEvent(e){const t=new ai;return this.copyMouseEvent(t,e),t.wheelDeltaY=e.wheelDeltaY,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.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.nativeEvent=e,t.type=e.type,t}clonePointerEvent(e){const t=new $n;return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,t.isTrusted=e.isTrusted,this.copyMouseEvent(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.type==="pointerleave"?t.type="pointerout":t.type.startsWith("mouse")?t.type=t.type.replace("mouse","pointer"):t.type.startsWith("touch")&&(t.type=rh[t.type]||t.type),t}copyMouseEvent(e,t){e.preventDefault=t.preventDefault.bind(t),e.stopPropagation=t.stopPropagation.bind(t),e.isTrusted=t.isTrusted,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}setCursor(e){if(!this.target||(e=e||"default",this.cursor===e))return;this.cursor=e;const t=!(globalThis.OffscreenCanvas&&this.target instanceof OffscreenCanvas),i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.target.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.target.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.target.style.cursor=e)}mapPositionToPoint(e,t,i){if(!this.target)return;const s=Number(this.target.getAttribute("width"))||0,n=Number(this.target.getAttribute("height"))||0,o=Number(this.target.getAttribute("data-pixel-ratio"))||1,a=this.target.isConnected?this.target.getBoundingClientRect():{x:0,y:0,width:s,height:n,left:0,top:0},l=1/o;e.x=(t-a.left)*(s/a.width)*l,e.y=(i-a.top)*(n/a.height)*l}}class St extends Zn{}var sh={grad:.9,turn:360,rad:360/(2*Math.PI)},Wt=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Te=function(r,A,e){return A===void 0&&(A=0),e===void 0&&(e=Math.pow(10,A)),Math.round(e*r)/e+0},pt=function(r,A,e){return A===void 0&&(A=0),e===void 0&&(e=1),r>e?e:r>A?r:A},to=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},Ao=function(r){return{r:pt(r.r,0,255),g:pt(r.g,0,255),b:pt(r.b,0,255),a:pt(r.a)}},ls=function(r){return{r:Te(r.r),g:Te(r.g),b:Te(r.b),a:Te(r.a,3)}},nh=/^#([0-9a-f]{3,8})$/i,Xi=function(r){var A=r.toString(16);return A.length<2?"0"+A:A},io=function(r){var A=r.r,e=r.g,t=r.b,i=r.a,s=Math.max(A,e,t),n=s-Math.min(A,e,t),o=n?s===A?(e-t)/n:s===e?2+(t-A)/n:4+(A-e)/n:0;return{h:60*(o<0?o+6:o),s:s?n/s*100:0,v:s/255*100,a:i}},ro=function(r){var A=r.h,e=r.s,t=r.v,i=r.a;A=A/360*6,e/=100,t/=100;var s=Math.floor(A),n=t*(1-e),o=t*(1-(A-s)*e),a=t*(1-(1-A+s)*e),l=s%6;return{r:255*[t,o,n,n,a,t][l],g:255*[a,t,t,o,n,n][l],b:255*[n,n,a,t,t,o][l],a:i}},so=function(r){return{h:to(r.h),s:pt(r.s,0,100),l:pt(r.l,0,100),a:pt(r.a)}},no=function(r){return{h:Te(r.h),s:Te(r.s),l:Te(r.l),a:Te(r.a,3)}},oo=function(r){return ro((e=(A=r).s,{h:A.h,s:(e*=((t=A.l)<50?t:100-t)/100)>0?2*e/(t+e)*100:0,v:t+e,a:A.a}));var A,e,t},li=function(r){return{h:(A=io(r)).h,s:(i=(200-(e=A.s))*(t=A.v)/100)>0&&i<200?e*t/100/(i<=100?i:200-i)*100:0,l:i/2,a:A.a};var A,e,t,i},oh=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ah=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hh=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hs={string:[[function(r){var A=nh.exec(r);return A?(r=A[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?Te(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?Te(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var A=lh.exec(r)||hh.exec(r);return A?A[2]!==A[4]||A[4]!==A[6]?null:Ao({r:Number(A[1])/(A[2]?100/255:1),g:Number(A[3])/(A[4]?100/255:1),b:Number(A[5])/(A[6]?100/255:1),a:A[7]===void 0?1:Number(A[7])/(A[8]?100:1)}):null},"rgb"],[function(r){var A=oh.exec(r)||ah.exec(r);if(!A)return null;var e,t,i=so({h:(e=A[1],t=A[2],t===void 0&&(t="deg"),Number(e)*(sh[t]||1)),s:Number(A[3]),l:Number(A[4]),a:A[5]===void 0?1:Number(A[5])/(A[6]?100:1)});return oo(i)},"hsl"]],object:[[function(r){var A=r.r,e=r.g,t=r.b,i=r.a,s=i===void 0?1:i;return Wt(A)&&Wt(e)&&Wt(t)?Ao({r:Number(A),g:Number(e),b:Number(t),a:Number(s)}):null},"rgb"],[function(r){var A=r.h,e=r.s,t=r.l,i=r.a,s=i===void 0?1:i;if(!Wt(A)||!Wt(e)||!Wt(t))return null;var n=so({h:Number(A),s:Number(e),l:Number(t),a:Number(s)});return oo(n)},"hsl"],[function(r){var A=r.h,e=r.s,t=r.v,i=r.a,s=i===void 0?1:i;if(!Wt(A)||!Wt(e)||!Wt(t))return null;var n=function(o){return{h:to(o.h),s:pt(o.s,0,100),v:pt(o.v,0,100),a:pt(o.a)}}({h:Number(A),s:Number(e),v:Number(t),a:Number(s)});return ro(n)},"hsv"]]},ao=function(r,A){for(var e=0;e<A.length;e++){var t=A[e][0](r);if(t)return[t,A[e][1]]}return[null,void 0]},gh=function(r){return typeof r=="string"?ao(r.trim(),hs.string):typeof r=="object"&&r!==null?ao(r,hs.object):[null,void 0]},gs=function(r,A){var e=li(r);return{h:e.h,s:pt(e.s+100*A,0,100),l:e.l,a:e.a}},cs=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},lo=function(r,A){var e=li(r);return{h:e.h,s:e.s,l:pt(e.l+100*A,0,100),a:e.a}},us=function(){function r(A){this.parsed=gh(A)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return Te(cs(this.rgba),2)},r.prototype.isDark=function(){return cs(this.rgba)<.5},r.prototype.isLight=function(){return cs(this.rgba)>=.5},r.prototype.toHex=function(){return A=ls(this.rgba),e=A.r,t=A.g,i=A.b,n=(s=A.a)<1?Xi(Te(255*s)):"","#"+Xi(e)+Xi(t)+Xi(i)+n;var A,e,t,i,s,n},r.prototype.toRgb=function(){return ls(this.rgba)},r.prototype.toRgbString=function(){return A=ls(this.rgba),e=A.r,t=A.g,i=A.b,(s=A.a)<1?"rgba("+e+", "+t+", "+i+", "+s+")":"rgb("+e+", "+t+", "+i+")";var A,e,t,i,s},r.prototype.toHsl=function(){return no(li(this.rgba))},r.prototype.toHslString=function(){return A=no(li(this.rgba)),e=A.h,t=A.s,i=A.l,(s=A.a)<1?"hsla("+e+", "+t+"%, "+i+"%, "+s+")":"hsl("+e+", "+t+"%, "+i+"%)";var A,e,t,i,s},r.prototype.toHsv=function(){return A=io(this.rgba),{h:Te(A.h),s:Te(A.s),v:Te(A.v),a:Te(A.a,3)};var A},r.prototype.invert=function(){return Mt({r:255-(A=this.rgba).r,g:255-A.g,b:255-A.b,a:A.a});var A},r.prototype.saturate=function(A){return A===void 0&&(A=.1),Mt(gs(this.rgba,A))},r.prototype.desaturate=function(A){return A===void 0&&(A=.1),Mt(gs(this.rgba,-A))},r.prototype.grayscale=function(){return Mt(gs(this.rgba,-1))},r.prototype.lighten=function(A){return A===void 0&&(A=.1),Mt(lo(this.rgba,A))},r.prototype.darken=function(A){return A===void 0&&(A=.1),Mt(lo(this.rgba,-A))},r.prototype.rotate=function(A){return A===void 0&&(A=15),this.hue(this.hue()+A)},r.prototype.alpha=function(A){return typeof A=="number"?Mt({r:(e=this.rgba).r,g:e.g,b:e.b,a:A}):Te(this.rgba.a,3);var e},r.prototype.hue=function(A){var e=li(this.rgba);return typeof A=="number"?Mt({h:A,s:e.s,l:e.l,a:e.a}):Te(e.h)},r.prototype.isEqual=function(A){return this.toHex()===Mt(A).toHex()},r}(),Mt=function(r){return r instanceof us?r:new us(r)},ho=[],ch=function(r){r.forEach(function(A){ho.indexOf(A)<0&&(A(us,hs),ho.push(A))})};function uh(r,A){var e={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"},t={};for(var i in e)t[e[i]]=i;var s={};r.prototype.toName=function(n){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,a,l=t[this.toHex()];if(l)return l;if(n!=null&&n.closest){var h=this.toRgb(),c=1/0,u="black";if(!s.length)for(var d in e)s[d]=new r(e[d]).toRgb();for(var I in e){var C=(o=h,a=s[I],Math.pow(o.r-a.r,2)+Math.pow(o.g-a.g,2)+Math.pow(o.b-a.b,2));C<c&&(c=C,u=I)}return u}},A.string.push([function(n){var o=n.toLowerCase(),a=o==="transparent"?"#0000":e[o];return a?new r(a).toRgb():null},"name"])}ch([uh]);class Rt{get value(){return this._value}set value(A){if(A===void 0||this._value===A)return;this._value=A;let e;typeof A=="number"?e={r:A>>24&255,g:A>>16&255,b:A>>8&255,a:(A&255)/255}:e=A;const t=Mt(e);t.isValid()?this._colord=t:console.warn(`Unable to convert color ${A}`)}get r8(){return this._colord.rgba.r}get g8(){return this._colord.rgba.g}get b8(){return this._colord.rgba.b}get a8(){return this._colord.rgba.a*255&255}get r(){return this.r8/255}get g(){return this.g8/255}get b(){return this.b8/255}get a(){return this._colord.rgba.a}get rgb(){return(this.r8<<16)+(this.g8<<8)+this.b8}get bgr(){return(this.b8<<16)+(this.g8<<8)+this.r8}get abgr(){return(this.a8<<24)+this.bgr}constructor(A=0){this.value=A}toArgb(A=this.a,e=!0){if(A===1)return(255<<24)+this.rgb;if(A===0)return e?0:this.rgb;let t=this.r8,i=this.g8,s=this.b8;return e&&(t=t*A+.5|0,i=i*A+.5|0,s=s*A+.5|0),(A*255<<24)+(t<<16)+(i<<8)+s}toHex(){return this._colord.toHex()}toArray(){return[this.r,this.g,this.b,this.a]}}class wt extends Yt{constructor(e){super();g(this,"_array",[]);this.dim=e}get length(){return this.dim}_operate(e,t,i){const{dim:s,_array:n}=this;let o;typeof t=="number"?o=Array.from({length:s},()=>t):t instanceof Ut||t instanceof wt?o=t.toArray():o=t;let a,l=[];if(i?i instanceof wt?a=i:l=i:a=this,t instanceof Ut){const{cols:h}=t;switch(e){case"*":for(let c=0;c<s;c++){let u=0;for(let d=0;d<s;d++)u+=n[c]*o[d*h+c];l[c]=u}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"+":for(let h=0;h<s;h++)l[h]=n[h]+o[h];break;case"-":for(let h=0;h<s;h++)l[h]=n[h]-o[h];break;case"*":for(let h=0;h<s;h++)l[h]=n[h]*o[h];break;case"/":for(let h=0;h<s;h++)l[h]=n[h]/o[h];break;case"rot":{const h=Math.cos(o[0]),c=Math.sin(o[0]);l[0]=n[0]*h-n[1]*c,l[1]=n[1]*h+n[0]*c;break}case"==":{let h=!0;for(let c=0;c<s;c++)h=h&&n[c]===o[c];return h}case"=":for(let h=0;h<s;h++){const c=o[h];c!==void 0&&(n[h]=c)}return this._emitUpdate(n),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Vector'`)}return(a==null?void 0:a.set(l))??l}add(e,t){return this._operate("+",e,t)}sub(e,t){return this._operate("-",e,t)}multiply(e,t){return this._operate("*",e,t)}divide(e,t){return this._operate("/",e,t)}rotate(e){return this._operate("rot",e)}set(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this._operate("=",e)}equals(e){return this._operate("==",e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}_emitUpdate(e){this._onUpdate(e),this.emit("update",e)}_onUpdate(e){}toArray(){return this._array.slice()}toName(){return`Vector${this.dim}`}}class Ut extends Yt{constructor(e,t,i){super();g(this,"_array",[]);this.rows=e,this.cols=t,i?this.set(i):this.identity()}get length(){return this.cols*this.rows}_operate(e,t,i){const{cols:s,rows:n,length:o,_array:a}=this;let l;typeof t=="number"?l=Array.from({length:o},()=>t):t instanceof wt||t instanceof Ut?l=t.toArray():l=t;let h,c=[];if(i?i instanceof wt||i instanceof Ut?h=i:c=i:t instanceof wt?h=new t.constructor:h=this,t instanceof wt){const{dim:u}=t;switch(e){case"*":for(let d=0;d<u;d++){let I=0;for(let C=0;C<s;C++)C<u&&(I+=a[d*s+C]*(l[C]??0));c[d]=I}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"*":for(let u=0;u<s;u++)for(let d=0;d<n;d++){const I=d*s;let C=0;for(let B=0;B<n;B++){const U=I+B,M=B*s+u;C+=a[U]*(l[M]??0)}c[I+u]=C}break;case"=":for(let u=0;u<o;u++){const d=l[u];d!==void 0&&(a[u]=d)}return this._emitUpdate(a),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Matrix2'`)}return(h==null?void 0:h.set(c))??c}identity(){const{cols:e,rows:t}=this,i=[];for(let s=0;s<e;s++)for(let n=0;n<t;n++){const o=n*e,a=s+o;i[a]=n+o===a?1:0}return this.set(i)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}set(e){return this._operate("=",e)}multiply(e){return this._operate("*",e)}onUpdate(e){return this.on("update",e),this}offUpdate(e){return this.off("update",e),this}_emitUpdate(e){this._onUpdate(e),this.emit("update",e)}_onUpdate(e){}toArray(e=!1){const{cols:t,rows:i,_array:s}=this;if(e){const n=[];for(let o=0;o<i;o++)for(let a=0;a<t;a++)n[o+a*t]=s[a+o*t];return n}return s.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array}}class go extends Ut{constructor(A){super(4,4,A)}}const fs=Jt/180,fh=180/Jt;function _t(r,A,e){return Math.max(r,Math.min(A,e))}function Ue(r,A,e){return(1-e)*r+e*A}const dh={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,A=20){if(!this.adaptive||!r||Number.isNaN(r))return A;let e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class co extends wt{constructor(A=0,e=0,t=0,i=0){super(4),this.set([A,e,t,i])}}class qi extends Ut{constructor(A){super(4,5,A)}hueRotate(A=0){const e=Math.sin(A),t=Math.cos(A),i=.213,s=.715,n=.072;return this.multiply([i+t*(1-i)+e*-.213,s+t*-.715+e*-.715,n+t*-.072+e*(1-n),0,0,i+t*-.213+e*.143,s+t*(1-s)+e*.14,n+t*-.072+e*-.283,0,0,i+t*-.213+e*-.787,s+t*-.715+e*s,n+t*(1-n)+e*n,0,0,0,0,0,1,0])}saturate(A=1){const e=(A-1)*2/3+1,t=(e-1)*-.5;return this.multiply([e,t,t,0,0,t,e,t,0,0,t,t,e,0,0,0,0,0,1,0])}brightness(A=1){const e=A;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0])}contrast(A=1){const e=A,t=-128*(e-1);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}invert(A=1){const e=Ue(1,-1,A),t=Ue(0,255,A);return this.multiply([e,0,0,0,t,0,e,0,0,t,0,0,e,0,t,0,0,0,1,0])}sepia(A=1){const e=_t(0,A,1);return this.multiply([Ue(1,.393,e),Ue(0,.7689999,e),Ue(0,.18899999,e),0,0,Ue(0,.349,e),Ue(1,.6859999,e),Ue(0,.16799999,e),0,0,Ue(0,.272,e),Ue(0,.5339999,e),Ue(1,.13099999,e),0,0,0,0,0,1,0])}opacity(A=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,A,0])}grayscale(A=1){const e=_t(0,A,1),t=Ue(1,.3,e),i=Ue(0,.3,e),s=Ue(1,.59,e),n=Ue(0,.59,e),o=Ue(1,.11,e),a=Ue(0,.11,e);return this.multiply([t,n,a,0,0,i,s,a,0,0,i,n,o,0,0,0,0,0,1,0])}multiply(A){const e=A,t=this._array;return this.set([t[0]*e[0]+t[1]*e[5]+t[2]*e[10]+t[3]*e[15],t[0]*e[1]+t[1]*e[6]+t[2]*e[11]+t[3]*e[16],t[0]*e[2]+t[1]*e[7]+t[2]*e[12]+t[3]*e[17],t[0]*e[3]+t[1]*e[8]+t[2]*e[13]+t[3]*e[18],t[0]*e[4]+t[1]*e[9]+t[2]*e[14]+t[3]*e[19]+t[4],t[5]*e[0]+t[6]*e[5]+t[7]*e[10]+t[8]*e[15],t[5]*e[1]+t[6]*e[6]+t[7]*e[11]+t[8]*e[16],t[5]*e[2]+t[6]*e[7]+t[7]*e[12]+t[8]*e[17],t[5]*e[3]+t[6]*e[8]+t[7]*e[13]+t[8]*e[18],t[5]*e[4]+t[6]*e[9]+t[7]*e[14]+t[8]*e[19]+t[9],t[10]*e[0]+t[11]*e[5]+t[12]*e[10]+t[13]*e[15],t[10]*e[1]+t[11]*e[6]+t[12]*e[11]+t[13]*e[16],t[10]*e[2]+t[11]*e[7]+t[12]*e[12]+t[13]*e[17],t[10]*e[3]+t[11]*e[8]+t[12]*e[13]+t[13]*e[18],t[10]*e[4]+t[11]*e[9]+t[12]*e[14]+t[13]*e[19]+t[14],t[15]*e[0]+t[16]*e[5]+t[17]*e[10]+t[18]*e[15],t[15]*e[1]+t[16]*e[6]+t[17]*e[11]+t[18]*e[16],t[15]*e[2]+t[16]*e[7]+t[17]*e[12]+t[18]*e[17],t[15]*e[3]+t[16]*e[8]+t[17]*e[13]+t[18]*e[18],t[15]*e[4]+t[16]*e[9]+t[17]*e[14]+t[18]*e[19]+t[19]])}toMatrix4(){const A=this._array;return new go([A[0],A[1],A[2],A[3],A[5],A[6],A[7],A[8],A[10],A[11],A[12],A[13],A[15],A[16],A[17],A[18]])}toVector4(){const A=this._array;return new co(A[4]/255,A[9]/255,A[14]/255,A[19]/255)}}class Ih extends Ut{constructor(A){super(2,2,A)}}let ds=class extends Ut{constructor(A){super(3,3,A)}invert(){const[A,e,t,i,s,n,o,a,l]=this._array,h=l*s-n*a,c=n*o-l*i,u=a*i-s*o,d=A*h+e*c+t*u;if(d===0)return this.set([0,0,0,0,0,0,0,0,0]);const I=1/d;return this.set([h*I,(t*a-l*e)*I,(n*e-t*s)*I,c*I,(l*A-t*o)*I,(t*i-n*A)*I,u*I,(e*o-a*A)*I,(s*A-e*i)*I])}};class uo extends ds{constructor(A=0,e=0,t=0,i=0,s=!1){super(),this._x=A,this._y=e,this._width=t,this._height=i,this._flipY=s,this._performUpdateArray()}flipY(A){return this._flipY!==A&&(this._flipY=A,this._performUpdateArray()),this}translate(A,e){return(this._x!==A||this._y!==e)&&(this._x=A,this._y=e,this._performUpdateArray()),this}resize(A,e){return(this._width!==A||this._height!==e)&&(this._width=A,this._height=e,this._performUpdateArray()),this}_performUpdateArray(){const A=this._width,e=this._height;if(!A||!e)return;const t=this._x,i=this._y,s=this._flipY?-1:1,n=1/A*2,o=s*(1/e*2),a=-1-t*n,l=-s-i*o;this.set([n,0,a,0,o,l,0,0,1])}}let zi=class Zr extends wt{get x(){return this._array[0]}set x(A){const[e,t]=this._array;e!==A&&this.set(A,t)}get y(){return this._array[1]}set y(A){const[e,t]=this._array;t!==A&&this.set(e,A)}get width(){return this.x}set width(A){this.x=A}get height(){return this.y}set height(A){this.y=A}constructor(A=0,e){super(2),this.set(typeof A=="number"?[A,e??A]:A)}update(A,e){const[t,i]=this._array;return(t!==A||i!==e)&&this.set(A,e),this}getLength(){const[A,e]=this._array;return Math.sqrt(A*A+e*e)}getAngle(){const[A,e]=this._array;return Math.atan2(-A,-e)+Math.PI}distanceTo(A){return Math.hypot(A.x-this.x,A.y-this.y)}normalize(){const[A,e]=this._array,t=1/(this.getLength()||1);return this.set(A*t,e*t),this}static lerp(A,e,t){return new Zr(e).clone().sub(new Zr(A)).multiply(t).add(new Zr(A))}};class hi{constructor(...A){g(this,"end",new zi);g(this,"position");g(this,"size");const e=new zi,t=new zi;switch(A.length){case 0:break;case 1:e.set(A[0].position),t.set(A[0].size);break;case 2:e.set(A[0]),t.set(A[1]);break;default:e.set(A[0],A[1]),t.set(A[2],A[3]);break}this.update=this.update.bind(this),this.position=e.on("update",this.update),this.size=t.on("update",this.update),this.update()}get x(){return this.position.x}get y(){return this.position.y}get left(){return this.position.x}get top(){return this.position.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get width(){return this.size.x}get height(){return this.size.y}update(){return this.end.set(this.position.x+this.size.x,this.position.y+this.size.y),this}toArray(){return[this.x,this.y,this.width,this.height]}}class Ze extends ds{constructor(e=!0){super();g(this,"_cx",1);g(this,"_sx",0);g(this,"_cy",0);g(this,"_sy",1);g(this,"_translateX",0);g(this,"_translateY",0);g(this,"_translateZ",1);g(this,"_scaleX",1);g(this,"_scaleY",1);g(this,"_skewX",0);g(this,"_skewY",0);g(this,"_rotate",0);g(this,"dirtyId",0);g(this,"_needsUpdateArray",!1);g(this,"_needsUpdateFields",!1);this.autoUpdate=e}_onUpdate(e){super._onUpdate(e),this._requestUpdateFields()}_updateSkew(){this._cx=Math.cos(this._rotate+this._skewY),this._sx=Math.sin(this._rotate+this._skewY),this._cy=-Math.sin(this._rotate-this._skewX),this._sy=Math.cos(this._rotate-this._skewX)}_requestUpdateArray(){this.autoUpdate?this._performUpdateArray():this._needsUpdateArray=!0}_requestUpdateFields(){this.autoUpdate?this._performUpdateFields():this._needsUpdateFields=!0}_performUpdateArray(){const e=this._cx*this._scaleX,t=this._sx*this._scaleX,i=this._cy*this._scaleY,s=this._sy*this._scaleY,n=this._translateX,o=this._translateY,a=this._translateZ,l=this._array;this._array=[e,i,n,t,s,o,l[6],l[7],a],this.dirtyId++}_performUpdateFields(){const{a:e,c:t,tx:i,b:s,d:n,ty:o,tz:a}=this.toObject(),l=-Math.atan2(-t,n),h=Math.atan2(s,e),c=Math.abs(l+h);c<1e-5||Math.abs(Ce-c)<1e-5?(this._rotate=h,this._skewX=this._skewY=0):(this._rotate=0,this._skewX=l,this._skewY=h),this._scaleX=Math.sqrt(e*e+s*s),this._scaleY=Math.sqrt(t*t+n*n),this._translateX=i,this._translateY=o,this._translateZ=a,this.dirtyId++}skew(e,t){return this._skewX=e,this._skewY=t,this._updateSkew(),this._requestUpdateArray(),this}skewX(e){return this.skew(e,this._skewY)}skewY(e){return this.skew(this._skewX,e)}translate(e,t,i=1){return this._translateX=e,this._translateY=t,this._translateZ=i,this._requestUpdateArray(),this}translateX(e){return this.translate(e,this._translateY)}translateY(e){return this.translate(this._translateX,e)}translateZ(e){return this.translate(this._translateX,this._translateY,e)}translate3d(e,t,i){return this.translate(e,t,i)}scale(e,t,i=1){return this._scaleX=e,this._scaleY=t,this._requestUpdateArray(),this}scaleX(e){return this.scale(e,this._scaleY)}scaleY(e){return this.scale(this._scaleX,e)}scale3d(e,t,i){return this.scale(e,t,i)}rotate(e){return this._rotate=e,this._updateSkew(),this._requestUpdateArray(),this}rotateX(e){return this.scaleY(this._rotateToScale(e))}rotateY(e){return this.scaleX(this._rotateToScale(e))}rotateZ(e){return this.rotate(e)}rotate3d(e,t,i,s){const[n,o,a]=this._rotate3d(e,t,i,s);return n&&this.rotateX(n),o&&this.rotateY(o),a&&this.rotateZ(a),this}_rotateToScale(e){const t=e/Ce;return t<=.5?t*-4+1:(t-1)*4+1}_rotate3d(e,t,i,s){if(e===1&&t===0&&i===0)return[s,0,0];if(e===0&&t===1&&i===0)return[0,s,0];if(e===0&&t===0)return[0,0,s];{const n=Math.cos(s),o=Math.sin(s),a=n+e*e*(1-n),l=e*t*(1-n)-i*o,h=e*i*(1-n)+t*o,c=n+t*t*(1-n),u=t*i*(1-n)-e*o,d=n+i*i*(1-n),I=-Math.atan2(-u,c),C=-Math.atan2(h,Math.sqrt(u*u+d*d)),B=-Math.atan2(-l,a);return[I,C,B]}}applyToPoint(e,t){const{a:i,c:s,tx:n,b:o,d:a,ty:l}=this.toObject();return[i*e+s*t+n,o*e+a*t+l]}inverse(){return this.clone().invert()}update(){let e=!1;return this._needsUpdateArray&&(this._needsUpdateArray=!1,this._performUpdateArray(),e=!0),this._needsUpdateFields&&(this._needsUpdateFields=!1,this._performUpdateFields(),e=!0),e}isIdentity(){const{a:e,b:t,c:i,d:s,tx:n,ty:o}=this.toObject();return e===1&&t===0&&i===0&&s===1&&n===0&&o===0}toObject(){const[e,t,i,s,n,o,,,a]=this._array;return{a:e,c:t,tx:i,b:s,d:n,ty:o,tz:a}}}class Bh extends wt{constructor(){super(3)}}var Eh=Object.defineProperty,fo=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Eh(A,e,i),i};class ji extends Wi{constructor(){super();g(this,"_starting",!1);g(this,"_nextDeltaTime",0);this._onNextTick=this._onNextTick.bind(this)}get starting(){return this._starting}get spf(){return this.fps?Math.floor(1e3/this.fps):0}start(e){return this._starting||(this._starting=!0,this.removeAllListeners(),this.on("process",e),Re.on(this._onNextTick,{sort:0})),this}stop(){return this._starting&&(this._starting=!1,Re.off(this._onNextTick,{sort:0})),this}_onNextTick(){const e=Re.elapsed*this.speed;if((this._nextDeltaTime-=e)<=0){const i=(this._nextDeltaTime=this.spf)||e;this.emit("process",i)}}}fo([_({default:24})],ji.prototype,"fps"),fo([_({default:1})],ji.prototype,"speed");class Io{constructor(){g(this,"view");g(this,"pixelRatio",ss);g(this,"screen",{x:0,y:0,width:0,height:0});g(this,"related",new RA)}getRelated(A,e){let t=this.related.get(A);return t||(e?(this.related.set(A,t=e()),t):(console.warn("Failed to get related",A),null))}resize(A,e,t=!0){const i=Math.floor(A*this.pixelRatio),s=Math.floor(e*this.pixelRatio),n=i/this.pixelRatio,o=s/this.pixelRatio;this.view&&(this.view.width=i,this.view.height=s),this.screen.width=n,this.screen.height=o,t&&this.view&&(this.view.style.width=`${n}px`,this.view.style.height=`${o}px`)}}var UA=(r=>(r.NORMAL="normal",r.ADD="add",r.MULTIPLY="multiply",r.SCREEN="screen",r.NONE="none",r.NORMAL_NPM="normal_npm",r.ADD_NPM="add_npm",r.SCREEN_NPM="screen_npm",r.SRC_IN="src_in",r.SRC_OUT="src_out",r.SRC_ATOP="src_atop",r.DST_OVER="dst_over",r.DST_IN="dst_in",r.DST_OUT="dst_out",r.DST_ATOP="dst_atop",r.XOR="xor",r.SUBTRACT="subtract",r))(UA||{});function Bo(r){return{normal:[r.ONE,r.ONE_MINUS_SRC_ALPHA],add:[r.ONE,r.ONE],multiply:[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],screen:[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],none:[0,0],normal_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],add_npm:[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],screen_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],src_in:[r.DST_ALPHA,r.ZERO],src_out:[r.ONE_MINUS_DST_ALPHA,r.ZERO],src_atop:[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],dst_over:[r.ONE_MINUS_DST_ALPHA,r.ONE],dst_in:[r.ZERO,r.SRC_ALPHA],dst_out:[r.ZERO,r.ONE_MINUS_SRC_ALPHA],dst_atop:[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],xor:[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],subtract:[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD]}}class Ct{get gl(){return this._renderer.gl}install(A){this._renderer=A}onUpdateContext(){}flush(){}reset(){}destroy(){}}const Fr=class Fr{constructor(A){g(this,"_blendMode",UA.NORMAL);g(this,"_polygonOffset",0);g(this,"bitmap",0);if(A)for(const e in A)this[e]=A[e]}static _init(){this._properties.forEach((A,e)=>{Object.defineProperty(this.prototype,A,{get(){return!!(this.bitmap&1<<e)},set(t){!!(this.bitmap&1<<e)!==t&&(this.bitmap^=1<<e)},enumerable:!0,configurable:!0})})}static for2D(){const A=new Fr;return A.depthTest=!1,A.blend=!0,A}get blendMode(){return this._blendMode}set blendMode(A){this.blend=A!==UA.NONE,this._blendMode=A}get polygonOffset(){return this._polygonOffset}set polygonOffset(A){this.offsets=!!A,this._polygonOffset=A}};g(Fr,"_properties",["blend","offsets","culling","depthTest","clockwiseFrontFace","depthMask"]);let EA=Fr;EA._init();class Eo extends Ct{constructor(){super(...arguments);g(this,"_blendEq",!1);g(this,"_setters",EA._properties.map(e=>this[`set${e.replace(/^\S/,t=>t.toUpperCase())}`]));g(this,"boundStateBitmap",0);g(this,"boundBlendMode");g(this,"blendModes");g(this,"defaultState",new EA({blend:!0}))}install(e){super.install(e),e.state=this}onUpdateContext(){super.onUpdateContext(),this.blendModes=Bo(this._renderer.gl)}toggle(e,t){this._renderer.gl[t?"enable":"disable"](e)}setBlend(e){this.toggle(this._renderer.gl.BLEND,e)}setOffsets(e){this.toggle(this._renderer.gl.POLYGON_OFFSET_FILL,e)}setCulling(e){this.toggle(this._renderer.gl.CULL_FACE,e)}setDepthTest(e){this.toggle(this._renderer.gl.DEPTH_TEST,e)}setDepthMask(e){this._renderer.gl.depthMask(e)}setClockwiseFrontFace(e){const t=this._renderer.gl;t.frontFace(t[e?"CW":"CCW"])}setBlendMode(e){if(e===this.boundBlendMode)return;this.boundBlendMode=e;const t=this.blendModes[e],i=this._renderer.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(e,t){this._renderer.gl.polygonOffset(e,t)}bind(e){var t;if(this.boundStateBitmap!==e.bitmap){let i=this.boundStateBitmap^e.bitmap,s=0;for(;i;)i&1&&((t=this._setters[s])==null||t.call(this,!!(e.bitmap&1<<s))),i=i>>1,s++;this.boundStateBitmap=e.bitmap}e.blend&&this.setBlendMode(e.blendMode),e.offsets&&this.setPolygonOffset(1,e.polygonOffset)}reset(){super.reset();const e=this._renderer.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.bind(this.defaultState),this._blendEq=!0,this.setBlendMode(UA.NORMAL)}}class po extends Ct{constructor(){super(...arguments);g(this,"_state",EA.for2D());g(this,"_batchSize",4096*4);g(this,"_vertexSize",27);g(this,"_drawCallUid",0);g(this,"_defaultModulate",4294967295);g(this,"_defaultBackgroundColor",0);g(this,"_defaultColorMatrixOffset",[0,0,0,0]);g(this,"_defaultColorMatrix",[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);g(this,"_batchables",[]);g(this,"_vertexCount",0);g(this,"_indexCount",0);g(this,"_attributeBuffer",[]);g(this,"_indexBuffers",[]);g(this,"_shaders",new Map);g(this,"_attributes",{aTextureId:{size:1,normalized:!0,type:"float"},aPosition:{size:2,normalized:!1,type:"float"},aUv:{size:2,normalized:!1,type:"float"},aModulate:{size:4,normalized:!0,type:"unsigned_byte"},aBackgroundColor:{size:4,normalized:!0,type:"unsigned_byte"},aColorMatrixOffset:{size:4,normalized:!1,type:"float"},aColorMatrix:{size:4,normalized:!1,type:"float"}})}install(e){super.install(e),e.batch2D=this}_getShader(e){let t=this._shaders.get(e);return t||this._shaders.set(e,t=this._createShader(e)),t}_createShader(e){const t=this._renderer,i=t.program.create({vert:`precision highp float;
2
2
  attribute float aTextureId;
3
3
  attribute vec2 aPosition;
4
4
  attribute vec2 aUv;
@@ -41,11 +41,11 @@ void main(void) {
41
41
  if (vTextureId < 0.0)
42
42
  {
43
43
  color = vec4(0.0, 0.0, 0.0, 0.0);
44
- }${Array.from({length:e},(c,f)=>{let p=" ";return f>=0&&(p+=`
45
- else `),f<e-1&&(p+=`
46
- if (vTextureId < ${f}.5)`),`${p}
44
+ }${Array.from({length:e},(h,c)=>{let u=" ";return c>=0&&(u+=`
45
+ else `),c<e-1&&(u+=`
46
+ if (vTextureId < ${c}.5)`),`${u}
47
47
  {
48
- color = texture2D(samplers[${f}], vUv);
48
+ color = texture2D(samplers[${c}], vUv);
49
49
  }`}).join("")}
50
50
 
51
51
  color += (1.0 - color.a) * vBackgroundColor;
@@ -55,10 +55,10 @@ void main(void) {
55
55
  color += vColorMatrixOffset;
56
56
  }
57
57
  gl_FragColor = color;
58
- }`}),s=t.buffer.create({target:"array_buffer",data:new Float32Array(1),usage:"dynamic_draw"}),o=t.buffer.create({target:"element_array_buffer",data:new Uint16Array(1),usage:"dynamic_draw"}),a={attributes:Object.fromEntries(Object.entries(this._attributes).map(([c,f])=>[c,{...f,buffer:s}])),elementArrayBuffer:o},l=t.vertexArray.create(i,a),h=new Int32Array(Array.from({length:e},(c,f)=>f));return{update:(c,f)=>{t.vertexArray.bind(l??a),t.buffer.update(s,{target:"array_buffer",data:c}),t.buffer.update(o,{target:"element_array_buffer",data:f})},draw:c=>{const f=this._renderer;f.program.bind(i),f.program.updateUniforms(i,{samplers:h,modulate:[1,1,1,1],translationMatrix:[1,0,0,0,1,0,0,0,1],...f.program.uniforms}),f.vertexArray.bind(l??a),f.draw(c)}}}render(e){const{vertices:t,indices:i}=e,s=t.length/2;this._vertexCount+s>this._batchSize&&this.flush(),this._vertexCount+=s,this._indexCount+=i.length,this._batchables.push(e)}flush(){if(super.flush(),this._vertexCount===0)return;const e=this._vertexCount,t=this._indexCount,i=this._batchables;this._batchables=[],this._vertexCount=0,this._indexCount=0;const s=this._renderer.texture.maxUnits,o=this._getAttributeBuffer(e),a=new Float32Array(o),l=new Uint32Array(o),h=this._getIndexBuffer(t);let c=0,f=0;const p=[];for(let g=i.length,_={id:++this._drawCallUid},y=[],E=new Map,T=0,P=0,S=0;S<g;S++){const w=i[S].texture,v=S===g-1;if(!w||E.has(w)){if(!v)continue}else y.push(w),E.set(w,T++);if(v||T>=s){_.textures=y,_.textureLocationMap=E,T=0,_.first=f;for(let x=P;x<=S;x++){const{indices:C,vertices:I,uvs:F=[],texture:B,modulate:U=this._defaultModulate,backgroundColor:V=this._defaultBackgroundColor,colorMatrix:A=this._defaultColorMatrix,colorMatrixOffset:N=this._defaultColorMatrixOffset,blendMode:W=Kt.NORMAL}=i[x],R=(B?E.get(B):-1)??-1;P<x&&_.blendMode!==W&&(_.count=f-_.first,p.push(_),P=x,_={id:++this._drawCallUid},_.textures=y,_.first=f);const D=c/this._vertexSize;for(let G=I.length,L=0;L<G;L+=2){a[c++]=R,a[c++]=I[L],a[c++]=I[L+1],a[c++]=F[L]??0,a[c++]=F[L+1]??0,l[c++]=U,l[c++]=V;for(let k=0;k<4;k++)a[c++]=N[k]??0;for(let k=0;k<16;k++)a[c++]=A[k]??0}for(let G=C.length,L=0;L<G;L++)h[f++]=D+C[L];_.blendMode=W}P=S+1,_.count=f-_.first,p.push(_),_={id:++this._drawCallUid},y=[],E=new Map}}const m=this._getShader(s);m.update(o,h);for(let g=p.length,_=0;_<g;_++){const y=p[_],{first:E=0,textures:T,textureLocationMap:P}=y;for(let S=T.length,w=0;w<S;w++){const v=T[w],x=P.get(v);x!==void 0&&this._renderer.texture.bind({target:"texture_2d",location:x,value:v})}this._state.blendMode=y.blendMode,this._renderer.state.bind(this._state),m.draw({mode:"triangles",count:y.count,first:E,bytesPerElement:2})}}_getAttributeBuffer(e){const t=ds(Math.ceil(e/8)),i=ps(t),s=t*8;this._attributeBuffer.length<=i&&(this._indexBuffers.length=i+1);let o=this._attributeBuffer[s];return o||(this._attributeBuffer[s]=o=new ArrayBuffer(s*this._vertexSize*4)),o}_getIndexBuffer(e){const t=ds(Math.ceil(e/12)),i=ps(t),s=t*12;this._indexBuffers.length<=i&&(this._indexBuffers.length=i+1);let o=this._indexBuffers[i];return o||(this._indexBuffers[i]=o=new Uint16Array(s)),o}}function ds(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function ps(n){let r=(n>65535?1:0)<<4;n>>>=r;let e=(n>255?1:0)<<3;return n>>>=e,r|=e,e=(n>15?1:0)<<2,n>>>=e,r|=e,e=(n>3?1:0)<<1,n>>>=e,r|=e,r|n>>1}class Qn extends He{constructor(){super(...arguments);u(this,"boundArrayBuffer",null);u(this,"boundTarget","array_buffer")}install(e){super.install(e),e.buffer=this}create(e){const t=this.gl.createBuffer();if(!t)throw new Error("failed to create");return e&&(this.bind({target:e.target,value:t}),this.update(e)),t}getMeta(e){return this._renderer.getRelated(e,()=>({id:gn(e),length:0,byteLength:0,bytesPerElement:0}))}update(...e){if(e.length>1){this.bind({target:e[1].target,value:e[0]}),this.update(e[1]);return}const t=e[0],i=(t.target??this.boundTarget)==="array_buffer"?this.boundArrayBuffer:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer;if(!i)return;const s=this.getMeta(i);Object.assign(s,{target:t.target,usage:t.usage});const o=s.target??this.boundTarget,a=s.usage??"static_draw",l=t.data,h=this.gl;let c;Array.isArray(l)?o==="array_buffer"?c=new Float32Array(l):c=new Uint32Array(l):c=l;const f=this._renderer.getBindPoint(o);c&&c.byteLength<=s.byteLength?h.bufferSubData(f,0,c):(h.bufferData(f,c,this._renderer.getBindPoint(a)),s.length=(c==null?void 0:c.length)??0,s.byteLength=(c==null?void 0:c.byteLength)??0,s.bytesPerElement=s.length?s.byteLength/s.length:0)}bind(e){let{target:t,value:i}=e;if(i){const o=this.getMeta(i);t??(t=o.target??this.boundTarget),o.target=t}else t??(t=this.boundTarget);const s=this._renderer.getBindPoint(t);this._renderer.gl.bindBuffer(s,i),t==="array_buffer"?this.boundArrayBuffer=i:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer=i,this.boundTarget=t}unbind(e){return this.bind({target:e,value:null})}reset(){super.reset(),this.boundArrayBuffer=null,this.boundTarget="array_buffer"}}class eo extends He{constructor(){super(...arguments);u(this,"boundFramebuffer",null);u(this,"_msaaSamples",[]);u(this,"_hasMRT",!0);u(this,"_writeDepthTexture",!0)}install(e){super.install(e),e.framebuffer=this}onUpdateContext(){if(this._hasMRT=!0,this._writeDepthTexture=!0,this._renderer.version===1){const e=this._renderer.gl,t=this._renderer.extensions.drawBuffers,i=this._renderer.extensions.depthTexture;t?e.drawBuffers=s=>t.drawBuffersWEBGL(s):(this._hasMRT=!1,e.drawBuffers=()=>{}),i||(this._writeDepthTexture=!1)}else{const e=this._renderer.gl;this._msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}}create(e){const t=this._renderer.gl.createFramebuffer();if(!t)throw new Error("Unable to create framebuffer");return e&&(this.bind(t),this.update(e)),t}getMeta(e){return this._renderer.getRelated(e,()=>({width:0,height:0,mipLevel:0,stencil:!1,depth:!1,depthTexture:null,colorTextures:[],multisample:0}))}update(...e){if(e.length>1)return this.bind(e[0]),this.update(e[1]);const t=this.boundFramebuffer;if(!t)return;const i=e[0],s=this.getMeta(t);Object.assign(s,{...i});const o=this._renderer.gl;let a=s.colorTextures.length;"drawBuffers"in o||(a=Math.min(a,1));for(let l=0;l<a;l++){const h=s.colorTextures[l];this._renderer.texture.bind({location:0,target:"texture_2d",value:h,forceUpdateLocation:!0}),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+l,o.TEXTURE_2D,h,s.mipLevel),this._renderer.texture.unbind(h)}if(a>1&&o.drawBuffers(s.colorTextures.map((l,h)=>o.COLOR_ATTACHMENT0+h)),s.depthTexture&&(this._renderer.version>1||this._renderer.extensions.depthTexture)&&(this._renderer.texture.bind({location:0,target:"texture_2d",value:s.depthTexture,forceUpdateLocation:!0}),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,s.depthTexture,s.mipLevel),this._renderer.texture.unbind(s.depthTexture)),(s.stencilBuffer||s.stencil||s.depth)&&!(s.depthTexture&&this._writeDepthTexture)){s.stencilBuffer??(s.stencilBuffer=o.createRenderbuffer()),o.bindRenderbuffer(o.RENDERBUFFER,s.stencilBuffer);const{attachment:l,format:h}=this._getAttachmentAndFormat(s);s.msaaBuffer?o.renderbufferStorageMultisample(o.RENDERBUFFER,s.multisample,h,s.width,s.height):o.renderbufferStorage(o.RENDERBUFFER,h,s.width*this._renderer.pixelRatio,s.height*this._renderer.pixelRatio),o.framebufferRenderbuffer(o.FRAMEBUFFER,l,o.RENDERBUFFER,s.stencilBuffer)}else s.stencilBuffer&&(o.deleteRenderbuffer(s.stencilBuffer),s.stencilBuffer=null)}_getAttachmentAndFormat(e){const t=this.gl;let i,s;return this._renderer.version===1?(i=t.DEPTH_STENCIL_ATTACHMENT,s=t.DEPTH_STENCIL):e.depth&&e.stencil?(i=t.DEPTH_STENCIL_ATTACHMENT,s=t.DEPTH24_STENCIL8):e.depth?(i=t.DEPTH_ATTACHMENT,s=t.DEPTH_COMPONENT24):(i=t.STENCIL_ATTACHMENT,s=t.STENCIL_INDEX8),{attachment:i,format:s}}resize(e,t,i){const s=this.gl,o=this.getMeta(e);if(Object.assign(o,{width:t,height:i}),o.stencil){const{format:l}=this._getAttachmentAndFormat(o);s.bindRenderbuffer(s.RENDERBUFFER,o.stencil),o.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,o.multisample,l,o.width,o.height):s.renderbufferStorage(s.RENDERBUFFER,l,o.width,o.height)}let a=o.colorTextures.length;s.drawBuffers||(a=Math.min(a,1));for(let l=0;l<a;l++){const h=o.colorTextures[l];this._renderer.texture.update(h,{value:{pixels:null,width:o.width,height:o.height}}),l===0&&o.msaaBuffer&&(s.bindRenderbuffer(s.RENDERBUFFER,o.msaaBuffer),s.renderbufferStorageMultisample(s.RENDERBUFFER,o.multisample,s.RGBA,o.width,o.height))}o.depthTexture&&this._renderer.texture.update(o.depthTexture,{value:{pixels:null,width:o.width,height:o.height}})}bind(e){const t=this._renderer.gl,i=e;if({value:this.boundFramebuffer!==i}.value&&(t.bindFramebuffer(t.FRAMEBUFFER,i),this.boundFramebuffer=i),i){const a=this.getMeta(i);for(let c=0;c<a.colorTextures.length;c++)this._renderer.texture.unbind(a.colorTextures[c]);a.depthTexture&&this._renderer.texture.unbind(a.depthTexture);const l=a.width>>a.mipLevel,h=a.height>>a.mipLevel;this._renderer.viewport.bind({x:0,y:0,width:l*this._renderer.pixelRatio,height:h*this._renderer.pixelRatio})}else this._renderer.viewport.bind({x:0,y:0,width:this._renderer.screen.width,height:this._renderer.screen.height})}forceStencil(){const e=this.boundFramebuffer;if(!e)return;const t=this.getMeta(e);if(!t||t.stencilBuffer)return;const i=this._renderer.gl;t.stencilBuffer=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,t.stencilBuffer);let s,o;this._renderer.version===1?(s=i.DEPTH_STENCIL_ATTACHMENT,o=i.DEPTH_STENCIL):t.depth?(s=i.DEPTH_STENCIL_ATTACHMENT,o=i.DEPTH24_STENCIL8):(s=i.STENCIL_ATTACHMENT,o=i.STENCIL_INDEX8),t.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,t.multisample,o,t.width*this._renderer.pixelRatio,t.height*this._renderer.pixelRatio):i.renderbufferStorage(i.RENDERBUFFER,o,t.width*this._renderer.pixelRatio,t.height*this._renderer.pixelRatio),i.framebufferRenderbuffer(i.FRAMEBUFFER,s,i.RENDERBUFFER,t.stencilBuffer)}reset(){super.reset(),this.boundFramebuffer=null}}class to extends He{constructor(){super(...arguments);u(this,"stack",[])}install(e){super.install(e),e.mask=this}get length(){return this.stack.length}get last(){return this.stack[this.length-1]}push(e,t){const i={source:e,mask:t};this.stack.push(i),typeof i.mask=="number"?this.pushColorMask(i):"render"in i.mask?this._renderer.stencil.push(i):this._renderer.scissor.push(i)}pop(e){const t=this.stack.pop();!t||t.source!==e||(typeof t.mask=="number"?this.popColorMask(t):"render"in t.mask?this._renderer.stencil.pop(t):this._renderer.scissor.pop(t))}pushColorMask(e){const t=e.preComputedColor??15,i=e.preComputedColor=t&e.mask;i!==t&&this.useColorMask(i)}popColorMask(e){const t=e.preComputedColor??15,i=this.length>0?this.last.preComputedColor??15:15;i!==t&&this.useColorMask(i)}useColorMask(e){this._renderer.gl.colorMask((e&1)!==0,(e&2)!==0,(e&4)!==0,(e&8)!==0)}}class ro extends He{constructor(){super(...arguments);u(this,"boundProgram",null);u(this,"uniforms",{projectionMatrix:[1,0,0,0,1,0,0,0,1]})}install(e){super.install(e),e.program=this}create(e){const t=this.gl.createProgram();if(!t)throw new Error("Unable to create program");return e&&this.update(t,e),t}getMeta(e){return this._renderer.getRelated(e,()=>({attributes:new Map,uniforms:new Map,boundUniforms:new Zt}))}update(...e){if(e.length>1){const h=this.boundProgram;this.boundProgram=e[0],this.update(e[1]),this.boundProgram=h;return}const t=e[0],i=this.boundProgram;if(!i)return;const s=this.gl,o=this.getMeta(i),a=this.createShader(t.vert,"vertex_shader"),l=this.createShader(t.frag,"fragment_shader");if(s.attachShader(i,a),s.attachShader(i,l),s.linkProgram(i),s.deleteShader(a),s.deleteShader(l),!s.getProgramParameter(i,s.LINK_STATUS))throw new Error(`Unable to link program: ${s.getProgramInfoLog(i)}`);o.attributes.clear(),o.uniforms.clear();for(let h=s.getProgramParameter(i,s.ACTIVE_ATTRIBUTES),c=0;c<h;c++){const f=s.getActiveAttrib(i,c);if(!f||f.name.startsWith("gl_"))continue;const p=this._renderer.bindPoints.get(f.type)??String(f.type);o.attributes.set(f.name,{type:p,name:f.name,size:Fl(p),location:s.getAttribLocation(i,f.name)})}for(let h=s.getProgramParameter(i,s.ACTIVE_UNIFORMS),c=0;c<h;c++){const f=s.getActiveUniform(i,c);if(!f)continue;const p=f.name.replace(/\[.*?\]$/,"");let m=s.getUniformLocation(i,p);m||(m=s.getUniformLocation(i,f.name)),o.uniforms.set(p,{name:p,index:c,type:this._renderer.bindPoints.get(f.type)??String(f.type),size:f.size,isArray:p!==f.name,location:m})}}bind(e){const t=this.gl;({value:this.boundProgram!==e}).value&&(t.useProgram(e),this.boundProgram=e)}createShader(e,t){const i=this.gl,s=i.createShader(this._renderer.getBindPoint(t));if(!s)throw new Error("Unable to create shader");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error(`Unable to compiling shader :
58
+ }`}),s=t.buffer.create({target:"array_buffer",data:new Float32Array(1),usage:"dynamic_draw"}),n=t.buffer.create({target:"element_array_buffer",data:new Uint16Array(1),usage:"dynamic_draw"}),o={attributes:Object.fromEntries(Object.entries(this._attributes).map(([h,c])=>[h,{...c,buffer:s}])),elementArrayBuffer:n},a=t.vertexArray.create(i,o),l=new Int32Array(Array.from({length:e},(h,c)=>c));return{update:(h,c)=>{t.vertexArray.bind(a??o),t.buffer.update(s,{target:"array_buffer",data:h}),t.buffer.update(n,{target:"element_array_buffer",data:c})},draw:h=>{const c=this._renderer;c.program.bind(i),c.program.updateUniforms(i,{samplers:l,modulate:[1,1,1,1],translationMatrix:[1,0,0,0,1,0,0,0,1],...c.program.uniforms}),c.vertexArray.bind(a??o),c.draw(h)}}}render(e){const{vertices:t,indices:i}=e,s=t.length/2;this._vertexCount+s>this._batchSize&&this.flush(),this._vertexCount+=s,this._indexCount+=i.length,this._batchables.push(e)}flush(){if(super.flush(),this._vertexCount===0)return;const e=this._vertexCount,t=this._indexCount,i=this._batchables;this._batchables=[],this._vertexCount=0,this._indexCount=0;const s=this._renderer.texture.maxUnits,n=this._getAttributeBuffer(e),o=new Float32Array(n),a=new Uint32Array(n),l=this._getIndexBuffer(t);let h=0,c=0;const u=[];for(let I=i.length,C={id:++this._drawCallUid},B=[],U=new Map,M=0,D=0,R=0;R<I;R++){const b=i[R].texture,Q=R===I-1;if(!b||U.has(b)){if(!Q)continue}else B.push(b),U.set(b,M++);if(Q||M>=s){C.textures=B,C.textureLocationMap=U,M=0,C.first=c;for(let v=D;v<=R;v++){const{indices:x,vertices:k,uvs:Z=[],texture:Y,modulate:L=this._defaultModulate,backgroundColor:te=this._defaultBackgroundColor,colorMatrix:N=this._defaultColorMatrix,colorMatrixOffset:$=this._defaultColorMatrixOffset,blendMode:Ae=UA.NORMAL}=i[v],J=(Y?U.get(Y):-1)??-1;D<v&&C.blendMode!==Ae&&(C.count=c-C.first,u.push(C),D=v,C={id:++this._drawCallUid},C.textures=B,C.first=c);const H=h/this._vertexSize;for(let oe=k.length,z=0;z<oe;z+=2){o[h++]=J,o[h++]=k[z],o[h++]=k[z+1],o[h++]=Z[z]??0,o[h++]=Z[z+1]??0,a[h++]=L,a[h++]=te;for(let X=0;X<4;X++)o[h++]=$[X]??0;for(let X=0;X<16;X++)o[h++]=N[X]??0}for(let oe=x.length,z=0;z<oe;z++)l[c++]=H+x[z];C.blendMode=Ae}D=R+1,C.count=c-C.first,u.push(C),C={id:++this._drawCallUid},B=[],U=new Map}}const d=this._getShader(s);d.update(n,l);for(let I=u.length,C=0;C<I;C++){const B=u[C],{first:U=0,textures:M,textureLocationMap:D}=B;for(let R=M.length,b=0;b<R;b++){const Q=M[b],v=D.get(Q);v!==void 0&&this._renderer.texture.bind({target:"texture_2d",location:v,value:Q})}this._state.blendMode=B.blendMode,this._renderer.state.bind(this._state),d.draw({mode:"triangles",count:B.count,first:U,bytesPerElement:2})}}_getAttributeBuffer(e){const t=Is(Math.ceil(e/8)),i=Bs(t),s=t*8;this._attributeBuffer.length<=i&&(this._indexBuffers.length=i+1);let n=this._attributeBuffer[s];return n||(this._attributeBuffer[s]=n=new ArrayBuffer(s*this._vertexSize*4)),n}_getIndexBuffer(e){const t=Is(Math.ceil(e/12)),i=Bs(t),s=t*12;this._indexBuffers.length<=i&&(this._indexBuffers.length=i+1);let n=this._indexBuffers[i];return n||(this._indexBuffers[i]=n=new Uint16Array(s)),n}}function Is(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Bs(r){let A=(r>65535?1:0)<<4;r>>>=A;let e=(r>255?1:0)<<3;return r>>>=e,A|=e,e=(r>15?1:0)<<2,r>>>=e,A|=e,e=(r>3?1:0)<<1,r>>>=e,A|=e,A|r>>1}class Co extends Ct{constructor(){super(...arguments);g(this,"boundArrayBuffer",null);g(this,"boundTarget","array_buffer")}install(e){super.install(e),e.buffer=this}create(e){const t=this.gl.createBuffer();if(!t)throw new Error("failed to create");return e&&(this.bind({target:e.target,value:t}),this.update(e)),t}getMeta(e){return this._renderer.getRelated(e,()=>({id:Nn(e),length:0,byteLength:0,bytesPerElement:0}))}update(...e){if(e.length>1){this.bind({target:e[1].target,value:e[0]}),this.update(e[1]);return}const t=e[0],i=(t.target??this.boundTarget)==="array_buffer"?this.boundArrayBuffer:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer;if(!i)return;const s=this.getMeta(i);Object.assign(s,{target:t.target,usage:t.usage});const n=s.target??this.boundTarget,o=s.usage??"static_draw",a=t.data,l=this.gl;let h;Array.isArray(a)?n==="array_buffer"?h=new Float32Array(a):h=new Uint32Array(a):h=a;const c=this._renderer.getBindPoint(n);h&&h.byteLength<=s.byteLength?l.bufferSubData(c,0,h):(l.bufferData(c,h,this._renderer.getBindPoint(o)),s.length=(h==null?void 0:h.length)??0,s.byteLength=(h==null?void 0:h.byteLength)??0,s.bytesPerElement=s.length?s.byteLength/s.length:0)}bind(e){let{target:t,value:i}=e;if(i){const n=this.getMeta(i);t??(t=n.target??this.boundTarget),n.target=t}else t??(t=this.boundTarget);const s=this._renderer.getBindPoint(t);this._renderer.gl.bindBuffer(s,i),t==="array_buffer"?this.boundArrayBuffer=i:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer=i,this.boundTarget=t}unbind(e){return this.bind({target:e,value:null})}reset(){super.reset(),this.boundArrayBuffer=null,this.boundTarget="array_buffer"}}class Qo extends Ct{constructor(){super(...arguments);g(this,"boundFramebuffer",null);g(this,"_msaaSamples",[]);g(this,"_hasMRT",!0);g(this,"_writeDepthTexture",!0)}install(e){super.install(e),e.framebuffer=this}onUpdateContext(){if(this._hasMRT=!0,this._writeDepthTexture=!0,this._renderer.version===1){const e=this._renderer.gl,t=this._renderer.extensions.drawBuffers,i=this._renderer.extensions.depthTexture;t?e.drawBuffers=s=>t.drawBuffersWEBGL(s):(this._hasMRT=!1,e.drawBuffers=()=>{}),i||(this._writeDepthTexture=!1)}else{const e=this._renderer.gl;this._msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}}create(e){const t=this._renderer.gl.createFramebuffer();if(!t)throw new Error("Unable to create framebuffer");return e&&(this.bind(t),this.update(e)),t}getMeta(e){return this._renderer.getRelated(e,()=>({width:0,height:0,mipLevel:0,stencil:!1,depth:!1,depthTexture:null,colorTextures:[],multisample:0}))}update(...e){if(e.length>1)return this.bind(e[0]),this.update(e[1]);const t=this.boundFramebuffer;if(!t)return;const i=e[0],s=this.getMeta(t);Object.assign(s,{...i});const n=this._renderer.gl;let o=s.colorTextures.length;"drawBuffers"in n||(o=Math.min(o,1));for(let a=0;a<o;a++){const l=s.colorTextures[a];this._renderer.texture.bind({location:0,target:"texture_2d",value:l,forceUpdateLocation:!0}),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+a,n.TEXTURE_2D,l,s.mipLevel),this._renderer.texture.unbind(l)}if(o>1&&n.drawBuffers(s.colorTextures.map((a,l)=>n.COLOR_ATTACHMENT0+l)),s.depthTexture&&(this._renderer.version>1||this._renderer.extensions.depthTexture)&&(this._renderer.texture.bind({location:0,target:"texture_2d",value:s.depthTexture,forceUpdateLocation:!0}),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,s.depthTexture,s.mipLevel),this._renderer.texture.unbind(s.depthTexture)),(s.stencilBuffer||s.stencil||s.depth)&&!(s.depthTexture&&this._writeDepthTexture)){s.stencilBuffer??(s.stencilBuffer=n.createRenderbuffer()),n.bindRenderbuffer(n.RENDERBUFFER,s.stencilBuffer);const{attachment:a,format:l}=this._getAttachmentAndFormat(s);s.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,s.multisample,l,s.width,s.height):n.renderbufferStorage(n.RENDERBUFFER,l,s.width*this._renderer.pixelRatio,s.height*this._renderer.pixelRatio),n.framebufferRenderbuffer(n.FRAMEBUFFER,a,n.RENDERBUFFER,s.stencilBuffer)}else s.stencilBuffer&&(n.deleteRenderbuffer(s.stencilBuffer),s.stencilBuffer=null)}_getAttachmentAndFormat(e){const t=this.gl;let i,s;return this._renderer.version===1?(i=t.DEPTH_STENCIL_ATTACHMENT,s=t.DEPTH_STENCIL):e.depth&&e.stencil?(i=t.DEPTH_STENCIL_ATTACHMENT,s=t.DEPTH24_STENCIL8):e.depth?(i=t.DEPTH_ATTACHMENT,s=t.DEPTH_COMPONENT24):(i=t.STENCIL_ATTACHMENT,s=t.STENCIL_INDEX8),{attachment:i,format:s}}resize(e,t,i){const s=this.gl,n=this.getMeta(e);if(Object.assign(n,{width:t,height:i}),n.stencil){const{format:a}=this._getAttachmentAndFormat(n);s.bindRenderbuffer(s.RENDERBUFFER,n.stencil),n.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,n.multisample,a,n.width,n.height):s.renderbufferStorage(s.RENDERBUFFER,a,n.width,n.height)}let o=n.colorTextures.length;s.drawBuffers||(o=Math.min(o,1));for(let a=0;a<o;a++){const l=n.colorTextures[a];this._renderer.texture.update(l,{value:{pixels:null,width:n.width,height:n.height}}),a===0&&n.msaaBuffer&&(s.bindRenderbuffer(s.RENDERBUFFER,n.msaaBuffer),s.renderbufferStorageMultisample(s.RENDERBUFFER,n.multisample,s.RGBA,n.width,n.height))}n.depthTexture&&this._renderer.texture.update(n.depthTexture,{value:{pixels:null,width:n.width,height:n.height}})}bind(e){const t=this._renderer.gl,i=e;if({value:this.boundFramebuffer!==i}.value&&(t.bindFramebuffer(t.FRAMEBUFFER,i),this.boundFramebuffer=i),i){const o=this.getMeta(i);for(let h=0;h<o.colorTextures.length;h++)this._renderer.texture.unbind(o.colorTextures[h]);o.depthTexture&&this._renderer.texture.unbind(o.depthTexture);const a=o.width>>o.mipLevel,l=o.height>>o.mipLevel;this._renderer.viewport.bind({x:0,y:0,width:a*this._renderer.pixelRatio,height:l*this._renderer.pixelRatio})}else this._renderer.viewport.bind({x:0,y:0,width:this._renderer.screen.width,height:this._renderer.screen.height})}forceStencil(){const e=this.boundFramebuffer;if(!e)return;const t=this.getMeta(e);if(!t||t.stencilBuffer)return;const i=this._renderer.gl;t.stencilBuffer=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,t.stencilBuffer);let s,n;this._renderer.version===1?(s=i.DEPTH_STENCIL_ATTACHMENT,n=i.DEPTH_STENCIL):t.depth?(s=i.DEPTH_STENCIL_ATTACHMENT,n=i.DEPTH24_STENCIL8):(s=i.STENCIL_ATTACHMENT,n=i.STENCIL_INDEX8),t.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,t.multisample,n,t.width*this._renderer.pixelRatio,t.height*this._renderer.pixelRatio):i.renderbufferStorage(i.RENDERBUFFER,n,t.width*this._renderer.pixelRatio,t.height*this._renderer.pixelRatio),i.framebufferRenderbuffer(i.FRAMEBUFFER,s,i.RENDERBUFFER,t.stencilBuffer)}reset(){super.reset(),this.boundFramebuffer=null}}class yo extends Ct{constructor(){super(...arguments);g(this,"stack",[])}install(e){super.install(e),e.mask=this}get length(){return this.stack.length}get last(){return this.stack[this.length-1]}push(e,t){const i={source:e,mask:t};this.stack.push(i),typeof i.mask=="number"?this.pushColorMask(i):"render"in i.mask?this._renderer.stencil.push(i):this._renderer.scissor.push(i)}pop(e){const t=this.stack.pop();!t||t.source!==e||(typeof t.mask=="number"?this.popColorMask(t):"render"in t.mask?this._renderer.stencil.pop(t):this._renderer.scissor.pop(t))}pushColorMask(e){const t=e.preComputedColor??15,i=e.preComputedColor=t&e.mask;i!==t&&this.useColorMask(i)}popColorMask(e){const t=e.preComputedColor??15,i=this.length>0?this.last.preComputedColor??15:15;i!==t&&this.useColorMask(i)}useColorMask(e){this._renderer.gl.colorMask((e&1)!==0,(e&2)!==0,(e&4)!==0,(e&8)!==0)}}class mo extends Ct{constructor(){super(...arguments);g(this,"boundProgram",null);g(this,"uniforms",{projectionMatrix:[1,0,0,0,1,0,0,0,1]})}install(e){super.install(e),e.program=this}create(e){const t=this.gl.createProgram();if(!t)throw new Error("Unable to create program");return e&&this.update(t,e),t}getMeta(e){return this._renderer.getRelated(e,()=>({attributes:new Map,uniforms:new Map,boundUniforms:new RA}))}update(...e){if(e.length>1){const l=this.boundProgram;this.boundProgram=e[0],this.update(e[1]),this.boundProgram=l;return}const t=e[0],i=this.boundProgram;if(!i)return;const s=this.gl,n=this.getMeta(i),o=this.createShader(t.vert,"vertex_shader"),a=this.createShader(t.frag,"fragment_shader");if(s.attachShader(i,o),s.attachShader(i,a),s.linkProgram(i),s.deleteShader(o),s.deleteShader(a),!s.getProgramParameter(i,s.LINK_STATUS))throw new Error(`Unable to link program: ${s.getProgramInfoLog(i)}`);n.attributes.clear(),n.uniforms.clear();for(let l=s.getProgramParameter(i,s.ACTIVE_ATTRIBUTES),h=0;h<l;h++){const c=s.getActiveAttrib(i,h);if(!c||c.name.startsWith("gl_"))continue;const u=this._renderer.bindPoints.get(c.type)??String(c.type);n.attributes.set(c.name,{type:u,name:c.name,size:ph(u),location:s.getAttribLocation(i,c.name)})}for(let l=s.getProgramParameter(i,s.ACTIVE_UNIFORMS),h=0;h<l;h++){const c=s.getActiveUniform(i,h);if(!c)continue;const u=c.name.replace(/\[.*?\]$/,"");let d=s.getUniformLocation(i,u);d||(d=s.getUniformLocation(i,c.name)),n.uniforms.set(u,{name:u,index:h,type:this._renderer.bindPoints.get(c.type)??String(c.type),size:c.size,isArray:u!==c.name,location:d})}}bind(e){const t=this.gl;({value:this.boundProgram!==e}).value&&(t.useProgram(e),this.boundProgram=e)}createShader(e,t){const i=this.gl,s=i.createShader(this._renderer.getBindPoint(t));if(!s)throw new Error("Unable to create shader");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error(`Unable to compiling shader :
59
59
  ${e}
60
- ${i.getShaderInfoLog(s)}`);return s}updateUniforms(...e){if(e.length>1){this.bind(e[0]),this.updateUniforms(e[1]);return}const t=this.boundProgram;if(!t)return;const i=this.gl,s=e[0],{uniforms:o,boundUniforms:a}=this.getMeta(t);for(const l in s){const h=s[l],c=o.get(l);if(!c)continue;const{type:f,isArray:p,location:m}=c;if(!(!m||a.get(m)===h))switch(a.set(m,h),f){case"float":p?i.uniform1fv(m,h):i.uniform1f(m,h);break;case"unsigned_int":p?i.uniform1uiv(m,h):i.uniform1ui(m,h);break;case"bool":case"int":case"sampler_2d":case"sampler_cube":case"sampler_2d_array":p?i.uniform1iv(m,h):i.uniform1i(m,h);break;case"bool_vec2":case"int_vec2":i.uniform2iv(m,h);break;case"unsigned_int_vec2":i.uniform2uiv(m,h);break;case"float_vec2":i.uniform2fv(m,h);break;case"bool_vec3":case"int_vec3":i.uniform3iv(m,h);break;case"unsigned_int_vec3":i.uniform3uiv(m,h);break;case"float_vec3":i.uniform3fv(m,h);break;case"bool_vec4":case"int_vec4":i.uniform4iv(m,h);break;case"unsigned_int_vec4":i.uniform4uiv(m,h);break;case"float_vec4":i.uniform4fv(m,h);break;case"float_mat2":i.uniformMatrix2fv(m,!1,h);break;case"float_mat3":i.uniformMatrix3fv(m,!1,h);break;case"float_mat4":i.uniformMatrix4fv(m,!1,h);break}}}reset(){super.reset(),this.boundProgram=null,this.uniforms={}}destroy(){super.destroy(),this.bind(null)}}function Fl(n){switch(n){case"float":case"int":case"unsigned_int":case"bool":case"sampler_2d":return 1;case"float_vec2":case"int_vec2":case"unsigned_int_vec2":case"bool_vec2":return 2;case"float_vec3":case"int_vec3":case"unsigned_int_vec3":case"bool_vec3":return 3;case"float_vec4":case"int_vec4":case"unsigned_int_vec4":case"bool_vec4":case"float_mat2":return 4;case"float_mat3":return 9;case"float_mat4":return 16;default:return 1}}class io extends He{install(r){super.install(r),r.scissor=this}get length(){var r;return((r=this._renderer.mask.last)==null?void 0:r.scissorCounter)??0}push(r){const e=this._renderer.gl;e.enable(e.SCISSOR_TEST),r.scissorCounter??(r.scissorCounter=0),r.scissorCounter++,this.use()}pop(r){if(this.length>0)this.use();else{const e=this._renderer.gl;e.disable(e.SCISSOR_TEST)}}use(){const r=this._renderer,{pixelRatio:e,mask:t,viewport:i,screen:s,gl:o}=r,a=t.last.mask;let l;i.boundViewport?l=i.boundViewport.height-(a.height+a.y)*e:l=(s.height-(a.height+a.y))*e,o.scissor(a.x*e,l,a.width*e,a.height*e)}}class so extends He{install(r){super.install(r),r.stencil=this}get length(){var r;return((r=this._renderer.mask.last)==null?void 0:r.stencilCounter)??0}push(r){const e=this._renderer.gl,t=r.mask,i=r.stencilCounter??(r.stencilCounter=0);r.stencilCounter===0&&(this._renderer.framebuffer.forceStencil(),e.clearStencil(0),e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST)),r.stencilCounter++;const s=r.color;s&&(r.color=0,e.colorMask(!1,!1,!1,!1)),e.stencilFunc(e.EQUAL,i,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.INCR),t.render(this._renderer),this._renderer.flush(),s&&(r.color=s,e.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this.use()}pop(r){const e=this._renderer.gl,t=r.mask;if(!this.length)e.disable(e.STENCIL_TEST);else{const i=this._renderer.mask.last,s=(i==null?void 0:i.color)??15;s!==0&&(i.color=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.render(this._renderer),this._renderer.flush(),s!==0&&(i.color=s,e.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this.use()}}use(){const r=this._renderer.gl;r.stencilFunc(r.EQUAL,this.length,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP)}}function $l(n,r){const e=new Set([...Object.keys(n),...Object.keys(r)]),t={};return e.forEach(i=>{t[i]=n[i]!==r[i]}),t}class no extends He{constructor(){super(...arguments);u(this,"maxUnits",0);u(this,"boundLocation",0);u(this,"boundTarget","texture_2d");u(this,"boundTextures",[]);u(this,"emptyTextures",{texture_2d:null,texture_cube_map:null})}install(e){super.install(e),e.texture=this}onUpdateContext(){super.onUpdateContext();const e=this.gl;this.maxUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(let s=0;s<this.maxUnits;s++)this.boundTextures[s]={texture_2d:null,texture_cube_map:null};const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4));const i=e.createTexture();e.bindTexture(e.TEXTURE_CUBE_MAP,i);for(let s=0;s<6;s++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR),this.emptyTextures={texture_2d:t,texture_cube_map:i};for(let s=this.boundTextures.length,o=0;o<s;o++)this.unbind(o)}create(e){const t=this.gl.createTexture();if(!t)throw new Error("Unable to create texture");return e&&(this.bind({location:e.location,target:e.target,value:t,forceUpdateLocation:!0}),this.update({filterMode:"linear",wrapMode:"repeat",...e})),t}getMeta(e){return this._renderer.getRelated(e,()=>({}))}update(...e){if(e.length>1){this.bind({location:e[1].location,target:e[1].target,value:e[0],forceUpdateLocation:!0}),this.update(e[1]);return}const t=e[0],{value:i,...s}=t,o=this.boundTextures[this.boundLocation][t.target??this.boundTarget];if(!o)return;const a=this.gl,l=this.getMeta(o),h=$l(l,s);Object.assign(l,s);const c=this._renderer.getBindPoint(l.target??this.boundTarget);if(i!==void 0&&(i===null?a.texImage2D(c,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,null):"pixels"in i?a.texImage2D(c,0,a.RGBA,i.width,i.height,0,a.RGBA,a.UNSIGNED_BYTE,i.pixels):a.texImage2D(c,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,i)),h.wrapMode&&l.wrapMode){const p=this._renderer.getBindPoint(l.wrapMode);a.texParameteri(c,a.TEXTURE_WRAP_S,p),a.texParameteri(c,a.TEXTURE_WRAP_T,p)}const f=l.filterMode;if(h.filterMode&&f){const p=this._renderer.getBindPoint(f.split("_")[0]);f.includes("_")?a.texParameteri(c,a.TEXTURE_MIN_FILTER,this._renderer.getBindPoint(f)):a.texParameteri(c,a.TEXTURE_MIN_FILTER,p),a.texParameteri(c,a.TEXTURE_MAG_FILTER,p)}if(l.anisoLevel&&f==="linear"&&this._renderer.extensions.anisotropicFiltering&&h.anisoLevel){const{MAX_TEXTURE_MAX_ANISOTROPY_EXT:p,TEXTURE_MAX_ANISOTROPY_EXT:m}=this._renderer.extensions.anisotropicFiltering;a.texParameterf(c,m,Math.min(l.anisoLevel,a.getParameter(p)))}}bind(e){const t=this.gl;let i,s,o,a;if(e&&"value"in e?{target:s,value:i,location:o,forceUpdateLocation:a}=e:i=e,i){const g=this.getMeta(i);g.target=s??(s=g.target??"texture_2d"),g.location=o??(o=g.location??0)}else s??(s="texture_2d"),o??(o=0);let l=this.boundTextures[o];l||(this.boundTextures[o]=l={texture_2d:null,texture_cube_map:null});const h=l[s]??null,c=this.boundLocation,f=i!==h,p={location:o!==c&&(f||a),texture:f},m=this._renderer.getBindPoint(s);p.location&&(t.activeTexture(t.TEXTURE0+o),this.boundLocation=o),p.texture&&(t.bindTexture(m,i??this.emptyTextures[s]),l[s]=i),this.boundTarget=s}unbind(e,t="texture_2d"){const i=this._renderer.gl;if(typeof e=="number")this.bind({value:null,target:t,location:e});else{const s=this.getMeta(e),{target:o=this.boundTarget}=s,a=this._renderer.getBindPoint(o);for(let l=0;l<this.boundTextures.length;l++)this.boundTextures[l][o]===e&&(this.boundLocation!==l&&(i.activeTexture(i.TEXTURE0+l),this.boundLocation=l),i.bindTexture(a,this.emptyTextures[o]),this.boundTextures[l][o]=null)}}reset(){super.reset(),this.boundLocation=0,this.boundTarget="texture_2d",this.boundTextures=[],this.maxUnits=0}}class oo extends He{constructor(){super(...arguments);u(this,"boundVertexArrayNull",{attributes:{},elementArrayBuffer:null});u(this,"boundVertexArrayObject",null);u(this,"boundVertexArray",this.boundVertexArrayNull)}install(e){super.install(e),e.vertexArray=this}enableVertexAttrib(e,t,i,s=1){const{buffer:o,size:a=0,type:l="float",normalized:h=!1,stride:c=0,offset:f=0,divisor:p}=i,m=this._renderer.gl;this._renderer.buffer.bind({target:"array_buffer",value:o});for(let g=0;g<s;g++)m.enableVertexAttribArray(t+g),m.vertexAttribPointer(t+g,a,this._renderer.getBindPoint(l),h,c,f+(c-f)/s*g);p&&("vertexAttribDivisor"in m?m.vertexAttribDivisor(t,p):console.warn("Failed to active vertex array object, GPU Instancing is not supported on this device")),this.boundVertexArray.attributes[e]={enable:!0,...i}}create(...e){const t=this._renderer.gl;if(!("createVertexArray"in t))return null;const i=t.createVertexArray();if(!i)throw new Error("Unable to create vertex array");return e.length===2?this.update(e[0],i,e[1]):e.length===1&&this.update(i,e[0]),i}getVertexArrayMeta(e){return this._renderer.getRelated(e,()=>({attributes:{},elementArrayBuffer:null}))}update(...e){var o,a,l;if(e.length>2){this._renderer.program.bind(e[0]),this.update(e[1],e[2]);return}else if(e.length===2)if(e[0]){const h=e[0],c=e[1],f=this.getVertexArrayMeta(h);this.bind(h),this.update(c),f.attributes=this.boundVertexArray.attributes,f.elementArrayBuffer=this.boundVertexArray.elementArrayBuffer,this.unbind(),this._renderer.buffer.unbind("array_buffer");return}else return this.update(e[1]);const t=this._renderer.program.boundProgram;if(!t)return;const i=e[0];if(i.attributes){const h=this._renderer.program.getMeta(t),c={},f={};for(const m in i.attributes){const g=i.attributes[m],_=h.attributes.get(m);let y;"buffer"in g?y={...g}:y={buffer:g},y.size=y.size||(_==null?void 0:_.size)||0;const E=this._renderer.buffer.getMeta(y.buffer),T=Number(((o=_==null?void 0:_.type.match(/mat(\d)/))==null?void 0:o[1])??1);let P;switch(y.type){case"unsigned_byte":P=y.size;break;case"unsigned_short":P=y.size*2;break;case"float":default:P=y.size*4;break}P*=T,c[a=E.id]??(c[a]=0),c[E.id]+=P,f[m]={attrib:y,meta:E,info:_,byteLength:P,dimension:T}}const p={};for(const m in f){const{attrib:g,meta:_,info:y,byteLength:E,dimension:T}=f[m];(y==null?void 0:y.location)!==void 0&&(p[l=_.id]??(p[l]=0),g.offset??(g.offset=p[_.id]),g.stride??(g.stride=c[_.id]===E?0:c[_.id]),this.enableVertexAttrib(m,y.location,g,T),p[_.id]+=E)}}const s=i.elementArrayBuffer??null;this._renderer.buffer.bind({target:"element_array_buffer",value:s}),this.boundVertexArray.elementArrayBuffer=s}bind(e){const t=this._renderer.gl;if(e&&"attributes"in e)this.update(e);else if("bindVertexArray"in t){const i=this.boundVertexArrayObject;({value:e!==i}).value&&(t.bindVertexArray(e),this.boundVertexArrayObject=e,e?this.boundVertexArray={...this.getVertexArrayMeta(e)}:this.boundVertexArray=this.boundVertexArrayNull)}}unbind(){return this.bind(null)}reset(){super.reset(),this.boundVertexArrayNull={attributes:{},elementArrayBuffer:null},this.boundVertexArray=this.boundVertexArrayNull,this.boundVertexArrayObject=null}}class ao extends He{constructor(){super(...arguments);u(this,"boundViewport",{x:0,y:0,width:0,height:0})}install(e){super.install(e),e.viewport=this}bind(e){const t=this.boundViewport,i=Math.floor(e.x),s=Math.floor(e.y),o=Math.floor(e.width),a=Math.floor(e.height);t.x===i&&t.y===s&&t.width===o&&t.height===a||(this._renderer.gl.viewport(i,s,o,a),t.x=i,t.y=s,t.width=o,t.height=a)}reset(){super.reset(),this.boundViewport={x:0,y:0,width:0,height:0}}}class lo extends Yn{constructor(e=En(),t){super();u(this,"_modules",[new no,new Qn,new eo,new ro,new oo,new ao,new Kn,new to,new io,new so,new Jn]);u(this,"bindPoints",new Map);if(!e)throw new Error("Failed to createHTMLCanvas");Tn(e)?this._setupContext(e,t):(this.gl=e,this.version=Sn(this.gl)?2:1),this._setupBindPoints()._setupExtensions()._setupPolyfill(),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this._modules.forEach(i=>i.install(this)),this._modules.forEach(i=>i.onUpdateContext())}_setupContext(e,t){this.view=e;let i=e.getContext("webgl2",t)||e.getContext("experimental-webgl2",t),s=2;if(i||(i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),s=1),!i)throw new Error("Unable to getContext");return this.gl=i,this.version=s,this._onContextLost=this._onContextLost.bind(this),this._onContextRestored=this._onContextRestored.bind(this),e.addEventListener("webglcontextlost",this._onContextLost,!1),e.addEventListener("webglcontextrestored",this._onContextRestored,!1),this}_setupExtensions(){const e=this.gl,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tcSRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};return this.version===1?(t.instancedArrays=e.getExtension("ANGLE_instanced_arrays"),t.drawBuffers=e.getExtension("WEBGL_draw_buffers"),t.depthTexture=e.getExtension("WEBGL_depth_texture"),t.vertexArrayObject=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),t.uint32ElementIndex=e.getExtension("OES_element_index_uint"),t.floatTexture=e.getExtension("OES_texture_float"),t.textureHalfFloat=e.getExtension("OES_texture_half_float"),t.textureHalfFloatLinear=e.getExtension("OES_texture_half_float_linear")):this.version===2&&(t.colorBufferFloat=e.getExtension("EXT_color_buffer_float")),this.extensions=t,this}_setupBindPoints(){for(const e in this.gl)if(e===e.toUpperCase()){const t=this.gl[e];typeof t=="number"&&this.bindPoints.set(t,e.toLowerCase())}return this}_setupPolyfill(){if(this.version===1){const{instancedArrays:e,vertexArrayObject:t,drawBuffers:i}=this.extensions,s=this.gl;t&&(s.createVertexArray=()=>t.createVertexArrayOES(),s.bindVertexArray=o=>t.bindVertexArrayOES(o),s.deleteVertexArray=o=>t.deleteVertexArrayOES(o)),e&&(s.vertexAttribDivisor=(o,a)=>e.vertexAttribDivisorANGLE(o,a),s.drawElementsInstanced=(o,a,l,h,c)=>e.drawElementsInstancedANGLE(o,a,l,h,c),s.drawArraysInstanced=(o,a,l,h)=>e.drawArraysInstancedANGLE(o,a,l,h)),i&&(s.drawBuffers=o=>i.drawBuffersWEBGL(o))}return this}_onContextLost(e){e.preventDefault(),setTimeout(()=>{var t;this.gl.isContextLost()&&((t=this.extensions.loseContext)==null||t.restoreContext())},0)}_onContextRestored(){}getBindPoint(e){return this.gl[e.toUpperCase()]}clear(e=this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT){this.gl.clear(e)}draw(e={}){const{mode:t="triangles",first:i=0,instanceCount:s}=e;let{count:o=0,bytesPerElement:a=0}=e;if(!o||!a){const h=this.vertexArray.boundVertexArray.elementArrayBuffer??Object.values(this.vertexArray.boundVertexArray.attributes)[0];if(h){const c=this.buffer.getMeta(h);o||(o=c.length),a||(a=c.bytesPerElement)}}const l=this.getBindPoint(t);if(a)if(a===2||a===4&&this.extensions.uint32ElementIndex){const h=a===2?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT;s&&"drawElementsInstanced"in this.gl?this.gl.drawElementsInstanced(l,o,h,i*a,s):this.gl.drawElements(l,o,h,i*a)}else console.warn("Unsupported index buffer type: uint32");else s&&"drawArraysInstanced"in this.gl?this.gl.drawArraysInstanced(l,i,o,s):this.gl.drawArrays(l,i,o)}reset(){this._modules.forEach(e=>e.reset())}flush(){this._modules.forEach(e=>e.flush())}destroy(){var e,t,i;this._modules.forEach(s=>s.destroy()),(e=this.view)==null||e.removeEventListener("webglcontextlost",this._onContextLost,!1),(t=this.view)==null||t.removeEventListener("webglcontextrestored",this._onContextRestored,!1),(i=this.extensions.loseContext)==null||i.loseContext()}toPixels(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,i=e*t*4,s=e*4,o=(t-1)*s,a=new Uint8Array(i),l=new Uint8ClampedArray(i);this.gl.readPixels(0,0,e,t,this.gl.RGBA,this.gl.UNSIGNED_BYTE,a);for(let h=0;h<i;h+=s)l.set(a.subarray(h,h+s),o-h);return l}}class Tt{}class ho extends Tt{install(r){const e=async t=>{const{parseFont:i}=await Promise.resolve().then(()=>cd);return await r.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s))};return this.load=t=>r.loadBy(t,()=>e(t)),["woff","ttf","otf"].forEach(t=>{r.register(t,e)}),r.font=this,this}}function zl(n,r,e=2){const t=r&&r.length,i=t?r[0]*e:n.length;let s=co(n,0,i,e,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h;if(t&&(s=Wl(n,r,s,e)),n.length>80*e){a=1/0,l=1/0;let c=-1/0,f=-1/0;for(let p=e;p<i;p+=e){const m=n[p],g=n[p+1];m<a&&(a=m),g<l&&(l=g),m>c&&(c=m),g>f&&(f=g)}h=Math.max(c-a,f-l),h=h!==0?32767/h:0}return xr(s,o,e,a,l,h,0),o}function co(n,r,e,t,i){let s;if(i===ih(n,r,e,t)>0)for(let o=r;o<e;o+=t)s=go(o/t|0,n[o],n[o+1],s);else for(let o=e-t;o>=r;o-=t)s=go(o/t|0,n[o],n[o+1],s);return s&&Jt(s,s.next)&&(Tr(s),s=s.next),s}function Lt(n,r){if(!n)return n;r||(r=n);let e=n,t;do if(t=!1,!e.steiner&&(Jt(e,e.next)||ie(e.prev,e,e.next)===0)){if(Tr(e),e=r=e.prev,e===e.next)break;t=!0}else e=e.next;while(t||e!==r);return r}function xr(n,r,e,t,i,s,o){if(!n)return;!o&&s&&Kl(n,t,i,s);let a=n;for(;n.prev!==n.next;){const l=n.prev,h=n.next;if(s?jl(n,t,i,s):Vl(n)){r.push(l.i,n.i,h.i),Tr(n),n=h.next,a=h.next;continue}if(n=h,n===a){o?o===1?(n=Gl(Lt(n),r),xr(n,r,e,t,i,s,2)):o===2&&ql(n,r,e,t,i,s):xr(Lt(n),r,e,t,i,s,1);break}}}function Vl(n){const r=n.prev,e=n,t=n.next;if(ie(r,e,t)>=0)return!1;const i=r.x,s=e.x,o=t.x,a=r.y,l=e.y,h=t.y,c=Math.min(i,s,o),f=Math.min(a,l,h),p=Math.max(i,s,o),m=Math.max(a,l,h);let g=t.next;for(;g!==r;){if(g.x>=c&&g.x<=p&&g.y>=f&&g.y<=m&&Pr(i,a,s,l,o,h,g.x,g.y)&&ie(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function jl(n,r,e,t){const i=n.prev,s=n,o=n.next;if(ie(i,s,o)>=0)return!1;const a=i.x,l=s.x,h=o.x,c=i.y,f=s.y,p=o.y,m=Math.min(a,l,h),g=Math.min(c,f,p),_=Math.max(a,l,h),y=Math.max(c,f,p),E=gs(m,g,r,e,t),T=gs(_,y,r,e,t);let P=n.prevZ,S=n.nextZ;for(;P&&P.z>=E&&S&&S.z<=T;){if(P.x>=m&&P.x<=_&&P.y>=g&&P.y<=y&&P!==i&&P!==o&&Pr(a,c,l,f,h,p,P.x,P.y)&&ie(P.prev,P,P.next)>=0||(P=P.prevZ,S.x>=m&&S.x<=_&&S.y>=g&&S.y<=y&&S!==i&&S!==o&&Pr(a,c,l,f,h,p,S.x,S.y)&&ie(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;P&&P.z>=E;){if(P.x>=m&&P.x<=_&&P.y>=g&&P.y<=y&&P!==i&&P!==o&&Pr(a,c,l,f,h,p,P.x,P.y)&&ie(P.prev,P,P.next)>=0)return!1;P=P.prevZ}for(;S&&S.z<=T;){if(S.x>=m&&S.x<=_&&S.y>=g&&S.y<=y&&S!==i&&S!==o&&Pr(a,c,l,f,h,p,S.x,S.y)&&ie(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function Gl(n,r){let e=n;do{const t=e.prev,i=e.next.next;!Jt(t,i)&&fo(t,e,e.next,i)&&Cr(t,i)&&Cr(i,t)&&(r.push(t.i,e.i,i.i),Tr(e),Tr(e.next),e=n=i),e=e.next}while(e!==n);return Lt(e)}function ql(n,r,e,t,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&eh(o,a)){let l=po(o,a);o=Lt(o,o.next),l=Lt(l,l.next),xr(o,r,e,t,i,s,0),xr(l,r,e,t,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function Wl(n,r,e,t){const i=[];for(let s=0,o=r.length;s<o;s++){const a=r[s]*t,l=s<o-1?r[s+1]*t:n.length,h=co(n,a,l,t,!1);h===h.next&&(h.steiner=!0),i.push(Ql(h))}i.sort(Xl);for(let s=0;s<i.length;s++)e=Hl(i[s],e);return e}function Xl(n,r){let e=n.x-r.x;if(e===0&&(e=n.y-r.y,e===0)){const t=(n.next.y-n.y)/(n.next.x-n.x),i=(r.next.y-r.y)/(r.next.x-r.x);e=t-i}return e}function Hl(n,r){const e=Yl(n,r);if(!e)return r;const t=po(e,n);return Lt(t,t.next),Lt(e,e.next)}function Yl(n,r){let e=r;const t=n.x,i=n.y;let s=-1/0,o;if(Jt(n,e))return e;do{if(Jt(n,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const f=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=t&&f>s&&(s=f,o=e.x<e.next.x?e:e.next,f===t))return o}e=e.next}while(e!==r);if(!o)return null;const a=o,l=o.x,h=o.y;let c=1/0;e=o;do{if(t>=e.x&&e.x>=l&&t!==e.x&&uo(i<h?t:s,i,l,h,i<h?s:t,i,e.x,e.y)){const f=Math.abs(i-e.y)/(t-e.x);Cr(e,n)&&(f<c||f===c&&(e.x>o.x||e.x===o.x&&Zl(o,e)))&&(o=e,c=f)}e=e.next}while(e!==a);return o}function Zl(n,r){return ie(n.prev,n,r.prev)<0&&ie(r.next,n,n.next)<0}function Kl(n,r,e,t){let i=n;do i.z===0&&(i.z=gs(i.x,i.y,r,e,t)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,Jl(i)}function Jl(n){let r,e=1;do{let t=n,i;n=null;let s=null;for(r=0;t;){r++;let o=t,a=0;for(let h=0;h<e&&(a++,o=o.nextZ,!!o);h++);let l=e;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||t.z<=o.z)?(i=t,t=t.nextZ,a--):(i=o,o=o.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=o}s.nextZ=null,e*=2}while(r>1);return n}function gs(n,r,e,t,i){return n=(n-e)*i|0,r=(r-t)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,n|r<<1}function Ql(n){let r=n,e=n;do(r.x<e.x||r.x===e.x&&r.y<e.y)&&(e=r),r=r.next;while(r!==n);return e}function uo(n,r,e,t,i,s,o,a){return(i-o)*(r-a)>=(n-o)*(s-a)&&(n-o)*(t-a)>=(e-o)*(r-a)&&(e-o)*(s-a)>=(i-o)*(t-a)}function Pr(n,r,e,t,i,s,o,a){return!(n===o&&r===a)&&uo(n,r,e,t,i,s,o,a)}function eh(n,r){return n.next.i!==r.i&&n.prev.i!==r.i&&!th(n,r)&&(Cr(n,r)&&Cr(r,n)&&rh(n,r)&&(ie(n.prev,n,r.prev)||ie(n,r.prev,r))||Jt(n,r)&&ie(n.prev,n,n.next)>0&&ie(r.prev,r,r.next)>0)}function ie(n,r,e){return(r.y-n.y)*(e.x-r.x)-(r.x-n.x)*(e.y-r.y)}function Jt(n,r){return n.x===r.x&&n.y===r.y}function fo(n,r,e,t){const i=li(ie(n,r,e)),s=li(ie(n,r,t)),o=li(ie(e,t,n)),a=li(ie(e,t,r));return!!(i!==s&&o!==a||i===0&&ai(n,e,r)||s===0&&ai(n,t,r)||o===0&&ai(e,n,t)||a===0&&ai(e,r,t))}function ai(n,r,e){return r.x<=Math.max(n.x,e.x)&&r.x>=Math.min(n.x,e.x)&&r.y<=Math.max(n.y,e.y)&&r.y>=Math.min(n.y,e.y)}function li(n){return n>0?1:n<0?-1:0}function th(n,r){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==r.i&&e.next.i!==r.i&&fo(e,e.next,n,r))return!0;e=e.next}while(e!==n);return!1}function Cr(n,r){return ie(n.prev,n,n.next)<0?ie(n,r,n.next)>=0&&ie(n,n.prev,r)>=0:ie(n,r,n.prev)<0||ie(n,n.next,r)<0}function rh(n,r){let e=n,t=!1;const i=(n.x+r.x)/2,s=(n.y+r.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(t=!t),e=e.next;while(e!==n);return t}function po(n,r){const e=ms(n.i,n.x,n.y),t=ms(r.i,r.x,r.y),i=n.next,s=r.prev;return n.next=r,r.prev=n,e.next=i,i.prev=e,t.next=e,e.prev=t,s.next=t,t.prev=s,t}function go(n,r,e,t){const i=ms(n,r,e);return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function Tr(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function ms(n,r,e){return{i:n,x:r,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function ih(n,r,e,t){let i=0;for(let s=r,o=e-t;s<e;s+=t)i+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return i}function sh(n,r,e,t={}){const{radius:i=1}=t;n.moveTo(r,e),n.arc(r,e,i,0,Math.PI*2)}const nh={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function ys(n,r){const{fill:e="#000",stroke:t="none",strokeWidth:i=t==="none"?0:1,strokeLinecap:s="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:l=[],strokeDashoffset:h=0,shadowOffsetX:c=0,shadowOffsetY:f=0,shadowBlur:p=0,shadowColor:m="rgba(0, 0, 0, 0)"}=r;n.fillStyle=e,n.strokeStyle=t,n.lineWidth=i,n.lineCap=s,n.lineJoin=nh[o],n.miterLimit=a,n.setLineDash(l),n.lineDashOffset=h,n.shadowOffsetX=c,n.shadowOffsetY=f,n.shadowBlur=p,n.shadowColor=m}class O{constructor(r=0,e=0){this.x=r,this.y=e}static get MAX(){return new O(1/0,1/0)}static get MIN(){return new O(-1/0,-1/0)}get array(){return[this.x,this.y]}set(r,e){return this.x=r,this.y=e,this}add(r){return this.x+=r.x,this.y+=r.y,this}sub(r){return this.x-=r.x,this.y-=r.y,this}multiply(r){return this.x*=r.x,this.y*=r.y,this}divide(r){return this.x/=r.x,this.y/=r.y,this}dot(r){return this.x*r.x+this.y*r.y}cross(r){return this.x*r.y-this.y*r.x}rotate(r,e={x:0,y:0}){const t=-r/180*Math.PI,i=this.x-e.x,s=-(this.y-e.y),o=Math.sin(t),a=Math.cos(t);return this.set(e.x+(i*a-s*o),e.y-(i*o+s*a)),this}distanceTo(r){return Math.sqrt(this.distanceToSquared(r))}distanceToSquared(r){const e=this.x-r.x,t=this.y-r.y;return e*e+t*t}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(r,e=r,t={x:0,y:0}){const i=r<0?t.x-this.x+t.x:this.x,s=e<0?t.y-this.y+t.y:this.y;return this.x=i*Math.abs(r),this.y=s*Math.abs(e),this}skew(r,e=0,t={x:0,y:0}){const i=this.x-t.x,s=this.y-t.y;return this.x=t.x+(i+Math.tan(r)*s),this.y=t.y+(s+Math.tan(e)*i),this}min(...r){return this.x=Math.min(this.x,...r.map(e=>e.x)),this.y=Math.min(this.y,...r.map(e=>e.y)),this}max(...r){return this.x=Math.max(this.x,...r.map(e=>e.x)),this.y=Math.max(this.y,...r.map(e=>e.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this}subVectors(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this}multiplyVectors(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this}divideVectors(r,e){return this.x=r.x/e.x,this.y=r.y/e.y,this}lerpVectors(r,e,t){return this.x=r.x+(e.x-r.x)*t,this.y=r.y+(e.y-r.y)*t,this}equals(r){return this.x===r.x&&this.y===r.y}applyMatrix3(r){const e=this.x,t=this.y,i=r.elements;return this.x=i[0]*e+i[3]*t+i[6],this.y=i[1]*e+i[4]*t+i[7],this}copy(r){return this.x=r.x,this.y=r.y,this}clone(){return new O(this.x,this.y)}}class Z{constructor(r=0,e=0,t=0,i=0){this.left=r,this.top=e,this.width=t,this.height=i}get x(){return this.left}set x(r){this.left=r}get y(){return this.top}set y(r){this.top=r}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new O((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...r){if(r.length===0)return new Z;if(r.length===1)return r[0].clone();const e=r[0],t=r.slice(1).reduce((i,s)=>(i.left=Math.min(i.left,s.left),i.top=Math.min(i.top,s.top),i.right=Math.max(i.right,s.right),i.bottom=Math.max(i.bottom,s.bottom),i),{left:(e==null?void 0:e.left)??0,top:(e==null?void 0:e.top)??0,right:(e==null?void 0:e.right)??0,bottom:(e==null?void 0:e.bottom)??0});return new Z(t.left,t.top,t.right-t.left,t.bottom-t.top)}translate(r,e){return this.left+=r,this.top+=e,this}copy(r){return this.left=r.left,this.top=r.top,this.width=r.width,this.height=r.height,this}clone(){return new Z(this.left,this.top,this.width,this.height)}}class Fe{constructor(r=1,e=0,t=0,i=0,s=1,o=0,a=0,l=0,h=1){u(this,"elements",[]);this.set(r,e,t,i,s,o,a,l,h)}set(r,e,t,i,s,o,a,l,h){const c=this.elements;return c[0]=r,c[1]=i,c[2]=a,c[3]=e,c[4]=s,c[5]=l,c[6]=t,c[7]=o,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(r){const e=this.elements,t=r.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this}multiply(r){return this.multiplyMatrices(this,r)}premultiply(r){return this.multiplyMatrices(r,this)}multiplyMatrices(r,e){const t=r.elements,i=e.elements,s=this.elements,o=t[0],a=t[3],l=t[6],h=t[1],c=t[4],f=t[7],p=t[2],m=t[5],g=t[8],_=i[0],y=i[3],E=i[6],T=i[1],P=i[4],S=i[7],w=i[2],v=i[5],x=i[8];return s[0]=o*_+a*T+l*w,s[3]=o*y+a*P+l*v,s[6]=o*E+a*S+l*x,s[1]=h*_+c*T+f*w,s[4]=h*y+c*P+f*v,s[7]=h*E+c*S+f*x,s[2]=p*_+m*T+g*w,s[5]=p*y+m*P+g*v,s[8]=p*E+m*S+g*x,this}invert(){const r=this.elements,e=r[0],t=r[1],i=r[2],s=r[3],o=r[4],a=r[5],l=r[6],h=r[7],c=r[8],f=c*o-a*h,p=a*l-c*s,m=h*s-o*l,g=e*f+t*p+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return r[0]=f*_,r[1]=(i*h-c*t)*_,r[2]=(a*t-i*o)*_,r[3]=p*_,r[4]=(c*e-i*l)*_,r[5]=(i*s-a*e)*_,r[6]=m*_,r[7]=(t*l-h*e)*_,r[8]=(o*e-t*s)*_,this}transpose(){let r;const e=this.elements;return r=e[1],e[1]=e[3],e[3]=r,r=e[2],e[2]=e[6],e[6]=r,r=e[5],e[5]=e[7],e[7]=r,this}scale(r,e){return this.premultiply(_s.makeScale(r,e)),this}rotate(r){return this.premultiply(_s.makeRotation(-r)),this}translate(r,e){return this.premultiply(_s.makeTranslation(r,e)),this}makeTranslation(r,e){return this.set(1,0,r,0,1,e,0,0,1),this}makeRotation(r){const e=Math.cos(r),t=Math.sin(r);return this.set(e,-t,0,t,e,0,0,0,1),this}makeScale(r,e){return this.set(r,0,0,0,e,0,0,0,1),this}fromArray(r,e=0){for(let t=0;t<9;t++)this.elements[t]=r[t+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const _s=new Fe;function mo(n,r,e,t){const i=n*e+r*t,s=Math.sqrt(n*n+r*r)*Math.sqrt(e*e+t*t);let o=Math.acos(Math.max(-1,Math.min(1,i/s)));return n*t-r*e<0&&(o=-o),o}function oh(n,r,e,t,i,s,o,a){if(r===0||e===0){n.lineTo(a.x,a.y);return}t=t*Math.PI/180,r=Math.abs(r),e=Math.abs(e);const l=(o.x-a.x)/2,h=(o.y-a.y)/2,c=Math.cos(t)*l+Math.sin(t)*h,f=-Math.sin(t)*l+Math.cos(t)*h;let p=r*r,m=e*e;const g=c*c,_=f*f,y=g/p+_/m;if(y>1){const F=Math.sqrt(y);r=F*r,e=F*e,p=r*r,m=e*e}const E=p*_+m*g,T=(p*m-E)/E;let P=Math.sqrt(Math.max(0,T));i===s&&(P=-P);const S=P*r*f/e,w=-P*e*c/r,v=Math.cos(t)*S-Math.sin(t)*w+(o.x+a.x)/2,x=Math.sin(t)*S+Math.cos(t)*w+(o.y+a.y)/2,C=mo(1,0,(c-S)/r,(f-w)/e),I=mo((c-S)/r,(f-w)/e,(-c-S)/r,(-f-w)/e)%(Math.PI*2);n.ellipse(v,x,r,e,t,C,C+I,s===0)}const he={SEPARATOR:/[ \t\r\n,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function lt(n,r,e=0){let a=0,l=!0,h="",c="";const f=[];function p(y,E,T){const P=new SyntaxError(`Unexpected character "${y}" at index ${E}.`);throw P.partial=T,P}function m(){h!==""&&(c===""?f.push(Number(h)):f.push(Number(h)*10**Number(c))),h="",c=""}let g;const _=n.length;for(let y=0;y<_;y++){if(g=n[y],Array.isArray(r)&&r.includes(f.length%e)&&he.FLAGS.test(g)){a=1,h=g,m();continue}if(a===0){if(he.WHITESPACE.test(g))continue;if(he.DIGIT.test(g)||he.SIGN.test(g)){a=1,h=g;continue}if(he.POINT.test(g)){a=2,h=g;continue}he.COMMA.test(g)&&(l&&p(g,y,f),l=!0)}if(a===1){if(he.DIGIT.test(g)){h+=g;continue}if(he.POINT.test(g)){h+=g,a=2;continue}if(he.EXP.test(g)){a=3;continue}he.SIGN.test(g)&&h.length===1&&he.SIGN.test(h[0])&&p(g,y,f)}if(a===2){if(he.DIGIT.test(g)){h+=g;continue}if(he.EXP.test(g)){a=3;continue}he.POINT.test(g)&&h[h.length-1]==="."&&p(g,y,f)}if(a===3){if(he.DIGIT.test(g)){c+=g;continue}if(he.SIGN.test(g)){if(c===""){c+=g;continue}c.length===1&&he.SIGN.test(c)&&p(g,y,f)}}he.WHITESPACE.test(g)?(m(),a=0,l=!1):he.COMMA.test(g)?(m(),a=0,l=!0):he.SIGN.test(g)?(m(),a=1,h=g):he.POINT.test(g)?(m(),a=2,h=g):p(g,y,f)}return m(),f}function Qt(n,r){return n-(r-n)}function yo(n,r){const e=new O,t=new O;for(let i=0,s=n.length;i<s;i++){const o=n[i];if(o.type==="m"||o.type==="M")o.type==="m"?e.add(o):e.copy(o),r.moveTo(e.x,e.y),t.copy(e);else if(o.type==="h"||o.type==="H")o.type==="h"?e.x+=o.x:e.x=o.x,r.lineTo(e.x,e.y),t.copy(e);else if(o.type==="v"||o.type==="V")o.type==="v"?e.y+=o.y:e.y=o.y,r.lineTo(e.x,e.y),t.copy(e);else if(o.type==="l"||o.type==="L")o.type==="l"?e.add(o):e.copy(o),r.lineTo(e.x,e.y),t.copy(e);else if(o.type==="c"||o.type==="C")o.type==="c"?(r.bezierCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),t.x=e.x+o.x2,t.y=e.y+o.y2,e.add(o)):(r.bezierCurveTo(o.x1,o.y1,o.x2,o.y2,o.x,o.y),t.x=o.x2,t.y=o.y2,e.copy(o));else if(o.type==="s"||o.type==="S")o.type==="s"?(r.bezierCurveTo(Qt(e.x,t.x),Qt(e.y,t.y),e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),t.x=e.x+o.x2,t.y=e.y+o.y2,e.add(o)):(r.bezierCurveTo(Qt(e.x,t.x),Qt(e.y,t.y),o.x2,o.y2,o.x,o.y),t.x=o.x2,t.y=o.y2,e.copy(o));else if(o.type==="q"||o.type==="Q")o.type==="q"?(r.quadraticCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x,e.y+o.y),t.x=e.x+o.x1,t.y=e.y+o.y1,e.add(o)):(r.quadraticCurveTo(o.x1,o.y1,o.x,o.y),t.x=o.x1,t.y=o.y1,e.copy(o));else if(o.type==="t"||o.type==="T"){const a=Qt(e.x,t.x),l=Qt(e.y,t.y);t.x=a,t.y=l,o.type==="t"?(r.quadraticCurveTo(a,l,e.x+o.x,e.y+o.y),e.add(o)):(r.quadraticCurveTo(a,l,o.x,o.y),e.copy(o))}else if(o.type==="a"||o.type==="A"){const a=e.clone();if(o.type==="a"){if(o.x===0&&o.y===0)continue;e.add(o)}else{if(e.equals(o))continue;e.copy(o)}t.copy(e),oh(r,o.rx,o.ry,o.angle,o.largeArcFlag,o.sweepFlag,a,e)}else o.type==="z"||o.type==="Z"?(r.startPoint&&e.copy(r.startPoint),r.closePath()):console.warn("Unsupported commands",o)}}function ah(n){let r,e;const t=[];for(let i=0,s=n.length;i<s;i++){const o=n[i];switch(o.type){case"m":case"M":if(o.x.toFixed(4)===(e==null?void 0:e.x.toFixed(4))&&o.y.toFixed(4)===(e==null?void 0:e.y.toFixed(4)))continue;t.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y},r={x:o.x,y:o.y};break;case"h":case"H":t.push(`${o.type} ${o.x}`),e={x:o.x,y:(e==null?void 0:e.y)??0};break;case"v":case"V":t.push(`${o.type} ${o.y}`),e={x:(e==null?void 0:e.x)??0,y:o.y};break;case"l":case"L":t.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"c":case"C":t.push(`${o.type} ${o.x1} ${o.y1} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"s":case"S":t.push(`${o.type} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"q":case"Q":t.push(`${o.type} ${o.x1} ${o.y1} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"t":case"T":t.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"a":case"A":t.push(`${o.type} ${o.rx} ${o.ry} ${o.angle} ${o.largeArcFlag} ${o.sweepFlag} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"z":case"Z":t.push(o.type),r&&(e={x:r.x,y:r.y});break}}return t.join(" ")}const lh=/[a-df-z][^a-df-z]*/gi;function _o(n){const r=[],e=n.match(lh);if(!e)return r;for(let t=0,i=e.length;t<i;t++){const s=e[t],o=s.charAt(0),a=s.slice(1).trim();let l;switch(o){case"m":case"M":l=lt(a);for(let h=0,c=l.length;h<c;h+=2)h===0?r.push({type:o,x:l[h],y:l[h+1]}):r.push({type:o==="m"?"l":"L",x:l[h],y:l[h+1]});break;case"h":case"H":l=lt(a);for(let h=0,c=l.length;h<c;h++)r.push({type:o,x:l[h]});break;case"v":case"V":l=lt(a);for(let h=0,c=l.length;h<c;h++)r.push({type:o,y:l[h]});break;case"l":case"L":l=lt(a);for(let h=0,c=l.length;h<c;h+=2)r.push({type:o,x:l[h],y:l[h+1]});break;case"c":case"C":l=lt(a);for(let h=0,c=l.length;h<c;h+=6)r.push({type:o,x1:l[h],y1:l[h+1],x2:l[h+2],y2:l[h+3],x:l[h+4],y:l[h+5]});break;case"s":case"S":l=lt(a);for(let h=0,c=l.length;h<c;h+=4)r.push({type:o,x2:l[h],y2:l[h+1],x:l[h+2],y:l[h+3]});break;case"q":case"Q":l=lt(a);for(let h=0,c=l.length;h<c;h+=4)r.push({type:o,x1:l[h],y1:l[h+1],x:l[h+2],y:l[h+3]});break;case"t":case"T":l=lt(a);for(let h=0,c=l.length;h<c;h+=2)r.push({type:o,x:l[h],y:l[h+1]});break;case"a":case"A":l=lt(a,[3,4],7);for(let h=0,c=l.length;h<c;h+=7)r.push({type:o,rx:l[h],ry:l[h+1],angle:l[h+2],largeArcFlag:l[h+3],sweepFlag:l[h+4],x:l[h+5],y:l[h+6]});break;case"z":case"Z":r.push({type:o});break;default:console.warn(s)}}return r}function vo(n,r,e,t,i){const s=(t-r)*.5,o=(i-e)*.5,a=n*n,l=n*a;return(2*e-2*t+s+o)*l+(-3*e+3*t-2*s-o)*a+s*n+e}function hh(n,r){const e=1-n;return e*e*e*r}function ch(n,r){const e=1-n;return 3*e*e*n*r}function uh(n,r){return 3*(1-n)*n*n*r}function fh(n,r){return n*n*n*r}function bo(n,r,e,t,i){return hh(n,r)+ch(n,e)+uh(n,t)+fh(n,i)}function dh(n,r={}){let{vertices:e=[],indices:t=[],holes:i=[],verticesStride:s=2,verticesOffset:o=0,indicesOffset:a=0}=r;const l=zl(n,i,2);if(l){for(let c=0;c<l.length;c+=3)t[a++]=l[c]+o,t[a++]=l[c+1]+o,t[a++]=l[c+2]+o;let h=o*s;for(let c=0;c<n.length;c+=2)e[h]=n[c],e[h+1]=n[c+1],h+=s}return{vertices:e,indices:t}}const ph=8,hi=11920929e-14,gh=1;function mh(n,r,e,t,i,s,o,a,l=.5,h){const f=Math.min(.99,Math.max(0,l));let p=(gh-f)/1;return p*=p,vs(n,r,e,t,i,s,o,a,h,p,0),h.push(o,a),h}function vs(n,r,e,t,i,s,o,a,l,h,c){if(c>ph)return;const f=(n+e)/2,p=(r+t)/2,m=(e+i)/2,g=(t+s)/2,_=(i+o)/2,y=(s+a)/2,E=(f+m)/2,T=(p+g)/2,P=(m+_)/2,S=(g+y)/2,w=(E+P)/2,v=(T+S)/2;if(c>0){let x=o-n,C=a-r;const I=Math.abs((e-o)*C-(t-a)*x),F=Math.abs((i-o)*C-(s-a)*x);if(I>hi&&F>hi){if((I+F)*(I+F)<=h*(x*x+C*C)){l.push(w,v);return}}else if(I>hi){if(I*I<=h*(x*x+C*C)){l.push(w,v);return}}else if(F>hi){if(F*F<=h*(x*x+C*C)){l.push(w,v);return}}else if(x=w-(n+o)/2,C=v-(r+a)/2,x*x+C*C<=h){l.push(w,v);return}}vs(n,r,f,p,E,T,w,v,l,h,c+1),vs(w,v,P,S,_,y,o,a,l,h,c+1)}const yh=8,_h=11920929e-14,vh=1;function bh(n,r,e,t,i,s,o=.5,a){const h=Math.min(.99,Math.max(0,o));let c=(vh-h)/1;return c*=c,bs(a,n,r,e,t,i,s,c,0),a.push(i,s),a}function bs(n,r,e,t,i,s,o,a,l){if(l>yh)return;const h=(r+t)/2,c=(e+i)/2,f=(t+s)/2,p=(i+o)/2,m=(h+f)/2,g=(c+p)/2;let _=s-r,y=o-e;const E=Math.abs((t-s)*y-(i-o)*_);if(E>_h){if(E*E<=a*(_*_+y*y)){n.push(m,g);return}}else if(_=m-(r+s)/2,y=g-(e+o)/2,_*_+y*y<=a){n.push(m,g);return}bs(n,r,e,h,c,m,g,a,l+1),bs(n,m,g,f,p,s,o,a,l+1)}function wh(n,r){const e=1-n;return e*e*r}function xh(n,r){return 2*(1-n)*n*r}function Ph(n,r){return n*n*r}function wo(n,r,e,t){return wh(n,r)+xh(n,e)+Ph(n,t)}const Ch=1e-4,xo=1e-4;function Th(n,r={}){const{vertices:e=[],indices:t=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:o=!0}=r,a=Ch;if(n.length===0)return{vertices:e,indices:t};const l=i;let h=l.alignment;if(i.alignment!==.5){let L=Sh(n);s&&(L*=-1),h=(h-.5)*L+.5}const c={x:n[0],y:n[1]},f={x:n[n.length-2],y:n[n.length-1]},p=o,m=Math.abs(c.x-f.x)<a&&Math.abs(c.y-f.y)<a;if(p){n=n.slice(),m&&(n.pop(),n.pop(),f.x=n[n.length-2],f.y=n[n.length-1]);const L=(c.x+f.x)*.5,k=(f.y+c.y)*.5;n.unshift(L,k),n.push(L,k)}const g=e,_=n.length/2;let y=n.length;const E=g.length/2,T=l.width/2,P=T*T,S=l.miterLimit*l.miterLimit;let w=n[0],v=n[1],x=n[2],C=n[3],I=0,F=0,B=-(v-C),U=w-x,V=0,A=0,N=Math.sqrt(B*B+U*U);B/=N,U/=N,B*=T,U*=T;const W=h,R=(1-W)*2,D=W*2;p||(l.cap==="round"?y+=Nt(w-B*(R-D)*.5,v-U*(R-D)*.5,w-B*R,v-U*R,w+B*D,v+U*D,g,!0)+2:l.cap==="square"&&(y+=Po(w,v,B,U,R,D,!0,g))),g.push(w-B*R,v-U*R),g.push(w+B*D,v+U*D);for(let L=1;L<_-1;++L){w=n[(L-1)*2],v=n[(L-1)*2+1],x=n[L*2],C=n[L*2+1],I=n[(L+1)*2],F=n[(L+1)*2+1],B=-(v-C),U=w-x,N=Math.sqrt(B*B+U*U),B/=N,U/=N,B*=T,U*=T,V=-(C-F),A=x-I,N=Math.sqrt(V*V+A*A),V/=N,A/=N,V*=T,A*=T;const k=x-w,K=v-C,H=x-I,X=F-C,q=k*H+K*X,ee=K*H-X*k,Y=ee<0;if(Math.abs(ee)<.001*Math.abs(q)){g.push(x-B*R,C-U*R),g.push(x+B*D,C+U*D),q>=0&&(l.join==="round"?y+=Nt(x,C,x-B*R,C-U*R,x-V*R,C-A*R,g,!1)+4:y+=2,g.push(x-V*D,C-A*D),g.push(x+V*R,C+A*R));continue}const ae=(-B+w)*(-U+C)-(-B+x)*(-U+v),pt=(-V+I)*(-A+C)-(-V+x)*(-A+F),Ke=(k*pt-H*ae)/ee,Ne=(X*ae-K*pt)/ee,ze=(Ke-x)*(Ke-x)+(Ne-C)*(Ne-C),Ee=x+(Ke-x)*R,Ve=C+(Ne-C)*R,it=x-(Ke-x)*D,st=C-(Ne-C)*D,Je=Math.min(k*k+K*K,H*H+X*X),cl=Y?R:D,Ip=Je+cl*cl*P;ze<=Ip?l.join==="bevel"||ze/P>S?(Y?(g.push(Ee,Ve),g.push(x+B*D,C+U*D),g.push(Ee,Ve),g.push(x+V*D,C+A*D)):(g.push(x-B*R,C-U*R),g.push(it,st),g.push(x-V*R,C-A*R),g.push(it,st)),y+=2):l.join==="round"?Y?(g.push(Ee,Ve),g.push(x+B*D,C+U*D),y+=Nt(x,C,x+B*D,C+U*D,x+V*D,C+A*D,g,!0)+4,g.push(Ee,Ve),g.push(x+V*D,C+A*D)):(g.push(x-B*R,C-U*R),g.push(it,st),y+=Nt(x,C,x-B*R,C-U*R,x-V*R,C-A*R,g,!1)+4,g.push(x-V*R,C-A*R),g.push(it,st)):(g.push(Ee,Ve),g.push(it,st)):(g.push(x-B*R,C-U*R),g.push(x+B*D,C+U*D),l.join==="round"?Y?y+=Nt(x,C,x+B*D,C+U*D,x+V*D,C+A*D,g,!0)+2:y+=Nt(x,C,x-B*R,C-U*R,x-V*R,C-A*R,g,!1)+2:l.join==="miter"&&ze/P<=S&&(Y?(g.push(it,st),g.push(it,st)):(g.push(Ee,Ve),g.push(Ee,Ve)),y+=2),g.push(x-V*R,C-A*R),g.push(x+V*D,C+A*D),y+=2)}w=n[(_-2)*2],v=n[(_-2)*2+1],x=n[(_-1)*2],C=n[(_-1)*2+1],B=-(v-C),U=w-x,N=Math.sqrt(B*B+U*U),B/=N,U/=N,B*=T,U*=T,g.push(x-B*R,C-U*R),g.push(x+B*D,C+U*D),p||(l.cap==="round"?y+=Nt(x-B*(R-D)*.5,C-U*(R-D)*.5,x-B*R,C-U*R,x+B*D,C+U*D,g,!1)+2:l.cap==="square"&&(y+=Po(x,C,B,U,R,D,!1,g)));const G=xo*xo;for(let L=E;L<y+E-2;++L)w=g[L*2],v=g[L*2+1],x=g[(L+1)*2],C=g[(L+1)*2+1],I=g[(L+2)*2],F=g[(L+2)*2+1],!(Math.abs(w*(C-F)+x*(F-v)+I*(v-C))<G)&&t.push(L,L+1,L+2);return{vertices:e,indices:t}}function Sh(n){const r=n.length;if(r<6)return 1;let e=0;for(let t=0,i=n[r-2],s=n[r-1];t<r;t+=2){const o=n[t],a=n[t+1];e+=(o-i)*(a+s),i=o,s=a}return e<0?-1:1}function Po(n,r,e,t,i,s,o,a){const l=n-e*i,h=r-t*i,c=n+e*s,f=r+t*s;let p,m;o?(p=t,m=-e):(p=-t,m=e);const g=l+p,_=h+m,y=c+p,E=f+m;return a.push(g,_),a.push(y,E),2}function Nt(n,r,e,t,i,s,o,a){const l=e-n,h=t-r;let c=Math.atan2(l,h),f=Math.atan2(i-n,s-r);a&&c<f?c+=Math.PI*2:!a&&c>f&&(f+=Math.PI*2);let p=c;const m=f-c,g=Math.abs(m),_=Math.sqrt(l*l+h*h),y=(15*g*Math.sqrt(_)/Math.PI>>0)+1,E=m/y;if(p+=E,a){o.push(n,r),o.push(e,t);for(let T=1,P=p;T<y;T++,P+=E)o.push(n,r),o.push(n+Math.sin(P)*_,r+Math.cos(P)*_);o.push(n,r),o.push(i,s)}else{o.push(e,t),o.push(n,r);for(let T=1,P=p;T<y;T++,P+=E)o.push(n+Math.sin(P)*_,r+Math.cos(P)*_),o.push(n,r);o.push(i,s),o.push(n,r)}return y*2}class er{constructor(){u(this,"arcLengthDivision",200);u(this,"_arcLengths")}getPointAt(r,e=new O){return this.getPoint(this.getUToTMapping(r),e)}isClockwise(){const r=this.getPoint(1),e=this.getPoint(.5),t=this.getPoint(1);return(e.x-r.x)*(t.y-e.y)-(e.y-r.y)*(t.x-e.x)<0}getControlPointRefs(){return[]}applyTransform(r){return this.getControlPointRefs().forEach(e=>{e.applyMatrix3(r)}),this}getUnevenPointArray(r=5,e=[]){const t=new O;for(let i=0,s=Math.max(1,r)-1;i<=s;i++)this.getPoint(i/s,t),e.push(t.x,t.y);return e}getSpacedPointArray(r=5,e=[]){const t=new O;for(let i=0,s=Math.max(1,r)-1;i<=s;i++)this.getPointAt(i/s,t),e.push(t.x,t.y);return e}getAdaptivePointArray(r=[]){return this.getUnevenPointArray(5,r)}_pointArrayToPoint(r,e=[]){for(let t=0,i=r.length;t<i;t+=2){const s=r[t],o=r[t+1];e.push(new O(s,o))}return e}getSpacedPoints(r,e=[]){const t=this.getSpacedPointArray(r);return this._pointArrayToPoint(t,e),e}getUnevenPoints(r,e=[]){const t=this.getUnevenPointArray(r);return this._pointArrayToPoint(t,e),e}getAdaptivePoints(r=[]){const e=this.getAdaptivePointArray();return this._pointArrayToPoint(e,r),r}getPoints(r,e=[]){let t;return r?t=this.getUnevenPointArray(r):t=this.getAdaptivePointArray(),this._pointArrayToPoint(t,e),e}getLength(){const r=this.getLengths();return r[r.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const r=this.arcLengthDivision,e=[0];for(let t=0,i=this.getPoint(0),s=1;s<=r;s++){const o=this.getPoint(s/r);t+=o.distanceTo(i),e.push(t),i=o}this._arcLengths=e}getUToTMapping(r,e){const t=this.getLengths(),i=t.length,s=e??r*t[i-1];if(i<2)return s/t[0];let o=0,a=0,l=i-1,h;for(;a<=l;)if(o=Math.floor(a+(l-a)/2),h=t[o]-s,h<0)a=o+1;else if(h>0)l=o-1;else{l=o;break}if(o=l,t[o]===s)return o/(i-1);const c=t[o],p=t[o+1]-c,m=(s-c)/p;return(o+m)/(i-1)}getTangent(r,e=new O){const i=Math.max(0,r-1e-4),s=Math.min(1,r+1e-4);return e.copy(this.getPoint(s).sub(this.getPoint(i)).normalize())}getTangentAt(r,e){return this.getTangent(this.getUToTMapping(r),e)}getNormal(r,e=new O){return this.getTangent(r,e),e.set(-e.y,e.x).normalize()}getNormalAt(r,e){return this.getNormal(this.getUToTMapping(r),e)}getTForPoint(r,e=.001){let t=0,i=1,s=(t+i)/2;for(;i-t>e;){s=(t+i)/2;const o=this.getPoint(s);if(o.distanceTo(r)<e)return s;o.x<r.x?t=s:i=s}return s}getMinMax(r=O.MAX,e=O.MIN){const t=this.getPoints();for(let i=0,s=t.length;i<s;i++){const o=t[i];r.min(o),e.max(o)}return{min:r,max:e}}getBoundingBox(){const{min:r,max:e}=this.getMinMax();return new Z(r.x,r.y,e.x-r.x,e.y-r.y)}fillTriangulate(r){return dh(this.getAdaptivePointArray(),r)}strokeTriangulate(r){return Th(this.getAdaptivePointArray(),r)}toCommands(){const r=[],e=this.getPoints();for(let t=0,i=e.length;t<i;t++){const s=e[t];t===0?r.push({type:"M",x:s.x,y:s.y}):r.push({type:"L",x:s.x,y:s.y})}return r}toData(){return ah(this.toCommands())}drawTo(r){return this.toCommands().forEach(e=>{switch(e.type){case"M":r.moveTo(e.x,e.y);break;case"L":r.lineTo(e.x,e.y);break}}),this}copy(r){return this.arcLengthDivision=r.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const Eh=new Fe,Co=new Fe,To=new Fe,ci=new O;class ws extends er{constructor(r=new O,e=new O,t=new O,i=0,s=0,o=Math.PI*2,a=!1){super(),this._center=r,this._radius=e,this._diff=t,this.rotate=i,this.startAngle=s,this.endAngle=o,this.clockwise=a}get cx(){return this._center.x}set cx(r){this._center.x=r}get cy(){return this._center.y}set cy(r){this._center.y=r}get rx(){return this._radius.x}set rx(r){this._radius.x=r}get ry(){return this._radius.y}set ry(r){this._radius.y=r}get dx(){return this._diff.x}set dx(r){this._diff.x=r}get dy(){return this._diff.y}set dy(r){this._diff.y=r}isClockwise(){return this.clockwise}getPoint(r,e=new O){const t=Math.PI*2;let i=this.endAngle-this.startAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=t;for(;i>t;)i-=t;i<Number.EPSILON&&(s?i=0:i=t),this.clockwise&&!s&&(i===t?i=-t:i=i-t);const o=this.startAngle+r*i;let a=this.cx+this.rx*Math.cos(o),l=this.cy+this.ry*Math.sin(o);if(this.rotate!==0){const h=Math.cos(this.rotate),c=Math.sin(this.rotate),f=a-this.cx,p=l-this.cy;a=f*h-p*c+this.cx,l=f*c+p*h+this.cy}return e.set(a,l)}toCommands(){const{cx:r,cy:e,rx:t,ry:i,startAngle:s,endAngle:o,clockwise:a,rotate:l}=this,h=r+t*Math.cos(s)*Math.cos(l)-i*Math.sin(s)*Math.sin(l),c=e+t*Math.cos(s)*Math.sin(l)+i*Math.sin(s)*Math.cos(l),f=Math.abs(s-o),p=f>Math.PI?1:0,m=a?1:0,g=l*180/Math.PI;if(f>=2*Math.PI){const _=s+Math.PI,y=r+t*Math.cos(_)*Math.cos(l)-i*Math.sin(_)*Math.sin(l),E=e+t*Math.cos(_)*Math.sin(l)+i*Math.sin(_)*Math.cos(l);return[{type:"M",x:h,y:c},{type:"A",rx:t,ry:i,angle:g,largeArcFlag:0,sweepFlag:m,x:y,y:E},{type:"A",rx:t,ry:i,angle:g,largeArcFlag:0,sweepFlag:m,x:h,y:c}]}else{const _=r+t*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),y=e+t*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l);return[{type:"M",x:h,y:c},{type:"A",rx:t,ry:i,angle:g,largeArcFlag:p,sweepFlag:m,x:_,y}]}}drawTo(r){const{cx:e,cy:t,rx:i,ry:s,rotate:o,startAngle:a,endAngle:l,clockwise:h}=this;return r.ellipse(e,t,i,s,o,a,l,!h),this}applyTransform(r){return ci.set(this.cx,this.cy),ci.applyMatrix3(r),this.cx=ci.x,this.cy=ci.y,Oh(r)?Mh(this,r):Ah(this,r),this}getControlPointRefs(){return[this._center]}getAdaptivePointArray(r=[]){const{cx:e,cy:t,rx:i,ry:s,dx:o,dy:a}=this;if(!(i>=0&&s>=0&&o>=0&&a>=0))return r;const l=Math.ceil(2.3*Math.sqrt(i+s)),h=l*8+(o?4:0)+(a?4:0);if(h===0)return r;const c=[];if(l===0)c[0]=c[6]=e+o,c[1]=c[3]=t+a,c[2]=c[4]=e-o,c[5]=c[7]=t-a;else{let f=0,p=l*4+(o?2:0)+2,m=p,g=h,_=o+i,y=a,E=e+_,T=e-_,P=t+y;if(c[f++]=E,c[f++]=P,c[--p]=P,c[--p]=T,a){const w=t-y;c[m++]=T,c[m++]=w,c[--g]=w,c[--g]=E}for(let w=1;w<l;w++){const v=Math.PI/2*(w/l),x=o+Math.cos(v)*i,C=a+Math.sin(v)*s,I=e+x,F=e-x,B=t+C,U=t-C;c[f++]=I,c[f++]=B,c[--p]=B,c[--p]=F,c[m++]=F,c[m++]=U,c[--g]=U,c[--g]=I}_=o,y=a+s,E=e+_,T=e-_,P=t+y;const S=t-y;c[f++]=E,c[f++]=P,c[--g]=S,c[--g]=E,o&&(c[f++]=T,c[f++]=P,c[--g]=S,c[--g]=T)}return Array.prototype.push.apply(r,c),r}fillTriangulate(r={}){let{vertices:e=[],indices:t=[],verticesStride:i=2,verticesOffset:s=0,indicesOffset:o=0}=r;const a=this.getAdaptivePointArray();if(a.length===0)return{vertices:e,indices:t};let l=0,h=0;for(let p=0;p<a.length;p+=2)l+=a[p],h+=a[p+1];l/=a.length/2,h/=a.length/2;let c=s;e[c*i]=l,e[c*i+1]=h;const f=c++;for(let p=0;p<a.length;p+=2)e[c*i]=a[p],e[c*i+1]=a[p+1],p>0&&(t[o++]=c,t[o++]=f,t[o++]=c-1),c++;return t[o++]=f+1,t[o++]=f,t[o++]=c-1,{vertices:e,indices:t}}getMinMax(r=O.MAX,e=O.MIN){const{cx:t,cy:i,rx:s,ry:o,rotate:a}=this,l=Math.cos(a),h=Math.sin(a),c=Math.sqrt(s*s*l*l+o*o*h*h),f=Math.sqrt(s*s*h*h+o*o*l*l);return r.x=Math.min(r.x,t-c),r.y=Math.min(r.y,i-f),e.x=Math.max(e.x,t+c),e.y=Math.max(e.y,i+f),{min:r,max:e}}copy(r){return super.copy(r),this.cx=r.cx,this.cy=r.cy,this.rx=r.rx,this.ry=r.ry,this.dx=r.dx,this.dy=r.dy,this.startAngle=r.startAngle,this.endAngle=r.endAngle,this.clockwise=r.clockwise,this.rotate=r.rotate,this}}function Mh(n,r){const e=n.rx,t=n.ry,i=Math.cos(n.rotate),s=Math.sin(n.rotate),o=new O(e*i,e*s),a=new O(-t*s,t*i),l=o.applyMatrix3(r),h=a.applyMatrix3(r),c=Eh.set(l.x,h.x,0,l.y,h.y,0,0,0,1),f=Co.copy(c).invert(),g=To.copy(f).transpose().multiply(f).elements,_=Uh(g[0],g[1],g[4]),y=Math.sqrt(_.rt1),E=Math.sqrt(_.rt2);if(n.rx=1/y,n.ry=1/E,n.rotate=Math.atan2(_.sn,_.cs),!((n.endAngle-n.startAngle)%(2*Math.PI)<Number.EPSILON)){const P=Co.set(y,0,0,0,E,0,0,0,1),S=To.set(_.cs,_.sn,0,-_.sn,_.cs,0,0,0,1),w=P.multiply(S).multiply(c),v=x=>{const{x:C,y:I}=new O(Math.cos(x),Math.sin(x)).applyMatrix3(w);return Math.atan2(I,C)};n.startAngle=v(n.startAngle),n.endAngle=v(n.endAngle),So(r)&&(n.clockwise=!n.clockwise)}}function Ah(n,r){const e=Eo(r),t=Mo(r);n.rx*=e,n.ry*=t;const i=e>Number.EPSILON?Math.atan2(r.elements[1],r.elements[0]):Math.atan2(-r.elements[3],r.elements[4]);n.rotate+=i,So(r)&&(n.startAngle*=-1,n.endAngle*=-1,n.clockwise=!n.clockwise)}function So(n){const r=n.elements;return r[0]*r[4]-r[1]*r[3]<0}function Oh(n){const r=n.elements,e=r[0]*r[3]+r[1]*r[4];if(e===0)return!1;const t=Eo(n),i=Mo(n);return Math.abs(e/(t*i))>Number.EPSILON}function Eo(n){const r=n.elements;return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Mo(n){const r=n.elements;return Math.sqrt(r[3]*r[3]+r[4]*r[4])}function Uh(n,r,e){let t,i,s,o,a;const l=n+e,h=n-e,c=Math.sqrt(h*h+4*r*r);return l>0?(t=.5*(l+c),a=1/t,i=n*a*e-r*a*r):l<0?i=.5*(l-c):(t=.5*c,i=-.5*c),h>0?s=h+c:s=h-c,Math.abs(s)>2*Math.abs(r)?(a=-2*r/s,o=1/Math.sqrt(1+a*a),s=a*o):Math.abs(r)===0?(s=1,o=0):(a=-.5*s/r,s=1/Math.sqrt(1+a*a),o=a*s),h>0&&(a=s,s=-o,o=a),{rt1:t,rt2:i,cs:s,sn:o}}class Ih extends ws{constructor(r=0,e=0,t=1,i=0,s=Math.PI*2,o=!1){super(new O(r,e),new O(t,t),new O(0,0),0,i,s,o)}drawTo(r){const{cx:e,cy:t,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;return r.arc(e,t,i,s,o,!a),this}getAdaptivePointArray(r=[]){const{cx:e,cy:t,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;let l=Math.abs(s-o);(!a&&s>o||a&&o>s)&&(l=2*Math.PI-l);let h=Math.max(6,Math.floor(6*i**(1/3)*(l/Math.PI)));h=Math.max(h,3);let c=l/h,f=s;c*=a?1:-1;for(let p=0;p<h+1;p++){const m=Math.cos(f),g=Math.sin(f),_=e+m*i,y=t+g*i;r.push(_,y),f+=c}return r}}class Sr extends er{constructor(r=[]){super(),this.curves=r}getFlatCurves(){return this.curves.flatMap(r=>r instanceof Sr?r.getFlatCurves():r)}addCurve(r){return this.curves.push(r),this}getPoint(r,e=new O){const t=r*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=t){const o=i[s]-t,a=this.curves[s],l=a.getLength();return a.getPointAt(l===0?0:1-o/l,e)}s++}return e}updateLengths(){const r=[];for(let e=0,t=0,i=this.curves.length;e<i;e++)t+=this.curves[e].getLength(),r.push(t);this._arcLengths=r}getControlPointRefs(){return this.curves.flatMap(r=>r.getControlPointRefs())}getAdaptivePointArray(r=[]){let e;return this.curves.forEach(t=>{t.getAdaptivePointArray(r),e&&r[e-1]===r[e+1]&&r[e]===r[e+2]&&r.splice(e+1,2),e=r.length-1}),r}applyTransform(r){return this.curves.forEach(e=>e.applyTransform(r)),this}getMinMax(r=O.MAX,e=O.MIN){return this.curves.forEach(t=>t.getMinMax(r,e)),{min:r,max:e}}getBoundingBox(){const{min:r,max:e}=this.getMinMax();return new Z(r.x,r.y,e.x-r.x,e.y-r.y)}toCommands(){return this.curves.flatMap(r=>r.toCommands())}drawTo(r){var t;const e=(t=this.curves[0])==null?void 0:t.getPoint(0);return e&&r.moveTo(e.x,e.y),this.curves.forEach(i=>i.drawTo(r)),this}copy(r){return super.copy(r),this.curves=r.curves.map(e=>e.clone()),this}}class xs extends er{constructor(r=new O,e=new O,t=new O,i=new O){super(),this.p1=r,this.cp1=e,this.cp2=t,this.p2=i}static from(r,e,t,i,s,o,a,l){return new xs(new O(r,e),new O(t,i),new O(s,o),new O(a,l))}getPoint(r,e=new O){const{p1:t,cp1:i,cp2:s,p2:o}=this;return e.set(bo(r,t.x,i.x,s.x,o.x),bo(r,t.y,i.y,s.y,o.y))}getAdaptivePointArray(r=[]){return mh(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,r)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(r,e,t){const i=e*e-4*r*t;if(i<0)return[];const s=Math.sqrt(i),o=(-e+s)/(2*r),a=(-e-s)/(2*r);return[o,a].filter(l=>l>=0&&l<=1)}getMinMax(r=O.MAX,e=O.MIN){const{p1:t,cp1:i,cp2:s,p2:o}=this,a=this._solveQuadratic(3*(i.x-t.x),6*(s.x-i.x),3*(o.x-s.x)),l=this._solveQuadratic(3*(i.y-t.y),6*(s.y-i.y),3*(o.y-s.y)),h=[0,1,...a,...l];return((f,p)=>{for(const m of f)for(let g=0;g<=p;g++){const _=g/p-.5,y=Math.min(1,Math.max(0,m+_)),E=this.getPoint(y);r.x=Math.min(r.x,E.x),r.y=Math.min(r.y,E.y),e.x=Math.max(e.x,E.x),e.y=Math.max(e.y,E.y)}})(h,10),{min:r,max:e}}toCommands(){const{p1:r,cp1:e,cp2:t,p2:i}=this;return[{type:"M",x:r.x,y:r.y},{type:"C",x1:e.x,y1:e.y,x2:t.x,y2:t.y,x:i.x,y:i.y}]}drawTo(r){const{p1:e,cp1:t,cp2:i,p2:s}=this;return r.lineTo(e.x,e.y),r.bezierCurveTo(t.x,t.y,i.x,i.y,s.x,s.y),this}copy(r){return super.copy(r),this.p1.copy(r.p1),this.cp1.copy(r.cp1),this.cp2.copy(r.cp2),this.p2.copy(r.p2),this}}class Dh extends ws{constructor(r=0,e=0,t=1,i=1,s=0,o=0,a=Math.PI*2,l=!1){super(new O(r,e),new O(t,i),new O,s,o,a,l)}drawTo(r){return r.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class St extends er{constructor(r=new O,e=new O){super(),this.p1=r,this.p2=e}static from(r,e,t,i){return new St(new O(r,e),new O(t,i))}getPoint(r,e=new O){return r===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(r).add(this.p1),e}getPointAt(r,e=new O){return this.getPoint(r,e)}getTangent(r,e=new O){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(r,e=new O){return this.getTangent(r,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptivePointArray(r=[]){return r.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),r}getMinMax(r=O.MAX,e=O.MIN){const{p1:t,p2:i}=this;return r.x=Math.min(r.x,t.x,i.x),r.y=Math.min(r.y,t.y,i.y),e.x=Math.max(e.x,t.x,i.x),e.y=Math.max(e.y,t.y,i.y),{min:r,max:e}}toCommands(){const{p1:r,p2:e}=this;return[{type:"M",x:r.x,y:r.y},{type:"L",x:e.x,y:e.y}]}drawTo(r){const{p1:e,p2:t}=this;return r.lineTo(e.x,e.y),r.lineTo(t.x,t.y),this}copy(r){return super.copy(r),this.p1.copy(r.p1),this.p2.copy(r.p2),this}}class Rh extends Sr{}class Ps extends er{constructor(r=new O,e=new O,t=new O){super(),this.p1=r,this.cp=e,this.p2=t}static from(r,e,t,i,s,o){return new Ps(new O(r,e),new O(t,i),new O(s,o))}getPoint(r,e=new O){const{p1:t,cp:i,p2:s}=this;return e.set(wo(r,t.x,i.x,s.x),wo(r,t.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptivePointArray(r=[]){return bh(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,r)}getMinMax(r=O.MAX,e=O.MIN){const{p1:t,cp:i,p2:s}=this,o=.5*(t.x+i.x),a=.5*(t.y+i.y),l=.5*(t.x+s.x),h=.5*(t.y+s.y);return r.x=Math.min(r.x,t.x,s.x,o,l),r.y=Math.min(r.y,t.y,s.y,a,h),e.x=Math.max(e.x,t.x,s.x,o,l),e.y=Math.max(e.y,t.y,s.y,a,h),{min:r,max:e}}toCommands(){const{p1:r,cp:e,p2:t}=this;return[{type:"M",x:r.x,y:r.y},{type:"Q",x1:e.x,y1:e.y,x:t.x,y:t.y}]}drawTo(r){const{p1:e,cp:t,p2:i}=this;return r.lineTo(e.x,e.y),r.quadraticCurveTo(t.x,t.y,i.x,i.y),this}copy(r){return super.copy(r),this.p1.copy(r.p1),this.cp.copy(r.cp),this.p2.copy(r.p2),this}}class Bh extends Rh{constructor(r=0,e=0,t=0,i=0){super(),this.x=r,this.y=e,this.width=t,this.height=i,this.update()}update(){const{x:r,y:e,width:t,height:i}=this,s=[new O(r,e),new O(r+t,e),new O(r+t,e+i),new O(r,e+i)];return this.curves=[new St(s[0],s[1]),new St(s[1],s[2]),new St(s[2],s[3]),new St(s[3],s[0])],this}drawTo(r){return r.rect(this.x,this.y,this.width,this.height),this}fillTriangulate(r={}){let{vertices:e=[],indices:t=[],verticesStride:i=2,verticesOffset:s=0,indicesOffset:o=0}=r;const{x:a,y:l,width:h,height:c}=this,f=[a,l,a+h,l,a+h,l+c,a,l+c];let p=0;s*=i,e[s+p]=f[0],e[s+p+1]=f[1],p+=i,e[s+p]=f[2],e[s+p+1]=f[3],p+=i,e[s+p]=f[6],e[s+p+1]=f[7],p+=i,e[s+p]=f[4],e[s+p+1]=f[5],p+=i;const m=s/i;return t[o++]=m,t[o++]=m+1,t[o++]=m+2,t[o++]=m+1,t[o++]=m+3,t[o++]=m+2,{vertices:e,indices:t}}copy(r){return super.copy(r),this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this.update(),this}}class kh extends ws{constructor(r=0,e=0,t=1,i=1,s=1){super(),this.x=r,this.y=e,this.width=t,this.height=i,this.radius=s,this.update()}update(){const{x:r,y:e,width:t,height:i,radius:s}=this,o=t/2,a=i/2,l=r+o,h=e+a,c=Math.max(0,Math.min(s,Math.min(o,a))),f=c,p=o-c,m=a-f;return this._center=new O(l,h),this._radius=new O(c,f),this._diff=new O(p,m),this}drawTo(r){const{x:e,y:t,width:i,height:s,radius:o}=this;return r.roundRect(e,t,i,s,o),this}copy(r){return super.copy(r),this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this.radius=r.radius,this.update(),this}}class Lh extends er{constructor(r=[]){super(),this.points=r}getPoint(r,e=new O){const{points:t}=this,i=(t.length-1)*r,s=Math.floor(i),o=i-s,a=t[s===0?s:s-1],l=t[s],h=t[s>t.length-2?t.length-1:s+1],c=t[s>t.length-3?t.length-1:s+2];return e.set(vo(o,a.x,l.x,h.x,c.x),vo(o,a.y,l.y,h.y,c.y)),e}getControlPointRefs(){return this.points}copy(r){super.copy(r),this.points=[];for(let e=0,t=r.points.length;e<t;e++)this.points.push(r.points[e].clone());return this}}class tr extends Sr{constructor(e){super();u(this,"startPoint");u(this,"currentPoint");u(this,"autoClose",!1);e&&this.addPoints(e)}addPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++){const{x:s,y:o}=e[t];this.lineTo(s,o)}return this}addCommands(e){return yo(e,this),this}addData(e){return this.addCommands(_o(e)),this}getUnevenPointArray(e=40,t=[]){return super.getUnevenPointArray(e,t),this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getSpacedPointArray(e=40,t=[]){return super.getSpacedPointArray(e,t),this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}_setCurrentPoint(e){return this.currentPoint=new O(e.x,e.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(e){if(this.curves.length>0){const t=e.getPoint(0);(!this.currentPoint||!t.equals(this.currentPoint))&&this.lineTo(t.x,t.y)}return this}closePath(){const e=this.startPoint;if(e){const t=this.currentPoint;t&&!e.equals(t)&&(this.curves.push(new St(t,e)),t.copy(e)),this.startPoint=void 0}return this}moveTo(e,t){return this.currentPoint=new O(e,t),this.startPoint=this.currentPoint.clone(),this}lineTo(e,t){const i=this.currentPoint;return i!=null&&i.equals({x:e,y:t})||this.curves.push(St.from((i==null?void 0:i.x)??0,(i==null?void 0:i.y)??0,e,t)),this._setCurrentPoint({x:e,y:t}),this}bezierCurveTo(e,t,i,s,o,a){const l=this.currentPoint;return l!=null&&l.equals({x:o,y:a})||this.curves.push(xs.from((l==null?void 0:l.x)??0,(l==null?void 0:l.y)??0,e,t,i,s,o,a)),this._setCurrentPoint({x:o,y:a}),this}quadraticCurveTo(e,t,i,s){const o=this.currentPoint;return o!=null&&o.equals({x:i,y:s})||this.curves.push(Ps.from((o==null?void 0:o.x)??0,(o==null?void 0:o.y)??0,e,t,i,s)),this._setCurrentPoint({x:i,y:s}),this}arc(e,t,i,s,o,a){const l=new Ih(e,t,i,s,o,!a);return this._connetLineTo(l),this.curves.push(l),this._setCurrentPoint(l.getPoint(1)),this}relativeArc(e,t,i,s,o,a){var l,h;return e+=((l=this.currentPoint)==null?void 0:l.x)??0,t+=((h=this.currentPoint)==null?void 0:h.y)??0,this.arc(e,t,i,s,o,a),this}arcTo(e,t,i,s,o){return console.warn("Method arcTo not supported yet"),this}ellipse(e,t,i,s,o,a,l,h=!0){const c=new Dh(e,t,i,s,o,a,l,!h);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(e,t,i,s,o,a,l,h){var c,f;return e+=((c=this.currentPoint)==null?void 0:c.x)??0,t+=((f=this.currentPoint)==null?void 0:f.y)??0,this.ellipse(e,t,i,s,o,a,l,h),this}rect(e,t,i,s){const o=new Bh(e,t,i,s);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:e,y:t}),this}roundRect(e,t,i,s,o){const a=new kh(e,t,i,s,o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint({x:e,y:t}),this}splineThru(e){const t=this.currentPoint??new O;return this.curves.push(new Lh([t].concat(e))),this._setCurrentPoint(e[e.length-1]),this}drawTo(e){var i;const t=(i=this.curves[0])==null?void 0:i.getPoint(0);return t&&e.moveTo(t.x,t.y),this.curves.forEach(s=>s.drawTo(e)),this.autoClose&&e.closePath(),this}copy(e){var t;return super.copy(e),this.autoClose=e.autoClose,this.currentPoint=(t=e.currentPoint)==null?void 0:t.clone(),this}}function Nh(n){return n.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function Fh(n,r,e,t){const i=r.clone().sub(n),s=t.clone().sub(e),o=e.clone().sub(n),a=i.cross(s);if(a===0)return new O((n.x+e.x)/2,(n.y+e.y)/2);const l=o.cross(s)/a;return Math.abs(l)>1?new O((n.x+e.x)/2,(n.y+e.y)/2):new O(n.x+l*i.x,n.y+l*i.y)}class Pe extends Sr{constructor(e,t={}){super();u(this,"currentCurve",new tr);u(this,"style");this.curves.push(this.currentCurve),this.style=t,e&&(e instanceof Pe?this.addPath(e):Array.isArray(e)?this.addCommands(e):this.addData(e))}get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}addPath(e){return e instanceof Pe?this.curves.push(...e.curves.map(t=>t.clone())):this.curves.push(e),this}closePath(){const e=this.startPoint;return e&&(this.currentCurve.closePath(),this.currentCurve.curves.length>0&&(this.currentCurve=new tr().moveTo(e.x,e.y),this.curves.push(this.currentCurve))),this}moveTo(e,t){var i;return(i=this.currentCurve.currentPoint)!=null&&i.equals({x:e,y:t})||(this.currentCurve.curves.length&&(this.currentCurve=new tr,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(e,t)),this}lineTo(e,t){return this.currentCurve.lineTo(e,t),this}bezierCurveTo(e,t,i,s,o,a){return this.currentCurve.bezierCurveTo(e,t,i,s,o,a),this}quadraticCurveTo(e,t,i,s){return this.currentCurve.quadraticCurveTo(e,t,i,s),this}arc(e,t,i,s,o,a){return this.currentCurve.arc(e,t,i,s,o,a),this}arcTo(e,t,i,s,o){return this.currentCurve.arcTo(e,t,i,s,o),this}ellipse(e,t,i,s,o,a,l,h){return this.currentCurve.ellipse(e,t,i,s,o,a,l,h),this}rect(e,t,i,s){return this.currentCurve.rect(e,t,i,s),this}roundRect(e,t,i,s,o){return this.currentCurve.roundRect(e,t,i,s,o),this}reset(){return this.currentCurve=new tr,this.curves.push(this.currentCurve),this.style={},this}addCommands(e){return yo(e,this),this}addData(e){return this.addCommands(_o(e)),this}splineThru(e){return this.currentCurve.splineThru(e),this}scale(e,t=e,i={x:0,y:0}){return this.getControlPointRefs().forEach(s=>{s.scale(e,t,i)}),this}skew(e,t=0,i={x:0,y:0}){return this.getControlPointRefs().forEach(s=>{s.skew(e,t,i)}),this}rotate(e,t={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.rotate(e,t)}),this}bold(e){if(e===0)return this;const t=this.getFlatCurves(),i=[],s=[],o=[];t.forEach((l,h)=>{const c=l.getControlPointRefs(),f=l.isClockwise();o[h]=c,s[h]=f;const p=c[0],m=c[c.length-1]??p;i.push({start:f?m:p,end:f?p:m,index:h})});const a=[];return i.forEach((l,h)=>{a[h]=[],i.forEach((c,f)=>{var p;c.start&&l.end&&f!==h&&((p=c.start)!=null&&p.equals(l.end))&&a[h].push(c.index)})}),t.forEach((l,h)=>{const c=s[h];o[h].forEach(f=>{f.add(l.getNormal(l.getTForPoint(f)).scale(c?e:-e))})}),a.forEach((l,h)=>{const c=o[h];l.forEach(f=>{const p=o[f],m=Fh(c[c.length-1],c[c.length-2]??c[c.length-1],p[0],p[1]??p[0]);m&&(c[c.length-1].copy(m),p[0].copy(m))})}),this}getMinMax(e=O.MAX,t=O.MIN,i=!0){const s=this.strokeWidth;return this.curves.forEach(o=>{if(o.getMinMax(e,t),i&&s>1){const a=s/2,l=o.isClockwise(),h=[];for(let c=0;c<=1;c+=1/o.arcLengthDivision){const f=o.getPoint(c),p=o.getNormal(c),m=p.clone().scale(l?a:-a),g=p.clone().scale(l?-a:a);h.push(f.clone().add(m),f.clone().add(g),f.clone().add({x:a,y:0}),f.clone().add({x:-a,y:0}),f.clone().add({x:0,y:a}),f.clone().add({x:0,y:-a}),f.clone().add({x:a,y:a}),f.clone().add({x:-a,y:-a}))}e.min(...h),t.max(...h)}}),{min:e,max:t}}getBoundingBox(e=!0){const{min:t,max:i}=this.getMinMax(void 0,void 0,e);return new Z(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(e,t={}){t={...this.style,...t};const{fill:i="#000",stroke:s="none"}=t;return e.beginPath(),e.save(),ys(e,t),this.curves.forEach(o=>{o.drawTo(e)}),i!=="none"&&e.fill(),s!=="none"&&e.stroke(),e.restore(),this}drawControlPointsTo(e,t={}){t={...this.style,...t};const{fill:i="#000",stroke:s="none"}=t;return e.beginPath(),e.save(),ys(e,t),this.getControlPointRefs().forEach(o=>{sh(e,o.x,o.y,{radius:4})}),i!=="none"&&e.fill(),s!=="none"&&e.stroke(),e.restore(),this}toCommands(){return this.curves.flatMap(e=>e.toCommands())}toData(){return this.curves.filter(e=>e.curves.length).map(e=>e.toData()).join(" ")}toSVGPathString(){const e={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},t={};for(const s in e)e[s]!==void 0&&(t[Nh(s)]=e[s]);Object.assign(t,{"stroke-width":`${this.strokeWidth}px`});let i="";for(const s in t)t[s]!==void 0&&(i+=`${s}:${t[s]};`);return`<path d="${this.toData()}" style="${i}"></path>`}copy(e){return super.copy(e),this.currentCurve=e.currentCurve.clone(),this.style={...e.style},this}}class Cs{constructor(r=[]){this.paths=r}getBoundingBox(r=!0){if(!this.paths.length)return;const e=O.MAX,t=O.MIN;return this.paths.forEach(i=>i.getMinMax(e,t,r)),new Z(e.x,e.y,t.x-e.x,t.y-e.y)}toSVGString(){const{x:r,y:e,width:t,height:i}=this.getBoundingBox(),s=this.paths.map(o=>o.toSVGPathString()).join("");return`<svg viewBox="${r} ${e} ${t} ${i}" width="${t}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${s}</svg>`}toSVGUrl(){return`data:image/svg+xml;base64,${btoa(this.toSVGString())}`}toSVG(){return new DOMParser().parseFromString(this.toSVGString(),"image/svg+xml").documentElement}toCanvas(r={}){const{pixelRatio:e=2,...t}=r,{left:i,top:s,width:o,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=o*e,l.height=a*e,l.style.width=`${o}px`,l.style.height=`${a}px`;const h=l.getContext("2d");return h&&(h.scale(e,e),h.translate(-i,-s),this.paths.forEach(c=>{c.drawTo(h,t)})),l}}const Ao="data:image/svg+xml;",Oo=`${Ao}base64,`,Uo=`${Ao}charset=utf8,`;function Io(n){if(typeof n=="string"){let r;n.startsWith(Oo)?(n=n.substring(Oo.length,n.length),r=atob(n)):n.startsWith(Uo)?(n=n.substring(Uo.length,n.length),r=decodeURIComponent(n)):r=n;const e=new DOMParser().parseFromString(r,"text/xml"),t=e.querySelector("parsererror");if(t)throw new Error(`${t.textContent??"parser error"}
61
- ${r}`);return e.documentElement}else return n}const $h="px",zh=90,Do=["mm","cm","in","pt","pc","px"],Ro={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function Q(n){let r="px";if(typeof n=="string"||n instanceof String)for(let t=0,i=Do.length;t<i;t++){const s=Do[t];if(n.endsWith(s)){r=s,n=n.substring(0,n.length-s.length);break}}let e;return e=Ro[r][$h],e<0&&(e=Ro[r].in*zh),e*Number.parseFloat(n)}const Vh=new Fe,ui=new Fe,Bo=new Fe,ko=new Fe;function jh(n,r,e){if(!(n.hasAttribute("transform")||n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))))return null;const t=Gh(n);return e.length>0&&t.premultiply(e[e.length-1]),r.copy(t),e.push(t),t}function Gh(n){const r=new Fe,e=Vh;if(n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))&&r.translate(Q(n.getAttribute("x")),Q(n.getAttribute("y"))),n.hasAttribute("transform")){const t=n.getAttribute("transform").split(")");for(let i=t.length-1;i>=0;i--){const s=t[i].trim();if(s==="")continue;const o=s.indexOf("("),a=s.length;if(o>0&&o<a){const l=s.slice(0,o),h=lt(s.slice(o+1));switch(e.identity(),l){case"translate":if(h.length>=1){const c=h[0];let f=0;h.length>=2&&(f=h[1]),e.translate(c,f)}break;case"rotate":if(h.length>=1){let c=0,f=0,p=0;c=h[0]*Math.PI/180,h.length>=3&&(f=h[1],p=h[2]),ui.makeTranslation(-f,-p),Bo.makeRotation(c),ko.multiplyMatrices(Bo,ui),ui.makeTranslation(f,p),e.multiplyMatrices(ui,ko)}break;case"scale":h.length>=1&&e.scale(h[0],h[1]??h[0]);break;case"skewX":h.length===1&&e.set(1,Math.tan(h[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":h.length===1&&e.set(1,0,0,Math.tan(h[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":h.length===6&&e.set(h[0],h[2],h[4],h[1],h[3],h[5],0,0,1);break}}r.premultiply(e)}}return r}function qh(n){return new Pe().arc(Q(n.getAttribute("cx")||0),Q(n.getAttribute("cy")||0),Q(n.getAttribute("r")||0),0,Math.PI*2)}function Wh(n,r){if(!(!n.sheet||!n.sheet.cssRules||!n.sheet.cssRules.length))for(let e=0;e<n.sheet.cssRules.length;e++){const t=n.sheet.cssRules[e];if(t.type!==1)continue;const i=t.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),s={};for(let o=t.style.length,a=0;a<o;a++){const l=t.style.item(a);s[l]=t.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)r[i[o]]=Object.assign(r[i[o]]||{},{...s})}}function Xh(n){return new Pe().ellipse(Q(n.getAttribute("cx")||0),Q(n.getAttribute("cy")||0),Q(n.getAttribute("rx")||0),Q(n.getAttribute("ry")||0),0,0,Math.PI*2)}function Hh(n){return new Pe().moveTo(Q(n.getAttribute("x1")||0),Q(n.getAttribute("y1")||0)).lineTo(Q(n.getAttribute("x2")||0),Q(n.getAttribute("y2")||0))}function Yh(n){const r=new Pe,e=n.getAttribute("d");return!e||e==="none"?null:(r.addData(e),r)}const Zh=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Kh(n){var t;const r=new Pe;let e=0;return(t=n.getAttribute("points"))==null||t.replace(Zh,(i,s,o)=>{const a=Q(s),l=Q(o);return e===0?r.moveTo(a,l):r.lineTo(a,l),e++,i}),r.currentCurve.autoClose=!0,r}const Jh=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Qh(n){var t;const r=new Pe;let e=0;return(t=n.getAttribute("points"))==null||t.replace(Jh,(i,s,o)=>{const a=Q(s),l=Q(o);return e===0?r.moveTo(a,l):r.lineTo(a,l),e++,i}),r.currentCurve.autoClose=!1,r}function ec(n){const r=Q(n.getAttribute("x")||0),e=Q(n.getAttribute("y")||0),t=Q(n.getAttribute("rx")||n.getAttribute("ry")||0),i=Q(n.getAttribute("ry")||n.getAttribute("rx")||0),s=Q(n.getAttribute("width")),o=Q(n.getAttribute("height")),a=1-.551915024494,l=new Pe;return l.moveTo(r+t,e),l.lineTo(r+s-t,e),(t!==0||i!==0)&&l.bezierCurveTo(r+s-t*a,e,r+s,e+i*a,r+s,e+i),l.lineTo(r+s,e+o-i),(t!==0||i!==0)&&l.bezierCurveTo(r+s,e+o-i*a,r+s-t*a,e+o,r+s-t,e+o),l.lineTo(r+t,e+o),(t!==0||i!==0)&&l.bezierCurveTo(r+t*a,e+o,r,e+o-i*a,r,e+o-i),l.lineTo(r,e+i),(t!==0||i!==0)&&l.bezierCurveTo(r,e+i*a,r+t*a,e,r+t,e),l}function ht(n,r,e){r=Object.assign({},r);let t={};if(n.hasAttribute("class")){const h=n.getAttribute("class").split(/\s/).filter(Boolean).map(c=>c.trim());for(let c=0;c<h.length;c++)t=Object.assign(t,e[`.${h[c]}`])}n.hasAttribute("id")&&(t=Object.assign(t,e[`#${n.getAttribute("id")}`]));for(let h=n.style.length,c=0;c<h;c++){const f=n.style.item(c),p=n.style.getPropertyValue(f);r[f]=p,t[f]=p}function i(h,c,f=s){n.hasAttribute(h)&&(r[c]=f(n.getAttribute(h))),t[h]&&(r[c]=f(t[h]))}function s(h){return h.startsWith("url")&&console.warn("url access in attributes is not implemented."),h}function o(h){return Math.max(0,Math.min(1,Q(h)))}function a(h){return Math.max(0,Q(h))}function l(h){return h.split(" ").filter(c=>c!=="").map(c=>Q(c))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",Q),i("visibility","visibility"),r}function Ts(n,r,e=[],t={}){var f;if(n.nodeType!==1)return e;let i=!1,s=null,o={...r};switch(n.nodeName){case"svg":o=ht(n,o,t);break;case"style":Wh(n,t);break;case"g":o=ht(n,o,t);break;case"path":o=ht(n,o,t),n.hasAttribute("d")&&(s=Yh(n));break;case"rect":o=ht(n,o,t),s=ec(n);break;case"polygon":o=ht(n,o,t),s=Kh(n);break;case"polyline":o=ht(n,o,t),s=Qh(n);break;case"circle":o=ht(n,o,t),s=qh(n);break;case"ellipse":o=ht(n,o,t),s=Xh(n);break;case"line":o=ht(n,o,t),s=Hh(n);break;case"defs":i=!0;break;case"use":{o=ht(n,o,t);const m=(n.getAttributeNS("http://www.w3.org/1999/xlink","href")||n.getAttribute("href")||"").substring(1),g=(f=n.viewportElement)==null?void 0:f.getElementById(m);g?Ts(g,o,e,t):console.warn(`'use node' references non-existent node id: ${m}`);break}default:console.warn(n);break}if(o.display==="none")return e;Object.assign(r,o);const a=new Fe,l=[],h=jh(n,a,l);s&&(s.applyTransform(a),e.push(s),s.style=r);const c=n.childNodes;for(let p=0,m=c.length;p<m;p++){const g=c[p];i&&g.nodeName!=="style"&&g.nodeName!=="defs"||Ts(g,r,e,t)}return h&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function Lo(n){return new Cs(Ts(Io(n),{}))}class fi extends yt{constructor(e={}){super();u(this,"vertexAttributes");u(this,"indexBuffer");u(this,"instanceCount");u(this,"mode");u(this,"_materialWeakMap",new Zt);this.vertexAttributes=new Map(Object.entries((e==null?void 0:e.vertexAttributes)??{})),this.indexBuffer=e==null?void 0:e.indexBuffer,this.instanceCount=e==null?void 0:e.instanceCount,this.mode=(e==null?void 0:e.mode)??"triangles"}_glVertexArray(e){var t;return{attributes:Object.fromEntries(Array.from(this.vertexAttributes).map(([i,s])=>[i,{buffer:s.buffer._glBuffer(e),size:s.size,type:s.type,normalized:s.normalized,stride:s.stride,offset:s.offset,divisor:s.divisor}])),elementArrayBuffer:(t=this.indexBuffer)==null?void 0:t._glBuffer(e)}}_glVertexArrayObject(e,t){let i=this._materialWeakMap.get(t);return i||(i={material:t.instanceId,geometry:this.instanceId},this._materialWeakMap.set(t,i)),e.getRelated(i,()=>e.vertexArray.create(t._glProgram(e),this._glVertexArray(e)))}draw(e,t,i){var l;e.flush(),t.activate(e,i);const s=this._glVertexArrayObject(e,t);let o=!1,a;this.vertexAttributes.forEach(h=>{(a==null?void 0:a.instanceId)!==h.buffer.instanceId&&(a=h.buffer,a.upload(e)&&(o=!0)),h.upload()&&(o=!0)}),(l=this.indexBuffer)!=null&&l.upload(e)&&(o=!0),o&&s&&e.vertexArray.update(t._glProgram(e),s,this._glVertexArray(e)),e.vertexArray.bind(s??this._glVertexArray(e)),e.draw({mode:this.mode,instanceCount:this.instanceCount}),e.vertexArray.unbind()}}var tc=Object.defineProperty,No=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&tc(r,e,i),i};class rr extends yt{constructor(e){super();u(this,"needsUpload",!1);this.setProperties(e)}_glBufferOptions(){return{target:"element_array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(e){return e.getRelated(this,()=>e.buffer.create(this._glBufferOptions()))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"data":case"dynamic":this.needsUpload=!0;break}}upload(e){const t=this.needsUpload;return t&&(this.needsUpload=!1,e.buffer.update(this._glBuffer(e),this._glBufferOptions())),t}}No([ue({default:null})],rr.prototype,"data"),No([ue({default:!1})],rr.prototype,"dynamic");var rc=Object.defineProperty,Fo=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&rc(r,e,i),i};class vt extends yt{constructor(e){super();u(this,"needsUpload",!1);this.setProperties(e)}_glBufferOptions(){return{target:"array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(e){return e.getRelated(this,()=>e.buffer.create(this._glBufferOptions()))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"data":case"dynamic":this.needsUpload=!0;break}}upload(e){const t=this.needsUpload;return t&&(this.needsUpload=!1,e.buffer.update(this._glBuffer(e),this._glBufferOptions())),t}}Fo([ue({default:null})],vt.prototype,"data"),Fo([ue({default:!1})],vt.prototype,"dynamic");var ic=Object.defineProperty,Ft=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&ic(r,e,i),i};class je extends yt{constructor(e){super();u(this,"stride");u(this,"offset");u(this,"divisor");u(this,"needsUpload",!1);this.setProperties({buffer:new vt,...e})}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"buffer":case"size":case"normalized":case"type":case"stride":case"offset":case"divisor":this.needsUpload=!0;break}}upload(){const e=this.needsUpload;return e&&(this.needsUpload=!1),e}}Ft([ue()],je.prototype,"buffer"),Ft([ue({default:0})],je.prototype,"size"),Ft([ue({default:!1})],je.prototype,"normalized"),Ft([ue({default:"float"})],je.prototype,"type"),Ft([ue()],je.prototype,"stride"),Ft([ue()],je.prototype,"offset"),Ft([ue()],je.prototype,"divisor");class sc extends fi{constructor(){super({vertexAttributes:{position:new je({buffer:new vt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new rr({data:new Uint16Array([0,1,3,2]),dynamic:!1}),mode:"triangle_strip"})}}const qi=class qi extends yt{constructor(e={}){super();u(this,"vert");u(this,"frag");u(this,"uniforms");this.vert=e.vert??`precision highp float;
60
+ ${i.getShaderInfoLog(s)}`);return s}updateUniforms(...e){if(e.length>1){this.bind(e[0]),this.updateUniforms(e[1]);return}const t=this.boundProgram;if(!t)return;const i=this.gl,s=e[0],{uniforms:n,boundUniforms:o}=this.getMeta(t);for(const a in s){const l=s[a],h=n.get(a);if(!h)continue;const{type:c,isArray:u,location:d}=h;if(!(!d||o.get(d)===l))switch(o.set(d,l),c){case"float":u?i.uniform1fv(d,l):i.uniform1f(d,l);break;case"unsigned_int":u?i.uniform1uiv(d,l):i.uniform1ui(d,l);break;case"bool":case"int":case"sampler_2d":case"sampler_cube":case"sampler_2d_array":u?i.uniform1iv(d,l):i.uniform1i(d,l);break;case"bool_vec2":case"int_vec2":i.uniform2iv(d,l);break;case"unsigned_int_vec2":i.uniform2uiv(d,l);break;case"float_vec2":i.uniform2fv(d,l);break;case"bool_vec3":case"int_vec3":i.uniform3iv(d,l);break;case"unsigned_int_vec3":i.uniform3uiv(d,l);break;case"float_vec3":i.uniform3fv(d,l);break;case"bool_vec4":case"int_vec4":i.uniform4iv(d,l);break;case"unsigned_int_vec4":i.uniform4uiv(d,l);break;case"float_vec4":i.uniform4fv(d,l);break;case"float_mat2":i.uniformMatrix2fv(d,!1,l);break;case"float_mat3":i.uniformMatrix3fv(d,!1,l);break;case"float_mat4":i.uniformMatrix4fv(d,!1,l);break}}}reset(){super.reset(),this.boundProgram=null,this.uniforms={}}destroy(){super.destroy(),this.bind(null)}}function ph(r){switch(r){case"float":case"int":case"unsigned_int":case"bool":case"sampler_2d":return 1;case"float_vec2":case"int_vec2":case"unsigned_int_vec2":case"bool_vec2":return 2;case"float_vec3":case"int_vec3":case"unsigned_int_vec3":case"bool_vec3":return 3;case"float_vec4":case"int_vec4":case"unsigned_int_vec4":case"bool_vec4":case"float_mat2":return 4;case"float_mat3":return 9;case"float_mat4":return 16;default:return 1}}class wo extends Ct{install(A){super.install(A),A.scissor=this}get length(){var A;return((A=this._renderer.mask.last)==null?void 0:A.scissorCounter)??0}push(A){const e=this._renderer.gl;e.enable(e.SCISSOR_TEST),A.scissorCounter??(A.scissorCounter=0),A.scissorCounter++,this.use()}pop(A){if(this.length>0)this.use();else{const e=this._renderer.gl;e.disable(e.SCISSOR_TEST)}}use(){const A=this._renderer,{pixelRatio:e,mask:t,viewport:i,screen:s,gl:n}=A,o=t.last.mask;let a;i.boundViewport?a=i.boundViewport.height-(o.height+o.y)*e:a=(s.height-(o.height+o.y))*e,n.scissor(o.x*e,a,o.width*e,o.height*e)}}class _o extends Ct{install(A){super.install(A),A.stencil=this}get length(){var A;return((A=this._renderer.mask.last)==null?void 0:A.stencilCounter)??0}push(A){const e=this._renderer.gl,t=A.mask,i=A.stencilCounter??(A.stencilCounter=0);A.stencilCounter===0&&(this._renderer.framebuffer.forceStencil(),e.clearStencil(0),e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST)),A.stencilCounter++;const s=A.color;s&&(A.color=0,e.colorMask(!1,!1,!1,!1)),e.stencilFunc(e.EQUAL,i,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.INCR),t.render(this._renderer),this._renderer.flush(),s&&(A.color=s,e.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this.use()}pop(A){const e=this._renderer.gl,t=A.mask;if(!this.length)e.disable(e.STENCIL_TEST);else{const i=this._renderer.mask.last,s=(i==null?void 0:i.color)??15;s!==0&&(i.color=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.render(this._renderer),this._renderer.flush(),s!==0&&(i.color=s,e.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this.use()}}use(){const A=this._renderer.gl;A.stencilFunc(A.EQUAL,this.length,4294967295),A.stencilOp(A.KEEP,A.KEEP,A.KEEP)}}function Ch(r,A){const e=new Set([...Object.keys(r),...Object.keys(A)]),t={};return e.forEach(i=>{t[i]=r[i]!==A[i]}),t}class vo extends Ct{constructor(){super(...arguments);g(this,"maxUnits",0);g(this,"boundLocation",0);g(this,"boundTarget","texture_2d");g(this,"boundTextures",[]);g(this,"emptyTextures",{texture_2d:null,texture_cube_map:null})}install(e){super.install(e),e.texture=this}onUpdateContext(){super.onUpdateContext();const e=this.gl;this.maxUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(let s=0;s<this.maxUnits;s++)this.boundTextures[s]={texture_2d:null,texture_cube_map:null};const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4));const i=e.createTexture();e.bindTexture(e.TEXTURE_CUBE_MAP,i);for(let s=0;s<6;s++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR),this.emptyTextures={texture_2d:t,texture_cube_map:i};for(let s=this.boundTextures.length,n=0;n<s;n++)this.unbind(n)}create(e){const t=this.gl.createTexture();if(!t)throw new Error("Unable to create texture");return e&&(this.bind({location:e.location,target:e.target,value:t,forceUpdateLocation:!0}),this.update({filterMode:"linear",wrapMode:"repeat",...e})),t}getMeta(e){return this._renderer.getRelated(e,()=>({}))}update(...e){if(e.length>1){this.bind({location:e[1].location,target:e[1].target,value:e[0],forceUpdateLocation:!0}),this.update(e[1]);return}const t=e[0],{value:i,...s}=t,n=this.boundTextures[this.boundLocation][t.target??this.boundTarget];if(!n)return;const o=this.gl,a=this.getMeta(n),l=Ch(a,s);Object.assign(a,s);const h=this._renderer.getBindPoint(a.target??this.boundTarget);if(i!==void 0&&(i===null?o.texImage2D(h,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,null):"pixels"in i?o.texImage2D(h,0,o.RGBA,i.width,i.height,0,o.RGBA,o.UNSIGNED_BYTE,i.pixels):o.texImage2D(h,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,i)),l.wrapMode&&a.wrapMode){const u=this._renderer.getBindPoint(a.wrapMode);o.texParameteri(h,o.TEXTURE_WRAP_S,u),o.texParameteri(h,o.TEXTURE_WRAP_T,u)}const c=a.filterMode;if(l.filterMode&&c){const u=this._renderer.getBindPoint(c.split("_")[0]);c.includes("_")?o.texParameteri(h,o.TEXTURE_MIN_FILTER,this._renderer.getBindPoint(c)):o.texParameteri(h,o.TEXTURE_MIN_FILTER,u),o.texParameteri(h,o.TEXTURE_MAG_FILTER,u)}if(a.anisoLevel&&c==="linear"&&this._renderer.extensions.anisotropicFiltering&&l.anisoLevel){const{MAX_TEXTURE_MAX_ANISOTROPY_EXT:u,TEXTURE_MAX_ANISOTROPY_EXT:d}=this._renderer.extensions.anisotropicFiltering;o.texParameterf(h,d,Math.min(a.anisoLevel,o.getParameter(u)))}}bind(e){const t=this.gl;let i,s,n,o;if(e&&"value"in e?{target:s,value:i,location:n,forceUpdateLocation:o}=e:i=e,i){const I=this.getMeta(i);I.target=s??(s=I.target??"texture_2d"),I.location=n??(n=I.location??0)}else s??(s="texture_2d"),n??(n=0);let a=this.boundTextures[n];a||(this.boundTextures[n]=a={texture_2d:null,texture_cube_map:null});const l=a[s]??null,h=this.boundLocation,c=i!==l,u={location:n!==h&&(c||o),texture:c},d=this._renderer.getBindPoint(s);u.location&&(t.activeTexture(t.TEXTURE0+n),this.boundLocation=n),u.texture&&(t.bindTexture(d,i??this.emptyTextures[s]),a[s]=i),this.boundTarget=s}unbind(e,t="texture_2d"){const i=this._renderer.gl;if(typeof e=="number")this.bind({value:null,target:t,location:e});else{const s=this.getMeta(e),{target:n=this.boundTarget}=s,o=this._renderer.getBindPoint(n);for(let a=0;a<this.boundTextures.length;a++)this.boundTextures[a][n]===e&&(this.boundLocation!==a&&(i.activeTexture(i.TEXTURE0+a),this.boundLocation=a),i.bindTexture(o,this.emptyTextures[n]),this.boundTextures[a][n]=null)}}reset(){super.reset(),this.boundLocation=0,this.boundTarget="texture_2d",this.boundTextures=[],this.maxUnits=0}}class bo extends Ct{constructor(){super(...arguments);g(this,"boundVertexArrayNull",{attributes:{},elementArrayBuffer:null});g(this,"boundVertexArrayObject",null);g(this,"boundVertexArray",this.boundVertexArrayNull)}install(e){super.install(e),e.vertexArray=this}enableVertexAttrib(e,t,i,s=1){const{buffer:n,size:o=0,type:a="float",normalized:l=!1,stride:h=0,offset:c=0,divisor:u}=i,d=this._renderer.gl;this._renderer.buffer.bind({target:"array_buffer",value:n});for(let I=0;I<s;I++)d.enableVertexAttribArray(t+I),d.vertexAttribPointer(t+I,o,this._renderer.getBindPoint(a),l,h,c+(h-c)/s*I);u&&("vertexAttribDivisor"in d?d.vertexAttribDivisor(t,u):console.warn("Failed to active vertex array object, GPU Instancing is not supported on this device")),this.boundVertexArray.attributes[e]={enable:!0,...i}}create(...e){const t=this._renderer.gl;if(!("createVertexArray"in t))return null;const i=t.createVertexArray();if(!i)throw new Error("Unable to create vertex array");return e.length===2?this.update(e[0],i,e[1]):e.length===1&&this.update(i,e[0]),i}getVertexArrayMeta(e){return this._renderer.getRelated(e,()=>({attributes:{},elementArrayBuffer:null}))}update(...e){var n,o,a;if(e.length>2){this._renderer.program.bind(e[0]),this.update(e[1],e[2]);return}else if(e.length===2)if(e[0]){const l=e[0],h=e[1],c=this.getVertexArrayMeta(l);this.bind(l),this.update(h),c.attributes=this.boundVertexArray.attributes,c.elementArrayBuffer=this.boundVertexArray.elementArrayBuffer,this.unbind(),this._renderer.buffer.unbind("array_buffer");return}else return this.update(e[1]);const t=this._renderer.program.boundProgram;if(!t)return;const i=e[0];if(i.attributes){const l=this._renderer.program.getMeta(t),h={},c={};for(const d in i.attributes){const I=i.attributes[d],C=l.attributes.get(d);let B;"buffer"in I?B={...I}:B={buffer:I},B.size=B.size||(C==null?void 0:C.size)||0;const U=this._renderer.buffer.getMeta(B.buffer),M=Number(((n=C==null?void 0:C.type.match(/mat(\d)/))==null?void 0:n[1])??1);let D;switch(B.type){case"unsigned_byte":D=B.size;break;case"unsigned_short":D=B.size*2;break;case"float":default:D=B.size*4;break}D*=M,h[o=U.id]??(h[o]=0),h[U.id]+=D,c[d]={attrib:B,meta:U,info:C,byteLength:D,dimension:M}}const u={};for(const d in c){const{attrib:I,meta:C,info:B,byteLength:U,dimension:M}=c[d];(B==null?void 0:B.location)!==void 0&&(u[a=C.id]??(u[a]=0),I.offset??(I.offset=u[C.id]),I.stride??(I.stride=h[C.id]===U?0:h[C.id]),this.enableVertexAttrib(d,B.location,I,M),u[C.id]+=U)}}const s=i.elementArrayBuffer??null;this._renderer.buffer.bind({target:"element_array_buffer",value:s}),this.boundVertexArray.elementArrayBuffer=s}bind(e){const t=this._renderer.gl;if(e&&"attributes"in e)this.update(e);else if("bindVertexArray"in t){const i=this.boundVertexArrayObject;({value:e!==i}).value&&(t.bindVertexArray(e),this.boundVertexArrayObject=e,e?this.boundVertexArray={...this.getVertexArrayMeta(e)}:this.boundVertexArray=this.boundVertexArrayNull)}}unbind(){return this.bind(null)}reset(){super.reset(),this.boundVertexArrayNull={attributes:{},elementArrayBuffer:null},this.boundVertexArray=this.boundVertexArrayNull,this.boundVertexArrayObject=null}}class Do extends Ct{constructor(){super(...arguments);g(this,"boundViewport",{x:0,y:0,width:0,height:0})}install(e){super.install(e),e.viewport=this}bind(e){const t=this.boundViewport,i=Math.floor(e.x),s=Math.floor(e.y),n=Math.floor(e.width),o=Math.floor(e.height);t.x===i&&t.y===s&&t.width===n&&t.height===o||(this._renderer.gl.viewport(i,s,n,o),t.x=i,t.y=s,t.width=n,t.height=o)}reset(){super.reset(),this.boundViewport={x:0,y:0,width:0,height:0}}}class xo extends Io{constructor(e=Xn(),t){super();g(this,"_modules",[new vo,new Co,new Qo,new mo,new bo,new Do,new Eo,new yo,new wo,new _o,new po]);g(this,"bindPoints",new Map);if(!e)throw new Error("Failed to createHTMLCanvas");Wn(e)?this._setupContext(e,t):(this.gl=e,this.version=Vn(this.gl)?2:1),this._setupBindPoints()._setupExtensions()._setupPolyfill(),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this._modules.forEach(i=>i.install(this)),this._modules.forEach(i=>i.onUpdateContext())}_setupContext(e,t){this.view=e;let i=e.getContext("webgl2",t)||e.getContext("experimental-webgl2",t),s=2;if(i||(i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),s=1),!i)throw new Error("Unable to getContext");return this.gl=i,this.version=s,this._onContextLost=this._onContextLost.bind(this),this._onContextRestored=this._onContextRestored.bind(this),e.addEventListener("webglcontextlost",this._onContextLost,!1),e.addEventListener("webglcontextrestored",this._onContextRestored,!1),this}_setupExtensions(){const e=this.gl,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tcSRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};return this.version===1?(t.instancedArrays=e.getExtension("ANGLE_instanced_arrays"),t.drawBuffers=e.getExtension("WEBGL_draw_buffers"),t.depthTexture=e.getExtension("WEBGL_depth_texture"),t.vertexArrayObject=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),t.uint32ElementIndex=e.getExtension("OES_element_index_uint"),t.floatTexture=e.getExtension("OES_texture_float"),t.textureHalfFloat=e.getExtension("OES_texture_half_float"),t.textureHalfFloatLinear=e.getExtension("OES_texture_half_float_linear")):this.version===2&&(t.colorBufferFloat=e.getExtension("EXT_color_buffer_float")),this.extensions=t,this}_setupBindPoints(){for(const e in this.gl)if(e===e.toUpperCase()){const t=this.gl[e];typeof t=="number"&&this.bindPoints.set(t,e.toLowerCase())}return this}_setupPolyfill(){if(this.version===1){const{instancedArrays:e,vertexArrayObject:t,drawBuffers:i}=this.extensions,s=this.gl;t&&(s.createVertexArray=()=>t.createVertexArrayOES(),s.bindVertexArray=n=>t.bindVertexArrayOES(n),s.deleteVertexArray=n=>t.deleteVertexArrayOES(n)),e&&(s.vertexAttribDivisor=(n,o)=>e.vertexAttribDivisorANGLE(n,o),s.drawElementsInstanced=(n,o,a,l,h)=>e.drawElementsInstancedANGLE(n,o,a,l,h),s.drawArraysInstanced=(n,o,a,l)=>e.drawArraysInstancedANGLE(n,o,a,l)),i&&(s.drawBuffers=n=>i.drawBuffersWEBGL(n))}return this}_onContextLost(e){e.preventDefault(),setTimeout(()=>{var t;this.gl.isContextLost()&&((t=this.extensions.loseContext)==null||t.restoreContext())},0)}_onContextRestored(){}getBindPoint(e){return this.gl[e.toUpperCase()]}clear(e=this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT){this.gl.clear(e)}draw(e={}){const{mode:t="triangles",first:i=0,instanceCount:s}=e;let{count:n=0,bytesPerElement:o=0}=e;if(!n||!o){const l=this.vertexArray.boundVertexArray.elementArrayBuffer??Object.values(this.vertexArray.boundVertexArray.attributes)[0];if(l){const h=this.buffer.getMeta(l);n||(n=h.length),o||(o=h.bytesPerElement)}}const a=this.getBindPoint(t);if(o)if(o===2||o===4&&this.extensions.uint32ElementIndex){const l=o===2?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT;s&&"drawElementsInstanced"in this.gl?this.gl.drawElementsInstanced(a,n,l,i*o,s):this.gl.drawElements(a,n,l,i*o)}else console.warn("Unsupported index buffer type: uint32");else s&&"drawArraysInstanced"in this.gl?this.gl.drawArraysInstanced(a,i,n,s):this.gl.drawArrays(a,i,n)}reset(){this._modules.forEach(e=>e.reset())}flush(){this._modules.forEach(e=>e.flush())}destroy(){var e,t,i;this._modules.forEach(s=>s.destroy()),(e=this.view)==null||e.removeEventListener("webglcontextlost",this._onContextLost,!1),(t=this.view)==null||t.removeEventListener("webglcontextrestored",this._onContextRestored,!1),(i=this.extensions.loseContext)==null||i.loseContext()}toPixels(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,i=e*t*4,s=e*4,n=(t-1)*s,o=new Uint8Array(i),a=new Uint8ClampedArray(i);this.gl.readPixels(0,0,e,t,this.gl.RGBA,this.gl.UNSIGNED_BYTE,o);for(let l=0;l<i;l+=s)a.set(o.subarray(l,l+s),n-l);return a}}class tA{}class So extends tA{install(A){const e=async t=>{const{parseFont:i}=await Promise.resolve().then(()=>Yf);return await A.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s))};return this.load=t=>A.loadBy(t,()=>e(t)),["woff","ttf","otf"].forEach(t=>{A.register(t,e)}),A.font=this,this}}function Qh(r,A,e=2){const t=A&&A.length,i=t?A[0]*e:r.length;let s=Mo(r,0,i,e,!0);const n=[];if(!s||s.next===s.prev)return n;let o,a,l;if(t&&(s=vh(r,A,s,e)),r.length>80*e){o=1/0,a=1/0;let h=-1/0,c=-1/0;for(let u=e;u<i;u+=e){const d=r[u],I=r[u+1];d<o&&(o=d),I<a&&(a=I),d>h&&(h=d),I>c&&(c=I)}l=Math.max(h-o,c-a),l=l!==0?32767/l:0}return gi(s,n,e,o,a,l,0),n}function Mo(r,A,e,t,i){let s;if(i===Fh(r,A,e,t)>0)for(let n=A;n<e;n+=t)s=Po(n/t|0,r[n],r[n+1],s);else for(let n=e-t;n>=A;n-=t)s=Po(n/t|0,r[n],r[n+1],s);return s&&kA(s,s.next)&&(fi(s),s=s.next),s}function pA(r,A){if(!r)return r;A||(A=r);let e=r,t;do if(t=!1,!e.steiner&&(kA(e,e.next)||me(e.prev,e,e.next)===0)){if(fi(e),e=A=e.prev,e===e.next)break;t=!0}else e=e.next;while(t||e!==A);return A}function gi(r,A,e,t,i,s,n){if(!r)return;!n&&s&&Mh(r,t,i,s);let o=r;for(;r.prev!==r.next;){const a=r.prev,l=r.next;if(s?mh(r,t,i,s):yh(r)){A.push(a.i,r.i,l.i),fi(r),r=l.next,o=l.next;continue}if(r=l,r===o){n?n===1?(r=wh(pA(r),A),gi(r,A,e,t,i,s,2)):n===2&&_h(r,A,e,t,i,s):gi(pA(r),A,e,t,i,s,1);break}}}function yh(r){const A=r.prev,e=r,t=r.next;if(me(A,e,t)>=0)return!1;const i=A.x,s=e.x,n=t.x,o=A.y,a=e.y,l=t.y,h=Math.min(i,s,n),c=Math.min(o,a,l),u=Math.max(i,s,n),d=Math.max(o,a,l);let I=t.next;for(;I!==A;){if(I.x>=h&&I.x<=u&&I.y>=c&&I.y<=d&&ci(i,o,s,a,n,l,I.x,I.y)&&me(I.prev,I,I.next)>=0)return!1;I=I.next}return!0}function mh(r,A,e,t){const i=r.prev,s=r,n=r.next;if(me(i,s,n)>=0)return!1;const o=i.x,a=s.x,l=n.x,h=i.y,c=s.y,u=n.y,d=Math.min(o,a,l),I=Math.min(h,c,u),C=Math.max(o,a,l),B=Math.max(h,c,u),U=Es(d,I,A,e,t),M=Es(C,B,A,e,t);let D=r.prevZ,R=r.nextZ;for(;D&&D.z>=U&&R&&R.z<=M;){if(D.x>=d&&D.x<=C&&D.y>=I&&D.y<=B&&D!==i&&D!==n&&ci(o,h,a,c,l,u,D.x,D.y)&&me(D.prev,D,D.next)>=0||(D=D.prevZ,R.x>=d&&R.x<=C&&R.y>=I&&R.y<=B&&R!==i&&R!==n&&ci(o,h,a,c,l,u,R.x,R.y)&&me(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;D&&D.z>=U;){if(D.x>=d&&D.x<=C&&D.y>=I&&D.y<=B&&D!==i&&D!==n&&ci(o,h,a,c,l,u,D.x,D.y)&&me(D.prev,D,D.next)>=0)return!1;D=D.prevZ}for(;R&&R.z<=M;){if(R.x>=d&&R.x<=C&&R.y>=I&&R.y<=B&&R!==i&&R!==n&&ci(o,h,a,c,l,u,R.x,R.y)&&me(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function wh(r,A){let e=r;do{const t=e.prev,i=e.next.next;!kA(t,i)&&Uo(t,e,e.next,i)&&ui(t,i)&&ui(i,t)&&(A.push(t.i,e.i,i.i),fi(e),fi(e.next),e=r=i),e=e.next}while(e!==r);return pA(e)}function _h(r,A,e,t,i,s){let n=r;do{let o=n.next.next;for(;o!==n.prev;){if(n.i!==o.i&&kh(n,o)){let a=ko(n,o);n=pA(n,n.next),a=pA(a,a.next),gi(n,A,e,t,i,s,0),gi(a,A,e,t,i,s,0);return}o=o.next}n=n.next}while(n!==r)}function vh(r,A,e,t){const i=[];for(let s=0,n=A.length;s<n;s++){const o=A[s]*t,a=s<n-1?A[s+1]*t:r.length,l=Mo(r,o,a,t,!1);l===l.next&&(l.steiner=!0),i.push(Uh(l))}i.sort(bh);for(let s=0;s<i.length;s++)e=Dh(i[s],e);return e}function bh(r,A){let e=r.x-A.x;if(e===0&&(e=r.y-A.y,e===0)){const t=(r.next.y-r.y)/(r.next.x-r.x),i=(A.next.y-A.y)/(A.next.x-A.x);e=t-i}return e}function Dh(r,A){const e=xh(r,A);if(!e)return A;const t=ko(e,r);return pA(t,t.next),pA(e,e.next)}function xh(r,A){let e=A;const t=r.x,i=r.y;let s=-1/0,n;if(kA(r,e))return e;do{if(kA(r,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const c=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(c<=t&&c>s&&(s=c,n=e.x<e.next.x?e:e.next,c===t))return n}e=e.next}while(e!==A);if(!n)return null;const o=n,a=n.x,l=n.y;let h=1/0;e=n;do{if(t>=e.x&&e.x>=a&&t!==e.x&&Ro(i<l?t:s,i,a,l,i<l?s:t,i,e.x,e.y)){const c=Math.abs(i-e.y)/(t-e.x);ui(e,r)&&(c<h||c===h&&(e.x>n.x||e.x===n.x&&Sh(n,e)))&&(n=e,h=c)}e=e.next}while(e!==o);return n}function Sh(r,A){return me(r.prev,r,A.prev)<0&&me(A.next,r,r.next)<0}function Mh(r,A,e,t){let i=r;do i.z===0&&(i.z=Es(i.x,i.y,A,e,t)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,Rh(i)}function Rh(r){let A,e=1;do{let t=r,i;r=null;let s=null;for(A=0;t;){A++;let n=t,o=0;for(let l=0;l<e&&(o++,n=n.nextZ,!!n);l++);let a=e;for(;o>0||a>0&&n;)o!==0&&(a===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,o--):(i=n,n=n.nextZ,a--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,e*=2}while(A>1);return r}function Es(r,A,e,t,i){return r=(r-e)*i|0,A=(A-t)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,r|A<<1}function Uh(r){let A=r,e=r;do(A.x<e.x||A.x===e.x&&A.y<e.y)&&(e=A),A=A.next;while(A!==r);return e}function Ro(r,A,e,t,i,s,n,o){return(i-n)*(A-o)>=(r-n)*(s-o)&&(r-n)*(t-o)>=(e-n)*(A-o)&&(e-n)*(s-o)>=(i-n)*(t-o)}function ci(r,A,e,t,i,s,n,o){return!(r===n&&A===o)&&Ro(r,A,e,t,i,s,n,o)}function kh(r,A){return r.next.i!==A.i&&r.prev.i!==A.i&&!Ph(r,A)&&(ui(r,A)&&ui(A,r)&&Nh(r,A)&&(me(r.prev,r,A.prev)||me(r,A.prev,A))||kA(r,A)&&me(r.prev,r,r.next)>0&&me(A.prev,A,A.next)>0)}function me(r,A,e){return(A.y-r.y)*(e.x-A.x)-(A.x-r.x)*(e.y-A.y)}function kA(r,A){return r.x===A.x&&r.y===A.y}function Uo(r,A,e,t){const i=$i(me(r,A,e)),s=$i(me(r,A,t)),n=$i(me(e,t,r)),o=$i(me(e,t,A));return!!(i!==s&&n!==o||i===0&&Zi(r,e,A)||s===0&&Zi(r,t,A)||n===0&&Zi(e,r,t)||o===0&&Zi(e,A,t))}function Zi(r,A,e){return A.x<=Math.max(r.x,e.x)&&A.x>=Math.min(r.x,e.x)&&A.y<=Math.max(r.y,e.y)&&A.y>=Math.min(r.y,e.y)}function $i(r){return r>0?1:r<0?-1:0}function Ph(r,A){let e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==A.i&&e.next.i!==A.i&&Uo(e,e.next,r,A))return!0;e=e.next}while(e!==r);return!1}function ui(r,A){return me(r.prev,r,r.next)<0?me(r,A,r.next)>=0&&me(r,r.prev,A)>=0:me(r,A,r.prev)<0||me(r,r.next,A)<0}function Nh(r,A){let e=r,t=!1;const i=(r.x+A.x)/2,s=(r.y+A.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(t=!t),e=e.next;while(e!==r);return t}function ko(r,A){const e=ps(r.i,r.x,r.y),t=ps(A.i,A.x,A.y),i=r.next,s=A.prev;return r.next=A,A.prev=r,e.next=i,i.prev=e,t.next=e,e.prev=t,s.next=t,t.prev=s,t}function Po(r,A,e,t){const i=ps(r,A,e);return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function fi(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function ps(r,A,e){return{i:r,x:A,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Fh(r,A,e,t){let i=0;for(let s=A,n=e-t;s<e;s+=t)i+=(r[n]-r[s])*(r[s+1]+r[n+1]),n=s;return i}function Th(r,A,e,t={}){const{radius:i=1}=t;r.moveTo(A,e),r.arc(A,e,i,0,Math.PI*2)}const Lh={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function Cs(r,A){const{fill:e="#000",stroke:t="none",strokeWidth:i=t==="none"?0:1,strokeLinecap:s="round",strokeLinejoin:n="miter",strokeMiterlimit:o=0,strokeDasharray:a=[],strokeDashoffset:l=0,shadowOffsetX:h=0,shadowOffsetY:c=0,shadowBlur:u=0,shadowColor:d="rgba(0, 0, 0, 0)"}=A;r.fillStyle=e,r.strokeStyle=t,r.lineWidth=i,r.lineCap=s,r.lineJoin=Lh[n],r.miterLimit=o,r.setLineDash(a),r.lineDashOffset=l,r.shadowOffsetX=h,r.shadowOffsetY=c,r.shadowBlur=u,r.shadowColor=d}class G{constructor(A=0,e=0){this.x=A,this.y=e}static get MAX(){return new G(1/0,1/0)}static get MIN(){return new G(-1/0,-1/0)}get array(){return[this.x,this.y]}set(A,e){return this.x=A,this.y=e,this}add(A){return this.x+=A.x,this.y+=A.y,this}sub(A){return this.x-=A.x,this.y-=A.y,this}multiply(A){return this.x*=A.x,this.y*=A.y,this}divide(A){return this.x/=A.x,this.y/=A.y,this}dot(A){return this.x*A.x+this.y*A.y}cross(A){return this.x*A.y-this.y*A.x}rotate(A,e={x:0,y:0}){const t=-A/180*Math.PI,i=this.x-e.x,s=-(this.y-e.y),n=Math.sin(t),o=Math.cos(t);return this.set(e.x+(i*o-s*n),e.y-(i*n+s*o)),this}distanceTo(A){return Math.sqrt(this.distanceToSquared(A))}distanceToSquared(A){const e=this.x-A.x,t=this.y-A.y;return e*e+t*t}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(A,e=A,t={x:0,y:0}){const i=A<0?t.x-this.x+t.x:this.x,s=e<0?t.y-this.y+t.y:this.y;return this.x=i*Math.abs(A),this.y=s*Math.abs(e),this}skew(A,e=0,t={x:0,y:0}){const i=this.x-t.x,s=this.y-t.y;return this.x=t.x+(i+Math.tan(A)*s),this.y=t.y+(s+Math.tan(e)*i),this}min(...A){return this.x=Math.min(this.x,...A.map(e=>e.x)),this.y=Math.min(this.y,...A.map(e=>e.y)),this}max(...A){return this.x=Math.max(this.x,...A.map(e=>e.x)),this.y=Math.max(this.y,...A.map(e=>e.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(A,e){return this.x=A.x+e.x,this.y=A.y+e.y,this}subVectors(A,e){return this.x=A.x-e.x,this.y=A.y-e.y,this}multiplyVectors(A,e){return this.x=A.x*e.x,this.y=A.y*e.y,this}divideVectors(A,e){return this.x=A.x/e.x,this.y=A.y/e.y,this}lerpVectors(A,e,t){return this.x=A.x+(e.x-A.x)*t,this.y=A.y+(e.y-A.y)*t,this}equals(A){return this.x===A.x&&this.y===A.y}applyMatrix3(A){const e=this.x,t=this.y,i=A.elements;return this.x=i[0]*e+i[3]*t+i[6],this.y=i[1]*e+i[4]*t+i[7],this}copy(A){return this.x=A.x,this.y=A.y,this}clone(){return new G(this.x,this.y)}}class fe{constructor(A=0,e=0,t=0,i=0){this.left=A,this.top=e,this.width=t,this.height=i}get x(){return this.left}set x(A){this.left=A}get y(){return this.top}set y(A){this.top=A}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new G((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...A){if(A.length===0)return new fe;if(A.length===1)return A[0].clone();const e=A[0],t=A.slice(1).reduce((i,s)=>(i.left=Math.min(i.left,s.left),i.top=Math.min(i.top,s.top),i.right=Math.max(i.right,s.right),i.bottom=Math.max(i.bottom,s.bottom),i),{left:(e==null?void 0:e.left)??0,top:(e==null?void 0:e.top)??0,right:(e==null?void 0:e.right)??0,bottom:(e==null?void 0:e.bottom)??0});return new fe(t.left,t.top,t.right-t.left,t.bottom-t.top)}translate(A,e){return this.left+=A,this.top+=e,this}copy(A){return this.left=A.left,this.top=A.top,this.width=A.width,this.height=A.height,this}clone(){return new fe(this.left,this.top,this.width,this.height)}}class ct{constructor(A=1,e=0,t=0,i=0,s=1,n=0,o=0,a=0,l=1){g(this,"elements",[]);this.set(A,e,t,i,s,n,o,a,l)}set(A,e,t,i,s,n,o,a,l){const h=this.elements;return h[0]=A,h[1]=i,h[2]=o,h[3]=e,h[4]=s,h[5]=a,h[6]=t,h[7]=n,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(A){const e=this.elements,t=A.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this}multiply(A){return this.multiplyMatrices(this,A)}premultiply(A){return this.multiplyMatrices(A,this)}multiplyMatrices(A,e){const t=A.elements,i=e.elements,s=this.elements,n=t[0],o=t[3],a=t[6],l=t[1],h=t[4],c=t[7],u=t[2],d=t[5],I=t[8],C=i[0],B=i[3],U=i[6],M=i[1],D=i[4],R=i[7],b=i[2],Q=i[5],v=i[8];return s[0]=n*C+o*M+a*b,s[3]=n*B+o*D+a*Q,s[6]=n*U+o*R+a*v,s[1]=l*C+h*M+c*b,s[4]=l*B+h*D+c*Q,s[7]=l*U+h*R+c*v,s[2]=u*C+d*M+I*b,s[5]=u*B+d*D+I*Q,s[8]=u*U+d*R+I*v,this}invert(){const A=this.elements,e=A[0],t=A[1],i=A[2],s=A[3],n=A[4],o=A[5],a=A[6],l=A[7],h=A[8],c=h*n-o*l,u=o*a-h*s,d=l*s-n*a,I=e*c+t*u+i*d;if(I===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/I;return A[0]=c*C,A[1]=(i*l-h*t)*C,A[2]=(o*t-i*n)*C,A[3]=u*C,A[4]=(h*e-i*a)*C,A[5]=(i*s-o*e)*C,A[6]=d*C,A[7]=(t*a-l*e)*C,A[8]=(n*e-t*s)*C,this}transpose(){let A;const e=this.elements;return A=e[1],e[1]=e[3],e[3]=A,A=e[2],e[2]=e[6],e[6]=A,A=e[5],e[5]=e[7],e[7]=A,this}scale(A,e){return this.premultiply(Qs.makeScale(A,e)),this}rotate(A){return this.premultiply(Qs.makeRotation(-A)),this}translate(A,e){return this.premultiply(Qs.makeTranslation(A,e)),this}makeTranslation(A,e){return this.set(1,0,A,0,1,e,0,0,1),this}makeRotation(A){const e=Math.cos(A),t=Math.sin(A);return this.set(e,-t,0,t,e,0,0,0,1),this}makeScale(A,e){return this.set(A,0,0,0,e,0,0,0,1),this}fromArray(A,e=0){for(let t=0;t<9;t++)this.elements[t]=A[t+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const Qs=new ct;function No(r,A,e,t){const i=r*e+A*t,s=Math.sqrt(r*r+A*A)*Math.sqrt(e*e+t*t);let n=Math.acos(Math.max(-1,Math.min(1,i/s)));return r*t-A*e<0&&(n=-n),n}function Gh(r,A,e,t,i,s,n,o){if(A===0||e===0){r.lineTo(o.x,o.y);return}t=t*Math.PI/180,A=Math.abs(A),e=Math.abs(e);const a=(n.x-o.x)/2,l=(n.y-o.y)/2,h=Math.cos(t)*a+Math.sin(t)*l,c=-Math.sin(t)*a+Math.cos(t)*l;let u=A*A,d=e*e;const I=h*h,C=c*c,B=I/u+C/d;if(B>1){const Z=Math.sqrt(B);A=Z*A,e=Z*e,u=A*A,d=e*e}const U=u*C+d*I,M=(u*d-U)/U;let D=Math.sqrt(Math.max(0,M));i===s&&(D=-D);const R=D*A*c/e,b=-D*e*h/A,Q=Math.cos(t)*R-Math.sin(t)*b+(n.x+o.x)/2,v=Math.sin(t)*R+Math.cos(t)*b+(n.y+o.y)/2,x=No(1,0,(h-R)/A,(c-b)/e),k=No((h-R)/A,(c-b)/e,(-h-R)/A,(-c-b)/e)%(Math.PI*2);r.ellipse(Q,v,A,e,t,x,x+k,s===0)}const De={SEPARATOR:/[ \t\r\n,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function kt(r,A,e=0){let o=0,a=!0,l="",h="";const c=[];function u(B,U,M){const D=new SyntaxError(`Unexpected character "${B}" at index ${U}.`);throw D.partial=M,D}function d(){l!==""&&(h===""?c.push(Number(l)):c.push(Number(l)*10**Number(h))),l="",h=""}let I;const C=r.length;for(let B=0;B<C;B++){if(I=r[B],Array.isArray(A)&&A.includes(c.length%e)&&De.FLAGS.test(I)){o=1,l=I,d();continue}if(o===0){if(De.WHITESPACE.test(I))continue;if(De.DIGIT.test(I)||De.SIGN.test(I)){o=1,l=I;continue}if(De.POINT.test(I)){o=2,l=I;continue}De.COMMA.test(I)&&(a&&u(I,B,c),a=!0)}if(o===1){if(De.DIGIT.test(I)){l+=I;continue}if(De.POINT.test(I)){l+=I,o=2;continue}if(De.EXP.test(I)){o=3;continue}De.SIGN.test(I)&&l.length===1&&De.SIGN.test(l[0])&&u(I,B,c)}if(o===2){if(De.DIGIT.test(I)){l+=I;continue}if(De.EXP.test(I)){o=3;continue}De.POINT.test(I)&&l[l.length-1]==="."&&u(I,B,c)}if(o===3){if(De.DIGIT.test(I)){h+=I;continue}if(De.SIGN.test(I)){if(h===""){h+=I;continue}h.length===1&&De.SIGN.test(h)&&u(I,B,c)}}De.WHITESPACE.test(I)?(d(),o=0,a=!1):De.COMMA.test(I)?(d(),o=0,a=!0):De.SIGN.test(I)?(d(),o=1,l=I):De.POINT.test(I)?(d(),o=2,l=I):u(I,B,c)}return d(),c}function PA(r,A){return r-(A-r)}function Fo(r,A){const e=new G,t=new G;for(let i=0,s=r.length;i<s;i++){const n=r[i];if(n.type==="m"||n.type==="M")n.type==="m"?e.add(n):e.copy(n),A.moveTo(e.x,e.y),t.copy(e);else if(n.type==="h"||n.type==="H")n.type==="h"?e.x+=n.x:e.x=n.x,A.lineTo(e.x,e.y),t.copy(e);else if(n.type==="v"||n.type==="V")n.type==="v"?e.y+=n.y:e.y=n.y,A.lineTo(e.x,e.y),t.copy(e);else if(n.type==="l"||n.type==="L")n.type==="l"?e.add(n):e.copy(n),A.lineTo(e.x,e.y),t.copy(e);else if(n.type==="c"||n.type==="C")n.type==="c"?(A.bezierCurveTo(e.x+n.x1,e.y+n.y1,e.x+n.x2,e.y+n.y2,e.x+n.x,e.y+n.y),t.x=e.x+n.x2,t.y=e.y+n.y2,e.add(n)):(A.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y),t.x=n.x2,t.y=n.y2,e.copy(n));else if(n.type==="s"||n.type==="S")n.type==="s"?(A.bezierCurveTo(PA(e.x,t.x),PA(e.y,t.y),e.x+n.x2,e.y+n.y2,e.x+n.x,e.y+n.y),t.x=e.x+n.x2,t.y=e.y+n.y2,e.add(n)):(A.bezierCurveTo(PA(e.x,t.x),PA(e.y,t.y),n.x2,n.y2,n.x,n.y),t.x=n.x2,t.y=n.y2,e.copy(n));else if(n.type==="q"||n.type==="Q")n.type==="q"?(A.quadraticCurveTo(e.x+n.x1,e.y+n.y1,e.x+n.x,e.y+n.y),t.x=e.x+n.x1,t.y=e.y+n.y1,e.add(n)):(A.quadraticCurveTo(n.x1,n.y1,n.x,n.y),t.x=n.x1,t.y=n.y1,e.copy(n));else if(n.type==="t"||n.type==="T"){const o=PA(e.x,t.x),a=PA(e.y,t.y);t.x=o,t.y=a,n.type==="t"?(A.quadraticCurveTo(o,a,e.x+n.x,e.y+n.y),e.add(n)):(A.quadraticCurveTo(o,a,n.x,n.y),e.copy(n))}else if(n.type==="a"||n.type==="A"){const o=e.clone();if(n.type==="a"){if(n.x===0&&n.y===0)continue;e.add(n)}else{if(e.equals(n))continue;e.copy(n)}t.copy(e),Gh(A,n.rx,n.ry,n.angle,n.largeArcFlag,n.sweepFlag,o,e)}else n.type==="z"||n.type==="Z"?(A.startPoint&&e.copy(A.startPoint),A.closePath()):console.warn("Unsupported commands",n)}}function Oh(r){let A,e;const t=[];for(let i=0,s=r.length;i<s;i++){const n=r[i];switch(n.type){case"m":case"M":if(n.x.toFixed(4)===(e==null?void 0:e.x.toFixed(4))&&n.y.toFixed(4)===(e==null?void 0:e.y.toFixed(4)))continue;t.push(`${n.type} ${n.x} ${n.y}`),e={x:n.x,y:n.y},A={x:n.x,y:n.y};break;case"h":case"H":t.push(`${n.type} ${n.x}`),e={x:n.x,y:(e==null?void 0:e.y)??0};break;case"v":case"V":t.push(`${n.type} ${n.y}`),e={x:(e==null?void 0:e.x)??0,y:n.y};break;case"l":case"L":t.push(`${n.type} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"c":case"C":t.push(`${n.type} ${n.x1} ${n.y1} ${n.x2} ${n.y2} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"s":case"S":t.push(`${n.type} ${n.x2} ${n.y2} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"q":case"Q":t.push(`${n.type} ${n.x1} ${n.y1} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"t":case"T":t.push(`${n.type} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"a":case"A":t.push(`${n.type} ${n.rx} ${n.ry} ${n.angle} ${n.largeArcFlag} ${n.sweepFlag} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"z":case"Z":t.push(n.type),A&&(e={x:A.x,y:A.y});break}}return t.join(" ")}const Hh=/[a-df-z][^a-df-z]*/gi;function To(r){const A=[],e=r.match(Hh);if(!e)return A;for(let t=0,i=e.length;t<i;t++){const s=e[t],n=s.charAt(0),o=s.slice(1).trim();let a;switch(n){case"m":case"M":a=kt(o);for(let l=0,h=a.length;l<h;l+=2)l===0?A.push({type:n,x:a[l],y:a[l+1]}):A.push({type:n==="m"?"l":"L",x:a[l],y:a[l+1]});break;case"h":case"H":a=kt(o);for(let l=0,h=a.length;l<h;l++)A.push({type:n,x:a[l]});break;case"v":case"V":a=kt(o);for(let l=0,h=a.length;l<h;l++)A.push({type:n,y:a[l]});break;case"l":case"L":a=kt(o);for(let l=0,h=a.length;l<h;l+=2)A.push({type:n,x:a[l],y:a[l+1]});break;case"c":case"C":a=kt(o);for(let l=0,h=a.length;l<h;l+=6)A.push({type:n,x1:a[l],y1:a[l+1],x2:a[l+2],y2:a[l+3],x:a[l+4],y:a[l+5]});break;case"s":case"S":a=kt(o);for(let l=0,h=a.length;l<h;l+=4)A.push({type:n,x2:a[l],y2:a[l+1],x:a[l+2],y:a[l+3]});break;case"q":case"Q":a=kt(o);for(let l=0,h=a.length;l<h;l+=4)A.push({type:n,x1:a[l],y1:a[l+1],x:a[l+2],y:a[l+3]});break;case"t":case"T":a=kt(o);for(let l=0,h=a.length;l<h;l+=2)A.push({type:n,x:a[l],y:a[l+1]});break;case"a":case"A":a=kt(o,[3,4],7);for(let l=0,h=a.length;l<h;l+=7)A.push({type:n,rx:a[l],ry:a[l+1],angle:a[l+2],largeArcFlag:a[l+3],sweepFlag:a[l+4],x:a[l+5],y:a[l+6]});break;case"z":case"Z":A.push({type:n});break;default:console.warn(s)}}return A}function Lo(r,A,e,t,i){const s=(t-A)*.5,n=(i-e)*.5,o=r*r,a=r*o;return(2*e-2*t+s+n)*a+(-3*e+3*t-2*s-n)*o+s*r+e}function Jh(r,A){const e=1-r;return e*e*e*A}function Kh(r,A){const e=1-r;return 3*e*e*r*A}function Yh(r,A){return 3*(1-r)*r*r*A}function Wh(r,A){return r*r*r*A}function Go(r,A,e,t,i){return Jh(r,A)+Kh(r,e)+Yh(r,t)+Wh(r,i)}function Vh(r,A={}){let{vertices:e=[],indices:t=[],holes:i=[],verticesStride:s=2,verticesOffset:n=0,indicesOffset:o=0}=A;const a=Qh(r,i,2);if(a){for(let h=0;h<a.length;h+=3)t[o++]=a[h]+n,t[o++]=a[h+1]+n,t[o++]=a[h+2]+n;let l=n*s;for(let h=0;h<r.length;h+=2)e[l]=r[h],e[l+1]=r[h+1],l+=s}return{vertices:e,indices:t}}const Xh=8,er=11920929e-14,qh=1;function zh(r,A,e,t,i,s,n,o,a=.5,l){const c=Math.min(.99,Math.max(0,a));let u=(qh-c)/1;return u*=u,ys(r,A,e,t,i,s,n,o,l,u,0),l.push(n,o),l}function ys(r,A,e,t,i,s,n,o,a,l,h){if(h>Xh)return;const c=(r+e)/2,u=(A+t)/2,d=(e+i)/2,I=(t+s)/2,C=(i+n)/2,B=(s+o)/2,U=(c+d)/2,M=(u+I)/2,D=(d+C)/2,R=(I+B)/2,b=(U+D)/2,Q=(M+R)/2;if(h>0){let v=n-r,x=o-A;const k=Math.abs((e-n)*x-(t-o)*v),Z=Math.abs((i-n)*x-(s-o)*v);if(k>er&&Z>er){if((k+Z)*(k+Z)<=l*(v*v+x*x)){a.push(b,Q);return}}else if(k>er){if(k*k<=l*(v*v+x*x)){a.push(b,Q);return}}else if(Z>er){if(Z*Z<=l*(v*v+x*x)){a.push(b,Q);return}}else if(v=b-(r+n)/2,x=Q-(A+o)/2,v*v+x*x<=l){a.push(b,Q);return}}ys(r,A,c,u,U,M,b,Q,a,l,h+1),ys(b,Q,D,R,C,B,n,o,a,l,h+1)}const jh=8,Zh=11920929e-14,$h=1;function eg(r,A,e,t,i,s,n=.5,o){const l=Math.min(.99,Math.max(0,n));let h=($h-l)/1;return h*=h,ms(o,r,A,e,t,i,s,h,0),o.push(i,s),o}function ms(r,A,e,t,i,s,n,o,a){if(a>jh)return;const l=(A+t)/2,h=(e+i)/2,c=(t+s)/2,u=(i+n)/2,d=(l+c)/2,I=(h+u)/2;let C=s-A,B=n-e;const U=Math.abs((t-s)*B-(i-n)*C);if(U>Zh){if(U*U<=o*(C*C+B*B)){r.push(d,I);return}}else if(C=d-(A+s)/2,B=I-(e+n)/2,C*C+B*B<=o){r.push(d,I);return}ms(r,A,e,l,h,d,I,o,a+1),ms(r,d,I,c,u,s,n,o,a+1)}function tg(r,A){const e=1-r;return e*e*A}function Ag(r,A){return 2*(1-r)*r*A}function ig(r,A){return r*r*A}function Oo(r,A,e,t){return tg(r,A)+Ag(r,e)+ig(r,t)}const rg=1e-4,Ho=1e-4;function sg(r,A={}){const{vertices:e=[],indices:t=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:n=!0}=A,o=rg;if(r.length===0)return{vertices:e,indices:t};const a=i;let l=a.alignment;if(i.alignment!==.5){let z=ng(r);s&&(z*=-1),l=(l-.5)*z+.5}const h={x:r[0],y:r[1]},c={x:r[r.length-2],y:r[r.length-1]},u=n,d=Math.abs(h.x-c.x)<o&&Math.abs(h.y-c.y)<o;if(u){r=r.slice(),d&&(r.pop(),r.pop(),c.x=r[r.length-2],c.y=r[r.length-1]);const z=(h.x+c.x)*.5,X=(c.y+h.y)*.5;r.unshift(z,X),r.push(z,X)}const I=e,C=r.length/2;let B=r.length;const U=I.length/2,M=a.width/2,D=M*M,R=a.miterLimit*a.miterLimit;let b=r[0],Q=r[1],v=r[2],x=r[3],k=0,Z=0,Y=-(Q-x),L=b-v,te=0,N=0,$=Math.sqrt(Y*Y+L*L);Y/=$,L/=$,Y*=M,L*=M;const Ae=l,J=(1-Ae)*2,H=Ae*2;u||(a.cap==="round"?B+=CA(b-Y*(J-H)*.5,Q-L*(J-H)*.5,b-Y*J,Q-L*J,b+Y*H,Q+L*H,I,!0)+2:a.cap==="square"&&(B+=Jo(b,Q,Y,L,J,H,!0,I))),I.push(b-Y*J,Q-L*J),I.push(b+Y*H,Q+L*H);for(let z=1;z<C-1;++z){b=r[(z-1)*2],Q=r[(z-1)*2+1],v=r[z*2],x=r[z*2+1],k=r[(z+1)*2],Z=r[(z+1)*2+1],Y=-(Q-x),L=b-v,$=Math.sqrt(Y*Y+L*L),Y/=$,L/=$,Y*=M,L*=M,te=-(x-Z),N=v-k,$=Math.sqrt(te*te+N*N),te/=$,N/=$,te*=M,N*=M;const X=v-b,ge=Q-x,ie=v-k,le=Z-x,re=X*ie+ge*le,he=ge*ie-le*X,V=he<0;if(Math.abs(he)<.001*Math.abs(re)){I.push(v-Y*J,x-L*J),I.push(v+Y*H,x+L*H),re>=0&&(a.join==="round"?B+=CA(v,x,v-Y*J,x-L*J,v-te*J,x-N*J,I,!1)+4:B+=2,I.push(v-te*H,x-N*H),I.push(v+te*J,x+N*J));continue}const Ee=(-Y+b)*(-L+x)-(-Y+v)*(-L+Q),ht=(-te+k)*(-N+x)-(-te+v)*(-N+Z),gt=(X*ht-ie*Ee)/he,Ye=(le*Ee-ge*ht)/he,ce=(gt-v)*(gt-v)+(Ye-x)*(Ye-x),_e=v+(gt-v)*J,We=x+(Ye-x)*J,je=v-(gt-v)*H,Se=x-(Ye-x)*H,rt=Math.min(X*X+ge*ge,ie*ie+le*le),Ht=V?J:H,Hr=rt+Ht*Ht*D;ce<=Hr?a.join==="bevel"||ce/D>R?(V?(I.push(_e,We),I.push(v+Y*H,x+L*H),I.push(_e,We),I.push(v+te*H,x+N*H)):(I.push(v-Y*J,x-L*J),I.push(je,Se),I.push(v-te*J,x-N*J),I.push(je,Se)),B+=2):a.join==="round"?V?(I.push(_e,We),I.push(v+Y*H,x+L*H),B+=CA(v,x,v+Y*H,x+L*H,v+te*H,x+N*H,I,!0)+4,I.push(_e,We),I.push(v+te*H,x+N*H)):(I.push(v-Y*J,x-L*J),I.push(je,Se),B+=CA(v,x,v-Y*J,x-L*J,v-te*J,x-N*J,I,!1)+4,I.push(v-te*J,x-N*J),I.push(je,Se)):(I.push(_e,We),I.push(je,Se)):(I.push(v-Y*J,x-L*J),I.push(v+Y*H,x+L*H),a.join==="round"?V?B+=CA(v,x,v+Y*H,x+L*H,v+te*H,x+N*H,I,!0)+2:B+=CA(v,x,v-Y*J,x-L*J,v-te*J,x-N*J,I,!1)+2:a.join==="miter"&&ce/D<=R&&(V?(I.push(je,Se),I.push(je,Se)):(I.push(_e,We),I.push(_e,We)),B+=2),I.push(v-te*J,x-N*J),I.push(v+te*H,x+N*H),B+=2)}b=r[(C-2)*2],Q=r[(C-2)*2+1],v=r[(C-1)*2],x=r[(C-1)*2+1],Y=-(Q-x),L=b-v,$=Math.sqrt(Y*Y+L*L),Y/=$,L/=$,Y*=M,L*=M,I.push(v-Y*J,x-L*J),I.push(v+Y*H,x+L*H),u||(a.cap==="round"?B+=CA(v-Y*(J-H)*.5,x-L*(J-H)*.5,v-Y*J,x-L*J,v+Y*H,x+L*H,I,!1)+2:a.cap==="square"&&(B+=Jo(v,x,Y,L,J,H,!1,I)));const oe=Ho*Ho;for(let z=U;z<B+U-2;++z)b=I[z*2],Q=I[z*2+1],v=I[(z+1)*2],x=I[(z+1)*2+1],k=I[(z+2)*2],Z=I[(z+2)*2+1],!(Math.abs(b*(x-Z)+v*(Z-Q)+k*(Q-x))<oe)&&t.push(z,z+1,z+2);return{vertices:e,indices:t}}function ng(r){const A=r.length;if(A<6)return 1;let e=0;for(let t=0,i=r[A-2],s=r[A-1];t<A;t+=2){const n=r[t],o=r[t+1];e+=(n-i)*(o+s),i=n,s=o}return e<0?-1:1}function Jo(r,A,e,t,i,s,n,o){const a=r-e*i,l=A-t*i,h=r+e*s,c=A+t*s;let u,d;n?(u=t,d=-e):(u=-t,d=e);const I=a+u,C=l+d,B=h+u,U=c+d;return o.push(I,C),o.push(B,U),2}function CA(r,A,e,t,i,s,n,o){const a=e-r,l=t-A;let h=Math.atan2(a,l),c=Math.atan2(i-r,s-A);o&&h<c?h+=Math.PI*2:!o&&h>c&&(c+=Math.PI*2);let u=h;const d=c-h,I=Math.abs(d),C=Math.sqrt(a*a+l*l),B=(15*I*Math.sqrt(C)/Math.PI>>0)+1,U=d/B;if(u+=U,o){n.push(r,A),n.push(e,t);for(let M=1,D=u;M<B;M++,D+=U)n.push(r,A),n.push(r+Math.sin(D)*C,A+Math.cos(D)*C);n.push(r,A),n.push(i,s)}else{n.push(e,t),n.push(r,A);for(let M=1,D=u;M<B;M++,D+=U)n.push(r+Math.sin(D)*C,A+Math.cos(D)*C),n.push(r,A);n.push(i,s),n.push(r,A)}return B*2}class NA{constructor(){g(this,"arcLengthDivision",200);g(this,"_arcLengths")}getPointAt(A,e=new G){return this.getPoint(this.getUToTMapping(A),e)}isClockwise(){const A=this.getPoint(1),e=this.getPoint(.5),t=this.getPoint(1);return(e.x-A.x)*(t.y-e.y)-(e.y-A.y)*(t.x-e.x)<0}getControlPointRefs(){return[]}applyTransform(A){return this.getControlPointRefs().forEach(e=>{e.applyMatrix3(A)}),this}getUnevenPointArray(A=5,e=[]){const t=new G;for(let i=0,s=Math.max(1,A)-1;i<=s;i++)this.getPoint(i/s,t),e.push(t.x,t.y);return e}getSpacedPointArray(A=5,e=[]){const t=new G;for(let i=0,s=Math.max(1,A)-1;i<=s;i++)this.getPointAt(i/s,t),e.push(t.x,t.y);return e}getAdaptivePointArray(A=[]){return this.getUnevenPointArray(5,A)}_pointArrayToPoint(A,e=[]){for(let t=0,i=A.length;t<i;t+=2){const s=A[t],n=A[t+1];e.push(new G(s,n))}return e}getSpacedPoints(A,e=[]){const t=this.getSpacedPointArray(A);return this._pointArrayToPoint(t,e),e}getUnevenPoints(A,e=[]){const t=this.getUnevenPointArray(A);return this._pointArrayToPoint(t,e),e}getAdaptivePoints(A=[]){const e=this.getAdaptivePointArray();return this._pointArrayToPoint(e,A),A}getPoints(A,e=[]){let t;return A?t=this.getUnevenPointArray(A):t=this.getAdaptivePointArray(),this._pointArrayToPoint(t,e),e}getLength(){const A=this.getLengths();return A[A.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const A=this.arcLengthDivision,e=[0];for(let t=0,i=this.getPoint(0),s=1;s<=A;s++){const n=this.getPoint(s/A);t+=n.distanceTo(i),e.push(t),i=n}this._arcLengths=e}getUToTMapping(A,e){const t=this.getLengths(),i=t.length,s=e??A*t[i-1];if(i<2)return s/t[0];let n=0,o=0,a=i-1,l;for(;o<=a;)if(n=Math.floor(o+(a-o)/2),l=t[n]-s,l<0)o=n+1;else if(l>0)a=n-1;else{a=n;break}if(n=a,t[n]===s)return n/(i-1);const h=t[n],u=t[n+1]-h,d=(s-h)/u;return(n+d)/(i-1)}getTangent(A,e=new G){const i=Math.max(0,A-1e-4),s=Math.min(1,A+1e-4);return e.copy(this.getPoint(s).sub(this.getPoint(i)).normalize())}getTangentAt(A,e){return this.getTangent(this.getUToTMapping(A),e)}getNormal(A,e=new G){return this.getTangent(A,e),e.set(-e.y,e.x).normalize()}getNormalAt(A,e){return this.getNormal(this.getUToTMapping(A),e)}getTForPoint(A,e=.001){let t=0,i=1,s=(t+i)/2;for(;i-t>e;){s=(t+i)/2;const n=this.getPoint(s);if(n.distanceTo(A)<e)return s;n.x<A.x?t=s:i=s}return s}getMinMax(A=G.MAX,e=G.MIN){const t=this.getPoints();for(let i=0,s=t.length;i<s;i++){const n=t[i];A.min(n),e.max(n)}return{min:A,max:e}}getBoundingBox(){const{min:A,max:e}=this.getMinMax();return new fe(A.x,A.y,e.x-A.x,e.y-A.y)}fillTriangulate(A){return Vh(this.getAdaptivePointArray(),A)}strokeTriangulate(A){return sg(this.getAdaptivePointArray(),A)}toCommands(){const A=[],e=this.getPoints();for(let t=0,i=e.length;t<i;t++){const s=e[t];t===0?A.push({type:"M",x:s.x,y:s.y}):A.push({type:"L",x:s.x,y:s.y})}return A}toData(){return Oh(this.toCommands())}drawTo(A){return this.toCommands().forEach(e=>{switch(e.type){case"M":A.moveTo(e.x,e.y);break;case"L":A.lineTo(e.x,e.y);break}}),this}copy(A){return this.arcLengthDivision=A.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const og=new ct,Ko=new ct,Yo=new ct,tr=new G;class ws extends NA{constructor(A=new G,e=new G,t=new G,i=0,s=0,n=Math.PI*2,o=!1){super(),this._center=A,this._radius=e,this._diff=t,this.rotate=i,this.startAngle=s,this.endAngle=n,this.clockwise=o}get cx(){return this._center.x}set cx(A){this._center.x=A}get cy(){return this._center.y}set cy(A){this._center.y=A}get rx(){return this._radius.x}set rx(A){this._radius.x=A}get ry(){return this._radius.y}set ry(A){this._radius.y=A}get dx(){return this._diff.x}set dx(A){this._diff.x=A}get dy(){return this._diff.y}set dy(A){this._diff.y=A}isClockwise(){return this.clockwise}getPoint(A,e=new G){const t=Math.PI*2;let i=this.endAngle-this.startAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=t;for(;i>t;)i-=t;i<Number.EPSILON&&(s?i=0:i=t),this.clockwise&&!s&&(i===t?i=-t:i=i-t);const n=this.startAngle+A*i;let o=this.cx+this.rx*Math.cos(n),a=this.cy+this.ry*Math.sin(n);if(this.rotate!==0){const l=Math.cos(this.rotate),h=Math.sin(this.rotate),c=o-this.cx,u=a-this.cy;o=c*l-u*h+this.cx,a=c*h+u*l+this.cy}return e.set(o,a)}toCommands(){const{cx:A,cy:e,rx:t,ry:i,startAngle:s,endAngle:n,clockwise:o,rotate:a}=this,l=A+t*Math.cos(s)*Math.cos(a)-i*Math.sin(s)*Math.sin(a),h=e+t*Math.cos(s)*Math.sin(a)+i*Math.sin(s)*Math.cos(a),c=Math.abs(s-n),u=c>Math.PI?1:0,d=o?1:0,I=a*180/Math.PI;if(c>=2*Math.PI){const C=s+Math.PI,B=A+t*Math.cos(C)*Math.cos(a)-i*Math.sin(C)*Math.sin(a),U=e+t*Math.cos(C)*Math.sin(a)+i*Math.sin(C)*Math.cos(a);return[{type:"M",x:l,y:h},{type:"A",rx:t,ry:i,angle:I,largeArcFlag:0,sweepFlag:d,x:B,y:U},{type:"A",rx:t,ry:i,angle:I,largeArcFlag:0,sweepFlag:d,x:l,y:h}]}else{const C=A+t*Math.cos(n)*Math.cos(a)-i*Math.sin(n)*Math.sin(a),B=e+t*Math.cos(n)*Math.sin(a)+i*Math.sin(n)*Math.cos(a);return[{type:"M",x:l,y:h},{type:"A",rx:t,ry:i,angle:I,largeArcFlag:u,sweepFlag:d,x:C,y:B}]}}drawTo(A){const{cx:e,cy:t,rx:i,ry:s,rotate:n,startAngle:o,endAngle:a,clockwise:l}=this;return A.ellipse(e,t,i,s,n,o,a,!l),this}applyTransform(A){return tr.set(this.cx,this.cy),tr.applyMatrix3(A),this.cx=tr.x,this.cy=tr.y,hg(A)?ag(this,A):lg(this,A),this}getControlPointRefs(){return[this._center]}getAdaptivePointArray(A=[]){const{cx:e,cy:t,rx:i,ry:s,dx:n,dy:o}=this;if(!(i>=0&&s>=0&&n>=0&&o>=0))return A;const a=Math.ceil(2.3*Math.sqrt(i+s)),l=a*8+(n?4:0)+(o?4:0);if(l===0)return A;const h=[];if(a===0)h[0]=h[6]=e+n,h[1]=h[3]=t+o,h[2]=h[4]=e-n,h[5]=h[7]=t-o;else{let c=0,u=a*4+(n?2:0)+2,d=u,I=l,C=n+i,B=o,U=e+C,M=e-C,D=t+B;if(h[c++]=U,h[c++]=D,h[--u]=D,h[--u]=M,o){const b=t-B;h[d++]=M,h[d++]=b,h[--I]=b,h[--I]=U}for(let b=1;b<a;b++){const Q=Math.PI/2*(b/a),v=n+Math.cos(Q)*i,x=o+Math.sin(Q)*s,k=e+v,Z=e-v,Y=t+x,L=t-x;h[c++]=k,h[c++]=Y,h[--u]=Y,h[--u]=Z,h[d++]=Z,h[d++]=L,h[--I]=L,h[--I]=k}C=n,B=o+s,U=e+C,M=e-C,D=t+B;const R=t-B;h[c++]=U,h[c++]=D,h[--I]=R,h[--I]=U,n&&(h[c++]=M,h[c++]=D,h[--I]=R,h[--I]=M)}return Array.prototype.push.apply(A,h),A}fillTriangulate(A={}){let{vertices:e=[],indices:t=[],verticesStride:i=2,verticesOffset:s=0,indicesOffset:n=0}=A;const o=this.getAdaptivePointArray();if(o.length===0)return{vertices:e,indices:t};let a=0,l=0;for(let u=0;u<o.length;u+=2)a+=o[u],l+=o[u+1];a/=o.length/2,l/=o.length/2;let h=s;e[h*i]=a,e[h*i+1]=l;const c=h++;for(let u=0;u<o.length;u+=2)e[h*i]=o[u],e[h*i+1]=o[u+1],u>0&&(t[n++]=h,t[n++]=c,t[n++]=h-1),h++;return t[n++]=c+1,t[n++]=c,t[n++]=h-1,{vertices:e,indices:t}}getMinMax(A=G.MAX,e=G.MIN){const{cx:t,cy:i,rx:s,ry:n,rotate:o}=this,a=Math.cos(o),l=Math.sin(o),h=Math.sqrt(s*s*a*a+n*n*l*l),c=Math.sqrt(s*s*l*l+n*n*a*a);return A.x=Math.min(A.x,t-h),A.y=Math.min(A.y,i-c),e.x=Math.max(e.x,t+h),e.y=Math.max(e.y,i+c),{min:A,max:e}}copy(A){return super.copy(A),this.cx=A.cx,this.cy=A.cy,this.rx=A.rx,this.ry=A.ry,this.dx=A.dx,this.dy=A.dy,this.startAngle=A.startAngle,this.endAngle=A.endAngle,this.clockwise=A.clockwise,this.rotate=A.rotate,this}}function ag(r,A){const e=r.rx,t=r.ry,i=Math.cos(r.rotate),s=Math.sin(r.rotate),n=new G(e*i,e*s),o=new G(-t*s,t*i),a=n.applyMatrix3(A),l=o.applyMatrix3(A),h=og.set(a.x,l.x,0,a.y,l.y,0,0,0,1),c=Ko.copy(h).invert(),I=Yo.copy(c).transpose().multiply(c).elements,C=gg(I[0],I[1],I[4]),B=Math.sqrt(C.rt1),U=Math.sqrt(C.rt2);if(r.rx=1/B,r.ry=1/U,r.rotate=Math.atan2(C.sn,C.cs),!((r.endAngle-r.startAngle)%(2*Math.PI)<Number.EPSILON)){const D=Ko.set(B,0,0,0,U,0,0,0,1),R=Yo.set(C.cs,C.sn,0,-C.sn,C.cs,0,0,0,1),b=D.multiply(R).multiply(h),Q=v=>{const{x,y:k}=new G(Math.cos(v),Math.sin(v)).applyMatrix3(b);return Math.atan2(k,x)};r.startAngle=Q(r.startAngle),r.endAngle=Q(r.endAngle),Wo(A)&&(r.clockwise=!r.clockwise)}}function lg(r,A){const e=Vo(A),t=Xo(A);r.rx*=e,r.ry*=t;const i=e>Number.EPSILON?Math.atan2(A.elements[1],A.elements[0]):Math.atan2(-A.elements[3],A.elements[4]);r.rotate+=i,Wo(A)&&(r.startAngle*=-1,r.endAngle*=-1,r.clockwise=!r.clockwise)}function Wo(r){const A=r.elements;return A[0]*A[4]-A[1]*A[3]<0}function hg(r){const A=r.elements,e=A[0]*A[3]+A[1]*A[4];if(e===0)return!1;const t=Vo(r),i=Xo(r);return Math.abs(e/(t*i))>Number.EPSILON}function Vo(r){const A=r.elements;return Math.sqrt(A[0]*A[0]+A[1]*A[1])}function Xo(r){const A=r.elements;return Math.sqrt(A[3]*A[3]+A[4]*A[4])}function gg(r,A,e){let t,i,s,n,o;const a=r+e,l=r-e,h=Math.sqrt(l*l+4*A*A);return a>0?(t=.5*(a+h),o=1/t,i=r*o*e-A*o*A):a<0?i=.5*(a-h):(t=.5*h,i=-.5*h),l>0?s=l+h:s=l-h,Math.abs(s)>2*Math.abs(A)?(o=-2*A/s,n=1/Math.sqrt(1+o*o),s=o*n):Math.abs(A)===0?(s=1,n=0):(o=-.5*s/A,s=1/Math.sqrt(1+o*o),n=o*s),l>0&&(o=s,s=-n,n=o),{rt1:t,rt2:i,cs:s,sn:n}}class cg extends ws{constructor(A=0,e=0,t=1,i=0,s=Math.PI*2,n=!1){super(new G(A,e),new G(t,t),new G(0,0),0,i,s,n)}drawTo(A){const{cx:e,cy:t,rx:i,startAngle:s,endAngle:n,clockwise:o}=this;return A.arc(e,t,i,s,n,!o),this}getAdaptivePointArray(A=[]){const{cx:e,cy:t,rx:i,startAngle:s,endAngle:n,clockwise:o}=this;let a=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(a=2*Math.PI-a);let l=Math.max(6,Math.floor(6*i**(1/3)*(a/Math.PI)));l=Math.max(l,3);let h=a/l,c=s;h*=o?1:-1;for(let u=0;u<l+1;u++){const d=Math.cos(c),I=Math.sin(c),C=e+d*i,B=t+I*i;A.push(C,B),c+=h}return A}}class di extends NA{constructor(A=[]){super(),this.curves=A}getFlatCurves(){return this.curves.flatMap(A=>A instanceof di?A.getFlatCurves():A)}addCurve(A){return this.curves.push(A),this}getPoint(A,e=new G){const t=A*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=t){const n=i[s]-t,o=this.curves[s],a=o.getLength();return o.getPointAt(a===0?0:1-n/a,e)}s++}return e}updateLengths(){const A=[];for(let e=0,t=0,i=this.curves.length;e<i;e++)t+=this.curves[e].getLength(),A.push(t);this._arcLengths=A}getControlPointRefs(){return this.curves.flatMap(A=>A.getControlPointRefs())}getAdaptivePointArray(A=[]){let e;return this.curves.forEach(t=>{t.getAdaptivePointArray(A),e&&A[e-1]===A[e+1]&&A[e]===A[e+2]&&A.splice(e+1,2),e=A.length-1}),A}applyTransform(A){return this.curves.forEach(e=>e.applyTransform(A)),this}getMinMax(A=G.MAX,e=G.MIN){return this.curves.forEach(t=>t.getMinMax(A,e)),{min:A,max:e}}getBoundingBox(){const{min:A,max:e}=this.getMinMax();return new fe(A.x,A.y,e.x-A.x,e.y-A.y)}toCommands(){return this.curves.flatMap(A=>A.toCommands())}drawTo(A){var t;const e=(t=this.curves[0])==null?void 0:t.getPoint(0);return e&&A.moveTo(e.x,e.y),this.curves.forEach(i=>i.drawTo(A)),this}copy(A){return super.copy(A),this.curves=A.curves.map(e=>e.clone()),this}}class _s extends NA{constructor(A=new G,e=new G,t=new G,i=new G){super(),this.p1=A,this.cp1=e,this.cp2=t,this.p2=i}static from(A,e,t,i,s,n,o,a){return new _s(new G(A,e),new G(t,i),new G(s,n),new G(o,a))}getPoint(A,e=new G){const{p1:t,cp1:i,cp2:s,p2:n}=this;return e.set(Go(A,t.x,i.x,s.x,n.x),Go(A,t.y,i.y,s.y,n.y))}getAdaptivePointArray(A=[]){return zh(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,A)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(A,e,t){const i=e*e-4*A*t;if(i<0)return[];const s=Math.sqrt(i),n=(-e+s)/(2*A),o=(-e-s)/(2*A);return[n,o].filter(a=>a>=0&&a<=1)}getMinMax(A=G.MAX,e=G.MIN){const{p1:t,cp1:i,cp2:s,p2:n}=this,o=this._solveQuadratic(3*(i.x-t.x),6*(s.x-i.x),3*(n.x-s.x)),a=this._solveQuadratic(3*(i.y-t.y),6*(s.y-i.y),3*(n.y-s.y)),l=[0,1,...o,...a];return((c,u)=>{for(const d of c)for(let I=0;I<=u;I++){const C=I/u-.5,B=Math.min(1,Math.max(0,d+C)),U=this.getPoint(B);A.x=Math.min(A.x,U.x),A.y=Math.min(A.y,U.y),e.x=Math.max(e.x,U.x),e.y=Math.max(e.y,U.y)}})(l,10),{min:A,max:e}}toCommands(){const{p1:A,cp1:e,cp2:t,p2:i}=this;return[{type:"M",x:A.x,y:A.y},{type:"C",x1:e.x,y1:e.y,x2:t.x,y2:t.y,x:i.x,y:i.y}]}drawTo(A){const{p1:e,cp1:t,cp2:i,p2:s}=this;return A.lineTo(e.x,e.y),A.bezierCurveTo(t.x,t.y,i.x,i.y,s.x,s.y),this}copy(A){return super.copy(A),this.p1.copy(A.p1),this.cp1.copy(A.cp1),this.cp2.copy(A.cp2),this.p2.copy(A.p2),this}}class ug extends ws{constructor(A=0,e=0,t=1,i=1,s=0,n=0,o=Math.PI*2,a=!1){super(new G(A,e),new G(t,i),new G,s,n,o,a)}drawTo(A){return A.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class AA extends NA{constructor(A=new G,e=new G){super(),this.p1=A,this.p2=e}static from(A,e,t,i){return new AA(new G(A,e),new G(t,i))}getPoint(A,e=new G){return A===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(A).add(this.p1),e}getPointAt(A,e=new G){return this.getPoint(A,e)}getTangent(A,e=new G){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(A,e=new G){return this.getTangent(A,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptivePointArray(A=[]){return A.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),A}getMinMax(A=G.MAX,e=G.MIN){const{p1:t,p2:i}=this;return A.x=Math.min(A.x,t.x,i.x),A.y=Math.min(A.y,t.y,i.y),e.x=Math.max(e.x,t.x,i.x),e.y=Math.max(e.y,t.y,i.y),{min:A,max:e}}toCommands(){const{p1:A,p2:e}=this;return[{type:"M",x:A.x,y:A.y},{type:"L",x:e.x,y:e.y}]}drawTo(A){const{p1:e,p2:t}=this;return A.lineTo(e.x,e.y),A.lineTo(t.x,t.y),this}copy(A){return super.copy(A),this.p1.copy(A.p1),this.p2.copy(A.p2),this}}class fg extends di{}class vs extends NA{constructor(A=new G,e=new G,t=new G){super(),this.p1=A,this.cp=e,this.p2=t}static from(A,e,t,i,s,n){return new vs(new G(A,e),new G(t,i),new G(s,n))}getPoint(A,e=new G){const{p1:t,cp:i,p2:s}=this;return e.set(Oo(A,t.x,i.x,s.x),Oo(A,t.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptivePointArray(A=[]){return eg(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,A)}getMinMax(A=G.MAX,e=G.MIN){const{p1:t,cp:i,p2:s}=this,n=.5*(t.x+i.x),o=.5*(t.y+i.y),a=.5*(t.x+s.x),l=.5*(t.y+s.y);return A.x=Math.min(A.x,t.x,s.x,n,a),A.y=Math.min(A.y,t.y,s.y,o,l),e.x=Math.max(e.x,t.x,s.x,n,a),e.y=Math.max(e.y,t.y,s.y,o,l),{min:A,max:e}}toCommands(){const{p1:A,cp:e,p2:t}=this;return[{type:"M",x:A.x,y:A.y},{type:"Q",x1:e.x,y1:e.y,x:t.x,y:t.y}]}drawTo(A){const{p1:e,cp:t,p2:i}=this;return A.lineTo(e.x,e.y),A.quadraticCurveTo(t.x,t.y,i.x,i.y),this}copy(A){return super.copy(A),this.p1.copy(A.p1),this.cp.copy(A.cp),this.p2.copy(A.p2),this}}class dg extends fg{constructor(A=0,e=0,t=0,i=0){super(),this.x=A,this.y=e,this.width=t,this.height=i,this.update()}update(){const{x:A,y:e,width:t,height:i}=this,s=[new G(A,e),new G(A+t,e),new G(A+t,e+i),new G(A,e+i)];return this.curves=[new AA(s[0],s[1]),new AA(s[1],s[2]),new AA(s[2],s[3]),new AA(s[3],s[0])],this}drawTo(A){return A.rect(this.x,this.y,this.width,this.height),this}fillTriangulate(A={}){let{vertices:e=[],indices:t=[],verticesStride:i=2,verticesOffset:s=0,indicesOffset:n=0}=A;const{x:o,y:a,width:l,height:h}=this,c=[o,a,o+l,a,o+l,a+h,o,a+h];let u=0;s*=i,e[s+u]=c[0],e[s+u+1]=c[1],u+=i,e[s+u]=c[2],e[s+u+1]=c[3],u+=i,e[s+u]=c[6],e[s+u+1]=c[7],u+=i,e[s+u]=c[4],e[s+u+1]=c[5],u+=i;const d=s/i;return t[n++]=d,t[n++]=d+1,t[n++]=d+2,t[n++]=d+1,t[n++]=d+3,t[n++]=d+2,{vertices:e,indices:t}}copy(A){return super.copy(A),this.x=A.x,this.y=A.y,this.width=A.width,this.height=A.height,this.update(),this}}class Ig extends ws{constructor(A=0,e=0,t=1,i=1,s=1){super(),this.x=A,this.y=e,this.width=t,this.height=i,this.radius=s,this.update()}update(){const{x:A,y:e,width:t,height:i,radius:s}=this,n=t/2,o=i/2,a=A+n,l=e+o,h=Math.max(0,Math.min(s,Math.min(n,o))),c=h,u=n-h,d=o-c;return this._center=new G(a,l),this._radius=new G(h,c),this._diff=new G(u,d),this}drawTo(A){const{x:e,y:t,width:i,height:s,radius:n}=this;return A.roundRect(e,t,i,s,n),this}copy(A){return super.copy(A),this.x=A.x,this.y=A.y,this.width=A.width,this.height=A.height,this.radius=A.radius,this.update(),this}}class Bg extends NA{constructor(A=[]){super(),this.points=A}getPoint(A,e=new G){const{points:t}=this,i=(t.length-1)*A,s=Math.floor(i),n=i-s,o=t[s===0?s:s-1],a=t[s],l=t[s>t.length-2?t.length-1:s+1],h=t[s>t.length-3?t.length-1:s+2];return e.set(Lo(n,o.x,a.x,l.x,h.x),Lo(n,o.y,a.y,l.y,h.y)),e}getControlPointRefs(){return this.points}copy(A){super.copy(A),this.points=[];for(let e=0,t=A.points.length;e<t;e++)this.points.push(A.points[e].clone());return this}}class FA extends di{constructor(e){super();g(this,"startPoint");g(this,"currentPoint");g(this,"autoClose",!1);e&&this.addPoints(e)}addPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++){const{x:s,y:n}=e[t];this.lineTo(s,n)}return this}addCommands(e){return Fo(e,this),this}addData(e){return this.addCommands(To(e)),this}getUnevenPointArray(e=40,t=[]){return super.getUnevenPointArray(e,t),this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getSpacedPointArray(e=40,t=[]){return super.getSpacedPointArray(e,t),this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}_setCurrentPoint(e){return this.currentPoint=new G(e.x,e.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(e){if(this.curves.length>0){const t=e.getPoint(0);(!this.currentPoint||!t.equals(this.currentPoint))&&this.lineTo(t.x,t.y)}return this}closePath(){const e=this.startPoint;if(e){const t=this.currentPoint;t&&!e.equals(t)&&(this.curves.push(new AA(t,e)),t.copy(e)),this.startPoint=void 0}return this}moveTo(e,t){return this.currentPoint=new G(e,t),this.startPoint=this.currentPoint.clone(),this}lineTo(e,t){const i=this.currentPoint;return i!=null&&i.equals({x:e,y:t})||this.curves.push(AA.from((i==null?void 0:i.x)??0,(i==null?void 0:i.y)??0,e,t)),this._setCurrentPoint({x:e,y:t}),this}bezierCurveTo(e,t,i,s,n,o){const a=this.currentPoint;return a!=null&&a.equals({x:n,y:o})||this.curves.push(_s.from((a==null?void 0:a.x)??0,(a==null?void 0:a.y)??0,e,t,i,s,n,o)),this._setCurrentPoint({x:n,y:o}),this}quadraticCurveTo(e,t,i,s){const n=this.currentPoint;return n!=null&&n.equals({x:i,y:s})||this.curves.push(vs.from((n==null?void 0:n.x)??0,(n==null?void 0:n.y)??0,e,t,i,s)),this._setCurrentPoint({x:i,y:s}),this}arc(e,t,i,s,n,o){const a=new cg(e,t,i,s,n,!o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint(a.getPoint(1)),this}relativeArc(e,t,i,s,n,o){var a,l;return e+=((a=this.currentPoint)==null?void 0:a.x)??0,t+=((l=this.currentPoint)==null?void 0:l.y)??0,this.arc(e,t,i,s,n,o),this}arcTo(e,t,i,s,n){return console.warn("Method arcTo not supported yet"),this}ellipse(e,t,i,s,n,o,a,l=!0){const h=new ug(e,t,i,s,n,o,a,!l);return this._connetLineTo(h),this.curves.push(h),this._setCurrentPoint(h.getPoint(1)),this}relativeEllipse(e,t,i,s,n,o,a,l){var h,c;return e+=((h=this.currentPoint)==null?void 0:h.x)??0,t+=((c=this.currentPoint)==null?void 0:c.y)??0,this.ellipse(e,t,i,s,n,o,a,l),this}rect(e,t,i,s){const n=new dg(e,t,i,s);return this._connetLineTo(n),this.curves.push(n),this._setCurrentPoint({x:e,y:t}),this}roundRect(e,t,i,s,n){const o=new Ig(e,t,i,s,n);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:e,y:t}),this}splineThru(e){const t=this.currentPoint??new G;return this.curves.push(new Bg([t].concat(e))),this._setCurrentPoint(e[e.length-1]),this}drawTo(e){var i;const t=(i=this.curves[0])==null?void 0:i.getPoint(0);return t&&e.moveTo(t.x,t.y),this.curves.forEach(s=>s.drawTo(e)),this.autoClose&&e.closePath(),this}copy(e){var t;return super.copy(e),this.autoClose=e.autoClose,this.currentPoint=(t=e.currentPoint)==null?void 0:t.clone(),this}}function Eg(r){return r.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function pg(r,A,e,t){const i=A.clone().sub(r),s=t.clone().sub(e),n=e.clone().sub(r),o=i.cross(s);if(o===0)return new G((r.x+e.x)/2,(r.y+e.y)/2);const a=n.cross(s)/o;return Math.abs(a)>1?new G((r.x+e.x)/2,(r.y+e.y)/2):new G(r.x+a*i.x,r.y+a*i.y)}class Ve extends di{constructor(e,t={}){super();g(this,"currentCurve",new FA);g(this,"style");this.curves.push(this.currentCurve),this.style=t,e&&(e instanceof Ve?this.addPath(e):Array.isArray(e)?this.addCommands(e):this.addData(e))}get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}addPath(e){return e instanceof Ve?this.curves.push(...e.curves.map(t=>t.clone())):this.curves.push(e),this}closePath(){const e=this.startPoint;return e&&(this.currentCurve.closePath(),this.currentCurve.curves.length>0&&(this.currentCurve=new FA().moveTo(e.x,e.y),this.curves.push(this.currentCurve))),this}moveTo(e,t){var i;return(i=this.currentCurve.currentPoint)!=null&&i.equals({x:e,y:t})||(this.currentCurve.curves.length&&(this.currentCurve=new FA,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(e,t)),this}lineTo(e,t){return this.currentCurve.lineTo(e,t),this}bezierCurveTo(e,t,i,s,n,o){return this.currentCurve.bezierCurveTo(e,t,i,s,n,o),this}quadraticCurveTo(e,t,i,s){return this.currentCurve.quadraticCurveTo(e,t,i,s),this}arc(e,t,i,s,n,o){return this.currentCurve.arc(e,t,i,s,n,o),this}arcTo(e,t,i,s,n){return this.currentCurve.arcTo(e,t,i,s,n),this}ellipse(e,t,i,s,n,o,a,l){return this.currentCurve.ellipse(e,t,i,s,n,o,a,l),this}rect(e,t,i,s){return this.currentCurve.rect(e,t,i,s),this}roundRect(e,t,i,s,n){return this.currentCurve.roundRect(e,t,i,s,n),this}reset(){return this.currentCurve=new FA,this.curves.push(this.currentCurve),this.style={},this}addCommands(e){return Fo(e,this),this}addData(e){return this.addCommands(To(e)),this}splineThru(e){return this.currentCurve.splineThru(e),this}scale(e,t=e,i={x:0,y:0}){return this.getControlPointRefs().forEach(s=>{s.scale(e,t,i)}),this}skew(e,t=0,i={x:0,y:0}){return this.getControlPointRefs().forEach(s=>{s.skew(e,t,i)}),this}rotate(e,t={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.rotate(e,t)}),this}bold(e){if(e===0)return this;const t=this.getFlatCurves(),i=[],s=[],n=[];t.forEach((a,l)=>{const h=a.getControlPointRefs(),c=a.isClockwise();n[l]=h,s[l]=c;const u=h[0],d=h[h.length-1]??u;i.push({start:c?d:u,end:c?u:d,index:l})});const o=[];return i.forEach((a,l)=>{o[l]=[],i.forEach((h,c)=>{var u;h.start&&a.end&&c!==l&&((u=h.start)!=null&&u.equals(a.end))&&o[l].push(h.index)})}),t.forEach((a,l)=>{const h=s[l];n[l].forEach(c=>{c.add(a.getNormal(a.getTForPoint(c)).scale(h?e:-e))})}),o.forEach((a,l)=>{const h=n[l];a.forEach(c=>{const u=n[c],d=pg(h[h.length-1],h[h.length-2]??h[h.length-1],u[0],u[1]??u[0]);d&&(h[h.length-1].copy(d),u[0].copy(d))})}),this}getMinMax(e=G.MAX,t=G.MIN,i=!0){const s=this.strokeWidth;return this.curves.forEach(n=>{if(n.getMinMax(e,t),i&&s>1){const o=s/2,a=n.isClockwise(),l=[];for(let h=0;h<=1;h+=1/n.arcLengthDivision){const c=n.getPoint(h),u=n.getNormal(h),d=u.clone().scale(a?o:-o),I=u.clone().scale(a?-o:o);l.push(c.clone().add(d),c.clone().add(I),c.clone().add({x:o,y:0}),c.clone().add({x:-o,y:0}),c.clone().add({x:0,y:o}),c.clone().add({x:0,y:-o}),c.clone().add({x:o,y:o}),c.clone().add({x:-o,y:-o}))}e.min(...l),t.max(...l)}}),{min:e,max:t}}getBoundingBox(e=!0){const{min:t,max:i}=this.getMinMax(void 0,void 0,e);return new fe(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(e,t={}){t={...this.style,...t};const{fill:i="#000",stroke:s="none"}=t;return e.beginPath(),e.save(),Cs(e,t),this.curves.forEach(n=>{n.drawTo(e)}),i!=="none"&&e.fill(),s!=="none"&&e.stroke(),e.restore(),this}drawControlPointsTo(e,t={}){t={...this.style,...t};const{fill:i="#000",stroke:s="none"}=t;return e.beginPath(),e.save(),Cs(e,t),this.getControlPointRefs().forEach(n=>{Th(e,n.x,n.y,{radius:4})}),i!=="none"&&e.fill(),s!=="none"&&e.stroke(),e.restore(),this}toCommands(){return this.curves.flatMap(e=>e.toCommands())}toData(){return this.curves.filter(e=>e.curves.length).map(e=>e.toData()).join(" ")}toSVGPathString(){const e={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},t={};for(const s in e)e[s]!==void 0&&(t[Eg(s)]=e[s]);Object.assign(t,{"stroke-width":`${this.strokeWidth}px`});let i="";for(const s in t)t[s]!==void 0&&(i+=`${s}:${t[s]};`);return`<path d="${this.toData()}" style="${i}"></path>`}copy(e){return super.copy(e),this.currentCurve=e.currentCurve.clone(),this.style={...e.style},this}}class bs{constructor(A=[]){this.paths=A}getBoundingBox(A=!0){if(!this.paths.length)return;const e=G.MAX,t=G.MIN;return this.paths.forEach(i=>i.getMinMax(e,t,A)),new fe(e.x,e.y,t.x-e.x,t.y-e.y)}toSVGString(){const{x:A,y:e,width:t,height:i}=this.getBoundingBox(),s=this.paths.map(n=>n.toSVGPathString()).join("");return`<svg viewBox="${A} ${e} ${t} ${i}" width="${t}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${s}</svg>`}toSVGUrl(){return`data:image/svg+xml;base64,${btoa(this.toSVGString())}`}toSVG(){return new DOMParser().parseFromString(this.toSVGString(),"image/svg+xml").documentElement}toCanvas(A={}){const{pixelRatio:e=2,...t}=A,{left:i,top:s,width:n,height:o}=this.getBoundingBox(),a=document.createElement("canvas");a.width=n*e,a.height=o*e,a.style.width=`${n}px`,a.style.height=`${o}px`;const l=a.getContext("2d");return l&&(l.scale(e,e),l.translate(-i,-s),this.paths.forEach(h=>{h.drawTo(l,t)})),a}}const qo="data:image/svg+xml;",zo=`${qo}base64,`,jo=`${qo}charset=utf8,`;function Zo(r){if(typeof r=="string"){let A;r.startsWith(zo)?(r=r.substring(zo.length,r.length),A=atob(r)):r.startsWith(jo)?(r=r.substring(jo.length,r.length),A=decodeURIComponent(r)):A=r;const e=new DOMParser().parseFromString(A,"text/xml"),t=e.querySelector("parsererror");if(t)throw new Error(`${t.textContent??"parser error"}
61
+ ${A}`);return e.documentElement}else return r}const Cg="px",Qg=90,$o=["mm","cm","in","pt","pc","px"],ea={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function pe(r){let A="px";if(typeof r=="string"||r instanceof String)for(let t=0,i=$o.length;t<i;t++){const s=$o[t];if(r.endsWith(s)){A=s,r=r.substring(0,r.length-s.length);break}}let e;return e=ea[A][Cg],e<0&&(e=ea[A].in*Qg),e*Number.parseFloat(r)}const yg=new ct,Ar=new ct,ta=new ct,Aa=new ct;function mg(r,A,e){if(!(r.hasAttribute("transform")||r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))))return null;const t=wg(r);return e.length>0&&t.premultiply(e[e.length-1]),A.copy(t),e.push(t),t}function wg(r){const A=new ct,e=yg;if(r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))&&A.translate(pe(r.getAttribute("x")),pe(r.getAttribute("y"))),r.hasAttribute("transform")){const t=r.getAttribute("transform").split(")");for(let i=t.length-1;i>=0;i--){const s=t[i].trim();if(s==="")continue;const n=s.indexOf("("),o=s.length;if(n>0&&n<o){const a=s.slice(0,n),l=kt(s.slice(n+1));switch(e.identity(),a){case"translate":if(l.length>=1){const h=l[0];let c=0;l.length>=2&&(c=l[1]),e.translate(h,c)}break;case"rotate":if(l.length>=1){let h=0,c=0,u=0;h=l[0]*Math.PI/180,l.length>=3&&(c=l[1],u=l[2]),Ar.makeTranslation(-c,-u),ta.makeRotation(h),Aa.multiplyMatrices(ta,Ar),Ar.makeTranslation(c,u),e.multiplyMatrices(Ar,Aa)}break;case"scale":l.length>=1&&e.scale(l[0],l[1]??l[0]);break;case"skewX":l.length===1&&e.set(1,Math.tan(l[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":l.length===1&&e.set(1,0,0,Math.tan(l[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":l.length===6&&e.set(l[0],l[2],l[4],l[1],l[3],l[5],0,0,1);break}}A.premultiply(e)}}return A}function _g(r){return new Ve().arc(pe(r.getAttribute("cx")||0),pe(r.getAttribute("cy")||0),pe(r.getAttribute("r")||0),0,Math.PI*2)}function vg(r,A){if(!(!r.sheet||!r.sheet.cssRules||!r.sheet.cssRules.length))for(let e=0;e<r.sheet.cssRules.length;e++){const t=r.sheet.cssRules[e];if(t.type!==1)continue;const i=t.selectorText.split(/,/g).filter(Boolean).map(n=>n.trim()),s={};for(let n=t.style.length,o=0;o<n;o++){const a=t.style.item(o);s[a]=t.style.getPropertyValue(a)}for(let n=0;n<i.length;n++)A[i[n]]=Object.assign(A[i[n]]||{},{...s})}}function bg(r){return new Ve().ellipse(pe(r.getAttribute("cx")||0),pe(r.getAttribute("cy")||0),pe(r.getAttribute("rx")||0),pe(r.getAttribute("ry")||0),0,0,Math.PI*2)}function Dg(r){return new Ve().moveTo(pe(r.getAttribute("x1")||0),pe(r.getAttribute("y1")||0)).lineTo(pe(r.getAttribute("x2")||0),pe(r.getAttribute("y2")||0))}function xg(r){const A=new Ve,e=r.getAttribute("d");return!e||e==="none"?null:(A.addData(e),A)}const Sg=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Mg(r){var t;const A=new Ve;let e=0;return(t=r.getAttribute("points"))==null||t.replace(Sg,(i,s,n)=>{const o=pe(s),a=pe(n);return e===0?A.moveTo(o,a):A.lineTo(o,a),e++,i}),A.currentCurve.autoClose=!0,A}const Rg=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Ug(r){var t;const A=new Ve;let e=0;return(t=r.getAttribute("points"))==null||t.replace(Rg,(i,s,n)=>{const o=pe(s),a=pe(n);return e===0?A.moveTo(o,a):A.lineTo(o,a),e++,i}),A.currentCurve.autoClose=!1,A}function kg(r){const A=pe(r.getAttribute("x")||0),e=pe(r.getAttribute("y")||0),t=pe(r.getAttribute("rx")||r.getAttribute("ry")||0),i=pe(r.getAttribute("ry")||r.getAttribute("rx")||0),s=pe(r.getAttribute("width")),n=pe(r.getAttribute("height")),o=1-.551915024494,a=new Ve;return a.moveTo(A+t,e),a.lineTo(A+s-t,e),(t!==0||i!==0)&&a.bezierCurveTo(A+s-t*o,e,A+s,e+i*o,A+s,e+i),a.lineTo(A+s,e+n-i),(t!==0||i!==0)&&a.bezierCurveTo(A+s,e+n-i*o,A+s-t*o,e+n,A+s-t,e+n),a.lineTo(A+t,e+n),(t!==0||i!==0)&&a.bezierCurveTo(A+t*o,e+n,A,e+n-i*o,A,e+n-i),a.lineTo(A,e+i),(t!==0||i!==0)&&a.bezierCurveTo(A,e+i*o,A+t*o,e,A+t,e),a}function Pt(r,A,e){A=Object.assign({},A);let t={};if(r.hasAttribute("class")){const l=r.getAttribute("class").split(/\s/).filter(Boolean).map(h=>h.trim());for(let h=0;h<l.length;h++)t=Object.assign(t,e[`.${l[h]}`])}r.hasAttribute("id")&&(t=Object.assign(t,e[`#${r.getAttribute("id")}`]));for(let l=r.style.length,h=0;h<l;h++){const c=r.style.item(h),u=r.style.getPropertyValue(c);A[c]=u,t[c]=u}function i(l,h,c=s){r.hasAttribute(l)&&(A[h]=c(r.getAttribute(l))),t[l]&&(A[h]=c(t[l]))}function s(l){return l.startsWith("url")&&console.warn("url access in attributes is not implemented."),l}function n(l){return Math.max(0,Math.min(1,pe(l)))}function o(l){return Math.max(0,pe(l))}function a(l){return l.split(" ").filter(h=>h!=="").map(h=>pe(h))}return i("fill","fill"),i("fill-opacity","fillOpacity",n),i("fill-rule","fillRule"),i("opacity","opacity",n),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",n),i("stroke-width","strokeWidth",o),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",o),i("stroke-dasharray","strokeDasharray",a),i("stroke-dashoffset","strokeDashoffset",pe),i("visibility","visibility"),A}function Ds(r,A,e=[],t={}){var c;if(r.nodeType!==1)return e;let i=!1,s=null,n={...A};switch(r.nodeName){case"svg":n=Pt(r,n,t);break;case"style":vg(r,t);break;case"g":n=Pt(r,n,t);break;case"path":n=Pt(r,n,t),r.hasAttribute("d")&&(s=xg(r));break;case"rect":n=Pt(r,n,t),s=kg(r);break;case"polygon":n=Pt(r,n,t),s=Mg(r);break;case"polyline":n=Pt(r,n,t),s=Ug(r);break;case"circle":n=Pt(r,n,t),s=_g(r);break;case"ellipse":n=Pt(r,n,t),s=bg(r);break;case"line":n=Pt(r,n,t),s=Dg(r);break;case"defs":i=!0;break;case"use":{n=Pt(r,n,t);const d=(r.getAttributeNS("http://www.w3.org/1999/xlink","href")||r.getAttribute("href")||"").substring(1),I=(c=r.viewportElement)==null?void 0:c.getElementById(d);I?Ds(I,n,e,t):console.warn(`'use node' references non-existent node id: ${d}`);break}default:console.warn(r);break}if(n.display==="none")return e;Object.assign(A,n);const o=new ct,a=[],l=mg(r,o,a);s&&(s.applyTransform(o),e.push(s),s.style=A);const h=r.childNodes;for(let u=0,d=h.length;u<d;u++){const I=h[u];i&&I.nodeName!=="style"&&I.nodeName!=="defs"||Ds(I,A,e,t)}return l&&(a.pop(),a.length>0?o.copy(a[a.length-1]):o.identity()),e}function ia(r){return new bs(Ds(Zo(r),{}))}class ir extends St{constructor(e={}){super();g(this,"vertexAttributes");g(this,"indexBuffer");g(this,"instanceCount");g(this,"mode");g(this,"_materialWeakMap",new RA);this.vertexAttributes=new Map(Object.entries((e==null?void 0:e.vertexAttributes)??{})),this.indexBuffer=e==null?void 0:e.indexBuffer,this.instanceCount=e==null?void 0:e.instanceCount,this.mode=(e==null?void 0:e.mode)??"triangles"}_glVertexArray(e){var t;return{attributes:Object.fromEntries(Array.from(this.vertexAttributes).map(([i,s])=>[i,{buffer:s.buffer._glBuffer(e),size:s.size,type:s.type,normalized:s.normalized,stride:s.stride,offset:s.offset,divisor:s.divisor}])),elementArrayBuffer:(t=this.indexBuffer)==null?void 0:t._glBuffer(e)}}_glVertexArrayObject(e,t){let i=this._materialWeakMap.get(t);return i||(i={material:t.instanceId,geometry:this.instanceId},this._materialWeakMap.set(t,i)),e.getRelated(i,()=>e.vertexArray.create(t._glProgram(e),this._glVertexArray(e)))}draw(e,t,i){var a;e.flush(),t.activate(e,i);const s=this._glVertexArrayObject(e,t);let n=!1,o;this.vertexAttributes.forEach(l=>{(o==null?void 0:o.instanceId)!==l.buffer.instanceId&&(o=l.buffer,o.upload(e)&&(n=!0)),l.upload()&&(n=!0)}),(a=this.indexBuffer)!=null&&a.upload(e)&&(n=!0),n&&s&&e.vertexArray.update(t._glProgram(e),s,this._glVertexArray(e)),e.vertexArray.bind(s??this._glVertexArray(e)),e.draw({mode:this.mode,instanceCount:this.instanceCount}),e.vertexArray.unbind()}}var Pg=Object.defineProperty,ra=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Pg(A,e,i),i};class TA extends St{constructor(e){super();g(this,"needsUpload",!1);this.setProperties(e)}_glBufferOptions(){return{target:"element_array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(e){return e.getRelated(this,()=>e.buffer.create(this._glBufferOptions()))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"data":case"dynamic":this.needsUpload=!0;break}}upload(e){const t=this.needsUpload;return t&&(this.needsUpload=!1,e.buffer.update(this._glBuffer(e),this._glBufferOptions())),t}}ra([Me({default:null})],TA.prototype,"data"),ra([Me({default:!1})],TA.prototype,"dynamic");var Ng=Object.defineProperty,sa=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Ng(A,e,i),i};class Vt extends St{constructor(e){super();g(this,"needsUpload",!1);this.setProperties(e)}_glBufferOptions(){return{target:"array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(e){return e.getRelated(this,()=>e.buffer.create(this._glBufferOptions()))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"data":case"dynamic":this.needsUpload=!0;break}}upload(e){const t=this.needsUpload;return t&&(this.needsUpload=!1,e.buffer.update(this._glBuffer(e),this._glBufferOptions())),t}}sa([Me({default:null})],Vt.prototype,"data"),sa([Me({default:!1})],Vt.prototype,"dynamic");var Fg=Object.defineProperty,QA=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Fg(A,e,i),i};class ft extends St{constructor(e){super();g(this,"stride");g(this,"offset");g(this,"divisor");g(this,"needsUpload",!1);this.setProperties({buffer:new Vt,...e})}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"buffer":case"size":case"normalized":case"type":case"stride":case"offset":case"divisor":this.needsUpload=!0;break}}upload(){const e=this.needsUpload;return e&&(this.needsUpload=!1),e}}QA([Me()],ft.prototype,"buffer"),QA([Me({default:0})],ft.prototype,"size"),QA([Me({default:!1})],ft.prototype,"normalized"),QA([Me({default:"float"})],ft.prototype,"type"),QA([Me()],ft.prototype,"stride"),QA([Me()],ft.prototype,"offset"),QA([Me()],ft.prototype,"divisor");class Tg extends ir{constructor(){super({vertexAttributes:{position:new ft({buffer:new Vt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new TA({data:new Uint16Array([0,1,3,2]),dynamic:!1}),mode:"triangle_strip"})}}const Tr=class Tr extends St{constructor(e={}){super();g(this,"vert");g(this,"frag");g(this,"uniforms");this.vert=e.vert??`precision highp float;
62
62
  attribute vec2 position;
63
63
  uniform mat3 projectionMatrix;
64
64
  uniform mat3 modelViewMatrix;
@@ -69,13 +69,13 @@ void main(void) {
69
69
  gl_FragColor = tint;
70
70
  }`,this.uniforms=new Map(Object.entries(e.uniforms??{projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}))}_glProgram(e){return e.getRelated(this,()=>{let t=this.vert,i=this.frag;return i.includes("precision")||(i=`precision mediump float;
71
71
  ${i}`),t.includes("precision")||(t=`precision mediump float;
72
- ${t}`),e.program.create({vert:t,frag:i})})}activate(e,t){e.program.bind(this._glProgram(e)),(t||this.uniforms.size>0)&&e.program.updateUniforms({...Object.fromEntries(this.uniforms.entries()),...t})}};u(qi,"instance",new qi);let se=qi;const nc=/^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm,oc=/vec(\d)\((.*)\)/;function ac(n){n=n.trim();const r=n.match(oc);if(r){const e=Array.from({length:Number(r[1])},()=>0);return r[2].split(",").forEach((t,i)=>{e[i]=Number(t.trim())}),e}return Number(n)}const Kr=class Kr extends se{constructor(e){super();u(this,"vert",`attribute vec2 position;
72
+ ${t}`),e.program.create({vert:t,frag:i})})}activate(e,t){e.program.bind(this._glProgram(e)),(t||this.uniforms.size>0)&&e.program.updateUniforms({...Object.fromEntries(this.uniforms.entries()),...t})}};g(Tr,"instance",new Tr);let we=Tr;const Lg=/^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm,Gg=/vec(\d)\((.*)\)/;function Og(r){r=r.trim();const A=r.match(Gg);if(A){const e=Array.from({length:Number(A[1])},()=>0);return A[2].split(",").forEach((t,i)=>{e[i]=Number(t.trim())}),e}return Number(r)}const Gi=class Gi extends we{constructor(e){super();g(this,"vert",`attribute vec2 position;
73
73
  attribute vec2 uv;
74
74
  varying vec2 vUv;
75
75
  void main() {
76
76
  gl_Position = vec4(position, 0.0, 1.0);
77
77
  vUv = uv;
78
- }`);u(this,"uniforms",new Map([["ratio",0],["from",0],["to",1],["progress",0]]));u(this,"has",{getColor:!1,getFromColor:!1,getToColor:!1,transform:!1,transition:!1});const t=this.has;for(const s in Kr.RE)t[s]=Kr.RE[s].test(e);this.frag=`precision highp float;
78
+ }`);g(this,"uniforms",new Map([["ratio",0],["from",0],["to",1],["progress",0]]));g(this,"has",{getColor:!1,getFromColor:!1,getToColor:!1,transform:!1,transition:!1});const t=this.has;for(const s in Gi.RE)t[s]=Gi.RE[s].test(e);this.frag=`precision highp float;
79
79
  varying vec2 vUv;
80
80
  uniform float ratio;
81
81
  uniform float progress;
@@ -88,7 +88,7 @@ vec4 getFromColor(vec2 uv) { return texture2D(from, uv); }
88
88
  vec4 getToColor(vec2 uv) { return texture2D(to, uv); }`:""}
89
89
  ${e}${t.transform?`
90
90
  void main(void) { gl_FragColor = transform(vUv); }`:t.transition?`
91
- void main(void) { gl_FragColor = transition(vUv); }`:""}`;const i=e.matchAll(nc);for(const s of i)s[1]&&s[2]&&s[1].split(",").forEach(o=>{this.uniforms.set(o.trim(),ac(s[2]))})}};u(Kr,"RE",{getColor:/\sgetColor\s*\(/,getFromColor:/\sgetFromColor\s*\(/,getToColor:/\sgetToColor\s*\(/,transform:/\stransform\s*\(/,transition:/\stransition\s*\(/});let di=Kr;class ir extends se{static get instance(){return this._instance??(this._instance=new this)}constructor(){super({vert:`precision highp float;
91
+ void main(void) { gl_FragColor = transition(vUv); }`:""}`;const i=e.matchAll(Lg);for(const s of i)s[1]&&s[2]&&s[1].split(",").forEach(n=>{this.uniforms.set(n.trim(),Og(s[2]))})}};g(Gi,"RE",{getColor:/\sgetColor\s*\(/,getFromColor:/\sgetFromColor\s*\(/,getToColor:/\sgetToColor\s*\(/,transform:/\stransform\s*\(/,transition:/\stransition\s*\(/});let rr=Gi;class LA extends we{static get instance(){return this._instance??(this._instance=new this)}constructor(){super({vert:`precision highp float;
92
92
  attribute vec2 position;
93
93
  attribute vec2 uv;
94
94
  uniform mat3 projectionMatrix;
@@ -102,7 +102,7 @@ uniform sampler2D sampler;
102
102
  uniform vec4 tint;
103
103
  void main(void) {
104
104
  gl_FragColor = texture2D(sampler, vUv) * tint;
105
- }`,uniforms:{sampler:0,projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}})}}u(ir,"_instance");class J extends fi{static get instance(){return this._instance??(this._instance=new this)}static draw(r,e=ir.instance,t){this.instance.draw(r,e,t)}constructor(){super({vertexAttributes:{position:new je({buffer:new vt({data:new Float32Array([-1,-1,1,-1,1,1,-1,1]),dynamic:!1}),size:2,normalized:!1,type:"float"}),uv:new je({buffer:new vt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new rr({data:new Uint16Array([0,1,2,0,2,3]),dynamic:!1})})}}u(J,"_instance");class lc extends fi{constructor(){const e=new vt({data:new Float32Array,dynamic:!0}),t=new vt({data:new Float32Array,dynamic:!0});super({vertexAttributes:{position:new je({buffer:e,size:2,normalized:!1,type:"float"}),uv:new je({buffer:t,size:2,normalized:!1,type:"float"})},indexBuffer:new rr({data:new Uint16Array,dynamic:!0})});u(this,"positionBuffer");u(this,"uvBuffer");this.positionBuffer=e,this.uvBuffer=t}update(e,t,i){return this.positionBuffer.data=e,this.uvBuffer.data=t,this.indexBuffer.data=i,this}}function hc(){return{shadowColor:"transparent",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0}}function $o(){return{left:0,top:0,width:0,height:0,rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function cc(){return{overflow:"visible",visibility:"visible",filter:"none",opacity:1,marginLeft:0,marginTop:0,marginRight:0,marginBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,...$o(),backgroundImage:"none",backgroundColor:"transparent",...hc(),borderRadius:0,borderColor:"transparent",borderWidth:1}}function zo(){return{writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1.2,letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textIndent:0,textTransform:"none",textOrientation:"mixed",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"black",color:"black",listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function uc(){return{...cc(),...zo()}}var fc=Object.defineProperty,_e=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&fc(r,e,i),i};const Vo={brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0};class ne extends yt{constructor(e){super();u(this,"_backgroundColor",new Ct);this.setProperties(e)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"backgroundColor":this._backgroundColor.value=this.backgroundColor==="none"?void 0:this.backgroundColor;break}}canPointeEvents(){return this.pointerEvents!=="none"}getComputedOpacity(){return at(0,this.opacity,1)}getComputedBackgroundColor(){return this._backgroundColor}async loadBackgroundImage(){if(this.backgroundImage!=="none")return await Pt.texture.load(this.backgroundImage)}getComputedTransform(){const{scaleX:e,scaleY:t,left:i,top:s,width:o,height:a,rotate:l}=this,h=new et,c=new et(!1),f=new et(!1).scale(e,t).translate(i,s).rotate(l*qn);let p=this.transform;(!p||p==="none")&&(p=""),yr(p,{width:o,height:a}).forEach(({name:S,args:w})=>{const v=w.map(x=>x.normalizedIntValue);switch(h.identity(),S){case"translate":h.translate(v[0]*o,(v[1]??v[0])*this.height);break;case"translateX":h.translateX(v[0]*o);break;case"translateY":h.translateY(v[0]*a);break;case"translateZ":h.translateZ(v[0]);break;case"translate3d":h.translate3d(v[0]*o,(v[1]??v[0])*a,v[2]??v[1]??v[0]);break;case"scale":h.scale(v[0],v[1]??v[0]);break;case"scaleX":h.scaleX(v[0]);break;case"scaleY":h.scaleY(v[0]);break;case"scale3d":h.scale3d(v[0],v[1]??v[0],v[2]??v[1]??v[0]);break;case"rotate":h.rotate(v[0]*le);break;case"rotateX":h.rotateX(v[0]*le);break;case"rotateY":h.rotateY(v[0]*le);break;case"rotateZ":h.rotateZ(v[0]*le);break;case"rotate3d":h.rotate3d(v[0]*le,(v[1]??v[0])*le,(v[2]??v[1]??v[0])*le,(v[3]??v[2]??v[1]??v[0])*le);break;case"skew":h.skew(v[0],v[0]??v[1]);break;case"skewX":h.skewX(v[0]);break;case"skewY":h.skewY(v[0]);break;case"matrix":h.set(v);break}c.multiply(h)}),f.update(),c.update();const m=f.toArray(),g=c.toArray(),_=[g[0]*m[0]+g[3]*m[1],g[1]*m[0]+g[4]*m[1],g[2]*m[0]+g[5]*m[1]+m[2],g[0]*m[3]+g[3]*m[4],g[1]*m[3]+g[4]*m[4],g[2]*m[3]+g[5]*m[4]+m[5],0,0,1],[y,E]=this.getComputedTransformOrigin(),T=y*o,P=E*a;return _[2]+=_[0]*-T+_[1]*-P+T,_[5]+=_[3]*-T+_[4]*-P+P,new et().set(_)}getComputedTransformOrigin(){const[e,t=e]=this.transformOrigin.split(" ");return[e,t].map(i=>{switch(i=i.trim(),i){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(i)}})}getComputedFilter(){let e={};return this.filter==="none"||(e=yr(this.filter).reduce((t,{name:i,args:s})=>(t[i]=s[0].normalizedIntValue,t),e),Object.keys(Vo).forEach(t=>{e[t]=e[t]??Vo[t]})),e}getComputedFilterColorMatrix(){const e=new us,t=this.getComputedFilter();for(const i in t){const s=t[i];switch(i){case"hue-rotate":e.hueRotate(s*le);break;case"saturate":e.saturate(s);break;case"brightness":e.brightness(s);break;case"contrast":e.contrast(s);break;case"invert":e.invert(s);break;case"sepia":e.sepia(s);break;case"opacity":e.opacity(s);break;case"grayscale":e.grayscale(s);break}}return e}}_e([M({default:"none"})],ne.prototype,"backgroundColor"),_e([M({default:"none"})],ne.prototype,"backgroundImage"),_e([M({default:"none"})],ne.prototype,"filter"),_e([M({default:"inherit"})],ne.prototype,"direction"),_e([M({default:"none"})],ne.prototype,"boxShadow"),_e([M({default:"none"})],ne.prototype,"maskImage"),_e([M({default:1})],ne.prototype,"opacity"),_e([M({default:0})],ne.prototype,"borderWidth"),_e([M({default:0})],ne.prototype,"borderRadius"),_e([M({default:"#000000"})],ne.prototype,"borderColor"),_e([M({default:"none"})],ne.prototype,"borderStyle"),_e([M({default:0})],ne.prototype,"outlineWidth"),_e([M({default:0})],ne.prototype,"outlineOffset"),_e([M({default:"#000000"})],ne.prototype,"outlineColor"),_e([M({default:"none"})],ne.prototype,"outlineStyle"),_e([M({default:"visible"})],ne.prototype,"visibility"),_e([M({default:"visible"})],ne.prototype,"overflow"),_e([M({default:"auto"})],ne.prototype,"pointerEvents");const jo=$o();for(const n in jo)vr(ne,n,{default:jo[n]});const Go=zo();for(const n in Go)vr(ne,n,{default:Go[n]});var dc=Object.defineProperty,sr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&dc(r,e,i),i};class ge extends yt{constructor(e){super();u(this,"_isPowerOfTwo",!1);u(this,"_needsUpload",!1);this.source=e,this._updateSize()}static get EMPTY(){return new this({width:1,height:1,pixels:null})}static get WHITE(){return new this({width:1,height:1,pixels:new Uint8Array([255,255,255,255])})}static get BLACK(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,0,255])})}static get RED(){return new this({width:1,height:1,pixels:new Uint8Array([255,0,0,255])})}static get GREEN(){return new this({width:1,height:1,pixels:new Uint8Array([0,255,0,255])})}static get BLUE(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,255,255])})}get valid(){return!!(this.width&&this.height)}get realWidth(){return Math.round(this.width*this.pixelRatio)}get realHeight(){return Math.round(this.height*this.pixelRatio)}_glTextureOptions(e,t){let i=this.wrapMode;return e.version===1&&!this._isPowerOfTwo&&(i="clamp_to_edge"),{value:this.source,target:"texture_2d",location:0,filterMode:this.filterMode,wrapMode:i,...t}}_glTexture(e,t){return e.getRelated(this,()=>e.texture.create(this._glTextureOptions(e,t)))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"width":case"height":this._updatePOT();break;case"source":this._updateSize();break;case"filterMode":case"wrapMode":case"pixelRatio":this.requestUpload();break}}_updatePOT(){this._isPowerOfTwo=Zi(this.realWidth)&&Zi(this.realHeight),this.requestUpload()}_updateSize(){const e=this.source;"pixels"in e?(this.width=e.width/this.pixelRatio,this.height=e.height/this.pixelRatio):(this.width=Number(e.naturalWidth||e.videoWidth||e.width||0)/this.pixelRatio,this.height=Number(e.naturalHeight||e.videoHeight||e.height||0)/this.pixelRatio),this.requestUpload()}requestUpload(){this._needsUpload=!0}upload(e,t){return this._needsUpload&&this.valid?(this._needsUpload=!1,e.texture.update(this._glTexture(e,t),this._glTextureOptions(e,t)),!0):!1}activate(e,t=0){return this.valid?(e.texture.bind({target:"texture_2d",value:this._glTexture(e,{location:t}),location:t}),this.upload(e,{location:t}),!0):!1}inactivate(e){e.texture.unbind(this._glTexture(e))}destroy(){_n&&this.source instanceof ImageBitmap&&this.source.close()}}sr([ue()],ge.prototype,"source"),sr([M({default:0})],ge.prototype,"width"),sr([M({default:0})],ge.prototype,"height"),sr([M({default:"linear"})],ge.prototype,"filterMode"),sr([M({default:"clamp_to_edge"})],ge.prototype,"wrapMode"),sr([M({default:1})],ge.prototype,"pixelRatio");var pc=Object.defineProperty,gc=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&pc(r,e,i),i};class Er extends ge{constructor(r=document.createElement("canvas")){super(r)}_updateProperty(r,e,t,i){switch(r){case"width":this.source.width=Math.max(1,Math.ceil(e*this.pixelRatio));break;case"height":this.source.height=Math.max(1,Math.ceil(e*this.pixelRatio));break}super._updateProperty(r,e,t,i)}}gc([M({default:2})],Er.prototype,"pixelRatio");class Ss extends ge{constructor(r){const e=new Ct(r);super({width:1,height:1,pixels:new Uint8Array([e.r8,e.g8,e.b8,e.a8])})}}function mc(n){return{autoLoad:!!((n==null?void 0:n.autoLoad)??!0),useBitmap:!!((n==null?void 0:n.useBitmap)??!0)&&Ji,crossorigin:(n==null?void 0:n.crossorigin)??null}}class yc extends ge{constructor(e,t){const i=mc(t);super(e);u(this,"bitmap");u(this,"useBitmap");u(this,"preserveBitmap",!1);u(this,"_loadSource");u(this,"_loadBitmap");const s=e.src,o=s.includes(".svg")||s.startsWith("data:image/svg+xml");this.useBitmap=i.useBitmap&&!o,i.autoLoad&&this.load()}async load(){return this._loadSource||(this._loadSource=new Promise(e=>{this._loadSource=void 0;const t=this.source,i=()=>{t.onload=null,t.onerror=null},s=()=>{i(),this.requestUpload(),this.useBitmap?this.genBitmap().finally(()=>e(this)):e(this)},o=a=>{i(),console.warn(`Failed to load ImageTexture, src: ${t.src}`,a),this.emit("error",a),e(this)};t.complete&&t.src?s():(t.onload=s,t.onerror=o)})),this._loadSource}genBitmap(){if(this._loadBitmap)return this._loadBitmap;if(this.bitmap||!Ji)return Promise.resolve(this);const e=this.source,t=!e.crossOrigin||e.crossOrigin==="anonymous";return this._loadBitmap=fetch(e.src,{mode:t?"cors":"no-cors"}).then(i=>i.blob()).then(i=>createImageBitmap(i,0,0,e.width,e.height,{premultiplyAlpha:"premultiply"})).then(i=>(this.bitmap=i,this.requestUpload(),this._loadBitmap=void 0,this)).catch(i=>(console.warn("Failed to genBitmap",i),this)),this._loadBitmap}_glTextureOptions(e){return{...super._glTextureOptions(e),value:this.bitmap??this.source}}upload(e){if(this.useBitmap){if(!this.bitmap)return this.genBitmap(),!1}else{const i=this.source;if(_r&&i instanceof HTMLImageElement&&(!i.complete||i.naturalWidth===0))return!1}const t=super.upload(e);return this.preserveBitmap&&this.bitmap&&(this.bitmap.close(),this.bitmap=void 0),t}}class Es extends ge{constructor(r,e=1,t=1){const i={width:e,height:t,pixels:null};r&&(ArrayBuffer.isView(r)?i.pixels=new Uint8Array(r.buffer):i.pixels=new Uint8Array(r)),super(i)}_updateProperty(r,e,t,i){switch(r){case"width":this.source.width=Math.round(e*this.pixelRatio);break;case"height":this.source.height=Math.round(e*this.pixelRatio);break}super._updateProperty(r,e,t,i)}}var _c=Object.defineProperty,qo=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&_c(r,e,i),i};function vc(n){return{autoLoad:!!((n==null?void 0:n.autoLoad)??!0),autoPlay:!!((n==null?void 0:n.autoPlay)??!1),fps:Number((n==null?void 0:n.fps)??0),crossorigin:(n==null?void 0:n.crossorigin)??null,loop:!!((n==null?void 0:n.loop)??!1),muted:!!((n==null?void 0:n.muted)??!1),playsinline:!!((n==null?void 0:n.playsinline)??!0)}}const Ms=(Xt=class extends ge{constructor(e,t){const i=vc(t);if(!Cn(e)){typeof e=="string"&&(e=[e]);const s=e[0].src||e[0],o=document.createElement("video");i.autoLoad&&o.setAttribute("preload","auto"),i.playsinline&&(o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline","")),i.muted&&(o.setAttribute("muted",""),o.muted=!0),i.loop&&o.setAttribute("loop",""),i.autoPlay&&o.setAttribute("autoplay",""),An(o,s,i.crossorigin);for(let a=0;a<e.length;++a){let{src:l,mime:h}=e[a];if(l=l||e[a],l.startsWith("data:"))h=l.slice(5,l.indexOf(";"));else if(!l.startsWith("blob:")){const f=l.split("?").shift().toLowerCase(),p=f.slice(f.lastIndexOf(".")+1);h=h||Xt.mimeTypes.get(p)||`video/${p}`}const c=document.createElement("source");c.src=l,h&&(c.type=h),o.appendChild(c)}e=o}super(e);u(this,"_spf",0);u(this,"_autoPlay",!1);u(this,"_sourceLoad");u(this,"_nextTime",0);u(this,"_connected",!1);u(this,"_requestId");u(this,"_resolve");u(this,"_reject");u(this,"_onPlayStart",()=>{this.valid||this._onCanPlay(),this._setupAutoUpdate()});u(this,"_onPlayStop",()=>{this._setupAutoUpdate()});u(this,"_onCanPlay",()=>{const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._nextTime=0,this._updateSize(),this.requestUpload(),this._nextTime=0,!t&&this._resolve&&(this._resolve(this),this._sourceLoad=void 0,this._resolve=void 0,this._reject=void 0),this.isPlaying?this._onPlayStart():this._autoPlay&&e.play()});u(this,"_onError",e=>{this.source.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=void 0,this._resolve=void 0)});u(this,"_onSeeked",()=>{this.autoUpdate&&!this.isPlaying&&(this._nextTime=0,this.requestUpload(),this._nextTime=0)});u(this,"_videoFrameRequestCallback",()=>{this.requestUpload(),this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)});u(this,"requestUpload",()=>{const e=Math.floor(fe.elapsed*this.source.playbackRate);this._nextTime-=e,(!this._spf||this._nextTime<=0)&&(super.requestUpload(),this._nextTime=this._spf||0)});this.fps=i.fps,this._autoPlay=i.autoPlay,i.autoPlay&&this.load(),this._setupAutoUpdate()}get isReady(){return this.source.readyState>2}get isPlaying(){return!this.source.paused&&!this.source.ended&&this.isReady}get duration(){return this.source.duration}get seeking(){return this.source.seeking}get currentTime(){return this.source.currentTime}set currentTime(e){this.source.currentTime=e}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"fps":this._spf=t?Math.floor(1e3/t):0,this._setupAutoUpdate();break;case"autoUpdate":this._setupAutoUpdate();break}}_setupAutoUpdate(){this.autoUpdate&&this.isPlaying?!this.fps&&this.source.requestVideoFrameCallback?(this._connected&&(fe.off(this.requestUpload),this._connected=!1,this._nextTime=0),this._requestId===void 0&&(this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected||(fe.on(this.requestUpload),this._connected=!0,this._nextTime=0)):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected&&(fe.off(this.requestUpload),this._connected=!1,this._nextTime=0))}async load(){if(!this._sourceLoad){const e=this.source;(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this.isReady?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._sourceLoad=new Promise((t,i)=>{this.valid?(this._sourceLoad=void 0,t(this)):(this._resolve=t,this._reject=i,e.load())})}return this._sourceLoad}destroy(){this._setupAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load())}},u(Xt,"mimeTypes",new Map(Object.entries({ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"}))),Xt);qo([ue({default:!0})],Ms.prototype,"autoUpdate"),qo([ue({default:0})],Ms.prototype,"fps");let Wo=Ms;class As extends Es{}class Xo extends Pe{constructor(){super(...arguments);u(this,"textureTransform");u(this,"fillStyle");u(this,"strokeStyle");u(this,"lineCap");u(this,"lineJoin");u(this,"lineWidth");u(this,"miterLimit");u(this,"_defaultStyle",ge.EMPTY);u(this,"_stroke",[]);u(this,"_fille",[])}stroke(){let e=this._defaultStyle;this.strokeStyle&&(this.strokeStyle instanceof ge?e=this.strokeStyle:e=new Ss(this.strokeStyle)),this.curves.length&&(this._stroke.push({path:new Pe(this),texture:e,textureTransform:this.textureTransform,style:{alignment:.5,cap:this.lineCap??"butt",join:this.lineJoin??"miter",width:this.lineWidth??1,miterLimit:this.miterLimit??10}}),this.currentCurve=new tr,this.curves=[this.currentCurve])}fillRect(e,t,i,s){this.rect(e,t,i,s).fill()}strokeRect(e,t,i,s){this.rect(e,t,i,s).stroke()}fill(){let e=this._defaultStyle;this.fillStyle&&(this.fillStyle instanceof ge?e=this.fillStyle:e=new Ss(this.fillStyle)),this._fille.push({path:new Pe(this),texture:e,textureTransform:this.textureTransform}),this.currentCurve=new tr,this.curves=[this.currentCurve]}copy(e){return super.copy(e),this.strokeStyle=e.strokeStyle,this.fillStyle=e.fillStyle,this.textureTransform=e.textureTransform,this.lineCap=e.lineCap,this.lineJoin=e.lineJoin,this.lineWidth=e.lineWidth,this.miterLimit=e.miterLimit,this._stroke=e._stroke.slice(),this._fille=e._fille.slice(),this}reset(){return super.reset(),this.strokeStyle=void 0,this.fillStyle=void 0,this.textureTransform=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineWidth=void 0,this.miterLimit=void 0,this._stroke.length=0,this._fille.length=0,this}buildUvs(e,t,i,s,o){if(s){let a=s.width,l=s.height;o&&([a,l]=o.applyToPoint(a,l));for(let h=t.length,c=e;c<h;c+=2)i.push(t[c]/a,t[c+1]/l)}else for(let a=t.length,l=e;l<a;l+=2)i.push(0,0)}toBatchables(){const e=[];let t=[],i=[],s=[],o=0,a;const l=c=>{e.push({type:c,vertices:t,indices:i,uvs:s,texture:a}),t=[],i=[],s=[],a=void 0};let h=t.length;for(let c=this._fille.length,f=0;f<c;f++){const p=this._fille[f];a??(a=p.texture),a!==p.texture&&l("fill"),o=t.length,p.path.fillTriangulate({vertices:t,indices:i}),this.buildUvs(o,t,s,p.texture,p.textureTransform)}t.length-h>0&&l("fill"),h=t.length;for(let c=this._stroke.length,f=0;f<c;f++){o=t.length;const p=this._stroke[f];a??(a=p.texture),p.path.strokeTriangulate({vertices:t,indices:i,lineStyle:p.style,flipAlignment:!1,closed:!0}),this.buildUvs(o,t,s,p.texture,p.textureTransform),l("stroke")}return t.length-h>0&&l("stroke"),e}}var bc=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,nr=(n,r,e,t)=>{for(var i=t>1?void 0:t?wc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&bc(r,e,i),i};d.Node=class extends ti{constructor(e,t=[]){super();u(this,"name",`${this.tag}:${String(this.instanceId)}`);u(this,"mask");u(this,"_readyed",!1);u(this,"_tree");u(this,"_parent");u(this,"_children",[]);u(this,"_meta",new Map);this._onTreeEnter=this._onTreeEnter.bind(this),this._onTreeExit=this._onTreeExit.bind(this),this._onParented=this._onParented.bind(this),this._onUnparented=this._onUnparented.bind(this),this._onReady=this._onReady.bind(this),this._onProcess=this._onProcess.bind(this),this.setProperties(e).append(t).on("treeEnter",this._onTreeEnter).on("treeExit",this._onTreeExit).on("parented",this._onParented).on("unparented",this._onUnparented).on("ready",this._onReady).on("process",this._onProcess)}getName(){return this.name}setName(e){return this.name=e,this}get tree(){return this.getTree()}set tree(e){this.setTree(e)}getTree(){return this._tree}getViewport(){var e;return(e=this._tree)==null?void 0:e.getCurrentViewport()}getWindow(){var e;return(e=this._tree)==null?void 0:e.root}isInsideTree(){return!!this._tree}setTree(e){const t=this._tree;if(e!==t){e?(this._tree=e,this.emit("treeEnter",e)):t&&(this.emit("treeExit",t),this._tree=e);for(let i=this._children.length,s=0;s<i;s++){const o=this._children[s];!e&&this.emit("childExitingTree",o),o.setTree(e),e&&this.emit("childEnteredTree",o)}e&&(this.emit("treePostEnter",e),this._readyed||(this._readyed=!0,this.emit("ready")))}return this}get parent(){return this._parent}set parent(e){this.setParent(e)}hasParent(){return!!this._parent}getParent(){return this._parent}setParent(e){var t;if(!((t=this._parent)!=null&&t.is(e))){const i=this._parent;this._parent=e,this.setTree(e==null?void 0:e._tree),e?this.emit("parented",e):i&&this.emit("unparented",i)}return this}get siblingIndex(){return this.getIndex()}set siblingIndex(e){var t;(t=this._parent)==null||t.moveChild(this,e)}get previousSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[this.getIndex()-1]}get nextSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[this.getIndex()+1]}get firstSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[0]}get lastSibling(){var t;const e=(t=this._parent)==null?void 0:t.getChildren();return e?e[e.length-1]:void 0}hasMeta(e){return this._meta.has(e)}getMeta(e,t){return this._meta.get(e)??t}setMeta(e,t){this._meta.set(e,t)}deleteMeta(e){this._meta.delete(e)}clearMeta(){this._meta.clear()}canProcess(){var e;if(!this._tree)return!1;switch(this.processMode){case"inherit":return((e=this._parent)==null?void 0:e.canProcess())??!0;case"pausable":return!this._tree.paused;case"when_paused":return this._tree.paused;case"always":return!0;case"disabled":default:return!1}}canRender(){var e;if(!this._tree)return!1;switch(this.renderMode){case"inherit":return((e=this._parent)==null?void 0:e.canRender())??!0;case"always":return!0;case"disabled":default:return!1}}_onTreeEnter(e){this._treeEnter(e),this.emit("treeEntered",e)}_onTreeExit(e){this.emit("treeExiting",e),this._treeExit(e),this.emit("treeExited",e)}_onParented(e){this._parented(e)}_onUnparented(e){this._unparented(e)}_onReady(){this._ready()}_onProcess(e=0){const t=this._tree,i=this.canRender(),s=this.canProcess();s&&(t==null||t.emit("nodeProcessing",this),this.emit("processing",e),this._process(e));let o;if(i){const a=t.renderStack.push(this);o=t.renderStack.currentCall,t.renderStack.currentCall=a}if(this.mask instanceof d.Node)this.getNode("__$mask")||(this.mask.processMode="disabled",this.addChild(this.mask,"front"));else{const a=this.getNode("__$mask");a&&this.removeChild(a)}for(let a=this._children.length,l=0;l<a;l++)this._children[l].emit("process",e);i&&(t.renderStack.currentCall=o),s&&(this.emit("processed",e),t==null||t.emit("nodeProcessed",this))}render(e,t){const i=this.mask;i&&(e.flush(),e.mask.push(this,i)),this._render(e),t==null||t(),i&&(e.flush(),e.mask.pop(this))}input(e,t){for(let i=this._children.length-1;i>=0;i--)this._children[i].input(e,t);this._input(e,t)}getChildren(e=!1){switch(e){case!0:return this._children;case!1:return this._children.filter(t=>t.internalMode==="default");default:return this._children.filter(t=>t.internalMode===e)}}getIndex(e=!1){var t;return((t=this._parent)==null?void 0:t.getChildren(e).indexOf(this))??0}getNode(e){return this._children.find(t=>t.name===e)}removeNode(e){var t;(t=this.getNode(e))==null||t.remove()}addSibling(e){return this.is(e)||!this.hasParent()||e.hasParent()?this:(e.internalMode=this.internalMode,this._parent.moveChild(e,this.getIndex(!0)+1),this)}append(...e){let t;return Array.isArray(e[0])?t=e[0]:t=e,t.forEach(i=>{this.addChild(i)}),this}addChild(e,t=e.internalMode){if(this.is(e)||e.hasParent())return this;switch(t){case"default":case"front":{const i=t==="default"?"back":"front",s=this._children.findIndex(o=>o.internalMode===i);s>-1?this._children.splice(s,0,e):this._children.push(e);break}case"back":this._children.push(e);break}return e.internalMode=t,e.setParent(this),this.emit("addChild",e),this}moveChild(e,t,i=e.internalMode){if(this.is(e)||e.hasParent()&&!this.is(e.parent))return this;e.internalMode=i;const s=this._children.indexOf(e);let o=this._children.findIndex(h=>{switch(i){case"default":return h.internalMode!=="front";case"back":return h.internalMode==="back";case"front":default:return!0}});o=o>-1?o:Math.max(0,this._children.length-1);let a=this._children.slice(o).findIndex(h=>{switch(i){case"front":return h.internalMode!=="front";case"default":return h.internalMode==="back";case"back":default:return!1}});a=a>-1?o+a:Math.max(0,this._children.length-1);const l=at(o,t>-1?t:a,a);return l!==s&&(s>-1&&this._children.splice(s,1),e.setParent(this),l>-1&&l<this._children.length?this._children.splice(l,0,e):this._children.push(e),s>-1?this.emit("moveChild",e,l,s):this.emit("addChild",e)),this}removeChild(e){const t=e.getIndex(!0);return this.is(e.parent)&&t>-1&&(this._children.splice(t,1),e.setParent(void 0),this.emit("removeChild",e,t)),this}removeChildren(){this.getChildren().forEach(e=>this.removeChild(e))}remove(){var e;(e=this._parent)==null||e.removeChild(this)}forEach(e){return this.getChildren().forEach(e),this}deepForEach(e){return this.getChildren().forEach(t=>{e(t),t.deepForEach(e)}),this}is(e){return!!(e&&this.instanceId===e.instanceId)}_ready(){}_treeEnter(e){}_treeExit(e){}_parented(e){}_unparented(e){}_process(e){}_input(e,t){}_render(e){}toJSON(){return{tag:this.tag,props:super.toJSON(),children:this.getChildren().map(e=>e.toJSON())}}static parse(e){if(Array.isArray(e))return e.map(l=>this.parse(l));const{tag:t,props:i,children:s}=e,o=ei.get(t)??d.Node,a=new o(i);return s==null||s.forEach(l=>a.addChild(this.parse(l))),a}},nr([M()],d.Node.prototype,"name",2),nr([M()],d.Node.prototype,"mask",2),nr([M({default:"inherit"})],d.Node.prototype,"processMode",2),nr([M({default:"inherit"})],d.Node.prototype,"renderMode",2),nr([M({default:"default"})],d.Node.prototype,"internalMode",2),d.Node=nr([j("Node")],d.Node);var xc=Object.defineProperty,Pc=Object.getOwnPropertyDescriptor,pi=(n,r,e,t)=>{for(var i=t>1?void 0:t?Pc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&xc(r,e,i),i};d.TimelineNode=class extends d.Node{constructor(e,t=[]){super();u(this,"computedDuration",0);u(this,"_currentTime",0);u(this,"_startTime",0);this.setProperties(e).append(t)}get timeline(){var e;return(e=this._tree)==null?void 0:e.timeline}get timelineCurrentTime(){var e;return((e=this.timeline)==null?void 0:e.currentTime)??0}get parentStartTime(){var e;return((e=this._parent)==null?void 0:e.startTime)??0}get currentTime(){return at(0,this._currentTime,this.computedDuration)}get startTime(){return this._startTime}set startTime(e){this.delay=e-this.parentStartTime,this._updateCurrentTime(!0)}get endTime(){return this._startTime+this.computedDuration}get currentTimeProgress(){return this.computedDuration?at(0,this._currentTime/this.computedDuration,1):0}isInsideTimeRange(){const e=this._currentTime;return this.computedDuration?e>=0&&e<=this.computedDuration:e>=0}_updateCurrentTime(e=!1){if(e||!this.paused){const t=this._parent;this._startTime=this.delay+this.parentStartTime,this.computedDuration=t!=null&&t.computedDuration?Math.min(this._startTime+this.duration,t.endTime)-this._startTime:this.duration,this._currentTime=this.timelineCurrentTime-this._startTime,this.emit("updateCurrentTime",this._currentTime)}}_process(e){this._updateCurrentTime(),super._process(e)}},pi([M({default:0})],d.TimelineNode.prototype,"delay",2),pi([M({default:0})],d.TimelineNode.prototype,"duration",2),pi([M({default:!1})],d.TimelineNode.prototype,"paused",2),d.TimelineNode=pi([j("TimelineNode")],d.TimelineNode);var Cc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,Mr=(n,r,e,t)=>{for(var i=t>1?void 0:t?Tc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Cc(r,e,i),i};d.Viewport=class extends d.Node{constructor(e=!1){super();u(this,"_projection",new Xn);u(this,"_framebufferIndex",0);u(this,"_framebuffers",[{texture:new As,needsUpload:!1},{texture:new As,needsUpload:!1}]);this.flipY=e,this._projection.flipY(e)}get valid(){return!!(this.width&&this.height)}get framebuffer(){return this._framebuffers[this._framebufferIndex]}get texture(){return this.framebuffer.texture}_glFramebufferOptions(e){const{width:t,height:i}=this,{pixelRatio:s}=e;return this._framebuffers.forEach(o=>{const a=o.texture;a.pixelRatio=s,a.width=t,a.height=i,a.upload(e)}),{width:t,height:i,colorTextures:[this.texture._glTexture(e)]}}_glFramebuffer(e){return e.getRelated(this.framebuffer,()=>e.framebuffer.create(this._glFramebufferOptions(e)))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"x":case"y":this.requestUpload(),this._projection.translate(this.x,this.y),this.emit("updateRect");break;case"width":case"height":this.requestUpload(),this._projection.resize(this.width,this.height),this.emit("updateRect");break}}requestUpload(){this._framebuffers.forEach(e=>e.needsUpload=!0)}resize(e,t){this.width=e,this.height=t}upload(e){const t=this.framebuffer;return t.needsUpload&&this.valid?(t.needsUpload=!1,e.framebuffer.update(this._glFramebuffer(e),this._glFramebufferOptions(e)),!0):!1}activate(e){var t;return this.valid?(e.flush(),(t=this._tree)==null||t.setCurrentViewport(this),e.framebuffer.bind(this._glFramebuffer(e)),this.upload(e),!0):!1}redraw(e,t){if(this.valid){e.flush();const i=this.framebuffer.texture;return this._framebufferIndex=(this._framebufferIndex+1)%this._framebuffers.length,this.activate(e),e.clear(),i.activate(e,0),t(),!0}return!1}activateWithCopy(e,t){this.resize(t.width,t.height),this.activate(e)&&(e.clear(),t.texture.activate(e,0),J.draw(e,ir.instance,{sampler:0}))}render(e,t){var s,o;const i=(s=this._tree)==null?void 0:s.getCurrentViewport();this.activate(e),e.clear(),super.render(e,t),e.flush(),i?i.activate(e):(e.framebuffer.bind(null),(o=this._tree)==null||o.setCurrentViewport(void 0))}getRect(){return new ni(this.x,this.y,this.width,this.height)}toProjectionArray(e=!1){return this._projection.toArray(e)}},Mr([M({default:0})],d.Viewport.prototype,"x",2),Mr([M({default:0})],d.Viewport.prototype,"y",2),Mr([M({default:0})],d.Viewport.prototype,"width",2),Mr([M({default:0})],d.Viewport.prototype,"height",2),d.Viewport=Mr([j("Viewport")],d.Viewport);var Sc=Object.defineProperty,Ec=Object.getOwnPropertyDescriptor,Ar=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ec(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Sc(r,e,i),i};d.Effect=class extends d.TimelineNode{constructor(e,t=[]){super();u(this,"viewport1",new d.Viewport);u(this,"viewport2",new d.Viewport);u(this,"_renderId",0);u(this,"_renderViewport");u(this,"_previousSibling");u(this,"_nextSibling");this._onProcessing=this._onProcessing.bind(this),this._onNodeProcessed=this._onNodeProcessed.bind(this),this.setProperties(e).append(t)}get _effectMode(){return this.effectMode??"parent"}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"glsl":{const o=new di(t);!this.effectMode&&o.has.transition&&(this.effectMode="transition"),this.material=o;break}case"glslSrc":{t?Pt.text.load(t).then(o=>this.glsl=o):this.glsl="";break}}}_treeEnter(e){e.on("processing",this._onProcessing),e.on("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(e),this.viewport2.setTree(e)}_treeExit(e){e.off("processing",this._onProcessing),e.off("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(void 0),this.viewport2.setTree(void 0)}_onProcessing(){switch(this._updateCurrentTime(),this._effectMode){case"transition":this._previousSibling=this.previousSibling,this._nextSibling=this.nextSibling;break;default:this._previousSibling=void 0,this._nextSibling=void 0;break}}_onNodeProcessed(e){var i;if(!this.isInsideTimeRange())return;const t=(i=this._tree)==null?void 0:i.renderStack;if(t)switch(this._effectMode){case"transition":e.is(this._previousSibling)?(this._previousSibling=void 0,t.push(this)):e.is(this._nextSibling)&&(this._nextSibling=void 0,t.push(this));break}}_processParent(){var a,l;const e=(a=this._tree)==null?void 0:a.renderStack;if(!e)return;const t=(l=e.currentCall)==null?void 0:l.parentCall;if(!t)return;const i=t.calls;let s,o;i.forEach((h,c)=>{var f;(h.renderable.is(this._parent)||(f=h.renderable.parent)!=null&&f.is(this._parent))&&(s=s??c,o=c)}),!(s===void 0||o===void 0)&&(i.splice(o+1,0,e.createCall(this)),i.splice(s,0,e.createCall(this)))}_processChildren(){var e;this._children.length&&(super.emit("process"),(e=this._tree)==null||e.renderStack.push(this))}_onProcess(e=0){if(this.canProcess())switch(this._renderId=0,this._effectMode){case"before":super._onProcess(e);break;case"parent":this._processParent();break;case"children":this._processChildren();break}}_renderBefore(e){var i;const t=(i=this._tree)==null?void 0:i.getCurrentViewport();t&&this.apply(e,t,{redraw:!0})}_renderTransition(e){var t;if(this._renderId%2===0)this._renderViewport=(t=this._tree)==null?void 0:t.getCurrentViewport(),this._renderViewport&&(this.viewport1.activateWithCopy(e,this._renderViewport),this.viewport2.resize(this._renderViewport.width,this._renderViewport.height)),this.viewport2.activate(e),e.clear();else{const i=this._renderViewport;this._renderViewport=void 0,i&&(i.activate(e),e.clear(),this.viewport1.texture.activate(e,0),this.viewport2.texture.activate(e,1),this.apply(e,i,{from:this.viewport1,to:this.viewport2}),e.texture.unbind(0),e.texture.unbind(1))}}_renderParentOrChildren(e){var t;if(this._renderId%2===0)this._renderViewport=(t=this._tree)==null?void 0:t.getCurrentViewport(),this._renderViewport&&this.viewport1.resize(this._renderViewport.width,this._renderViewport.height),this.viewport1.activate(e),e.clear();else{const i=this._renderViewport;this._renderViewport=void 0,i&&(this.viewport1.activate(e),this.apply(e,this.viewport1,{redraw:!0,target:this._effectMode==="parent"?this._parent??void 0:void 0,targetArea:this._parseTargetArea()}),i.activate(e),this.viewport1.texture.activate(e,0),J.draw(e))}}_parseTargetArea(){if(this._effectMode==="parent"&&this._parent&&"getRect"in this._parent){const e=this._parent.getRect();if(e)return[e.left/this.viewport1.width,e.top/this.viewport1.height,e.width/this.viewport1.width,e.height/this.viewport1.height]}}_render(e){switch(this._effectMode){case"before":this._renderBefore(e);break;case"transition":this._renderTransition(e);break;case"parent":case"children":default:this._renderParentOrChildren(e);break}this._renderId++}apply(e,t,i){this.material&&(i!=null&&i.redraw?t.redraw(e,()=>{J.draw(e,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:t.width/t.height})}):J.draw(e,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:i!=null&&i.from?i.from.width/i.from.height:0}))}},Ar([ue()],d.Effect.prototype,"material",2),Ar([M()],d.Effect.prototype,"effectMode",2),Ar([M({default:""})],d.Effect.prototype,"glsl",2),Ar([M({default:""})],d.Effect.prototype,"glslSrc",2),d.Effect=Ar([j("Effect")],d.Effect);var Ho=Object.defineProperty,Mc=Object.getOwnPropertyDescriptor,Ac=(n,r,e)=>r in n?Ho(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Os=(n,r,e,t)=>{for(var i=t>1?void 0:t?Mc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ho(r,e,i),i},Yo=(n,r,e)=>Ac(n,typeof r!="symbol"?r+"":r,e);const Oc=`attribute vec2 position;
105
+ }`,uniforms:{sampler:0,projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}})}}g(LA,"_instance");class Ie extends ir{static get instance(){return this._instance??(this._instance=new this)}static draw(A,e=LA.instance,t){this.instance.draw(A,e,t)}constructor(){super({vertexAttributes:{position:new ft({buffer:new Vt({data:new Float32Array([-1,-1,1,-1,1,1,-1,1]),dynamic:!1}),size:2,normalized:!1,type:"float"}),uv:new ft({buffer:new Vt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new TA({data:new Uint16Array([0,1,2,0,2,3]),dynamic:!1})})}}g(Ie,"_instance");class Hg extends ir{constructor(){const e=new Vt({data:new Float32Array,dynamic:!0}),t=new Vt({data:new Float32Array,dynamic:!0});super({vertexAttributes:{position:new ft({buffer:e,size:2,normalized:!1,type:"float"}),uv:new ft({buffer:t,size:2,normalized:!1,type:"float"})},indexBuffer:new TA({data:new Uint16Array,dynamic:!0})});g(this,"positionBuffer");g(this,"uvBuffer");this.positionBuffer=e,this.uvBuffer=t}update(e,t,i){return this.positionBuffer.data=e,this.uvBuffer.data=t,this.indexBuffer.data=i,this}}function Jg(){return{shadowColor:"transparent",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0}}function xs(){return{left:0,top:0,width:0,height:0,rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Kg(){return{overflow:"visible",visibility:"visible",filter:"none",opacity:1,marginLeft:0,marginTop:0,marginRight:0,marginBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,...xs(),backgroundImage:"none",backgroundColor:"transparent",...Jg(),borderRadius:0,borderColor:"transparent",borderWidth:1}}function Ss(){return{writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1.2,letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textIndent:0,textTransform:"none",textOrientation:"mixed",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"black",color:"black",listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function Yg(){return{...Kg(),...Ss()}}var Wg=Object.defineProperty,Le=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Wg(A,e,i),i};const na={brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0};class ve extends St{constructor(e){super();g(this,"_backgroundColor",new Rt);this.setProperties(e)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"backgroundColor":this._backgroundColor.value=this.backgroundColor==="none"?void 0:this.backgroundColor;break}}canPointeEvents(){return this.pointerEvents!=="none"}getComputedOpacity(){return _t(0,this.opacity,1)}getComputedBackgroundColor(){return this._backgroundColor}async loadBackgroundImage(){if(this.backgroundImage!=="none")return await Ot.texture.load(this.backgroundImage)}getComputedTransform(){const{scaleX:e,scaleY:t,left:i,top:s,width:n,height:o,rotate:a}=this,l=new Ze,h=new Ze(!1),c=new Ze(!1).scale(e,t).translate(i,s).rotate(a*fs);let u=this.transform;(!u||u==="none")&&(u=""),IA(u,{width:n,height:o}).forEach(({name:R,args:b})=>{const Q=b.map(v=>v.normalizedIntValue);switch(l.identity(),R){case"translate":l.translate(Q[0]*n,(Q[1]??Q[0])*this.height);break;case"translateX":l.translateX(Q[0]*n);break;case"translateY":l.translateY(Q[0]*o);break;case"translateZ":l.translateZ(Q[0]);break;case"translate3d":l.translate3d(Q[0]*n,(Q[1]??Q[0])*o,Q[2]??Q[1]??Q[0]);break;case"scale":l.scale(Q[0],Q[1]??Q[0]);break;case"scaleX":l.scaleX(Q[0]);break;case"scaleY":l.scaleY(Q[0]);break;case"scale3d":l.scale3d(Q[0],Q[1]??Q[0],Q[2]??Q[1]??Q[0]);break;case"rotate":l.rotate(Q[0]*Ce);break;case"rotateX":l.rotateX(Q[0]*Ce);break;case"rotateY":l.rotateY(Q[0]*Ce);break;case"rotateZ":l.rotateZ(Q[0]*Ce);break;case"rotate3d":l.rotate3d(Q[0]*Ce,(Q[1]??Q[0])*Ce,(Q[2]??Q[1]??Q[0])*Ce,(Q[3]??Q[2]??Q[1]??Q[0])*Ce);break;case"skew":l.skew(Q[0],Q[0]??Q[1]);break;case"skewX":l.skewX(Q[0]);break;case"skewY":l.skewY(Q[0]);break;case"matrix":l.set(Q);break}h.multiply(l)}),c.update(),h.update();const d=c.toArray(),I=h.toArray(),C=[I[0]*d[0]+I[3]*d[1],I[1]*d[0]+I[4]*d[1],I[2]*d[0]+I[5]*d[1]+d[2],I[0]*d[3]+I[3]*d[4],I[1]*d[3]+I[4]*d[4],I[2]*d[3]+I[5]*d[4]+d[5],0,0,1],[B,U]=this.getComputedTransformOrigin(),M=B*n,D=U*o;return C[2]+=C[0]*-M+C[1]*-D+M,C[5]+=C[3]*-M+C[4]*-D+D,new Ze().set(C)}getComputedTransformOrigin(){const[e,t=e]=this.transformOrigin.split(" ");return[e,t].map(i=>{switch(i=i.trim(),i){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(i)}})}getComputedFilter(){let e={};return this.filter==="none"||(e=IA(this.filter).reduce((t,{name:i,args:s})=>(t[i]=s[0].normalizedIntValue,t),e),Object.keys(na).forEach(t=>{e[t]=e[t]??na[t]})),e}getComputedFilterColorMatrix(){const e=new qi,t=this.getComputedFilter();for(const i in t){const s=t[i];switch(i){case"hue-rotate":e.hueRotate(s*Ce);break;case"saturate":e.saturate(s);break;case"brightness":e.brightness(s);break;case"contrast":e.contrast(s);break;case"invert":e.invert(s);break;case"sepia":e.sepia(s);break;case"opacity":e.opacity(s);break;case"grayscale":e.grayscale(s);break}}return e}}Le([_({default:"none"})],ve.prototype,"backgroundColor"),Le([_({default:"none"})],ve.prototype,"backgroundImage"),Le([_({default:"none"})],ve.prototype,"filter"),Le([_({default:"inherit"})],ve.prototype,"direction"),Le([_({default:"none"})],ve.prototype,"boxShadow"),Le([_({default:"none"})],ve.prototype,"maskImage"),Le([_({default:1})],ve.prototype,"opacity"),Le([_({default:0})],ve.prototype,"borderWidth"),Le([_({default:0})],ve.prototype,"borderRadius"),Le([_({default:"#000000"})],ve.prototype,"borderColor"),Le([_({default:"none"})],ve.prototype,"borderStyle"),Le([_({default:0})],ve.prototype,"outlineWidth"),Le([_({default:0})],ve.prototype,"outlineOffset"),Le([_({default:"#000000"})],ve.prototype,"outlineColor"),Le([_({default:"none"})],ve.prototype,"outlineStyle"),Le([_({default:"visible"})],ve.prototype,"visibility"),Le([_({default:"visible"})],ve.prototype,"overflow"),Le([_({default:"auto"})],ve.prototype,"pointerEvents");const oa=xs();for(const r in oa)BA(ve,r,{default:oa[r]});const aa=Ss();for(const r in aa)BA(ve,r,{default:aa[r]});var Vg=Object.defineProperty,GA=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Vg(A,e,i),i};class Ne extends St{constructor(e){super();g(this,"_isPowerOfTwo",!1);g(this,"_needsUpload",!1);this.source=e,this._updateSize()}static get EMPTY(){return new this({width:1,height:1,pixels:null})}static get WHITE(){return new this({width:1,height:1,pixels:new Uint8Array([255,255,255,255])})}static get BLACK(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,0,255])})}static get RED(){return new this({width:1,height:1,pixels:new Uint8Array([255,0,0,255])})}static get GREEN(){return new this({width:1,height:1,pixels:new Uint8Array([0,255,0,255])})}static get BLUE(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,255,255])})}get valid(){return!!(this.width&&this.height)}get realWidth(){return Math.round(this.width*this.pixelRatio)}get realHeight(){return Math.round(this.height*this.pixelRatio)}_glTextureOptions(e,t){let i=this.wrapMode;return e.version===1&&!this._isPowerOfTwo&&(i="clamp_to_edge"),{value:this.source,target:"texture_2d",location:0,filterMode:this.filterMode,wrapMode:i,...t}}_glTexture(e,t){return e.getRelated(this,()=>e.texture.create(this._glTextureOptions(e,t)))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"width":case"height":this._updatePOT();break;case"source":this._updateSize();break;case"filterMode":case"wrapMode":case"pixelRatio":this.requestUpload();break}}_updatePOT(){this._isPowerOfTwo=$r(this.realWidth)&&$r(this.realHeight),this.requestUpload()}_updateSize(){const e=this.source;"pixels"in e?(this.width=e.width/this.pixelRatio,this.height=e.height/this.pixelRatio):(this.width=Number(e.naturalWidth||e.videoWidth||e.width||0)/this.pixelRatio,this.height=Number(e.naturalHeight||e.videoHeight||e.height||0)/this.pixelRatio),this.requestUpload()}requestUpload(){this._needsUpload=!0}upload(e,t){return this._needsUpload&&this.valid?(this._needsUpload=!1,e.texture.update(this._glTexture(e,t),this._glTextureOptions(e,t)),!0):!1}activate(e,t=0){return this.valid?(e.texture.bind({target:"texture_2d",value:this._glTexture(e,{location:t}),location:t}),this.upload(e,{location:t}),!0):!1}inactivate(e){e.texture.unbind(this._glTexture(e))}destroy(){Ln&&this.source instanceof ImageBitmap&&this.source.close()}}GA([Me()],Ne.prototype,"source"),GA([_({default:0})],Ne.prototype,"width"),GA([_({default:0})],Ne.prototype,"height"),GA([_({default:"linear"})],Ne.prototype,"filterMode"),GA([_({default:"clamp_to_edge"})],Ne.prototype,"wrapMode"),GA([_({default:1})],Ne.prototype,"pixelRatio");var Xg=Object.defineProperty,qg=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Xg(A,e,i),i};class Ii extends Ne{constructor(A=document.createElement("canvas")){super(A)}_updateProperty(A,e,t,i){switch(A){case"width":this.source.width=Math.max(1,Math.ceil(e*this.pixelRatio));break;case"height":this.source.height=Math.max(1,Math.ceil(e*this.pixelRatio));break}super._updateProperty(A,e,t,i)}}qg([_({default:2})],Ii.prototype,"pixelRatio");class Ms extends Ne{constructor(A){const e=new Rt(A);super({width:1,height:1,pixels:new Uint8Array([e.r8,e.g8,e.b8,e.a8])})}}function zg(r){return{autoLoad:!!((r==null?void 0:r.autoLoad)??!0),useBitmap:!!((r==null?void 0:r.useBitmap)??!0)&&ts,crossorigin:(r==null?void 0:r.crossorigin)??null}}class jg extends Ne{constructor(e,t){const i=zg(t);super(e);g(this,"bitmap");g(this,"useBitmap");g(this,"preserveBitmap",!1);g(this,"_loadSource");g(this,"_loadBitmap");const s=e.src,n=s.includes(".svg")||s.startsWith("data:image/svg+xml");this.useBitmap=i.useBitmap&&!n,i.autoLoad&&this.load()}async load(){return this._loadSource||(this._loadSource=new Promise(e=>{this._loadSource=void 0;const t=this.source,i=()=>{t.onload=null,t.onerror=null},s=()=>{i(),this.requestUpload(),this.useBitmap?this.genBitmap().finally(()=>e(this)):e(this)},n=o=>{i(),console.warn(`Failed to load ImageTexture, src: ${t.src}`,o),this.emit("error",o),e(this)};t.complete&&t.src?s():(t.onload=s,t.onerror=n)})),this._loadSource}genBitmap(){if(this._loadBitmap)return this._loadBitmap;if(this.bitmap||!ts)return Promise.resolve(this);const e=this.source,t=!e.crossOrigin||e.crossOrigin==="anonymous";return this._loadBitmap=fetch(e.src,{mode:t?"cors":"no-cors"}).then(i=>i.blob()).then(i=>createImageBitmap(i,0,0,e.width,e.height,{premultiplyAlpha:"premultiply"})).then(i=>(this.bitmap=i,this.requestUpload(),this._loadBitmap=void 0,this)).catch(i=>(console.warn("Failed to genBitmap",i),this)),this._loadBitmap}_glTextureOptions(e){return{...super._glTextureOptions(e),value:this.bitmap??this.source}}upload(e){if(this.useBitmap){if(!this.bitmap)return this.genBitmap(),!1}else{const i=this.source;if(oi&&i instanceof HTMLImageElement&&(!i.complete||i.naturalWidth===0))return!1}const t=super.upload(e);return this.preserveBitmap&&this.bitmap&&(this.bitmap.close(),this.bitmap=void 0),t}}class Rs extends Ne{constructor(A,e=1,t=1){const i={width:e,height:t,pixels:null};A&&(ArrayBuffer.isView(A)?i.pixels=new Uint8Array(A.buffer):i.pixels=new Uint8Array(A)),super(i)}_updateProperty(A,e,t,i){switch(A){case"width":this.source.width=Math.round(e*this.pixelRatio);break;case"height":this.source.height=Math.round(e*this.pixelRatio);break}super._updateProperty(A,e,t,i)}}var Zg=Object.defineProperty,la=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Zg(A,e,i),i};function $g(r){return{autoLoad:!!((r==null?void 0:r.autoLoad)??!0),autoPlay:!!((r==null?void 0:r.autoPlay)??!1),fps:Number((r==null?void 0:r.fps)??0),crossorigin:(r==null?void 0:r.crossorigin)??null,loop:!!((r==null?void 0:r.loop)??!1),muted:!!((r==null?void 0:r.muted)??!1),playsinline:!!((r==null?void 0:r.playsinline)??!0)}}const Us=(xA=class extends Ne{constructor(e,t){const i=$g(t);if(!Yn(e)){typeof e=="string"&&(e=[e]);const s=e[0].src||e[0],n=document.createElement("video");i.autoLoad&&n.setAttribute("preload","auto"),i.playsinline&&(n.setAttribute("webkit-playsinline",""),n.setAttribute("playsinline","")),i.muted&&(n.setAttribute("muted",""),n.muted=!0),i.loop&&n.setAttribute("loop",""),i.autoPlay&&n.setAttribute("autoplay",""),zn(n,s,i.crossorigin);for(let o=0;o<e.length;++o){let{src:a,mime:l}=e[o];if(a=a||e[o],a.startsWith("data:"))l=a.slice(5,a.indexOf(";"));else if(!a.startsWith("blob:")){const c=a.split("?").shift().toLowerCase(),u=c.slice(c.lastIndexOf(".")+1);l=l||xA.mimeTypes.get(u)||`video/${u}`}const h=document.createElement("source");h.src=a,l&&(h.type=l),n.appendChild(h)}e=n}super(e);g(this,"_spf",0);g(this,"_autoPlay",!1);g(this,"_sourceLoad");g(this,"_nextTime",0);g(this,"_connected",!1);g(this,"_requestId");g(this,"_resolve");g(this,"_reject");g(this,"_onPlayStart",()=>{this.valid||this._onCanPlay(),this._setupAutoUpdate()});g(this,"_onPlayStop",()=>{this._setupAutoUpdate()});g(this,"_onCanPlay",()=>{const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._nextTime=0,this._updateSize(),this.requestUpload(),this._nextTime=0,!t&&this._resolve&&(this._resolve(this),this._sourceLoad=void 0,this._resolve=void 0,this._reject=void 0),this.isPlaying?this._onPlayStart():this._autoPlay&&e.play()});g(this,"_onError",e=>{this.source.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=void 0,this._resolve=void 0)});g(this,"_onSeeked",()=>{this.autoUpdate&&!this.isPlaying&&(this._nextTime=0,this.requestUpload(),this._nextTime=0)});g(this,"_videoFrameRequestCallback",()=>{this.requestUpload(),this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)});g(this,"requestUpload",()=>{const e=Math.floor(Re.elapsed*this.source.playbackRate);this._nextTime-=e,(!this._spf||this._nextTime<=0)&&(super.requestUpload(),this._nextTime=this._spf||0)});this.fps=i.fps,this._autoPlay=i.autoPlay,i.autoPlay&&this.load(),this._setupAutoUpdate()}get isReady(){return this.source.readyState>2}get isPlaying(){return!this.source.paused&&!this.source.ended&&this.isReady}get duration(){return this.source.duration}get seeking(){return this.source.seeking}get currentTime(){return this.source.currentTime}set currentTime(e){this.source.currentTime=e}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"fps":this._spf=t?Math.floor(1e3/t):0,this._setupAutoUpdate();break;case"autoUpdate":this._setupAutoUpdate();break}}_setupAutoUpdate(){this.autoUpdate&&this.isPlaying?!this.fps&&this.source.requestVideoFrameCallback?(this._connected&&(Re.off(this.requestUpload),this._connected=!1,this._nextTime=0),this._requestId===void 0&&(this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected||(Re.on(this.requestUpload),this._connected=!0,this._nextTime=0)):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected&&(Re.off(this.requestUpload),this._connected=!1,this._nextTime=0))}async load(){if(!this._sourceLoad){const e=this.source;(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this.isReady?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._sourceLoad=new Promise((t,i)=>{this.valid?(this._sourceLoad=void 0,t(this)):(this._resolve=t,this._reject=i,e.load())})}return this._sourceLoad}destroy(){this._setupAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load())}},g(xA,"mimeTypes",new Map(Object.entries({ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"}))),xA);la([Me({default:!0})],Us.prototype,"autoUpdate"),la([Me({default:0})],Us.prototype,"fps");let ha=Us;class ks extends Rs{}class Ps extends Ve{constructor(){super(...arguments);g(this,"textureTransform");g(this,"fillStyle");g(this,"strokeStyle");g(this,"lineCap");g(this,"lineJoin");g(this,"lineWidth");g(this,"miterLimit");g(this,"_defaultStyle",Ne.EMPTY);g(this,"_stroke",[]);g(this,"_fille",[])}stroke(){let e=this._defaultStyle;this.strokeStyle&&(this.strokeStyle instanceof Ne?e=this.strokeStyle:e=new Ms(this.strokeStyle)),this.curves.length&&(this._stroke.push({path:new Ve(this),texture:e,textureTransform:this.textureTransform,style:{alignment:.5,cap:this.lineCap??"butt",join:this.lineJoin??"miter",width:this.lineWidth??1,miterLimit:this.miterLimit??10}}),this.currentCurve=new FA,this.curves=[this.currentCurve])}fillRect(e,t,i,s){this.rect(e,t,i,s).fill()}strokeRect(e,t,i,s){this.rect(e,t,i,s).stroke()}fill(){let e=this._defaultStyle;this.fillStyle&&(this.fillStyle instanceof Ne?e=this.fillStyle:e=new Ms(this.fillStyle)),this._fille.push({path:new Ve(this),texture:e,textureTransform:this.textureTransform}),this.currentCurve=new FA,this.curves=[this.currentCurve]}copy(e){return super.copy(e),this.strokeStyle=e.strokeStyle,this.fillStyle=e.fillStyle,this.textureTransform=e.textureTransform,this.lineCap=e.lineCap,this.lineJoin=e.lineJoin,this.lineWidth=e.lineWidth,this.miterLimit=e.miterLimit,this._stroke=e._stroke.slice(),this._fille=e._fille.slice(),this}reset(){return super.reset(),this.strokeStyle=void 0,this.fillStyle=void 0,this.textureTransform=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineWidth=void 0,this.miterLimit=void 0,this._stroke.length=0,this._fille.length=0,this}buildUvs(e,t,i,s,n){if(s){let o=s.width,a=s.height;n&&([o,a]=n.applyToPoint(o,a));for(let l=t.length,h=e;h<l;h+=2)i.push(t[h]/o,t[h+1]/a)}else for(let o=t.length,a=e;a<o;a+=2)i.push(0,0)}toBatchables(){const e=[];let t=[],i=[],s=[],n=0,o;const a=h=>{e.push({type:h,vertices:t,indices:i,uvs:s,texture:o}),t=[],i=[],s=[],o=void 0};let l=t.length;for(let h=this._fille.length,c=0;c<h;c++){const u=this._fille[c];o??(o=u.texture),o!==u.texture&&a("fill"),n=t.length,u.path.fillTriangulate({vertices:t,indices:i}),this.buildUvs(n,t,s,u.texture,u.textureTransform)}t.length-l>0&&a("fill"),l=t.length;for(let h=this._stroke.length,c=0;c<h;c++){n=t.length;const u=this._stroke[c];o??(o=u.texture),u.path.strokeTriangulate({vertices:t,indices:i,lineStyle:u.style,flipAlignment:!1,closed:!0}),this.buildUvs(n,t,s,u.texture,u.textureTransform),a("stroke")}return t.length-l>0&&a("stroke"),e}}var ec=Object.defineProperty,tc=Object.getOwnPropertyDescriptor,OA=(r,A,e,t)=>{for(var i=t>1?void 0:t?tc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&ec(A,e,i),i};const ga={};function Ac(r){let A=ga[r]??0;return A++,ga[r]=A,A}f.Node=class extends Wi{constructor(e,t=[]){super();g(this,"name",`${this.tag}:${Ac(this.tag)}`);g(this,"mask");g(this,"_readyed",!1);g(this,"_tree");g(this,"_parent");g(this,"_children",[]);g(this,"_meta",new Map);this._onTreeEnter=this._onTreeEnter.bind(this),this._onTreeExit=this._onTreeExit.bind(this),this._onParented=this._onParented.bind(this),this._onUnparented=this._onUnparented.bind(this),this._onReady=this._onReady.bind(this),this._onProcess=this._onProcess.bind(this),this.setProperties(e).append(t),this.on("treeEnter",this._onTreeEnter).on("treeExit",this._onTreeExit).on("parented",this._onParented).on("unparented",this._onUnparented).on("ready",this._onReady).on("process",this._onProcess)}getName(){return this.name}setName(e){return this.name=e,this}get tree(){return this.getTree()}set tree(e){this.setTree(e)}getTree(){return this._tree}getViewport(){var e;return(e=this._tree)==null?void 0:e.getCurrentViewport()}getWindow(){var e;return(e=this._tree)==null?void 0:e.root}isInsideTree(){return!!this._tree}setTree(e){const t=this._tree;if(e!==t){e?(this._tree=e,this.emit("treeEnter",e)):t&&(this.emit("treeExit",t),this._tree=e);for(let i=this._children.length,s=0;s<i;s++){const n=this._children[s];!e&&this.emit("childExitingTree",n),n.setTree(e),e&&this.emit("childEnteredTree",n)}e&&(this.emit("treePostEnter",e),this._readyed||(this._readyed=!0,this.emit("ready")))}return this}get parent(){return this._parent}set parent(e){this.setParent(e)}hasParent(){return!!this._parent}getParent(){return this._parent}setParent(e){var t;if(!((t=this._parent)!=null&&t.is(e))){const i=this._parent;this._parent=e,this.setTree(e==null?void 0:e._tree),e?this.emit("parented",e):i&&this.emit("unparented",i)}return this}get siblingIndex(){return this.getIndex()}set siblingIndex(e){var t;(t=this._parent)==null||t.moveChild(this,e)}get previousSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[this.getIndex()-1]}get nextSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[this.getIndex()+1]}get firstSibling(){var e;return(e=this._parent)==null?void 0:e.getChildren()[0]}get lastSibling(){var t;const e=(t=this._parent)==null?void 0:t.getChildren();return e?e[e.length-1]:void 0}hasMeta(e){return this._meta.has(e)}getMeta(e,t){return this._meta.get(e)??t}setMeta(e,t){this._meta.set(e,t)}deleteMeta(e){this._meta.delete(e)}clearMeta(){this._meta.clear()}canProcess(){var e;if(!this._tree)return!1;switch(this.processMode){case"inherit":return((e=this._parent)==null?void 0:e.canProcess())??!0;case"pausable":return!this._tree.paused;case"when_paused":return this._tree.paused;case"always":return!0;case"disabled":default:return!1}}canRender(){var e;if(!this._tree)return!1;switch(this.renderMode){case"inherit":return((e=this._parent)==null?void 0:e.canRender())??!0;case"always":return!0;case"disabled":default:return!1}}_onTreeEnter(e){this._treeEnter(e),this.emit("treeEntered",e)}_onTreeExit(e){this.emit("treeExiting",e),this._treeExit(e),this.emit("treeExited",e)}_onParented(e){this._parented(e)}_onUnparented(e){this._unparented(e)}_onReady(){this._ready()}_onProcess(e=0){const t=this._tree,i=this.canRender(),s=this.canProcess();s&&(t==null||t.emit("nodeProcessing",this),this.emit("processing",e),this._process(e));let n;if(i){const o=t.renderStack.push(this);n=t.renderStack.currentCall,t.renderStack.currentCall=o}if(this.mask instanceof f.Node)this.getNode("__$mask")||(this.mask.processMode="disabled",this.appendChild(this.mask,"front"));else{const o=this.getNode("__$mask");o&&this.removeChild(o)}for(let o=this._children.length,a=0;a<o;a++)this._children[a].emit("process",e);i&&(t.renderStack.currentCall=n),s&&(this.emit("processed",e),t==null||t.emit("nodeProcessed",this))}render(e,t){const i=this.mask;i&&(e.flush(),e.mask.push(this,i)),this._render(e),t==null||t(),i&&(e.flush(),e.mask.pop(this))}input(e,t){for(let i=this._children.length-1;i>=0;i--)this._children[i].input(e,t);this._input(e,t)}getChildren(e=!1){switch(e){case!0:return this._children;case!1:return this._children.filter(t=>t.internalMode==="default");default:return this._children.filter(t=>t.internalMode===e)}}getIndex(e=!1){var t;return((t=this._parent)==null?void 0:t.getChildren(e).indexOf(this))??0}getNode(e){return this._children.find(t=>t.name===e)}removeNode(e){var t;(t=this.getNode(e))==null||t.remove()}addSibling(e){return this.is(e)||!this.hasParent()||e.hasParent()?this:(e.internalMode=this.internalMode,this._parent.moveChild(e,this.getIndex(!0)+1),this)}append(...e){let t;Array.isArray(e[0])?t=e[0]:t=e,t.forEach(i=>{this.appendChild(i)})}appendChild(e,t=e.internalMode){if(this.is(e)||e.hasParent())return e;switch(t){case"default":case"front":{const i=t==="default"?"back":"front",s=this._children.findIndex(n=>n.internalMode===i);s>-1?this._children.splice(s,0,e):this._children.push(e);break}case"back":this._children.push(e);break}return e.internalMode=t,e.setParent(this),this.emit("appendChild",e),e}moveChild(e,t,i=e.internalMode){if(this.is(e)||e.hasParent()&&!this.is(e.parent))return this;e.internalMode=i;const s=this._children.indexOf(e);let n=this._children.findIndex(l=>{switch(i){case"default":return l.internalMode!=="front";case"back":return l.internalMode==="back";case"front":default:return!0}});n=n>-1?n:Math.max(0,this._children.length-1);let o=this._children.slice(n).findIndex(l=>{switch(i){case"front":return l.internalMode!=="front";case"default":return l.internalMode==="back";case"back":default:return!1}});o=o>-1?n+o:Math.max(0,this._children.length);const a=_t(n,t>-1?t:o,o);return a!==s&&(s>-1&&this._children.splice(s,1),e.setParent(this),a>-1&&a<this._children.length?this._children.splice(a,0,e):this._children.push(e),s>-1?this.emit("moveChild",e,a,s):this.emit("appendChild",e)),this}removeChild(e){const t=e.getIndex(!0);return this.is(e.parent)&&t>-1&&(this._children.splice(t,1),e.setParent(void 0),this.emit("removeChild",e,t)),e}removeChildren(){this.getChildren().forEach(e=>this.removeChild(e))}remove(){var e;(e=this._parent)==null||e.removeChild(this)}forEach(e){return this.getChildren().forEach(e),this}deepForEach(e){return this.getChildren().forEach(t=>{e(t),t.deepForEach(e)}),this}is(e){return!!(e&&this.instanceId===e.instanceId)}_ready(){}_treeEnter(e){}_treeExit(e){}_parented(e){}_unparented(e){}_process(e){}_input(e,t){}_render(e){}toJSON(){return{tag:this.tag,props:super.toJSON(),children:this.getChildren().map(e=>e.toJSON())}}static parse(e){if(Array.isArray(e))return e.map(a=>this.parse(a));const{tag:t,props:i,children:s}=e,n=Yi.get(t)??f.Node,o=new n(i);return s==null||s.forEach(a=>o.appendChild(this.parse(a))),o}},OA([_()],f.Node.prototype,"name",2),OA([_()],f.Node.prototype,"mask",2),OA([_({default:"inherit"})],f.Node.prototype,"processMode",2),OA([_({default:"inherit"})],f.Node.prototype,"renderMode",2),OA([_({default:"default"})],f.Node.prototype,"internalMode",2),f.Node=OA([ae("Node")],f.Node);var ic=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,sr=(r,A,e,t)=>{for(var i=t>1?void 0:t?rc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&ic(A,e,i),i};f.TimelineNode=class extends f.Node{constructor(e,t=[]){super();g(this,"computedDuration",0);g(this,"_currentTime",0);g(this,"_startTime",0);this.setProperties(e).append(t)}get timeline(){var e;return(e=this._tree)==null?void 0:e.timeline}get timelineCurrentTime(){var e;return((e=this.timeline)==null?void 0:e.currentTime)??0}get parentStartTime(){var e;return((e=this._parent)==null?void 0:e.startTime)??0}get currentTime(){return _t(0,this._currentTime,this.computedDuration)}get startTime(){return this._startTime}set startTime(e){this.delay=e-this.parentStartTime,this._updateCurrentTime(!0)}get endTime(){return this._startTime+this.computedDuration}get currentTimeProgress(){return this.computedDuration?_t(0,this._currentTime/this.computedDuration,1):0}isInsideTimeRange(){const e=this._currentTime;return this.computedDuration?e>=0&&e<=this.computedDuration:e>=0}_updateCurrentTime(e=!1){if(e||!this.paused){const t=this._parent;this._startTime=this.delay+this.parentStartTime,this.computedDuration=t!=null&&t.computedDuration?Math.min(this._startTime+this.duration,t.endTime)-this._startTime:this.duration,this._currentTime=this.timelineCurrentTime-this._startTime,this.emit("updateCurrentTime",this._currentTime)}}_process(e){this._updateCurrentTime(),super._process(e)}},sr([_({default:0})],f.TimelineNode.prototype,"delay",2),sr([_({default:0})],f.TimelineNode.prototype,"duration",2),sr([_({default:!1})],f.TimelineNode.prototype,"paused",2),f.TimelineNode=sr([ae("TimelineNode")],f.TimelineNode);var sc=Object.defineProperty,nc=Object.getOwnPropertyDescriptor,Bi=(r,A,e,t)=>{for(var i=t>1?void 0:t?nc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&sc(A,e,i),i};f.Viewport=class extends f.Node{constructor(e=!1){super();g(this,"_projection",new uo);g(this,"_framebufferIndex",0);g(this,"_framebuffers",[{texture:new ks,needsUpload:!1},{texture:new ks,needsUpload:!1}]);this.flipY=e,this._projection.flipY(e)}get valid(){return!!(this.width&&this.height)}get framebuffer(){return this._framebuffers[this._framebufferIndex]}get texture(){return this.framebuffer.texture}_glFramebufferOptions(e){const{width:t,height:i}=this,{pixelRatio:s}=e;return this._framebuffers.forEach(n=>{const o=n.texture;o.pixelRatio=s,o.width=t,o.height=i,o.upload(e)}),{width:t,height:i,colorTextures:[this.texture._glTexture(e)]}}_glFramebuffer(e){return e.getRelated(this.framebuffer,()=>e.framebuffer.create(this._glFramebufferOptions(e)))}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"x":case"y":this.requestUpload(),this._projection.translate(this.x,this.y),this.emit("updateRect");break;case"width":case"height":this.requestUpload(),this._projection.resize(this.width,this.height),this.emit("updateRect");break}}requestUpload(){this._framebuffers.forEach(e=>e.needsUpload=!0)}resize(e,t){this.width=e,this.height=t}upload(e){const t=this.framebuffer;return t.needsUpload&&this.valid?(t.needsUpload=!1,e.framebuffer.update(this._glFramebuffer(e),this._glFramebufferOptions(e)),!0):!1}activate(e){var t;return this.valid?(e.flush(),(t=this._tree)==null||t.setCurrentViewport(this),e.framebuffer.bind(this._glFramebuffer(e)),this.upload(e),!0):!1}redraw(e,t){if(this.valid){e.flush();const i=this.framebuffer.texture;return this._framebufferIndex=(this._framebufferIndex+1)%this._framebuffers.length,this.activate(e),e.clear(),i.activate(e,0),t(),!0}return!1}activateWithCopy(e,t){this.resize(t.width,t.height),this.activate(e)&&(e.clear(),t.texture.activate(e,0),Ie.draw(e,LA.instance,{sampler:0}))}render(e,t){var s,n;const i=(s=this._tree)==null?void 0:s.getCurrentViewport();this.activate(e),e.clear(),super.render(e,t),e.flush(),i?i.activate(e):(e.framebuffer.bind(null),(n=this._tree)==null||n.setCurrentViewport(void 0))}getRect(){return new hi(this.x,this.y,this.width,this.height)}toProjectionArray(e=!1){return this._projection.toArray(e)}},Bi([_({default:0})],f.Viewport.prototype,"x",2),Bi([_({default:0})],f.Viewport.prototype,"y",2),Bi([_({default:0})],f.Viewport.prototype,"width",2),Bi([_({default:0})],f.Viewport.prototype,"height",2),f.Viewport=Bi([ae("Viewport")],f.Viewport);var oc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,Ei=(r,A,e,t)=>{for(var i=t>1?void 0:t?ac(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&oc(A,e,i),i};f.Effect=class extends f.TimelineNode{constructor(e,t=[]){super();g(this,"viewport1",new f.Viewport);g(this,"viewport2",new f.Viewport);g(this,"_renderId",0);g(this,"_renderViewport");g(this,"_previousSibling");g(this,"_nextSibling");this._onProcessing=this._onProcessing.bind(this),this._onNodeProcessed=this._onNodeProcessed.bind(this),this.setProperties(e).append(t)}get _effectMode(){return this.effectMode??"parent"}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"glsl":{const n=new rr(t);!this.effectMode&&n.has.transition&&(this.effectMode="transition"),this.material=n;break}case"glslSrc":{t?Ot.text.load(t).then(n=>this.glsl=n):this.glsl="";break}}}_treeEnter(e){e.on("processing",this._onProcessing),e.on("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(e),this.viewport2.setTree(e)}_treeExit(e){e.off("processing",this._onProcessing),e.off("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(void 0),this.viewport2.setTree(void 0)}_onProcessing(){switch(this._updateCurrentTime(),this._effectMode){case"transition":this._previousSibling=this.previousSibling,this._nextSibling=this.nextSibling;break;default:this._previousSibling=void 0,this._nextSibling=void 0;break}}_onNodeProcessed(e){var i;if(!this.isInsideTimeRange())return;const t=(i=this._tree)==null?void 0:i.renderStack;if(t)switch(this._effectMode){case"transition":e.is(this._previousSibling)?(this._previousSibling=void 0,t.push(this)):e.is(this._nextSibling)&&(this._nextSibling=void 0,t.push(this));break}}_processParent(){var o,a;const e=(o=this._tree)==null?void 0:o.renderStack;if(!e)return;const t=(a=e.currentCall)==null?void 0:a.parentCall;if(!t)return;const i=t.calls;let s,n;i.forEach((l,h)=>{var c;(l.renderable.is(this._parent)||(c=l.renderable.parent)!=null&&c.is(this._parent))&&(s=s??h,n=h)}),!(s===void 0||n===void 0)&&(i.splice(n+1,0,e.createCall(this)),i.splice(s,0,e.createCall(this)))}_processChildren(){var e;this._children.length&&(super.emit("process"),(e=this._tree)==null||e.renderStack.push(this))}_onProcess(e=0){if(this.canProcess())switch(this._renderId=0,this._effectMode){case"before":super._onProcess(e);break;case"parent":this._processParent();break;case"children":this._processChildren();break}}_renderBefore(e){var i;const t=(i=this._tree)==null?void 0:i.getCurrentViewport();t&&this.apply(e,t,{redraw:!0})}_renderTransition(e){var t;if(this._renderId%2===0)this._renderViewport=(t=this._tree)==null?void 0:t.getCurrentViewport(),this._renderViewport&&(this.viewport1.activateWithCopy(e,this._renderViewport),this.viewport2.resize(this._renderViewport.width,this._renderViewport.height)),this.viewport2.activate(e),e.clear();else{const i=this._renderViewport;this._renderViewport=void 0,i&&(i.activate(e),e.clear(),this.viewport1.texture.activate(e,0),this.viewport2.texture.activate(e,1),this.apply(e,i,{from:this.viewport1,to:this.viewport2}),e.texture.unbind(0),e.texture.unbind(1))}}_renderParentOrChildren(e){var t;if(this._renderId%2===0)this._renderViewport=(t=this._tree)==null?void 0:t.getCurrentViewport(),this._renderViewport&&this.viewport1.resize(this._renderViewport.width,this._renderViewport.height),this.viewport1.activate(e),e.clear();else{const i=this._renderViewport;this._renderViewport=void 0,i&&(this.viewport1.activate(e),this.apply(e,this.viewport1,{redraw:!0,target:this._effectMode==="parent"?this._parent??void 0:void 0,targetArea:this._parseTargetArea()}),i.activate(e),this.viewport1.texture.activate(e,0),Ie.draw(e))}}_parseTargetArea(){if(this._effectMode==="parent"&&this._parent&&"getRect"in this._parent){const e=this._parent.getRect();if(e)return[e.left/this.viewport1.width,e.top/this.viewport1.height,e.width/this.viewport1.width,e.height/this.viewport1.height]}}_render(e){switch(this._effectMode){case"before":this._renderBefore(e);break;case"transition":this._renderTransition(e);break;case"parent":case"children":default:this._renderParentOrChildren(e);break}this._renderId++}apply(e,t,i){this.material&&(i!=null&&i.redraw?t.redraw(e,()=>{Ie.draw(e,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:t.width/t.height})}):Ie.draw(e,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:i!=null&&i.from?i.from.width/i.from.height:0}))}},Ei([Me()],f.Effect.prototype,"material",2),Ei([_()],f.Effect.prototype,"effectMode",2),Ei([_({default:""})],f.Effect.prototype,"glsl",2),Ei([_({default:""})],f.Effect.prototype,"glslSrc",2),f.Effect=Ei([ae("Effect")],f.Effect);var ca=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,hc=(r,A,e)=>A in r?ca(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Ns=(r,A,e,t)=>{for(var i=t>1?void 0:t?lc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&ca(A,e,i),i},ua=(r,A,e)=>hc(r,typeof A!="symbol"?A+"":A,e);const gc=`attribute vec2 position;
106
106
  attribute vec2 uv;
107
107
  varying vec2 vUv[9];
108
108
  uniform float strength;
@@ -118,7 +118,7 @@ void main(void) {
118
118
  vUv[6] = uv + vec2(2.0 * strength, 0.0);
119
119
  vUv[7] = uv + vec2(3.0 * strength, 0.0);
120
120
  vUv[8] = uv + vec2(4.0 * strength, 0.0);
121
- }`,Uc=`attribute vec2 position;
121
+ }`,cc=`attribute vec2 position;
122
122
  attribute vec2 uv;
123
123
  uniform float strength;
124
124
  varying vec2 vUv[9];
@@ -134,7 +134,7 @@ void main(void) {
134
134
  vUv[6] = uv + vec2(0.0, 2.0 * strength);
135
135
  vUv[7] = uv + vec2(0.0, 3.0 * strength);
136
136
  vUv[8] = uv + vec2(0.0, 4.0 * strength);
137
- }`,Zo=`varying vec2 vUv[9];
137
+ }`,fa=`varying vec2 vUv[9];
138
138
  uniform sampler2D sampler;
139
139
 
140
140
  void main(void) {
@@ -168,7 +168,7 @@ void main(void) {
168
168
  gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;
169
169
  gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;
170
170
  }
171
- }`;d.BlurEffect=class extends d.Effect{apply(r,e){e.redraw(r,()=>{J.draw(r,d.BlurEffect.materialX,{sampler:0,strength:1/e.width*this.strength/this.quality})}),e.redraw(r,()=>{J.draw(r,d.BlurEffect.materialY,{sampler:0,strength:1/e.height*this.strength/this.quality})})}},Yo(d.BlurEffect,"materialX",new se({vert:Oc,frag:Zo})),Yo(d.BlurEffect,"materialY",new se({vert:Uc,frag:Zo})),Os([M({default:8})],d.BlurEffect.prototype,"strength",2),Os([M({default:4})],d.BlurEffect.prototype,"quality",2),d.BlurEffect=Os([j("BlurEffect")],d.BlurEffect);var Ko=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,Dc=(n,r,e)=>r in n?Ko(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,bt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ic(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ko(r,e,i),i},Rc=(n,r,e)=>Dc(n,r+"",e);d.ColorAdjustEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"saturation",1);u(this,"contrast",1);u(this,"brightness",1);u(this,"red",1);u(this,"green",1);u(this,"blue",1);u(this,"alpha",1);u(this,"gamma",1)}apply(e,t){t.redraw(e,()=>{J.draw(e,d.ColorAdjustEffect.material,{sampler:0,saturation:this.saturation,contrast:this.contrast,brightness:this.brightness,red:this.red,green:this.green,blue:this.blue,alpha:this.alpha,gamma:Math.max(this.gamma??1,1e-4)})})}},Rc(d.ColorAdjustEffect,"material",new se({vert:`precision mediump float;
171
+ }`;f.BlurEffect=class extends f.Effect{apply(A,e){e.redraw(A,()=>{Ie.draw(A,f.BlurEffect.materialX,{sampler:0,strength:1/e.width*this.strength/this.quality})}),e.redraw(A,()=>{Ie.draw(A,f.BlurEffect.materialY,{sampler:0,strength:1/e.height*this.strength/this.quality})})}},ua(f.BlurEffect,"materialX",new we({vert:gc,frag:fa})),ua(f.BlurEffect,"materialY",new we({vert:cc,frag:fa})),Ns([_({default:8})],f.BlurEffect.prototype,"strength",2),Ns([_({default:4})],f.BlurEffect.prototype,"quality",2),f.BlurEffect=Ns([ae("BlurEffect")],f.BlurEffect);var da=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,fc=(r,A,e)=>A in r?da(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Xt=(r,A,e,t)=>{for(var i=t>1?void 0:t?uc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&da(A,e,i),i},dc=(r,A,e)=>fc(r,A+"",e);f.ColorAdjustEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"saturation",1);g(this,"contrast",1);g(this,"brightness",1);g(this,"red",1);g(this,"green",1);g(this,"blue",1);g(this,"alpha",1);g(this,"gamma",1)}apply(e,t){t.redraw(e,()=>{Ie.draw(e,f.ColorAdjustEffect.material,{sampler:0,saturation:this.saturation,contrast:this.contrast,brightness:this.brightness,red:this.red,green:this.green,blue:this.blue,alpha:this.alpha,gamma:Math.max(this.gamma??1,1e-4)})})}},dc(f.ColorAdjustEffect,"material",new we({vert:`precision mediump float;
172
172
  attribute vec2 position;
173
173
  attribute vec2 uv;
174
174
  varying vec2 vUv;
@@ -199,7 +199,7 @@ void main(void) {
199
199
  c.rgb *= c.a;
200
200
  }
201
201
  gl_FragColor = c * alpha;
202
- }`})),bt([M()],d.ColorAdjustEffect.prototype,"saturation",2),bt([M()],d.ColorAdjustEffect.prototype,"contrast",2),bt([M()],d.ColorAdjustEffect.prototype,"brightness",2),bt([M()],d.ColorAdjustEffect.prototype,"red",2),bt([M()],d.ColorAdjustEffect.prototype,"green",2),bt([M()],d.ColorAdjustEffect.prototype,"blue",2),bt([M()],d.ColorAdjustEffect.prototype,"alpha",2),bt([M()],d.ColorAdjustEffect.prototype,"gamma",2),d.ColorAdjustEffect=bt([j("ColorAdjustEffect")],d.ColorAdjustEffect);var Jo=Object.defineProperty,Bc=Object.getOwnPropertyDescriptor,kc=(n,r,e)=>r in n?Jo(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Qo=(n,r,e,t)=>{for(var i=t>1?void 0:t?Bc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Jo(r,e,i),i},Lc=(n,r,e)=>kc(n,r+"",e);d.ColorFilterEffect=class extends d.Effect{constructor(e){super();u(this,"_colorMatrix",new us);this.setProperties(e)}apply(e,t){if(!this.filter)return;const i=yr(this.filter),s=this._colorMatrix.identity();i.forEach(({name:o,args:a})=>{const l=a.map(h=>h.normalizedIntValue);switch(o){case"hue-rotate":case"hueRotate":s.hueRotate(l[0]*le);break;case"saturate":s.saturate(l[0]);break;case"brightness":s.brightness(l[0]);break;case"contrast":s.contrast(l[0]);break;case"invert":s.invert(l[0]);break;case"sepia":s.sepia(l[0]);break;case"opacity":s.opacity(l[0]);break;case"grayscale":s.grayscale(l[0]);break}}),t.redraw(e,()=>{J.draw(e,d.ColorFilterEffect.material,{sampler:0,m:s.toArray()})})}},Lc(d.ColorFilterEffect,"material",new se({vert:`precision mediump float;
202
+ }`})),Xt([_()],f.ColorAdjustEffect.prototype,"saturation",2),Xt([_()],f.ColorAdjustEffect.prototype,"contrast",2),Xt([_()],f.ColorAdjustEffect.prototype,"brightness",2),Xt([_()],f.ColorAdjustEffect.prototype,"red",2),Xt([_()],f.ColorAdjustEffect.prototype,"green",2),Xt([_()],f.ColorAdjustEffect.prototype,"blue",2),Xt([_()],f.ColorAdjustEffect.prototype,"alpha",2),Xt([_()],f.ColorAdjustEffect.prototype,"gamma",2),f.ColorAdjustEffect=Xt([ae("ColorAdjustEffect")],f.ColorAdjustEffect);var Ia=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,Bc=(r,A,e)=>A in r?Ia(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Ba=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ic(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ia(A,e,i),i},Ec=(r,A,e)=>Bc(r,A+"",e);f.ColorFilterEffect=class extends f.Effect{constructor(e){super();g(this,"_colorMatrix",new qi);this.setProperties(e)}apply(e,t){if(!this.filter)return;const i=IA(this.filter),s=this._colorMatrix.identity();i.forEach(({name:n,args:o})=>{const a=o.map(l=>l.normalizedIntValue);switch(n){case"hue-rotate":case"hueRotate":s.hueRotate(a[0]*Ce);break;case"saturate":s.saturate(a[0]);break;case"brightness":s.brightness(a[0]);break;case"contrast":s.contrast(a[0]);break;case"invert":s.invert(a[0]);break;case"sepia":s.sepia(a[0]);break;case"opacity":s.opacity(a[0]);break;case"grayscale":s.grayscale(a[0]);break}}),t.redraw(e,()=>{Ie.draw(e,f.ColorFilterEffect.material,{sampler:0,m:s.toArray()})})}},Ec(f.ColorFilterEffect,"material",new we({vert:`precision mediump float;
203
203
  attribute vec2 position;
204
204
  attribute vec2 uv;
205
205
  varying vec2 vUv;
@@ -222,7 +222,7 @@ void main(void) {
222
222
  m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,
223
223
  m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0
224
224
  );
225
- }`})),Qo([M({default:""})],d.ColorFilterEffect.prototype,"filter",2),d.ColorFilterEffect=Qo([j("ColorFilterEffect")],d.ColorFilterEffect);var ea=Object.defineProperty,Nc=Object.getOwnPropertyDescriptor,Fc=(n,r,e)=>r in n?ea(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Us=(n,r,e,t)=>{for(var i=t>1?void 0:t?Nc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ea(r,e,i),i},$c=(n,r,e)=>Fc(n,r+"",e);const Or=50;d.ColorOverlayEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"colors",[]);u(this,"alpha",.5);u(this,"_color",new Ct)}apply(e,t){t.redraw(e,()=>{const i=this.colors.map(s=>{this._color.value=s;const o=this._color.toArray();return o[3]=this.alpha,o});for(;i.length<Or;)i.push([0,0,0,0]);J.draw(e,d.ColorOverlayEffect.material,{sampler:0,colors:i.slice(0,Or).flatMap(s=>s)})})}},$c(d.ColorOverlayEffect,"material",new se({vert:`precision mediump float;
225
+ }`})),Ba([_({default:""})],f.ColorFilterEffect.prototype,"filter",2),f.ColorFilterEffect=Ba([ae("ColorFilterEffect")],f.ColorFilterEffect);var Ea=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,Cc=(r,A,e)=>A in r?Ea(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Fs=(r,A,e,t)=>{for(var i=t>1?void 0:t?pc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ea(A,e,i),i},Qc=(r,A,e)=>Cc(r,A+"",e);const pi=50;f.ColorOverlayEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"colors",[]);g(this,"alpha",.5);g(this,"_color",new Rt)}apply(e,t){t.redraw(e,()=>{const i=this.colors.map(s=>{this._color.value=s;const n=this._color.toArray();return n[3]=this.alpha,n});for(;i.length<pi;)i.push([0,0,0,0]);Ie.draw(e,f.ColorOverlayEffect.material,{sampler:0,colors:i.slice(0,pi).flatMap(s=>s)})})}},Qc(f.ColorOverlayEffect,"material",new we({vert:`precision mediump float;
226
226
  attribute vec2 position;
227
227
  attribute vec2 uv;
228
228
  varying vec2 vUv;
@@ -231,7 +231,7 @@ void main() {
231
231
  vUv = uv;
232
232
  }`,frag:`precision mediump float;
233
233
  uniform sampler2D sampler;
234
- uniform vec4 colors[${Or}];
234
+ uniform vec4 colors[${pi}];
235
235
  varying vec2 vUv;
236
236
 
237
237
  float calcWidth() {
@@ -240,7 +240,7 @@ float calcWidth() {
240
240
 
241
241
  int calcCount() {
242
242
  int count = 0;
243
- for (int i = 0; i < ${Or}; i++) {
243
+ for (int i = 0; i < ${pi}; i++) {
244
244
  if (colors[i] != vec4(0,0,0,0)){
245
245
  count++;
246
246
  }
@@ -252,7 +252,7 @@ vec4 calcColor(float x) {
252
252
  float perUnit = calcWidth() / float(calcCount());
253
253
  int index = int(x / perUnit);
254
254
 
255
- for(int i=0; i<${Or}; i++){
255
+ for(int i=0; i<${pi}; i++){
256
256
  if(i==index){
257
257
  return colors[i];
258
258
  }
@@ -265,7 +265,7 @@ void main(void) {
265
265
  vec4 color = texture2D(sampler, vUv);
266
266
  vec4 mask = calcColor(vUv.x);
267
267
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
268
- }`})),Us([M()],d.ColorOverlayEffect.prototype,"colors",2),Us([M()],d.ColorOverlayEffect.prototype,"alpha",2),d.ColorOverlayEffect=Us([j("ColorOverlayEffect")],d.ColorOverlayEffect);var ta=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,Vc=(n,r,e)=>r in n?ta(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Is=(n,r,e,t)=>{for(var i=t>1?void 0:t?zc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ta(r,e,i),i},jc=(n,r,e)=>Vc(n,r+"",e);d.ColorRemoveEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"colors",[]);u(this,"epsilon",.5);u(this,"_color",new Ct)}apply(e,t){const s=new Float32Array(150),o=this.colors.map(a=>(this._color.value=a,this._color.toArray().slice(0,3)));for(;o.length<50;)o.push([-1,0,0]);o.slice(0,50).forEach((a,l)=>{s[l*3]=a[0],s[l*3+1]=a[1],s[l*3+2]=a[2]}),t.redraw(e,()=>{J.draw(e,d.ColorRemoveEffect.material,{sampler:0,epsilon:this.epsilon,originalColors:s})})}},jc(d.ColorRemoveEffect,"material",new se({vert:`precision mediump float;
268
+ }`})),Fs([_()],f.ColorOverlayEffect.prototype,"colors",2),Fs([_()],f.ColorOverlayEffect.prototype,"alpha",2),f.ColorOverlayEffect=Fs([ae("ColorOverlayEffect")],f.ColorOverlayEffect);var pa=Object.defineProperty,yc=Object.getOwnPropertyDescriptor,mc=(r,A,e)=>A in r?pa(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Ts=(r,A,e,t)=>{for(var i=t>1?void 0:t?yc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&pa(A,e,i),i},wc=(r,A,e)=>mc(r,A+"",e);f.ColorRemoveEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"colors",[]);g(this,"epsilon",.5);g(this,"_color",new Rt)}apply(e,t){const s=new Float32Array(150),n=this.colors.map(o=>(this._color.value=o,this._color.toArray().slice(0,3)));for(;n.length<50;)n.push([-1,0,0]);n.slice(0,50).forEach((o,a)=>{s[a*3]=o[0],s[a*3+1]=o[1],s[a*3+2]=o[2]}),t.redraw(e,()=>{Ie.draw(e,f.ColorRemoveEffect.material,{sampler:0,epsilon:this.epsilon,originalColors:s})})}},wc(f.ColorRemoveEffect,"material",new we({vert:`precision mediump float;
269
269
  attribute vec2 position;
270
270
  attribute vec2 uv;
271
271
  varying vec2 vUv;
@@ -294,7 +294,7 @@ void main(void) {
294
294
  }
295
295
 
296
296
  gl_FragColor = color;
297
- }`})),Is([M()],d.ColorRemoveEffect.prototype,"colors",2),Is([M()],d.ColorRemoveEffect.prototype,"epsilon",2),d.ColorRemoveEffect=Is([j("ColorRemoveEffect")],d.ColorRemoveEffect);var ra=Object.defineProperty,Gc=Object.getOwnPropertyDescriptor,qc=(n,r,e)=>r in n?ra(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Ds=(n,r,e,t)=>{for(var i=t>1?void 0:t?Gc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ra(r,e,i),i},Wc=(n,r,e)=>qc(n,r+"",e);const Ur=50;d.ColorReplaceEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"colors",[]);u(this,"epsilon",.05);u(this,"_color",new Ct)}apply(e,t){const i=this.colors.map(l=>{this._color.value=l[0];const h=this._color.toArray().slice(0,3);this._color.value=l[1];const c=this._color.toArray().slice(0,3);return[h,c]}),s=this.epsilon,o=new Float32Array(Ur*3),a=new Float32Array(Ur*3);for(;i.length<Ur;)i.push([[-1,0,0],[0,0,0,1]]);i.slice(0,Ur).forEach(([l,h],c)=>{o[c*3]=l[0],o[c*3+1]=l[1],o[c*3+2]=l[2],a[c*3]=h[0],a[c*3+1]=h[1],a[c*3+2]=h[2]}),t.redraw(e,()=>{J.draw(e,d.ColorReplaceEffect.material,{sampler:0,epsilon:s,originalColors:o,targetColors:a})})}},Wc(d.ColorReplaceEffect,"material",new se({vert:`precision mediump float;
297
+ }`})),Ts([_()],f.ColorRemoveEffect.prototype,"colors",2),Ts([_()],f.ColorRemoveEffect.prototype,"epsilon",2),f.ColorRemoveEffect=Ts([ae("ColorRemoveEffect")],f.ColorRemoveEffect);var Ca=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,vc=(r,A,e)=>A in r?Ca(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Ls=(r,A,e,t)=>{for(var i=t>1?void 0:t?_c(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ca(A,e,i),i},bc=(r,A,e)=>vc(r,A+"",e);const Ci=50;f.ColorReplaceEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"colors",[]);g(this,"epsilon",.05);g(this,"_color",new Rt)}apply(e,t){const i=this.colors.map(a=>{this._color.value=a[0];const l=this._color.toArray().slice(0,3);this._color.value=a[1];const h=this._color.toArray().slice(0,3);return[l,h]}),s=this.epsilon,n=new Float32Array(Ci*3),o=new Float32Array(Ci*3);for(;i.length<Ci;)i.push([[-1,0,0],[0,0,0,1]]);i.slice(0,Ci).forEach(([a,l],h)=>{n[h*3]=a[0],n[h*3+1]=a[1],n[h*3+2]=a[2],o[h*3]=l[0],o[h*3+1]=l[1],o[h*3+2]=l[2]}),t.redraw(e,()=>{Ie.draw(e,f.ColorReplaceEffect.material,{sampler:0,epsilon:s,originalColors:n,targetColors:o})})}},bc(f.ColorReplaceEffect,"material",new we({vert:`precision mediump float;
298
298
  attribute vec2 position;
299
299
  attribute vec2 uv;
300
300
  varying vec2 vUv;
@@ -304,7 +304,7 @@ void main() {
304
304
  }`,frag:`varying vec2 vUv;
305
305
  uniform sampler2D sampler;
306
306
  uniform float epsilon;
307
- const int MAX_COLORS = ${Ur};
307
+ const int MAX_COLORS = ${Ci};
308
308
  uniform vec3 originalColors[MAX_COLORS];
309
309
  uniform vec3 targetColors[MAX_COLORS];
310
310
 
@@ -330,7 +330,7 @@ void main(void) {
330
330
  return;
331
331
  }
332
332
  }
333
- }`})),Ds([M()],d.ColorReplaceEffect.prototype,"colors",2),Ds([M()],d.ColorReplaceEffect.prototype,"epsilon",2),d.ColorReplaceEffect=Ds([j("ColorReplaceEffect")],d.ColorReplaceEffect);var ia=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,Hc=(n,r,e)=>r in n?ia(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,sa=(n,r,e,t)=>{for(var i=t>1?void 0:t?Xc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ia(r,e,i),i},Yc=(n,r,e)=>Hc(n,r+"",e);d.EmbossEffect=class extends d.Effect{constructor(e=5){super();u(this,"strength");this.strength=e}apply(e,t){t.redraw(e,()=>{J.draw(e,d.EmbossEffect.material,{sampler:0,strength:this.strength,inputSize:[t.width,t.height,1/t.width,1/t.height]})})}},Yc(d.EmbossEffect,"material",new se({vert:`precision mediump float;
333
+ }`})),Ls([_()],f.ColorReplaceEffect.prototype,"colors",2),Ls([_()],f.ColorReplaceEffect.prototype,"epsilon",2),f.ColorReplaceEffect=Ls([ae("ColorReplaceEffect")],f.ColorReplaceEffect);var Qa=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,xc=(r,A,e)=>A in r?Qa(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,ya=(r,A,e,t)=>{for(var i=t>1?void 0:t?Dc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Qa(A,e,i),i},Sc=(r,A,e)=>xc(r,A+"",e);f.EmbossEffect=class extends f.Effect{constructor(e=5){super();g(this,"strength");this.strength=e}apply(e,t){t.redraw(e,()=>{Ie.draw(e,f.EmbossEffect.material,{sampler:0,strength:this.strength,inputSize:[t.width,t.height,1/t.width,1/t.height]})})}},Sc(f.EmbossEffect,"material",new we({vert:`precision mediump float;
334
334
  attribute vec2 position;
335
335
  attribute vec2 uv;
336
336
  varying vec2 vUv;
@@ -352,7 +352,7 @@ void main(void) {
352
352
  color.rgb = vec3((color.r + color.g + color.b) / 3.0);
353
353
  float alpha = texture2D(sampler, vUv).a;
354
354
  gl_FragColor = vec4(color.rgb * alpha, alpha);
355
- }`})),sa([M()],d.EmbossEffect.prototype,"strength",2),d.EmbossEffect=sa([j("EmbossEffect")],d.EmbossEffect);var na=Object.defineProperty,Zc=Object.getOwnPropertyDescriptor,Kc=(n,r,e)=>r in n?na(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,ct=(n,r,e,t)=>{for(var i=t>1?void 0:t?Zc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&na(r,e,i),i},Jc=(n,r,e)=>Kc(n,r+"",e);d.GlitchEffect=class extends d.Effect{constructor(){super();u(this,"_canvas");u(this,"_texture");u(this,"_sizes");u(this,"_offsets");u(this,"_redraw",!1);u(this,"slices",10);u(this,"sampleSize",512);u(this,"offset",100);u(this,"direction",0);u(this,"fillMode",2);u(this,"seed",0);u(this,"red",[2,2]);u(this,"green",[-10,4]);u(this,"blue",[10,-4]);this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this._texture=new ge(this._canvas),this._sizes=new Float32Array(this.slices),this._offsets=new Float32Array(this.slices)}redraw(){const e=this.sampleSize,t=this._texture,i=this._canvas.getContext("2d");i.clearRect(0,0,8,e);let s,o=0;for(let a=0;a<this.slices;a++){s=Math.floor(this._offsets[a]*256);const l=this._sizes[a]*e,h=s>0?s:0,c=s<0?-s:0;i.fillStyle=`rgba(${h}, ${c}, 0, 1)`,i.fillRect(0,o>>0,e,l+1>>0),o+=l}t.requestUpload()}apply(e,t){this._redraw||(this._redraw=!0,this.redraw());const i=t.width,s=t.height,o=this.direction*(Math.PI/180),a=Math.sin(o),l=Math.cos(o);t.redraw(e,()=>{this._texture.activate(e,1),J.draw(e,d.GlitchEffect.material,{sampler:0,filterClamp:[0,0,1,1],filterArea:[i,s,0,0],dimensions:[i,s],aspect:s/i,displacementMap:1,offset:this.offset,sinDir:a,cosDir:l,fillMode:this.fillMode,seed:this.seed,red:this.red,green:this.green,blue:this.blue})})}},Jc(d.GlitchEffect,"material",new se({vert:`precision mediump float;
355
+ }`})),ya([_()],f.EmbossEffect.prototype,"strength",2),f.EmbossEffect=ya([ae("EmbossEffect")],f.EmbossEffect);var ma=Object.defineProperty,Mc=Object.getOwnPropertyDescriptor,Rc=(r,A,e)=>A in r?ma(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Nt=(r,A,e,t)=>{for(var i=t>1?void 0:t?Mc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&ma(A,e,i),i},Uc=(r,A,e)=>Rc(r,A+"",e);f.GlitchEffect=class extends f.Effect{constructor(){super();g(this,"_canvas");g(this,"_texture");g(this,"_sizes");g(this,"_offsets");g(this,"_redraw",!1);g(this,"slices",10);g(this,"sampleSize",512);g(this,"offset",100);g(this,"direction",0);g(this,"fillMode",2);g(this,"seed",0);g(this,"red",[2,2]);g(this,"green",[-10,4]);g(this,"blue",[10,-4]);this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this._texture=new Ne(this._canvas),this._sizes=new Float32Array(this.slices),this._offsets=new Float32Array(this.slices)}redraw(){const e=this.sampleSize,t=this._texture,i=this._canvas.getContext("2d");i.clearRect(0,0,8,e);let s,n=0;for(let o=0;o<this.slices;o++){s=Math.floor(this._offsets[o]*256);const a=this._sizes[o]*e,l=s>0?s:0,h=s<0?-s:0;i.fillStyle=`rgba(${l}, ${h}, 0, 1)`,i.fillRect(0,n>>0,e,a+1>>0),n+=a}t.requestUpload()}apply(e,t){this._redraw||(this._redraw=!0,this.redraw());const i=t.width,s=t.height,n=this.direction*(Math.PI/180),o=Math.sin(n),a=Math.cos(n);t.redraw(e,()=>{this._texture.activate(e,1),Ie.draw(e,f.GlitchEffect.material,{sampler:0,filterClamp:[0,0,1,1],filterArea:[i,s,0,0],dimensions:[i,s],aspect:s/i,displacementMap:1,offset:this.offset,sinDir:o,cosDir:a,fillMode:this.fillMode,seed:this.seed,red:this.red,green:this.green,blue:this.blue})})}},Uc(f.GlitchEffect,"material",new we({vert:`precision mediump float;
356
356
  attribute vec2 position;
357
357
  attribute vec2 uv;
358
358
  varying vec2 vUv;
@@ -453,7 +453,7 @@ void main(void) {
453
453
  gl_FragColor.g = texture2D(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;
454
454
  gl_FragColor.b = texture2D(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;
455
455
  gl_FragColor.a = texture2D(sampler, coord).a;
456
- }`})),ct([M()],d.GlitchEffect.prototype,"slices",2),ct([M()],d.GlitchEffect.prototype,"sampleSize",2),ct([M()],d.GlitchEffect.prototype,"offset",2),ct([M()],d.GlitchEffect.prototype,"direction",2),ct([M()],d.GlitchEffect.prototype,"fillMode",2),ct([M()],d.GlitchEffect.prototype,"seed",2),ct([M()],d.GlitchEffect.prototype,"red",2),ct([M()],d.GlitchEffect.prototype,"green",2),ct([M()],d.GlitchEffect.prototype,"blue",2),d.GlitchEffect=ct([j("GlitchEffect")],d.GlitchEffect);var oa=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,eu=(n,r,e)=>r in n?oa(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,$t=(n,r,e,t)=>{for(var i=t>1?void 0:t?Qc(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&oa(r,e,i),i},tu=(n,r,e)=>eu(n,r+"",e);d.GodrayEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"angle",30);u(this,"gain",.5);u(this,"lacunarity",2.5);u(this,"parallel",!0);u(this,"center",[0,0]);u(this,"alpha",1)}apply(e,t){const i=this.angle*(Math.PI/180),s=this.parallel?[Math.cos(i),Math.sin(i)]:this.center;t.redraw(e,()=>{J.draw(e,d.GodrayEffect.material,{sampler:0,inputSize:[t.width,t.height,0,0],gain:this.gain,lacunarity:this.lacunarity,parallel:this.parallel,alpha:this.alpha,light:s,aspect:t.height/t.width})})}},tu(d.GodrayEffect,"material",new se({vert:`precision mediump float;
456
+ }`})),Nt([_()],f.GlitchEffect.prototype,"slices",2),Nt([_()],f.GlitchEffect.prototype,"sampleSize",2),Nt([_()],f.GlitchEffect.prototype,"offset",2),Nt([_()],f.GlitchEffect.prototype,"direction",2),Nt([_()],f.GlitchEffect.prototype,"fillMode",2),Nt([_()],f.GlitchEffect.prototype,"seed",2),Nt([_()],f.GlitchEffect.prototype,"red",2),Nt([_()],f.GlitchEffect.prototype,"green",2),Nt([_()],f.GlitchEffect.prototype,"blue",2),f.GlitchEffect=Nt([ae("GlitchEffect")],f.GlitchEffect);var wa=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,Pc=(r,A,e)=>A in r?wa(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,yA=(r,A,e,t)=>{for(var i=t>1?void 0:t?kc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&wa(A,e,i),i},Nc=(r,A,e)=>Pc(r,A+"",e);f.GodrayEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"angle",30);g(this,"gain",.5);g(this,"lacunarity",2.5);g(this,"parallel",!0);g(this,"center",[0,0]);g(this,"alpha",1)}apply(e,t){const i=this.angle*(Math.PI/180),s=this.parallel?[Math.cos(i),Math.sin(i)]:this.center;t.redraw(e,()=>{Ie.draw(e,f.GodrayEffect.material,{sampler:0,inputSize:[t.width,t.height,0,0],gain:this.gain,lacunarity:this.lacunarity,parallel:this.parallel,alpha:this.alpha,light:s,aspect:t.height/t.width})})}},Nc(f.GodrayEffect,"material",new we({vert:`precision mediump float;
457
457
  attribute vec2 position;
458
458
  attribute vec2 uv;
459
459
  varying vec2 vUv;
@@ -583,7 +583,7 @@ void main(void) {
583
583
  mist.a = 1.0;
584
584
  mist *= alpha;
585
585
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
586
- }`})),$t([M()],d.GodrayEffect.prototype,"angle",2),$t([M()],d.GodrayEffect.prototype,"gain",2),$t([M()],d.GodrayEffect.prototype,"lacunarity",2),$t([M()],d.GodrayEffect.prototype,"parallel",2),$t([M()],d.GodrayEffect.prototype,"center",2),$t([M()],d.GodrayEffect.prototype,"alpha",2),d.GodrayEffect=$t([j("GodrayEffect")],d.GodrayEffect);var aa=Object.defineProperty,ru=Object.getOwnPropertyDescriptor,iu=(n,r,e)=>r in n?aa(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Rs=(n,r,e,t)=>{for(var i=t>1?void 0:t?ru(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&aa(r,e,i),i},su=(n,r,e)=>iu(n,r+"",e);d.MaskEffect=class extends d.Effect{constructor(e,t=[]){super();u(this,"texture");this.setProperties(e).append(t)}async load(){this.texture=void 0,this.src&&(this.texture=await Pt.texture.load(this.src))}_updateProperty(e,t,i,s){var o;switch(super._updateProperty(e,t,i,s),e){case"src":this.load();break;case"texture":(o=i==null?void 0:i.destroy)==null||o.call(i);break}}apply(e,t,i){this.texture&&i.targetArea&&t.redraw(e,()=>{this.texture.activate(e,1),J.draw(e,d.MaskEffect.material,{sampler:0,mask:1,area:i.targetArea}),e.texture.unbind(1)})}},su(d.MaskEffect,"material",new se({vert:`precision mediump float;
586
+ }`})),yA([_()],f.GodrayEffect.prototype,"angle",2),yA([_()],f.GodrayEffect.prototype,"gain",2),yA([_()],f.GodrayEffect.prototype,"lacunarity",2),yA([_()],f.GodrayEffect.prototype,"parallel",2),yA([_()],f.GodrayEffect.prototype,"center",2),yA([_()],f.GodrayEffect.prototype,"alpha",2),f.GodrayEffect=yA([ae("GodrayEffect")],f.GodrayEffect);var _a=Object.defineProperty,Fc=Object.getOwnPropertyDescriptor,Tc=(r,A,e)=>A in r?_a(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Gs=(r,A,e,t)=>{for(var i=t>1?void 0:t?Fc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&_a(A,e,i),i},Lc=(r,A,e)=>Tc(r,A+"",e);f.MaskEffect=class extends f.Effect{constructor(e,t=[]){super();g(this,"texture");this.setProperties(e).append(t)}async load(){this.texture=void 0,this.src&&(this.texture=await Ot.texture.load(this.src))}_updateProperty(e,t,i,s){var n;switch(super._updateProperty(e,t,i,s),e){case"src":this.load();break;case"texture":(n=i==null?void 0:i.destroy)==null||n.call(i);break}}apply(e,t,i){this.texture&&i.targetArea&&t.redraw(e,()=>{this.texture.activate(e,1),Ie.draw(e,f.MaskEffect.material,{sampler:0,mask:1,area:i.targetArea}),e.texture.unbind(1)})}},Lc(f.MaskEffect,"material",new we({vert:`precision mediump float;
587
587
  attribute vec2 position;
588
588
  attribute vec2 uv;
589
589
  varying vec2 vUv;
@@ -612,7 +612,7 @@ void main(void) {
612
612
  } else {
613
613
  gl_FragColor = vec4(0.);
614
614
  }
615
- }`})),Rs([ue()],d.MaskEffect.prototype,"texture",2),Rs([M({default:""})],d.MaskEffect.prototype,"src",2),d.MaskEffect=Rs([j("MaskEffect")],d.MaskEffect);var la=Object.defineProperty,nu=Object.getOwnPropertyDescriptor,ou=(n,r,e)=>r in n?la(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,ha=(n,r,e,t)=>{for(var i=t>1?void 0:t?nu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&la(r,e,i),i},au=(n,r,e)=>ou(n,r+"",e);d.PixelateEffect=class extends d.Effect{constructor(e=10){super();u(this,"size");this.size=e}apply(e,t){t.redraw(e,()=>{J.draw(e,d.PixelateEffect.material,{sampler:0,size:[this.size,this.size],filterArea:[t.width,t.height,0,0]})})}},au(d.PixelateEffect,"material",new se({vert:`precision mediump float;
615
+ }`})),Gs([Me()],f.MaskEffect.prototype,"texture",2),Gs([_({default:""})],f.MaskEffect.prototype,"src",2),f.MaskEffect=Gs([ae("MaskEffect")],f.MaskEffect);var va=Object.defineProperty,Gc=Object.getOwnPropertyDescriptor,Oc=(r,A,e)=>A in r?va(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,ba=(r,A,e,t)=>{for(var i=t>1?void 0:t?Gc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&va(A,e,i),i},Hc=(r,A,e)=>Oc(r,A+"",e);f.PixelateEffect=class extends f.Effect{constructor(e=10){super();g(this,"size");this.size=e}apply(e,t){t.redraw(e,()=>{Ie.draw(e,f.PixelateEffect.material,{sampler:0,size:[this.size,this.size],filterArea:[t.width,t.height,0,0]})})}},Hc(f.PixelateEffect,"material",new we({vert:`precision mediump float;
616
616
  attribute vec2 position;
617
617
  attribute vec2 uv;
618
618
  varying vec2 vUv;
@@ -645,7 +645,7 @@ void main(void) {
645
645
  coord = pixelate(coord, size);
646
646
  coord = unmapCoord(coord);
647
647
  gl_FragColor = texture2D(sampler, coord);
648
- }`})),ha([M()],d.PixelateEffect.prototype,"size",2),d.PixelateEffect=ha([j("PixelateEffect")],d.PixelateEffect);var ca=Object.defineProperty,lu=Object.getOwnPropertyDescriptor,hu=(n,r,e)=>r in n?ca(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,cu=(n,r,e,t)=>{for(var i=t>1?void 0:t?lu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ca(r,e,i),i},uu=(n,r,e)=>hu(n,r+"",e);d.ShadowEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"blur",new d.BlurEffect);u(this,"viewport3",new d.Viewport)}apply(e,t){this.viewport3.activateWithCopy(e,t),this.viewport3.redraw(e,()=>{J.draw(e,d.ShadowEffect.material,{sampler:0,offset:[.001,.001],color:[0,0,0],alpha:.5})}),this.blur.apply(e,this.viewport3),t.redraw(e,()=>{this.viewport3.texture.activate(e,1),J.draw(e,ir.instance,{sampler:1}),J.draw(e,ir.instance,{sampler:0}),e.texture.unbind(1)})}},uu(d.ShadowEffect,"material",new se({vert:`precision mediump float;
648
+ }`})),ba([_()],f.PixelateEffect.prototype,"size",2),f.PixelateEffect=ba([ae("PixelateEffect")],f.PixelateEffect);var Da=Object.defineProperty,Jc=Object.getOwnPropertyDescriptor,Kc=(r,A,e)=>A in r?Da(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Yc=(r,A,e,t)=>{for(var i=t>1?void 0:t?Jc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Da(A,e,i),i},Wc=(r,A,e)=>Kc(r,A+"",e);f.ShadowEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"blur",new f.BlurEffect);g(this,"viewport3",new f.Viewport)}apply(e,t){this.viewport3.activateWithCopy(e,t),this.viewport3.redraw(e,()=>{Ie.draw(e,f.ShadowEffect.material,{sampler:0,offset:[.001,.001],color:[0,0,0],alpha:.5})}),this.blur.apply(e,this.viewport3),t.redraw(e,()=>{this.viewport3.texture.activate(e,1),Ie.draw(e,LA.instance,{sampler:1}),Ie.draw(e,LA.instance,{sampler:0}),e.texture.unbind(1)})}},Wc(f.ShadowEffect,"material",new we({vert:`precision mediump float;
649
649
  attribute vec2 position;
650
650
  attribute vec2 uv;
651
651
  varying vec2 vUv;
@@ -664,7 +664,7 @@ void main(void) {
664
664
  sample.rgb = color.rgb * sample.a;
665
665
  sample *= alpha;
666
666
  gl_FragColor = sample;
667
- }`})),d.ShadowEffect=cu([j("ShadowEffect")],d.ShadowEffect);var ua=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,du=(n,r,e)=>r in n?ua(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,Ir=(n,r,e,t)=>{for(var i=t>1?void 0:t?fu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ua(r,e,i),i},pu=(n,r,e)=>du(n,r+"",e);d.ZoomBlurEffect=class extends d.Effect{constructor(){super(...arguments);u(this,"center");u(this,"innerRadius",20);u(this,"radius",-1);u(this,"strength",.1)}apply(e,t){t.redraw(e,()=>{J.draw(e,d.ZoomBlurEffect.material,{sampler:0,center:this.center??[t.width/2,t.height/2],innerRadius:this.innerRadius,radius:this.radius,strength:this.strength,inputSize:[t.width,t.height,1/t.width,1/t.height]})})}},pu(d.ZoomBlurEffect,"material",new se({vert:`attribute vec2 position;
667
+ }`})),f.ShadowEffect=Yc([ae("ShadowEffect")],f.ShadowEffect);var xa=Object.defineProperty,Vc=Object.getOwnPropertyDescriptor,Xc=(r,A,e)=>A in r?xa(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Qi=(r,A,e,t)=>{for(var i=t>1?void 0:t?Vc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&xa(A,e,i),i},qc=(r,A,e)=>Xc(r,A+"",e);f.ZoomBlurEffect=class extends f.Effect{constructor(){super(...arguments);g(this,"center");g(this,"innerRadius",20);g(this,"radius",-1);g(this,"strength",.1)}apply(e,t){t.redraw(e,()=>{Ie.draw(e,f.ZoomBlurEffect.material,{sampler:0,center:this.center??[t.width/2,t.height/2],innerRadius:this.innerRadius,radius:this.radius,strength:this.strength,inputSize:[t.width,t.height,1/t.width,1/t.height]})})}},qc(f.ZoomBlurEffect,"material",new we({vert:`attribute vec2 position;
668
668
  attribute vec2 uv;
669
669
  varying vec2 vUv;
670
670
  void main() {
@@ -744,12 +744,13 @@ void main() {
744
744
  color /= total;
745
745
 
746
746
  gl_FragColor = color;
747
- }`})),Ir([M()],d.ZoomBlurEffect.prototype,"center",2),Ir([M()],d.ZoomBlurEffect.prototype,"innerRadius",2),Ir([M()],d.ZoomBlurEffect.prototype,"radius",2),Ir([M()],d.ZoomBlurEffect.prototype,"strength",2),d.ZoomBlurEffect=Ir([j("ZoomBlurEffect")],d.ZoomBlurEffect);var gu=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,Bs=(n,r,e,t)=>{for(var i=t>1?void 0:t?mu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&gu(r,e,i),i};d.CanvasItem=class extends d.TimelineNode{constructor(e,t=[]){super();u(this,"opacity",1);u(this,"visible",!0);u(this,"_parentOpacity");u(this,"_parentVisible");u(this,"_modulate",new Ct(4294967295));u(this,"_backgroundImage");u(this,"context",new Xo);u(this,"_resetContext",!0);u(this,"_redrawing",!1);u(this,"_reflowing",!1);u(this,"_repainting",!1);u(this,"_originalBatchables",[]);u(this,"_layoutedBatchables",[]);u(this,"_batchables",[]);this._updateStyleProperty=this._updateStyleProperty.bind(this),this.style=new ne,this.setProperties(e).append(t)}get style(){return this._style}set style(e){var i;const t=(...s)=>{this.emit("updateStyleProperty",...s),this._updateStyleProperty(s[0],s[1],s[2],s[3])};e.on("updateProperty",t),(i=this._style)==null||i.off("updateProperty",t),this._style=e}setProperties(e){if(e){const{style:t,...i}=e;t&&this.style.setProperties(t),super.setProperties(i)}return this}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"modulate":this._modulate.value=t,this.requestRepaint();break;case"blendMode":this.requestRepaint();break}}_updateStyleProperty(e,t,i,s){switch(e){case"backgroundColor":this._updateBackgroundColor();break;case"backgroundImage":this._updateBackgroundImage();break;case"opacity":this._updateOpacity();break;case"visibility":this._updateVisible();break;case"filter":this.requestRepaint();break;case"boxShadow":this._updateBoxShadow();break;case"maskImage":this._updateMaskImage();break;case"borderRadius":this.requestRedraw();break}}_updateBoxShadow(){const e="__$style.shadow";if(this.style.boxShadow!=="none")this.getNode(e)||this.addChild(new d.ShadowEffect,"back");else{const t=this.getNode(e);t&&this.removeChild(t)}}_updateMaskImage(){const e="__$style.maskImage",t=this.style.maskImage;if(t&&t!=="none"){const i=this.getNode(e);i?i.src=t:this.addChild(new d.MaskEffect({src:t}),"back")}else{const i=this.getNode(e);i&&this.removeChild(i)}}_updateBackgroundColor(){const e=this.style.getComputedBackgroundColor();this._originalBatchables.length?this.requestRepaint():e.a>0&&this.requestRedraw()}async _updateBackgroundImage(){this._backgroundImage=await this.style.loadBackgroundImage(),this.requestRedraw()}_updateOpacity(){var t;const e=this.style.getComputedOpacity()*(((t=this.getParent())==null?void 0:t.opacity)??1);this.opacity!==e&&(this.opacity=e,this.requestRepaint())}_updateCurrentTime(e=!1){super._updateCurrentTime(e),this._updateVisible()}_updateVisible(){var t;let e=this.style.visibility==="visible"&&(((t=this.getParent())==null?void 0:t.visible)??!0);e&&!this.isInsideTimeRange()&&(e=!1),this.visible=e}show(){this.style.visibility="visible"}hide(){this.style.visibility="hidden"}isVisibleInTree(){return this.opacity>0&&this.visible}canRender(){return super.canRender()&&this.isVisibleInTree()}requestRedraw(){this._redrawing=!0}requestReflow(){this._reflowing=!0}requestRepaint(){this._repainting=!0}_process(e){const t=this.getParent();this._parentVisible!==(t==null?void 0:t.visible)&&(this._parentVisible=t==null?void 0:t.visible,this._updateVisible()),this._parentOpacity!==(t==null?void 0:t.opacity)&&(this._parentOpacity=t==null?void 0:t.opacity,this._updateOpacity()),super._process(e)}_draw(){this._drawBackground(),this._drawContent(),this._drawBorder(),this._drawOutline()}_drawBackground(){const e=this._backgroundImage;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new et().scale(this.style.width/e.width,this.style.height/e.height),this._fillBoundingRect())}_drawContent(){this._fillBoundingRect()}_drawBorder(){this.style.borderWidth&&this.style.borderStyle!=="none"&&(this.context.lineWidth=this.style.borderWidth,this.context.strokeStyle=this.style.borderColor,this._strokeBoundingRect())}_drawOutline(){this.style.outlineWidth&&this.style.outlineColor!=="none"&&(this.context.lineWidth=this.style.outlineWidth,this.context.strokeStyle=this.style.outlineColor,this._strokeBoundingRect())}_drawBoundingRect(){const{borderRadius:e,width:t,height:i}=this.style;t&&i&&(e?this.context.roundRect(0,0,t,i,e):this.context.rect(0,0,t,i))}_fillBoundingRect(){this._drawBoundingRect(),this.context.fill()}_strokeBoundingRect(){this._drawBoundingRect(),this.context.stroke()}_relayout(e){return this._reflow(e)}_reflow(e){return this._repaint(e)}_repaint(e){const t=this.style.getComputedFilterColorMatrix();return e.map(i=>({...i,backgroundColor:this.style.getComputedBackgroundColor().abgr,modulate:this._modulate.toArgb(this.opacity,!0),colorMatrix:t.toMatrix4().toArray(!0),colorMatrixOffset:t.toVector4().toArray(),blendMode:this.blendMode}))}_render(e){let t;this._redrawing?(this.emit("draw"),this._draw(),this._originalBatchables=this.context.toBatchables(),this._layoutedBatchables=this._relayout(this._originalBatchables),t=this._layoutedBatchables,this._resetContext&&this.context.reset()):this._reflowing?(this._layoutedBatchables=this._reflow(this._originalBatchables),t=this._layoutedBatchables):this._repainting&&(t=this._repaint(this._layoutedBatchables)),t&&(this._batchables=t,this._redrawing=!1,this._reflowing=!1,this._repainting=!1),this._batchables.forEach(i=>{var s,o;(s=i.texture)==null||s.upload(e),e.batch2D.render({...i,texture:(o=i.texture)==null?void 0:o._glTexture(e)})}),super._render(e)}toJSON(){const e=super.toJSON();return{...e,props:{style:this.style.toJSON(),...e.props}}}},Bs([M()],d.CanvasItem.prototype,"modulate",2),Bs([M()],d.CanvasItem.prototype,"blendMode",2),d.CanvasItem=Bs([j("CanvasItem")],d.CanvasItem);class yu extends d.Node{constructor(){super(...arguments);u(this,"currentCall");u(this,"calls",[])}createCall(e){return{renderable:e,parentCall:this.currentCall,fn:e.render.bind(e),calls:[]}}push(e){var i;const t=this.createCall(e);return(((i=this.currentCall)==null?void 0:i.calls)??this.calls).push(t),t}render(e){this.calls.forEach(function t(i){i.fn(e,()=>{i.calls.forEach(t)})}),this.calls=[]}}var _u=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,Dr=(n,r,e,t)=>{for(var i=t>1?void 0:t?vu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&_u(r,e,i),i};d.Timeline=class extends d.Node{static from(r,e=!1){const[t,i]=r?Array.isArray(r)?r:[0,r]:[];return new d.Timeline({startTime:t,endTime:i,loop:e})}constructor(r){super(),this.setProperties(r)}_updateProperty(r,e,t){switch(super._updateProperty(r,e,t),r){case"startTime":this.startTime=Math.min(e,this.endTime);break;case"endTime":this.endTime=e||Number.MAX_SAFE_INTEGER;break}}addTime(r){const e=this.startTime,t=this.endTime;let i=this.currentTime;return i=i+r,this.loop&&i>t&&(i=e+i%t),i=at(e,i,t),this.currentTime=i,this.emit("updateCurrentTime",i,r),this}_process(r){super._process(r),this.addTime(r)}},Dr([M({default:0})],d.Timeline.prototype,"startTime",2),Dr([M({default:0})],d.Timeline.prototype,"currentTime",2),Dr([M({default:Number.MAX_SAFE_INTEGER})],d.Timeline.prototype,"endTime",2),Dr([M({default:!1})],d.Timeline.prototype,"loop",2),d.Timeline=Dr([j("Timeline")],d.Timeline);var bu=Object.defineProperty,fa=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&bu(r,e,i),i};class gi extends oi{constructor(e=new d.Timeline){super();u(this,"renderStack",new yu);u(this,"root",new d.Viewport(!0).setTree(this));u(this,"timeline");u(this,"_backgroundColor",new Ct);u(this,"_currentViewport");this.timeline=e.setTree(this)}getCurrentViewport(){return this._currentViewport}setCurrentViewport(e){this._currentViewport=e}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"backgroundColor":this._backgroundColor.value=t;break}}_render(e,t=0){return this.timeline.addTime(t),this.emit("processing"),this.root.emit("process",t),this.emit("processed"),e.program.uniforms.projectionMatrix=this.root.toProjectionArray(!0),this.renderStack.render(e),this._renderScreen(e),this}_renderScreen(e){e.state.reset();const{pixelRatio:t}=e,{width:i,height:s}=this.root;e.framebuffer.bind(null),e.viewport.bind({x:0,y:0,width:i*t,height:s*t}),this.backgroundColor&&e.gl.clearColor(...this._backgroundColor.toArray()),e.clear(),this.backgroundColor&&e.gl.clearColor(0,0,0,0);const o=this.root.texture;o.activate(e,0),J.draw(e),e.texture.unbind(o)}}fa([M({default:!1})],gi.prototype,"paused"),fa([M()],gi.prototype,"backgroundColor");var wu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,Pu=(n,r,e,t)=>{for(var i=t>1?void 0:t?xu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&wu(r,e,i),i};d.Transition=class extends d.Effect{constructor(r,e=[]){super(),this.setProperties(r).append(e)}},d.Transition=Pu([j("Transition",{effectMode:"transition",processMode:"pausable",duration:2e3})],d.Transition);var Cu=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,Su=(n,r,e,t)=>{for(var i=t>1?void 0:t?Tu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Cu(r,e,i),i};d.Node2D=class extends d.CanvasItem{constructor(e,t=[]){super();u(this,"transform",new et);u(this,"_parentTransformDirtyId");this.setProperties(e).append(t)}_updateStyleProperty(e,t,i){switch(super._updateStyleProperty(e,t,i),e){case"width":case"height":this.mask instanceof d.Node2D&&(this.mask.style.width=this.style.width,this.mask.style.height=this.style.height),this.requestRedraw();case"scaleX":case"scaleY":case"left":case"top":case"rotate":case"transform":case"transformOrigin":this._updateTransform();break;case"overflow":this._updateOverflow();break}}_updateTransform(){const e=this.getParent(),t=e==null?void 0:e.transform;this._parentTransformDirtyId=t==null?void 0:t.dirtyId;const i=this.style.getComputedTransform().toArray();let s;if(t){const o=t.toArray();s=[i[0]*o[0]+i[3]*o[1],i[1]*o[0]+i[4]*o[1],i[2]*o[0]+i[5]*o[1]+o[2],i[0]*o[3]+i[3]*o[4],i[1]*o[3]+i[4]*o[4],i[2]*o[3]+i[5]*o[4]+o[5],0,0,1]}else s=i;this.transform.set(s),this._updateOverflow(),this.requestReflow()}getRect(){const[e,t,i,s,o,a]=this.transform.toArray(),l=this.style.width,h=this.style.height;return new ni(i,a,e*l+t*h,s*l+o*h)}_updateOverflow(){if(this.style.overflow==="hidden"){const e=this.getRect();this.mask={x:e.x,y:e.y,width:e.width,height:e.height}}else this.mask=void 0}_transformVertices(e){const[t,i,s,o,a,l]=this.transform.toArray(),h=e.slice();for(let c=e.length,f=0;f<c;f+=2){const p=e[f],m=e[f+1];h[f]=t*p+i*m+s,h[f+1]=o*p+a*m+l}return h}_reflow(e){return super._reflow(e.map(t=>({...t,vertices:this._transformVertices(t.vertices)})))}_process(e){var i;const t=this.getParent();((i=t==null?void 0:t.transform)==null?void 0:i.dirtyId)!==this._parentTransformDirtyId&&this._updateTransform(),super._process(e)}_input(e,t){if(super._input(e,t),!e.target&&this.isVisibleInTree()&&this.style.canPointeEvents())switch(t){case"pointerdown":case"pointermove":case"pointerup":{const{screenX:i,screenY:s}=e;if(i&&s){const{width:o,height:a}=this.style,[l,h]=this.transform.inverse().applyToPoint(i,s);l>=0&&l<o&&h>=0&&h<a&&(e.target=this,this.emit(t,e))}break}}}clone(){return new this.constructor(this.toJSON(),this.getChildren(!0))}},d.Node2D=Su([j("Node2D")],d.Node2D);var Eu=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,me=(n,r,e,t)=>{for(var i=t>1?void 0:t?Mu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Eu(r,e,i),i};function ve(n){return function(r,e){Object.defineProperty(r.constructor.prototype,e,{get(){return n!=null&&n.method?(...t)=>(this.context[e].call(this.context,...t),n.redraw&&this.requestRedraw(),r):this.context[e]},set(t){this.context[e]=t},configurable:!0,enumerable:!0})}}d.Graphics2D=class extends d.Node2D{constructor(){super(...arguments);u(this,"_resetContext",!1);u(this,"lineCap");u(this,"lineJoin");u(this,"fillStyle");u(this,"strokeStyle");u(this,"lineWidth");u(this,"miterLimit")}drawCircle(e,t,i){return this.arc(e+i,t+i,i,0,le),this.fill(),this}drawEllipse(e,t,i,s){const o=i/2,a=s/2;return this.ellipse(e+o,t+a,o,a,0,0,le),this.fill(),this}},me([ve()],d.Graphics2D.prototype,"lineCap",2),me([ve()],d.Graphics2D.prototype,"lineJoin",2),me([ve()],d.Graphics2D.prototype,"fillStyle",2),me([ve()],d.Graphics2D.prototype,"strokeStyle",2),me([ve()],d.Graphics2D.prototype,"lineWidth",2),me([ve()],d.Graphics2D.prototype,"miterLimit",2),me([ve({method:!0})],d.Graphics2D.prototype,"rect",2),me([ve({method:!0,redraw:!0})],d.Graphics2D.prototype,"fillRect",2),me([ve({method:!0,redraw:!0})],d.Graphics2D.prototype,"strokeRect",2),me([ve({method:!0})],d.Graphics2D.prototype,"roundRect",2),me([ve({method:!0})],d.Graphics2D.prototype,"ellipse",2),me([ve({method:!0})],d.Graphics2D.prototype,"arc",2),me([ve({method:!0})],d.Graphics2D.prototype,"beginPath",2),me([ve({method:!0})],d.Graphics2D.prototype,"moveTo",2),me([ve({method:!0})],d.Graphics2D.prototype,"lineTo",2),me([ve({method:!0})],d.Graphics2D.prototype,"closePath",2),me([ve({method:!0,redraw:!0})],d.Graphics2D.prototype,"fill",2),me([ve({method:!0,redraw:!0})],d.Graphics2D.prototype,"stroke",2),d.Graphics2D=me([j("Graphics2D")],d.Graphics2D);class mi extends yt{constructor(e){super();u(this,"frames");let t;if(Array.isArray(e))t=e;else if(e instanceof ge)t=[{texture:e,duration:0}];else throw new TypeError("Failed new Image2DResource");this.frames=t,this.updateDuration()}updateDuration(){return this.duration=this.frames.reduce((e,t)=>t.duration+e,0),this}destroy(){this.frames.forEach(e=>{e.texture.destroy()})}}var Au=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,yi=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ou(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Au(r,e,i),i};d.Image2D=class extends d.Node2D{constructor(e,t=[]){super();u(this,"resource");u(this,"_frameIndex",0);u(this,"_complete",!1);u(this,"_wait",Promise.resolve());this.setProperties(e),this.append(t)}get currentTexture(){var e,t;return(t=(e=this.resource)==null?void 0:e.frames[this._frameIndex])==null?void 0:t.texture}get framesDuration(){var e;return((e=this.resource)==null?void 0:e.duration)??0}get naturalWidth(){var e;return((e=this.currentTexture)==null?void 0:e.realWidth)??0}get naturalHeight(){var e;return((e=this.currentTexture)==null?void 0:e.realHeight)??0}get complete(){return this._complete}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._wait=this._load(t);break}}decode(){return this._wait}setResource(e){let t;if(e instanceof mi?t=e:t=new mi(e),this.resource=t.updateDuration(),this.currentTexture&&(!this.style.width||!this.style.height)){const i=this.currentTexture;this.style.width=i.realWidth,this.style.height=i.realHeight}return this}async _load(e){if(this._complete=!1,e)try{this.setResource(this.gif?await Pt.gif.load(e):await Pt.texture.load(e)),this.requestRedraw(),this.emit("load")}catch(t){console.warn(t),this.emit("error",t)}else this.resource=void 0;this._complete=!0}_getFrameCurrentTime(){const e=this.framesDuration;if(!e||!this._tree)return 0;const t=this._currentTime;return t<0?0:t%e}_updateFrameIndex(){if(!this.resource)return this;const e=this._getFrameCurrentTime(),t=this.resource.frames,i=t.length;if(i<=1&&this._frameIndex===0)return this;let s=i-1;for(let o=0,a=0;a<i;a++)if(o+=t[a].duration??0,o>=e){s=a;break}return this._frameIndex!==s&&(this._frameIndex=s,this.requestRepaint()),this}_process(e){this._updateFrameIndex(),super._process(e)}_drawContent(){const e=this.currentTexture;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new et().scale(this.style.width/e.width,this.style.height/e.height),super._drawContent())}},yi([ue()],d.Image2D.prototype,"resource",2),yi([M({default:!1})],d.Image2D.prototype,"gif",2),yi([M({default:""})],d.Image2D.prototype,"src",2),d.Image2D=yi([j("Image2D")],d.Image2D);class _i extends d.Node2D{constructor(){super(...arguments);u(this,"texture")}_drawContent(){var e;(e=this.texture)!=null&&e.valid&&(this.context.fillStyle=this.texture,this.context.textureTransform=new et().scale(this.style.width/this.texture.width,this.style.height/this.texture.height),super._drawContent())}}var Uu=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,da=(n,r,e,t)=>{for(var i=t>1?void 0:t?Iu(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Uu(r,e,i),i};d.Lottie2D=class extends _i{constructor(e,t=[]){super();u(this,"texture",new Er);u(this,"animation");this.setProperties(e),this.append(t)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._load();break}}_updateStyleProperty(e,t,i){switch(super._updateStyleProperty(e,t,i),e){case"width":this.texture.width=this.style.width;break;case"height":this.texture.height=this.style.height;break}}async _load(){this.animation=await Pt.lottie.load(this.src,this.texture.source),this.duration=this.animation.getDuration(!1)*1e3,this.texture.requestUpload(),this.requestRedraw()}_process(e){var t;(t=this.animation)==null||t.goToAndStop(this.currentTime,!1),this.texture.requestUpload(),this.requestRepaint(),super._process(e)}},da([M({default:""})],d.Lottie2D.prototype,"src",2),d.Lottie2D=da([j("Lottie2D")],d.Lottie2D);var Ae=Uint8Array,Ge=Uint16Array,ks=Int32Array,vi=new Ae([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),bi=new Ae([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ls=new Ae([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pa=function(n,r){for(var e=new Ge(31),t=0;t<31;++t)e[t]=r+=1<<n[t-1];for(var i=new ks(e[30]),t=1;t<30;++t)for(var s=e[t];s<e[t+1];++s)i[s]=s-e[t]<<5|t;return{b:e,r:i}},ga=pa(vi,2),ma=ga.b,Ns=ga.r;ma[28]=258,Ns[258]=28;for(var ya=pa(bi,0),Du=ya.b,_a=ya.r,Fs=new Ge(32768),te=0;te<32768;++te){var Et=(te&43690)>>1|(te&21845)<<1;Et=(Et&52428)>>2|(Et&13107)<<2,Et=(Et&61680)>>4|(Et&3855)<<4,Fs[te]=((Et&65280)>>8|(Et&255)<<8)>>1}for(var ut=function(n,r,e){for(var t=n.length,i=0,s=new Ge(r);i<t;++i)n[i]&&++s[n[i]-1];var o=new Ge(r);for(i=1;i<r;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(e){a=new Ge(1<<r);var l=15-r;for(i=0;i<t;++i)if(n[i])for(var h=i<<4|n[i],c=r-n[i],f=o[n[i]-1]++<<c,p=f|(1<<c)-1;f<=p;++f)a[Fs[f]>>l]=h}else for(a=new Ge(t),i=0;i<t;++i)n[i]&&(a[i]=Fs[o[n[i]-1]++]>>15-n[i]);return a},Mt=new Ae(288),te=0;te<144;++te)Mt[te]=8;for(var te=144;te<256;++te)Mt[te]=9;for(var te=256;te<280;++te)Mt[te]=7;for(var te=280;te<288;++te)Mt[te]=8;for(var Rr=new Ae(32),te=0;te<32;++te)Rr[te]=5;var Ru=ut(Mt,9,0),Bu=ut(Mt,9,1),ku=ut(Rr,5,0),Lu=ut(Rr,5,1),$s=function(n){for(var r=n[0],e=1;e<n.length;++e)n[e]>r&&(r=n[e]);return r},tt=function(n,r,e){var t=r/8|0;return(n[t]|n[t+1]<<8)>>(r&7)&e},zs=function(n,r){var e=r/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(r&7)},Vs=function(n){return(n+7)/8|0},va=function(n,r,e){return(e==null||e>n.length)&&(e=n.length),new Ae(n.subarray(r,e))},Nu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],rt=function(n,r,e){var t=new Error(r||Nu[n]);if(t.code=n,Error.captureStackTrace&&Error.captureStackTrace(t,rt),!e)throw t;return t},Fu=function(n,r,e,t){var i=n.length,s=0;if(!i||r.f&&!r.l)return e||new Ae(0);var o=!e,a=o||r.i!=2,l=r.i;o&&(e=new Ae(i*3));var h=function(Ne){var ze=e.length;if(Ne>ze){var Ee=new Ae(Math.max(ze*2,Ne));Ee.set(e),e=Ee}},c=r.f||0,f=r.p||0,p=r.b||0,m=r.l,g=r.d,_=r.m,y=r.n,E=i*8;do{if(!m){c=tt(n,f,1);var T=tt(n,f+1,3);if(f+=3,T)if(T==1)m=Bu,g=Lu,_=9,y=5;else if(T==2){var v=tt(n,f,31)+257,x=tt(n,f+10,15)+4,C=v+tt(n,f+5,31)+1;f+=14;for(var I=new Ae(C),F=new Ae(19),B=0;B<x;++B)F[Ls[B]]=tt(n,f+B*3,7);f+=x*3;for(var U=$s(F),V=(1<<U)-1,A=ut(F,U,1),B=0;B<C;){var N=A[tt(n,f,V)];f+=N&15;var P=N>>4;if(P<16)I[B++]=P;else{var W=0,R=0;for(P==16?(R=3+tt(n,f,3),f+=2,W=I[B-1]):P==17?(R=3+tt(n,f,7),f+=3):P==18&&(R=11+tt(n,f,127),f+=7);R--;)I[B++]=W}}var D=I.subarray(0,v),G=I.subarray(v);_=$s(D),y=$s(G),m=ut(D,_,1),g=ut(G,y,1)}else rt(1);else{var P=Vs(f)+4,S=n[P-4]|n[P-3]<<8,w=P+S;if(w>i){l&&rt(0);break}a&&h(p+S),e.set(n.subarray(P,w),p),r.b=p+=S,r.p=f=w*8,r.f=c;continue}if(f>E){l&&rt(0);break}}a&&h(p+131072);for(var L=(1<<_)-1,k=(1<<y)-1,K=f;;K=f){var W=m[zs(n,f)&L],H=W>>4;if(f+=W&15,f>E){l&&rt(0);break}if(W||rt(2),H<256)e[p++]=H;else if(H==256){K=f,m=null;break}else{var X=H-254;if(H>264){var B=H-257,q=vi[B];X=tt(n,f,(1<<q)-1)+ma[B],f+=q}var ee=g[zs(n,f)&k],Y=ee>>4;ee||rt(3),f+=ee&15;var G=Du[Y];if(Y>3){var q=bi[Y];G+=zs(n,f)&(1<<q)-1,f+=q}if(f>E){l&&rt(0);break}a&&h(p+131072);var ae=p+X;if(p<G){var pt=s-G,Ke=Math.min(G,ae);for(pt+p<0&&rt(3);p<Ke;++p)e[p]=t[pt+p]}for(;p<ae;++p)e[p]=e[p-G]}}r.l=m,r.p=K,r.b=p,r.f=c,m&&(c=1,r.m=_,r.d=g,r.n=y)}while(!c);return p!=e.length&&o?va(e,0,p):e.subarray(0,p)},wt=function(n,r,e){e<<=r&7;var t=r/8|0;n[t]|=e,n[t+1]|=e>>8},Br=function(n,r,e){e<<=r&7;var t=r/8|0;n[t]|=e,n[t+1]|=e>>8,n[t+2]|=e>>16},js=function(n,r){for(var e=[],t=0;t<n.length;++t)n[t]&&e.push({s:t,f:n[t]});var i=e.length,s=e.slice();if(!i)return{t:Pa,l:0};if(i==1){var o=new Ae(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(w,v){return w.f-v.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],h=0,c=1,f=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=e[e[h].f<e[f].f?h++:f++],l=e[h!=c&&e[h].f<e[f].f?h++:f++],e[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=s[0].s,t=1;t<i;++t)s[t].s>p&&(p=s[t].s);var m=new Ge(p+1),g=Gs(e[c-1],m,0);if(g>r){var t=0,_=0,y=g-r,E=1<<y;for(s.sort(function(v,x){return m[x.s]-m[v.s]||v.f-x.f});t<i;++t){var T=s[t].s;if(m[T]>r)_+=E-(1<<g-m[T]),m[T]=r;else break}for(_>>=y;_>0;){var P=s[t].s;m[P]<r?_-=1<<r-m[P]++-1:++t}for(;t>=0&&_;--t){var S=s[t].s;m[S]==r&&(--m[S],++_)}g=r}return{t:new Ae(m),l:g}},Gs=function(n,r,e){return n.s==-1?Math.max(Gs(n.l,r,e+1),Gs(n.r,r,e+1)):r[n.s]=e},ba=function(n){for(var r=n.length;r&&!n[--r];);for(var e=new Ge(++r),t=0,i=n[0],s=1,o=function(l){e[t++]=l},a=1;a<=r;++a)if(n[a]==i&&a!=r)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=n[a]}return{c:e.subarray(0,t),n:r}},kr=function(n,r){for(var e=0,t=0;t<r.length;++t)e+=n[t]*r[t];return e},wa=function(n,r,e){var t=e.length,i=Vs(r+2);n[i]=t&255,n[i+1]=t>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var s=0;s<t;++s)n[i+s+4]=e[s];return(i+4+t)*8},xa=function(n,r,e,t,i,s,o,a,l,h,c){wt(r,c++,e),++i[256];for(var f=js(i,15),p=f.t,m=f.l,g=js(s,15),_=g.t,y=g.l,E=ba(p),T=E.c,P=E.n,S=ba(_),w=S.c,v=S.n,x=new Ge(19),C=0;C<T.length;++C)++x[T[C]&31];for(var C=0;C<w.length;++C)++x[w[C]&31];for(var I=js(x,7),F=I.t,B=I.l,U=19;U>4&&!F[Ls[U-1]];--U);var V=h+5<<3,A=kr(i,Mt)+kr(s,Rr)+o,N=kr(i,p)+kr(s,_)+o+14+3*U+kr(x,F)+2*x[16]+3*x[17]+7*x[18];if(l>=0&&V<=A&&V<=N)return wa(r,c,n.subarray(l,l+h));var W,R,D,G;if(wt(r,c,1+(N<A)),c+=2,N<A){W=ut(p,m,0),R=p,D=ut(_,y,0),G=_;var L=ut(F,B,0);wt(r,c,P-257),wt(r,c+5,v-1),wt(r,c+10,U-4),c+=14;for(var C=0;C<U;++C)wt(r,c+3*C,F[Ls[C]]);c+=3*U;for(var k=[T,w],K=0;K<2;++K)for(var H=k[K],C=0;C<H.length;++C){var X=H[C]&31;wt(r,c,L[X]),c+=F[X],X>15&&(wt(r,c,H[C]>>5&127),c+=H[C]>>12)}}else W=Ru,R=Mt,D=ku,G=Rr;for(var C=0;C<a;++C){var q=t[C];if(q>255){var X=q>>18&31;Br(r,c,W[X+257]),c+=R[X+257],X>7&&(wt(r,c,q>>23&31),c+=vi[X]);var ee=q&31;Br(r,c,D[ee]),c+=G[ee],ee>3&&(Br(r,c,q>>5&8191),c+=bi[ee])}else Br(r,c,W[q]),c+=R[q]}return Br(r,c,W[256]),c+R[256]},$u=new ks([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pa=new Ae(0),zu=function(n,r,e,t,i,s){var o=s.z||n.length,a=new Ae(t+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(t,a.length-i),h=s.l,c=(s.r||0)&7;if(r){c&&(l[0]=s.r>>3);for(var f=$u[r-1],p=f>>13,m=f&8191,g=(1<<e)-1,_=s.p||new Ge(32768),y=s.h||new Ge(g+1),E=Math.ceil(e/3),T=2*E,P=function(Ve){return(n[Ve]^n[Ve+1]<<E^n[Ve+2]<<T)&g},S=new ks(25e3),w=new Ge(288),v=new Ge(32),x=0,C=0,I=s.i||0,F=0,B=s.w||0,U=0;I+2<o;++I){var V=P(I),A=I&32767,N=y[V];if(_[A]=N,y[V]=A,B<=I){var W=o-I;if((x>7e3||F>24576)&&(W>423||!h)){c=xa(n,l,0,S,w,v,C,F,U,I-U,c),F=x=C=0,U=I;for(var R=0;R<286;++R)w[R]=0;for(var R=0;R<30;++R)v[R]=0}var D=2,G=0,L=m,k=A-N&32767;if(W>2&&V==P(I-k))for(var K=Math.min(p,W)-1,H=Math.min(32767,I),X=Math.min(258,W);k<=H&&--L&&A!=N;){if(n[I+D]==n[I+D-k]){for(var q=0;q<X&&n[I+q]==n[I+q-k];++q);if(q>D){if(D=q,G=k,q>K)break;for(var ee=Math.min(k,q-2),Y=0,R=0;R<ee;++R){var ae=I-k+R&32767,pt=_[ae],Ke=ae-pt&32767;Ke>Y&&(Y=Ke,N=ae)}}}A=N,N=_[A],k+=A-N&32767}if(G){S[F++]=268435456|Ns[D]<<18|_a[G];var Ne=Ns[D]&31,ze=_a[G]&31;C+=vi[Ne]+bi[ze],++w[257+Ne],++v[ze],B=I+D,++x}else S[F++]=n[I],++w[n[I]]}}for(I=Math.max(I,B);I<o;++I)S[F++]=n[I],++w[n[I]];c=xa(n,l,h,S,w,v,C,F,U,I-U,c),h||(s.r=c&7|l[c/8|0]<<3,c-=7,s.h=y,s.p=_,s.i=I,s.w=B)}else{for(var I=s.w||0;I<o+h;I+=65535){var Ee=I+65535;Ee>=o&&(l[c/8|0]=h,Ee=o),c=wa(l,c+1,n.subarray(I,Ee))}s.i=o}return va(a,0,t+Vs(c)+i)},Ca=function(){var n=1,r=0;return{p:function(e){for(var t=n,i=r,s=e.length|0,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=t+=e[o];t=(t&65535)+15*(t>>16),i=(i&65535)+15*(i>>16)}n=t,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|(n&65280)<<8|(r&255)<<8|r>>8}}},Vu=function(n,r,e,t,i){if(!i&&(i={l:1},r.dictionary)){var s=r.dictionary.subarray(-32768),o=new Ae(s.length+n.length);o.set(s),o.set(n,s.length),n=o,i.w=s.length}return zu(n,r.level==null?6:r.level,r.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+r.mem,e,t,i)},Ta=function(n,r,e){for(;e;++r)n[r]=e,e>>>=8},ju=function(n,r){var e=r.level,t=e==0?0:e<6?1:e==9?3:2;if(n[0]=120,n[1]=t<<6|(r.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,r.dictionary){var i=Ca();i.p(r.dictionary),Ta(n,2,i.d())}},Gu=function(n,r){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&rt(6,"invalid zlib data"),(n[1]>>5&1)==1&&rt(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function qu(n,r){r||(r={});var e=Ca();e.p(n);var t=Vu(n,r,r.dictionary?6:2,4);return ju(t,r),Ta(t,t.length-4,e.d()),t}function Wu(n,r){return Fu(n.subarray(Gu(n),-4),{i:2},r,r)}var Xu=typeof TextDecoder<"u"&&new TextDecoder,Hu=0;try{Xu.decode(Pa,{stream:!0}),Hu=1}catch{}const Yu="modern-font";function Lr(n,r){if(!n)throw new Error(`[${Yu}] ${r}`)}function Zu(n){if("buffer"in n){const r=n.buffer;return n.byteOffset>0||n.byteLength<n.buffer.byteLength?r.slice(n.byteOffset,n.byteOffset+n.byteLength):r}else return n}function or(n){return"buffer"in n?new DataView(n.buffer,n.byteOffset,n.byteLength):new DataView(n)}function Ku(n){let r="";for(let e=0,t=n.length,i;e<t;e++)i=n.charCodeAt(e),i!==0&&(r+=String.fromCharCode(i));return r}function wi(n){n=Ku(n);const r=[];for(let e=0,t=n.length,i;e<t;e++)i=n.charCodeAt(e),r.push(i>>8),r.push(i&255);return r}function Ju(n){let r="";for(let e=0,t=n.length;e<t;e++)n[e]<127?r+=String.fromCharCode(n[e]):r+=`%${(256+n[e]).toString(16).slice(1)}`;return unescape(r)}function Qu(n){let r="";for(let e=0,t=n.length;e<t;e+=2)r+=String.fromCharCode((n[e]<<8)+n[e+1]);return r}var ef=Object.defineProperty,Oe=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&ef(r,e,i),i};const Nr={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function Ue(){return function(n,r){Object.defineProperty(n.constructor.prototype,r,{get(){if(typeof r=="string"){if(r.startsWith("read"))return(...e)=>this.read(r.substring(4).toLowerCase(),...e);if(r.startsWith("write"))return(...e)=>this.write(r.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class be extends DataView{constructor(e,t,i,s){super(Zu(e),t,i);u(this,"cursor",0);this.littleEndian=s}readColumn(e){if(e.size){const t=Array.from({length:e.size},(i,s)=>this.read(e.type,e.offset+s));switch(e.type){case"char":return t.join("");default:return t}}else return this.read(e.type,e.offset)}writeColumn(e,t){e.size?Array.from({length:e.size},(i,s)=>{this.write(e.type,t[s],e.offset+s)}):this.write(e.type,t,e.offset)}read(e,t=this.cursor,i=this.littleEndian){var h;switch(e){case"char":return this.readChar(t);case"fixed":return this.readFixed(t,i);case"longDateTime":return this.readLongDateTime(t,i)}const s=`get${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,a=(h=o[s])==null?void 0:h.bind(o),l=a==null?void 0:a(t,i);return this.cursor+=Nr[e],l}readUint24(e=this.cursor){const[t,i,s]=this.readBytes(e,3);return(t<<16)+(i<<8)+s}readBytes(e,t){t==null&&(t=e,e=this.cursor);const i=[];for(let s=0;s<t;++s)i.push(this.getUint8(e+s));return this.cursor=e+t,i}readString(e,t){const i=this.readBytes(e,t);let s="";for(let o=0,a=i.length;o<a;o++)s+=String.fromCharCode(i[o]);return s}readFixed(e,t){const i=this.readInt32(e,t)/65536;return Math.ceil(i*1e5)/1e5}readLongDateTime(e=this.cursor,t){const i=this.readUint32(e+4,t),s=new Date;return s.setTime(i*1e3+-20775456e5),s}readChar(e){return this.readString(e,1)}write(e,t,i=this.cursor,s=this.littleEndian){var c;switch(e){case"char":return this.writeChar(t,i);case"fixed":return this.writeFixed(t,i);case"longDateTime":return this.writeLongDateTime(t,i)}const o=`set${e.replace(/^\S/,f=>f.toUpperCase())}`,a=this,l=(c=a[o])==null?void 0:c.bind(a),h=l==null?void 0:l(i,t,s);return this.cursor+=Nr[e.toLowerCase()],h}writeString(e="",t=this.cursor){const i=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let s=0,o=e.length,a;s<o;++s)a=e.charCodeAt(s)||0,a>127?this.writeUint16(a):this.writeUint8(a);return this.cursor+=i,this}writeChar(e,t){return this.writeString(e,t)}writeFixed(e,t){return this.writeInt32(Math.round(e*65536),t),this}writeLongDateTime(e,t=this.cursor){typeof e>"u"?e=-20775456e5:typeof e.getTime=="function"?e=e.getTime():/^\d+$/.test(e)?e=+e:e=Date.parse(e);const s=Math.round((e- -20775456e5)/1e3);return this.writeUint32(0,t),this.writeUint32(s,t+4),this}writeBytes(e,t=this.cursor){let i;if(Array.isArray(e)){i=e.length;for(let s=0;s<i;++s)this.setUint8(t+s,e[s])}else{const s=or(e);i=s.byteLength;for(let o=0;o<i;++o)this.setUint8(t+o,s.getUint8(o))}return this.cursor=t+i,this}seek(e){return this.cursor=e,this}}Oe([Ue()],be.prototype,"readInt8"),Oe([Ue()],be.prototype,"readInt16"),Oe([Ue()],be.prototype,"readInt32"),Oe([Ue()],be.prototype,"readUint8"),Oe([Ue()],be.prototype,"readUint16"),Oe([Ue()],be.prototype,"readUint32"),Oe([Ue()],be.prototype,"readFloat32"),Oe([Ue()],be.prototype,"readFloat64"),Oe([Ue()],be.prototype,"writeInt8"),Oe([Ue()],be.prototype,"writeInt16"),Oe([Ue()],be.prototype,"writeInt32"),Oe([Ue()],be.prototype,"writeUint8"),Oe([Ue()],be.prototype,"writeUint16"),Oe([Ue()],be.prototype,"writeUint32"),Oe([Ue()],be.prototype,"writeFloat32"),Oe([Ue()],be.prototype,"writeFloat64");const Sa=new WeakMap;function b(n){const r=typeof n=="object"?n:{type:n},{size:e=1,type:t}=r;return(i,s)=>{if(typeof s!="string")return;let o=Sa.get(i);o||(o={columns:[],byteLength:0},Sa.set(i,o));const a={...r,name:s,byteLength:e*Nr[t],offset:r.offset??o.columns.reduce((l,h)=>l+h.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,h)=>l+Nr[h.type]*(h.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class qe{constructor(r,e,t,i){u(this,"view");this.view=new be(r,e,t,i)}}class xi extends qe{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(r){return new FontFace(r,this.view.buffer)}}var tf=Object.defineProperty,Re=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&tf(r,e,i),i};const Be=class ul extends xi{constructor(){super(...arguments);u(this,"format","EmbeddedOpenType");u(this,"mimeType","application/vnd.ms-fontobject")}static from(e){const t=e.sfnt,s=t.name.names,o=wi(s.fontFamily||""),a=o.length,l=wi(s.fontStyle||""),h=l.length,c=wi(s.version||""),f=c.length,p=wi(s.fullName||""),m=p.length,g=86+a+4+h+4+f+4+m+2+e.view.byteLength,_=new ul(new ArrayBuffer(g),0,g,!0);_.EOTSize=_.view.byteLength,_.FontDataSize=e.view.byteLength,_.Version=131073,_.Flags=0,_.Charset=1,_.MagicNumber=20556,_.Padding1=0,_.CheckSumAdjustment=t.head.checkSumAdjustment;const y=t.os2;return y&&(_.FontPANOSE=y.fontPANOSE,_.Italic=y.fsSelection,_.Weight=y.usWeightClass,_.fsType=y.fsType,_.UnicodeRange=y.ulUnicodeRange,_.CodePageRange=y.ulCodePageRange),_.view.writeUint16(a),_.view.writeBytes(o),_.view.writeUint16(0),_.view.writeUint16(h),_.view.writeBytes(l),_.view.writeUint16(0),_.view.writeUint16(f),_.view.writeBytes(c),_.view.writeUint16(0),_.view.writeUint16(m),_.view.writeBytes(p),_.view.writeUint16(0),_.view.writeUint16(0),_.view.writeBytes(e.view),_}};Re([b("uint32")],Be.prototype,"EOTSize"),Re([b("uint32")],Be.prototype,"FontDataSize"),Re([b("uint32")],Be.prototype,"Version"),Re([b("uint32")],Be.prototype,"Flags"),Re([b({type:"uint8",size:10})],Be.prototype,"FontPANOSE"),Re([b("uint8")],Be.prototype,"Charset"),Re([b("uint8")],Be.prototype,"Italic"),Re([b("uint32")],Be.prototype,"Weight"),Re([b("uint16")],Be.prototype,"fsType"),Re([b("uint16")],Be.prototype,"MagicNumber"),Re([b({type:"uint8",size:16})],Be.prototype,"UnicodeRange"),Re([b({type:"uint8",size:8})],Be.prototype,"CodePageRange"),Re([b("uint32")],Be.prototype,"CheckSumAdjustment"),Re([b({type:"uint8",size:16})],Be.prototype,"Reserved"),Re([b("uint16")],Be.prototype,"Padding1");var rf=Object.defineProperty,Pi=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&rf(r,e,i),i};class ar extends qe{constructor(r,e){super(r,e,16)}}Pi([b({type:"char",size:4})],ar.prototype,"tag"),Pi([b("uint32")],ar.prototype,"checkSum"),Pi([b("uint32")],ar.prototype,"offset"),Pi([b("uint32")],ar.prototype,"length");const qs=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],sf=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Ws{constructor(r){u(this,"index");u(this,"name");u(this,"isComposite",!1);u(this,"components",[]);u(this,"pathCommands",[]);const e={...r};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(r=0,e=0,t=72,i={},s){const o=1/((s==null?void 0:s.unitsPerEm)??1e3)*t,{xScale:a=o,yScale:l=o}=i,h=this.pathCommands,c=[];for(let f=0,p=h.length;f<p;f+=1){const m=h[f];m.type==="M"?c.push({type:"M",x:r+m.x*a,y:e+-m.y*l}):m.type==="L"?c.push({type:"L",x:r+m.x*a,y:e+-m.y*l}):m.type==="Q"?c.push({type:"Q",x1:r+m.x1*a,y1:e+-m.y1*l,x:r+m.x*a,y:e+-m.y*l}):m.type==="C"?c.push({type:"C",x1:r+m.x1*a,y1:e+-m.y1*l,x2:r+m.x2*a,y2:e+-m.y2*l,x:r+m.x*a,y:e+-m.y*l}):m.type==="Z"&&c.push({type:"Z"})}return c}}class nf extends Ws{parse(r,e,t){const i=this,{nominalWidthX:s,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=r,h=r.topDict.paintType,c=this.index;let f,p,m,g;const _=[],y=[];let E=0,T=!1,P=!1,S=o,w=0,v=0;function x(A,N){_.push({type:"L",x:A,y:N})}function C(A,N,W,R,D,G){_.push({type:"C",x1:A,y1:N,x2:W,y2:R,x:D,y:G})}function I(A,N){P&&h!==2&&F(),P=!0,_.push({type:"M",x:A,y:N})}function F(){_.push({type:"Z"})}function B(A){_.push(...A)}function U(){y.length%2!==0&&!T&&(S=y.shift()+s),E+=y.length>>1,y.length=0,T=!0}function V(A){let N,W,R,D,G,L,k,K,H,X,q,ee,Y=0;for(;Y<A.length;){let ae=A[Y++];switch(ae){case 1:U();break;case 3:U();break;case 4:y.length>1&&!T&&(S=y.shift()+s,T=!0),v+=y.pop(),I(w,v);break;case 5:for(;y.length>0;)w+=y.shift(),v+=y.shift(),x(w,v);break;case 6:for(;y.length>0&&(w+=y.shift(),x(w,v),y.length!==0);)v+=y.shift(),x(w,v);break;case 7:for(;y.length>0&&(v+=y.shift(),x(w,v),y.length!==0);)w+=y.shift(),x(w,v);break;case 8:for(;y.length>0;)f=w+y.shift(),p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),w=m+y.shift(),v=g+y.shift(),C(f,p,m,g,w,v);break;case 10:G=y.pop()+l,L=r.subrs[G],L&&V(L);break;case 11:return;case 12:switch(ae=A[Y],Y+=1,ae){case 35:f=w+y.shift(),p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),k=m+y.shift(),K=g+y.shift(),H=k+y.shift(),X=K+y.shift(),q=H+y.shift(),ee=X+y.shift(),w=q+y.shift(),v=ee+y.shift(),y.shift(),C(f,p,m,g,k,K),C(H,X,q,ee,w,v);break;case 34:f=w+y.shift(),p=v,m=f+y.shift(),g=p+y.shift(),k=m+y.shift(),K=g,H=k+y.shift(),X=g,q=H+y.shift(),ee=v,w=q+y.shift(),C(f,p,m,g,k,K),C(H,X,q,ee,w,v);break;case 36:f=w+y.shift(),p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),k=m+y.shift(),K=g,H=k+y.shift(),X=g,q=H+y.shift(),ee=X+y.shift(),w=q+y.shift(),C(f,p,m,g,k,K),C(H,X,q,ee,w,v);break;case 37:f=w+y.shift(),p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),k=m+y.shift(),K=g+y.shift(),H=k+y.shift(),X=K+y.shift(),q=H+y.shift(),ee=X+y.shift(),Math.abs(q-w)>Math.abs(ee-v)?w=q+y.shift():v=ee+y.shift(),C(f,p,m,g,k,K),C(H,X,q,ee,w,v);break;default:console.warn(`Glyph ${c}: unknown operator ${1200+ae}`),y.length=0}break;case 14:if(y.length>=4){const pt=qs[y.pop()],Ke=qs[y.pop()],Ne=y.pop(),ze=y.pop();if(pt&&Ke){i.isComposite=!0,i.components=[];const Ee=r.charset.indexOf(pt),Ve=r.charset.indexOf(Ke);i.components.push({glyphIndex:Ve,dx:0,dy:0}),i.components.push({glyphIndex:Ee,dx:ze,dy:Ne}),B(t.get(Ve).pathCommands);const it=JSON.parse(JSON.stringify(t.get(Ee).pathCommands));for(let st=0;st<it.length;st+=1){const Je=it[st];Je.type!=="Z"&&(Je.x+=ze,Je.y+=Ne),(Je.type==="Q"||Je.type==="C")&&(Je.x1+=ze,Je.y1+=Ne),Je.type==="C"&&(Je.x2+=ze,Je.y2+=Ne)}B(it)}}else y.length>0&&!T&&(S=y.shift()+s,T=!0);P&&h!==2&&(F(),P=!1);break;case 18:U();break;case 19:case 20:U(),Y+=E+7>>3;break;case 21:y.length>2&&!T&&(S=y.shift()+s,T=!0),v+=y.pop(),w+=y.pop(),I(w,v);break;case 22:y.length>1&&!T&&(S=y.shift()+s,T=!0),w+=y.pop(),I(w,v);break;case 23:U();break;case 24:for(;y.length>2;)f=w+y.shift(),p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),w=m+y.shift(),v=g+y.shift(),C(f,p,m,g,w,v);w+=y.shift(),v+=y.shift(),x(w,v);break;case 25:for(;y.length>6;)w+=y.shift(),v+=y.shift(),x(w,v);f=w+y.shift(),p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),w=m+y.shift(),v=g+y.shift(),C(f,p,m,g,w,v);break;case 26:for(y.length%2&&(w+=y.shift());y.length>0;)f=w,p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),w=m,v=g+y.shift(),C(f,p,m,g,w,v);break;case 27:for(y.length%2&&(v+=y.shift());y.length>0;)f=w+y.shift(),p=v,m=f+y.shift(),g=p+y.shift(),w=m+y.shift(),v=g,C(f,p,m,g,w,v);break;case 28:N=A[Y],W=A[Y+1],y.push((N<<24|W<<16)>>16),Y+=2;break;case 29:G=y.pop()+a,L=r.gsubrs[G],L&&V(L);break;case 30:for(;y.length>0&&(f=w,p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),w=m+y.shift(),v=g+(y.length===1?y.shift():0),C(f,p,m,g,w,v),y.length!==0);)f=w+y.shift(),p=v,m=f+y.shift(),g=p+y.shift(),v=g+y.shift(),w=m+(y.length===1?y.shift():0),C(f,p,m,g,w,v);break;case 31:for(;y.length>0&&(f=w+y.shift(),p=v,m=f+y.shift(),g=p+y.shift(),v=g+y.shift(),w=m+(y.length===1?y.shift():0),C(f,p,m,g,w,v),y.length!==0);)f=w,p=v+y.shift(),m=f+y.shift(),g=p+y.shift(),w=m+y.shift(),v=g+(y.length===1?y.shift():0),C(f,p,m,g,w,v);break;default:ae<32?console.warn(`Glyph ${c}: unknown operator ${ae}`):ae<247?y.push(ae-139):ae<251?(N=A[Y],Y+=1,y.push((ae-247)*256+N+108)):ae<255?(N=A[Y],Y+=1,y.push(-(ae-251)*256-N-108)):(N=A[Y],W=A[Y+1],R=A[Y+2],D=A[Y+3],Y+=4,y.push((N<<24|W<<16|R<<8|D)/65536))}}}V(e),this.pathCommands=_,T&&(this.advanceWidth=S)}}class Xs{constructor(r){u(this,"_items",[]);this._sfnt=r}get(r){const e=this._items[r];let t;if(e)t=e;else{t=this._get(r);const i=this._sfnt.hmtx.metrics[r];i&&(t.advanceWidth=t.advanceWidth||i.advanceWidth,t.leftSideBearing=t.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(r);s&&(t.unicode??(t.unicode=s[0]),t.unicodes??(t.unicodes=s)),this._items[r]=t}return t}}class of extends Xs{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(r){const e=this._sfnt.cff,t=new nf({index:r});return t.parse(e,e.charStringsIndex.get(r),this),t.name=e.charset[r],t}}var af=Object.defineProperty,Ea=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&af(r,e,i),i};class Ci extends qe{constructor(e,t,i,s){super(e,t,i,s);u(this,"_offsets");u(this,"_objects");this._init()}get offsets(){return this._offsets??(this._offsets=this.readOffsets())}get objects(){return this._objects??(this._objects=this.readObjects())}_init(){const e=this.view,t=this.count,i=this.offsetSize;this.objectOffset=(t+1)*i+2,this.endOffset=e.byteOffset+this.objectOffset+this.offsets[t]}readOffsets(){const e=this.view,t=this.count,i=this.offsetSize;e.seek(3);const s=[];for(let o=0,a=t+1;o<a;o++){const l=this.view;let h=0;for(let c=0;c<i;c++)h<<=8,h+=l.readUint8();s.push(h)}return s}readObjects(){const e=[];for(let t=0,i=this.count;t<i;t++)e.push(this.get(t));return e}get(e){const t=this.offsets,i=this.objectOffset,s=i+t[e],a=i+t[e+1]-s;return this._isString?this.view.readString(s,a):this.view.readBytes(s,a)}}Ea([b("uint16")],Ci.prototype,"count"),Ea([b("uint8")],Ci.prototype,"offsetSize");class Ti extends Ci{constructor(){super(...arguments);u(this,"_isString",!1)}}class Ma extends Ci{constructor(){super(...arguments);u(this,"_isString",!0)}}const lf=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],hf=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],cf=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],uf=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function Si(n,r){return r<=390?lf[r]:n[r-391]}function re(n,r="number",e){return(t,i)=>{if(typeof i!="string")return;const s={type:r,operator:n,default:e??r==="number"?0:void 0};Object.defineProperty(t.constructor.prototype,i,{get(){return this._getProp(s)},set(o){this._setProp(s,o)},configurable:!0,enumerable:!0})}}class Aa extends qe{constructor(){super(...arguments);u(this,"_dict");u(this,"_stringIndex")}get dict(){return this._dict??(this._dict=this._readDict())}setStringIndex(e){return this._stringIndex=e,this}_readFloatOperand(){const e=this.view;let t="";const i=15,s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const o=e.readUint8(),a=o>>4,l=o&15;if(a===i||(t+=s[a],l===i))break;t+=s[l]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let i,s,o,a;if(e===28)return i=t.readUint8(),s=t.readUint8(),i<<8|s;if(e===29)return i=t.readUint8(),s=t.readUint8(),o=t.readUint8(),a=t.readUint8(),i<<24|s<<16|o<<8|a;if(e===30)return this._readFloatOperand();if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return i=t.readUint8(),(e-247)*256+i+108;if(e>=251&&e<=254)return i=t.readUint8(),-(e-251)*256-i-108;throw new Error(`invalid b0 ${e}, at: ${t.cursor}`)}_readDict(){const e=this.view;e.seek(0);let t=[];const i=e.cursor+e.byteLength,s={};for(;e.cursor<i;){let o=e.readUint8();o<=21?(o===12&&(o=1200+e.readUint8()),s[o]=t,t=[]):t.push(this._readOperand(o))}return s}_getProp(e){var i;const t=this.dict[e.operator]??e.default;switch(e.type){case"number":return t[0];case"string":return Si(((i=this._stringIndex)==null?void 0:i.objects)??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var ff=Object.defineProperty,Hs=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&ff(r,e,i),i};class Ei extends Aa{}Hs([re(19)],Ei.prototype,"subrs"),Hs([re(20)],Ei.prototype,"defaultWidthX"),Hs([re(21)],Ei.prototype,"nominalWidthX");var df=Object.defineProperty,ce=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&df(r,e,i),i};class oe extends Aa{}ce([re(0,"string")],oe.prototype,"version"),ce([re(1,"string")],oe.prototype,"notice"),ce([re(1200,"string")],oe.prototype,"copyright"),ce([re(2,"string")],oe.prototype,"fullName"),ce([re(3,"string")],oe.prototype,"familyName"),ce([re(4,"string")],oe.prototype,"weight"),ce([re(1201)],oe.prototype,"isFixedPitch"),ce([re(1202)],oe.prototype,"italicAngle"),ce([re(1203,"number",-100)],oe.prototype,"underlinePosition"),ce([re(1204,"number",50)],oe.prototype,"underlineThickness"),ce([re(1205)],oe.prototype,"paintType"),ce([re(1206,"number",2)],oe.prototype,"charstringType"),ce([re(1207,"number[]",[.001,0,0,.001,0,0])],oe.prototype,"fontMatrix"),ce([re(13)],oe.prototype,"uniqueId"),ce([re(5,"number[]",[0,0,0,0])],oe.prototype,"fontBBox"),ce([re(1208)],oe.prototype,"strokeWidth"),ce([re(14)],oe.prototype,"xuid"),ce([re(15)],oe.prototype,"charset"),ce([re(16)],oe.prototype,"encoding"),ce([re(17)],oe.prototype,"charStrings"),ce([re(18,"number[]",[0,0])],oe.prototype,"private");function Ce(n,r=n){return e=>{zt.tableDefinitions.set(n,{tag:n,prop:r,class:e}),Object.defineProperty(zt.prototype,r,{get(){return this.get(n)},set(t){return this.set(n,t)},configurable:!0,enumerable:!0})}}const Ht=class Ht{constructor(r){u(this,"tables",new Map);u(this,"tableViews",new Map);(r instanceof Map?r:new Map(Object.entries(r))).forEach((t,i)=>{this.tableViews.set(i,new DataView(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)))})}get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(r){let e=this.cmap.unicodeToGlyphIndexMap.get(r.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:t,charset:i}=this.cff;e=i.indexOf(t[r.codePointAt(0)])}return e??0}charToGlyph(r){return this.glyphs.get(this.charToGlyphIndex(r))}textToGlyphIndexes(r){const e=[];for(const t of r)e.push(this.charToGlyphIndex(t));return e}textToGlyphs(r){const e=this.glyphs,t=this.textToGlyphIndexes(r),i=t.length,s=Array.from({length:i}),o=e.get(0);for(let a=0;a<i;a+=1)s[a]=e.get(t[a])||o;return s}getPathCommands(r,e,t,i,s){const o=[];return this.forEachGlyph(r,e,t,i,s,(a,l,h,c,f)=>{o.push(...a.getPathCommands(l,h,c,f,this))}),o}getAdvanceWidth(r,e,t){return this.forEachGlyph(r,0,0,e,t,()=>{})}forEachGlyph(r,e=0,t=0,i=72,s={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(r);for(let h=0;h<l.length;h+=1){const c=l[h];o.call(this,c,e,t,i,s),c.advanceWidth&&(e+=c.advanceWidth*a),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}clone(){return new Ht(this.tableViews)}delete(r){const e=Ht.tableDefinitions.get(r);return e?(this.tableViews.delete(r),this.tables.delete(e.prop),this):this}set(r,e){const t=Ht.tableDefinitions.get(r);return t&&this.tables.set(t.prop,e),this.tableViews.set(r,e.view),this}get(r){const e=Ht.tableDefinitions.get(r);if(!e)return;let t=this.tables.get(e.prop);if(!t){const i=e.class;if(i){const s=this.tableViews.get(r);if(!s)return;t=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,t)}}return t}};u(Ht,"tableDefinitions",new Map);let zt=Ht;class Ie extends qe{setSFNT(r){return this._sfnt=r,this}getSFNT(){return this._sfnt}}var pf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,Fr=(n,r,e,t)=>{for(var i=t>1?void 0:t?gf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&pf(r,e,i),i};let Vt=class extends Ie{constructor(r,e,t,i){super(r,e,t,i);u(this,"_glyphs");u(this,"privateDict");u(this,"subrsIndex");this._init()}get glyphs(){return this._glyphs??(this._glyphs=new of(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var r;return((r=this.privateDict)==null?void 0:r.defaultWidthX)??0}get nominalWidthX(){var r;return((r=this.privateDict)==null?void 0:r.nominalWidthX)??0}get subrs(){var r;return((r=this.subrsIndex)==null?void 0:r.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const r=this.view,{buffer:e,byteOffset:t}=r,i=t+4;this.nameIndex=new Ma(e,i),this.topDictIndex=new Ti(e,this.nameIndex.endOffset),this.stringIndex=new Ma(e,this.topDictIndex.endOffset),this.globalSubrIndex=new Ti(e,this.stringIndex.endOffset),this.topDict=new oe(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const s=this.topDict.private[0],o=this.topDict.private[1];s&&(this.privateDict=new Ei(e,t+o,s).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new Ti(e,t+o+this.privateDict.subrs))),this.charStringsIndex=new Ti(e,t+this.topDict.charStrings);const a=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=hf:this.topDict.charset===1?this.charset=cf:this.topDict.charset===2?this.charset=uf:this.charset=this._readCharset(t+this.topDict.charset,a,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=qs:this.topDict.encoding===1?this.encoding=sf:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(r,e,t){const i=this.view;i.seek(r);let s,o,a;e-=1;const l=[".notdef"],h=i.readUint8();if(h===0)for(s=0;s<e;s+=1)o=i.readUint16(),l.push(Si(t,o));else if(h===1)for(;l.length<=e;)for(o=i.readUint16(),a=i.readUint8(),s=0;s<=a;s+=1)l.push(Si(t,o)),o+=1;else if(h===2)for(;l.length<=e;)for(o=i.readUint16(),a=i.readUint16(),s=0;s<=a;s+=1)l.push(Si(t,o)),o+=1;else throw new Error(`Unknown charset format ${h}`);return l}_readEncoding(r){const e=this.view;e.seek(r);let t,i;const s={},o=e.readUint8();if(o===0){const a=e.readUint8();for(t=0;t<a;t+=1)i=e.readUint8(),s[i]=t}else if(o===1){const a=e.readUint8();for(i=1,t=0;t<a;t+=1){const l=e.readUint8(),h=e.readUint8();for(let c=l;c<=l+h;c+=1)s[c]=i,i+=1}}else console.warn(`unknown encoding format:${o}`);return s}_calcSubroutineBias(r){let e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}};Fr([b("uint8")],Vt.prototype,"majorVersion",2),Fr([b("uint8")],Vt.prototype,"minorVersion",2),Fr([b("uint8")],Vt.prototype,"headerSize",2),Fr([b("uint8")],Vt.prototype,"offsetSize",2),Vt=Fr([Ce("CFF ","cff")],Vt);var mf=Object.defineProperty,Mi=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&mf(r,e,i),i};const $r=class fl extends qe{constructor(r=new ArrayBuffer(262),e){super(r,e,262)}static from(r){const e=new fl;return e.format=0,e.length=e.view.byteLength,e.language=0,r.forEach((t,i)=>{i<256&&t<256&&e.view.writeUint8(t,6+i)}),e}getUnicodeToGlyphIndexMap(){const r=new Map;return this.glyphIndexArray.forEach((e,t)=>{r.set(t,e)}),r}};Mi([b("uint16")],$r.prototype,"format"),Mi([b("uint16")],$r.prototype,"length"),Mi([b("uint16")],$r.prototype,"language"),Mi([b({type:"uint8",size:256})],$r.prototype,"glyphIndexArray");let Ys=$r;var yf=Object.defineProperty,Zs=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&yf(r,e,i),i};class zr extends qe{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((r,e)=>Math.max(r,e),0)}get subHeaders(){const r=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:r},(e,t)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(r-t)*8-2)/2}))}get glyphIndexArray(){const r=this.maxSubHeaderKey,e=6+256*2+r*8;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(r){const e=new Map,t=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,o=this.glyphIndexArray,a=t.findIndex(h=>h===i);let l=0;for(let h=0;h<256;h++)if(t[h]===0)h>=a||h<s[0].firstCode||h>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(h-s[0].firstCode)>=o.length?l=0:(l=o[s[0].idRangeOffset+(h-s[0].firstCode)],l!==0&&(l=l+s[0].idDelta)),l!==0&&l<r&&e.set(h,l);else{const c=t[h];for(let f=0,p=s[c].entryCount;f<p;f++)if(s[c].idRangeOffset+f>=o.length?l=0:(l=o[s[c].idRangeOffset+f],l!==0&&(l=l+s[c].idDelta)),l!==0&&l<r){const m=(h<<8|f+s[c].firstCode)%65535;e.set(m,l)}}return e}}Zs([b("uint16")],zr.prototype,"format"),Zs([b("uint16")],zr.prototype,"length"),Zs([b("uint16")],zr.prototype,"language");function Oa(n){return n>32767?n-65536:n<-32767?n+65536:n}function Ks(n,r){let e;const t=[];let i={};return n.forEach((s,o)=>{r&&o>r||((!e||o!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,t.push(i),i={start:o,startId:s,delta:Oa(s-o)}):(i.start=Number(o),i.startId=s,i.delta=Oa(s-o))),e={unicode:o,glyphIndex:s})}),e&&(i.end=e.unicode,t.push(i)),t}var _f=Object.defineProperty,jt=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&_f(r,e,i),i};const At=class dl extends qe{get endCode(){const r=this.segCountX2;return this.view.seek(14),Array.from({length:r/2},()=>this.view.readUint16())}set endCode(r){this.view.seek(14),r.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(r){this.view.writeUint16(r,14+this.segCountX2)}get startCode(){const r=this.segCountX2;return this.view.seek(14+r+2),Array.from({length:r/2},()=>this.view.readUint16())}set startCode(r){this.view.seek(14+this.segCountX2+2),r.forEach(e=>this.view.writeUint16(e))}get idDelta(){const r=this.segCountX2;return this.view.seek(14+r+2+r),Array.from({length:r/2},()=>this.view.readUint16())}set idDelta(r){const e=this.segCountX2;this.view.seek(14+e+2+e),r.forEach(t=>this.view.writeUint16(t))}get idRangeOffsetCursor(){const r=this.segCountX2;return 14+r+2+r*2}get idRangeOffset(){const r=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:r/2},()=>this.view.readUint16())}set idRangeOffset(r){this.view.seek(this.idRangeOffsetCursor),r.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const r=this.segCountX2;return 14+r+2+r*3}get glyphIndexArray(){const r=this.glyphIndexArrayCursor;this.view.seek(r);const e=(this.view.byteLength-r)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(r){const e=Ks(r,65535),t=e.length+1,i=Math.floor(Math.log(t)/Math.LN2),s=2*2**i,o=new dl(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=t*2,o.searchRange=s,o.entrySelector=i,o.rangeShift=2*t-s,o.endCode=[...e.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...e.map(a=>a.start),65535],o.idDelta=[...e.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:t},()=>0),o}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.segCountX2/2,t=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let h=0;h<e;++h)for(let c=i[h],f=s[h];c<=f;++c)if(o[h]===0)r.set(c,(c+a[h])%65536);else{const p=h+o[h]/2+(c-i[h])-t,m=l[p];m!==0?r.set(c,(m+a[h])%65536):r.set(c,0)}return r.delete(65535),r}};jt([b("uint16")],At.prototype,"format"),jt([b("uint16")],At.prototype,"length"),jt([b("uint16")],At.prototype,"language"),jt([b("uint16")],At.prototype,"segCountX2"),jt([b("uint16")],At.prototype,"searchRange"),jt([b("uint16")],At.prototype,"entrySelector"),jt([b("uint16")],At.prototype,"rangeShift");let Js=At;var vf=Object.defineProperty,Vr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&vf(r,e,i),i};class Gt extends qe{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const r=this.glyphIndexArray,e=new Map;return r.forEach((t,i)=>{e.set(i,t)}),e}}Vr([b("uint16")],Gt.prototype,"format"),Vr([b("uint16")],Gt.prototype,"length"),Vr([b("uint16")],Gt.prototype,"language"),Vr([b("uint16")],Gt.prototype,"firstCode"),Vr([b("uint16")],Gt.prototype,"entryCount");var bf=Object.defineProperty,jr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&bf(r,e,i),i};const lr=class pl extends qe{get groups(){const r=this.nGroups;return this.view.seek(16),Array.from({length:r},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(r){const e=Ks(r),t=new pl(new ArrayBuffer(16+e.length*12));return t.format=12,t.reserved=0,t.length=t.view.byteLength,t.language=0,t.nGroups=e.length,e.forEach(i=>{t.view.writeUint32(i.start),t.view.writeUint32(i.end),t.view.writeUint32(i.startId)}),t}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.groups;for(let t=0,i=e.length;t<i;t++){const s=e[t];let o=s.startGlyphCode,a=s.startCharCode;const l=s.endCharCode;for(;a<=l;)r.set(a++,o++)}return r}};jr([b("uint16")],lr.prototype,"format"),jr([b("uint16")],lr.prototype,"reserved"),jr([b("uint32")],lr.prototype,"length"),jr([b("uint32")],lr.prototype,"language"),jr([b("uint32")],lr.prototype,"nGroups");let Qs=lr;var wf=Object.defineProperty,en=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&wf(r,e,i),i};class Gr extends qe{getVarSelectorRecords(){const r=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:r},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const t=this.view.readUint32();e.unicodeValueRanges=Array.from({length:t},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const t=this.view.readUint32();e.uVSMappings=Array.from({length:t},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const r=new Map,e=this.getVarSelectorRecords();for(let t=0,i=e.length;t<i;t++){const{uVSMappings:s}=e[t];s.forEach(o=>{r.set(o.unicodeValue,o.glyphID)})}return r}}en([b("uint16")],Gr.prototype,"format"),en([b("uint32")],Gr.prototype,"length"),en([b("uint32")],Gr.prototype,"numVarSelectorRecords");var xf=Object.defineProperty,Pf=Object.getOwnPropertyDescriptor,tn=(n,r,e,t)=>{for(var i=t>1?void 0:t?Pf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&xf(r,e,i),i};let hr=class extends Ie{constructor(){super(...arguments);u(this,"_unicodeToGlyphIndexMap");u(this,"_glyphIndexToUnicodesMap")}static from(r){const e=Array.from(r.keys()).some(f=>f>65535),t=Js.from(r),i=Ys.from(r),s=e?Qs.from(r):void 0,o=4+(s?32:24),a=o+t.view.byteLength,l=a+i.view.byteLength,h=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:a},{platformID:3,platformSpecificID:1,offset:o},s&&{platformID:3,platformSpecificID:10,offset:l}].filter(Boolean),c=new hr(new ArrayBuffer(4+8*h.length+t.view.byteLength+i.view.byteLength+((s==null?void 0:s.view.byteLength)??0)));return c.numberSubtables=h.length,c.view.seek(4),h.forEach(f=>{c.view.writeUint16(f.platformID),c.view.writeUint16(f.platformSpecificID),c.view.writeUint32(f.offset)}),c.view.writeBytes(t.view,o),c.view.writeBytes(i.view,a),s&&c.view.writeBytes(s.view,l),c}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let i=0,s=t.length;i<s;i++){const o=t[i],a=e.get(o);r.has(a)?r.get(a).push(o):r.set(a,[o])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(e=>{this.view.seek(e.offset);const t=this.view.readUint16();let i;switch(t){case 0:i=new Ys(this.view.buffer,e.offset);break;case 2:i=new zr(this.view.buffer,e.offset,this.view.readUint16());break;case 4:i=new Js(this.view.buffer,e.offset,this.view.readUint16());break;case 6:i=new Gt(this.view.buffer,e.offset,this.view.readUint16());break;case 12:i=new Qs(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:i=new Gr(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:i}})}readunicodeToGlyphIndexMap(){var a,l,h,c,f;const r=this.readSubtables(),e=(a=r.find(p=>p.format===0))==null?void 0:a.view,t=(l=r.find(p=>p.platformID===3&&p.platformSpecificID===3&&p.format===2))==null?void 0:l.view,i=(h=r.find(p=>p.platformID===3&&p.platformSpecificID===1&&p.format===4))==null?void 0:h.view,s=(c=r.find(p=>p.platformID===3&&p.platformSpecificID===10&&p.format===12))==null?void 0:c.view,o=(f=r.find(p=>p.platformID===0&&p.platformSpecificID===5&&p.format===14))==null?void 0:f.view;return new Map([...(e==null?void 0:e.getUnicodeToGlyphIndexMap())??[],...(t==null?void 0:t.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs))??[],...(i==null?void 0:i.getUnicodeToGlyphIndexMap())??[],...(s==null?void 0:s.getUnicodeToGlyphIndexMap())??[],...(o==null?void 0:o.getUnicodeToGlyphIndexMap())??[]])}};tn([b("uint16")],hr.prototype,"version",2),tn([b("uint16")],hr.prototype,"numberSubtables",2),hr=tn([Ce("cmap")],hr);class Cf extends Ws{_parseContours(r){const e=[];let t=[];for(let i=0;i<r.length;i+=1){const s=r[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return Lr(t.length===0,"There are still points left in the current contour."),e}_transformPoints(r,e){const t=[];for(let i=0;i<r.length;i+=1){const s=r[i],o={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};t.push(o)}return t}_parseGlyphCoordinate(r,e,t,i,s){let o;return(e&i)>0?(o=r.view.readUint8(),e&s||(o=-o),o=t+o):(e&s)>0?o=t:o=t+r.view.readInt16(),o}parse(r,e,t){r.view.seek(e);const i=this.numberOfContours=r.view.readInt16();if(this.xMin=r.view.readInt16(),this.yMin=r.view.readInt16(),this.xMax=r.view.readInt16(),this.yMax=r.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let _=0;_<i;_++)a.push(r.view.readUint16());const l=this.instructionLength=r.view.readUint16();Lr(l<5e3,`Bad instructionLength:${l}`);const h=this.instructions=[];for(let _=0;_<l;++_)h.push(r.view.readUint8());const c=r.view.byteOffset,f=a[a.length-1]+1;Lr(f<2e4,`Bad numberOfCoordinates:${c}`);const p=[];let m,g=0;for(;g<f;)if(m=r.view.readUint8(),p.push(m),g++,m&8&&g<f){const _=r.view.readUint8();for(let y=0;y<_;y++)p.push(m),g++}if(Lr(p.length===f,`Bad flags length: ${p.length}, numberOfCoordinates: ${f}`),a.length>0){const _=[];let y;if(f>0){for(let P=0;P<f;P+=1)m=p[P],y={},y.onCurve=!!(m&1),y.lastPointOfContour=a.includes(P),_.push(y);let E=0;for(let P=0;P<f;P+=1)m=p[P],y=_[P],y.x=this._parseGlyphCoordinate(r,m,E,2,16),E=y.x;let T=0;for(let P=0;P<f;P+=1)m=p[P],y=_[P],y.y=this._parseGlyphCoordinate(r,m,T,4,32),T=y.y}this.points=_}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=r.view.readUint16();const h={glyphIndex:r.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(h.dx=r.view.readInt16(),h.dy=r.view.readInt16()):h.matchedPoints=[r.view.readUint16(),r.view.readUint16()]:(a&2)>0?(h.dx=r.view.readInt8(),h.dy=r.view.readInt8()):h.matchedPoints=[r.view.readUint8(),r.view.readUint8()],(a&8)>0?h.xScale=h.yScale=r.view.readInt16()/16384:(a&64)>0?(h.xScale=r.view.readInt16()/16384,h.yScale=r.view.readInt16()/16384):(a&128)>0&&(h.xScale=r.view.readInt16()/16384,h.scale01=r.view.readInt16()/16384,h.scale10=r.view.readInt16()/16384,h.yScale=r.view.readInt16()/16384),this.components.push(h),l=!!(a&32)}if(a&256){this.instructionLength=r.view.readUint16(),this.instructions=[];for(let h=0;h<this.instructionLength;h+=1)this.instructions.push(r.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],h=t.get(l.glyphIndex);if(h.getPathCommands(),h.points){let c;if(l.matchedPoints===void 0)c=this._transformPoints(h.points,l);else{Lr(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>h.points.length-1,`Matched points out of range in ${this.name}`);const f=this.points[l.matchedPoints[0]];let p=h.points[l.matchedPoints[1]];const m={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],m)[0],m.dx=f.x-p.x,m.dy=f.y-p.y,c=this._transformPoints(h.points,m)}this.points=this.points.concat(c)}}const s=[],o=this._parseContours(this.points);for(let a=0,l=o.length;a<l;++a){const h=o[a];let c=h[h.length-1],f=h[0];c.onCurve?s.push({type:"M",x:c.x,y:c.y}):f.onCurve?s.push({type:"M",x:f.x,y:f.y}):s.push({type:"M",x:(c.x+f.x)*.5,y:(c.y+f.y)*.5});for(let p=0,m=h.length;p<m;++p)if(c=f,f=h[(p+1)%m],c.onCurve)s.push({type:"L",x:c.x,y:c.y});else{let g=f;f.onCurve||(g={x:(c.x+f.x)*.5,y:(c.y+f.y)*.5}),s.push({type:"Q",x1:c.x,y1:c.y,x:g.x,y:g.y})}s.push({type:"Z"})}this.pathCommands=s}}class Tf extends Xs{get length(){return this._sfnt.loca.locations.length}_get(r){const e=this._sfnt.loca.locations,t=e[r],i=new Cf({index:r});return t!==e[r+1]&&i.parse(this._sfnt.glyf,t,this),i}}var Sf=Object.defineProperty,Ef=Object.getOwnPropertyDescriptor,Mf=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ef(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Sf(r,e,i),i};let Ai=class extends Ie{constructor(){super(...arguments);u(this,"_glyphs")}static from(r){const e=r.reduce((i,s)=>i+s.byteLength,0),t=new Ai(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeBytes(i)}),t}get glyphs(){return this._glyphs??(this._glyphs=new Tf(this._sfnt))}};Ai=Mf([Ce("glyf")],Ai);var Af=Object.defineProperty,Of=Object.getOwnPropertyDescriptor,Uf=(n,r,e,t)=>{for(var i=t>1?void 0:t?Of(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Af(r,e,i),i};let rn=class extends Ie{};rn=Uf([Ce("GPOS","gpos")],rn);var If=Object.defineProperty,Df=Object.getOwnPropertyDescriptor,qt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Df(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&If(r,e,i),i};let xt=class extends Ie{};qt([b("uint16")],xt.prototype,"majorVersion",2),qt([b("uint16")],xt.prototype,"minorVersion",2),qt([b("uint16")],xt.prototype,"scriptListOffset",2),qt([b("uint16")],xt.prototype,"featureListOffset",2),qt([b("uint16")],xt.prototype,"lookupListOffset",2),qt([b("uint16")],xt.prototype,"featureVariationsOffset",2),xt=qt([Ce("GSUB","gsub")],xt);var Rf=Object.defineProperty,Bf=Object.getOwnPropertyDescriptor,we=(n,r,e,t)=>{for(var i=t>1?void 0:t?Bf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Rf(r,e,i),i};let pe=class extends Ie{constructor(n=new ArrayBuffer(54),r){super(n,r,Math.min(54,n.byteLength-(r??0)))}};we([b("fixed")],pe.prototype,"version",2),we([b("fixed")],pe.prototype,"fontRevision",2),we([b("uint32")],pe.prototype,"checkSumAdjustment",2),we([b("uint32")],pe.prototype,"magickNumber",2),we([b("uint16")],pe.prototype,"flags",2),we([b("uint16")],pe.prototype,"unitsPerEm",2),we([b({type:"longDateTime"})],pe.prototype,"created",2),we([b({type:"longDateTime"})],pe.prototype,"modified",2),we([b("int16")],pe.prototype,"xMin",2),we([b("int16")],pe.prototype,"yMin",2),we([b("int16")],pe.prototype,"xMax",2),we([b("int16")],pe.prototype,"yMax",2),we([b("uint16")],pe.prototype,"macStyle",2),we([b("uint16")],pe.prototype,"lowestRecPPEM",2),we([b("int16")],pe.prototype,"fontDirectionHint",2),we([b("int16")],pe.prototype,"indexToLocFormat",2),we([b("int16")],pe.prototype,"glyphDataFormat",2),pe=we([Ce("head")],pe);var kf=Object.defineProperty,Lf=Object.getOwnPropertyDescriptor,ke=(n,r,e,t)=>{for(var i=t>1?void 0:t?Lf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&kf(r,e,i),i};let Te=class extends Ie{constructor(n=new ArrayBuffer(36),r){super(n,r,Math.min(36,n.byteLength-(r??0)))}};ke([b("fixed")],Te.prototype,"version",2),ke([b("int16")],Te.prototype,"ascent",2),ke([b("int16")],Te.prototype,"descent",2),ke([b("int16")],Te.prototype,"lineGap",2),ke([b("uint16")],Te.prototype,"advanceWidthMax",2),ke([b("int16")],Te.prototype,"minLeftSideBearing",2),ke([b("int16")],Te.prototype,"minRightSideBearing",2),ke([b("int16")],Te.prototype,"xMaxExtent",2),ke([b("int16")],Te.prototype,"caretSlopeRise",2),ke([b("int16")],Te.prototype,"caretSlopeRun",2),ke([b("int16")],Te.prototype,"caretOffset",2),ke([b({type:"int16",size:4})],Te.prototype,"reserved",2),ke([b("int16")],Te.prototype,"metricDataFormat",2),ke([b("uint16")],Te.prototype,"numOfLongHorMetrics",2),Te=ke([Ce("hhea")],Te);var Nf=Object.defineProperty,Ff=Object.getOwnPropertyDescriptor,$f=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ff(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Nf(r,e,i),i};let Oi=class extends Ie{constructor(){super(...arguments);u(this,"_metrics")}static from(r){const e=r.length*4,t=new Oi(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeUint16(i.advanceWidth),t.view.writeUint16(i.leftSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const r=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const i=this.view;return i.seek(0),Array.from({length:r}).map((s,o)=>(o<e&&(t=i.readUint16()),{advanceWidth:t,leftSideBearing:i.readUint16()}))}};Oi=$f([Ce("hmtx")],Oi);var zf=Object.defineProperty,Vf=Object.getOwnPropertyDescriptor,jf=(n,r,e,t)=>{for(var i=t>1?void 0:t?Vf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&zf(r,e,i),i};let sn=class extends Ie{};sn=jf([Ce("kern","kern")],sn);var Gf=Object.defineProperty,qf=Object.getOwnPropertyDescriptor,Wf=(n,r,e,t)=>{for(var i=t>1?void 0:t?qf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Gf(r,e,i),i};let Ui=class extends Ie{constructor(){super(...arguments);u(this,"_locations")}static from(r,e=1){const t=r.length*(e?4:2),i=new Ui(new ArrayBuffer(t));return r.forEach(s=>{e?i.view.writeUint32(s):i.view.writeUint16(s/2)}),i}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const r=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:r}).map(()=>e?t.readUint32():t.readUint16()*2)}};Ui=Wf([Ce("loca")],Ui);var Xf=Object.defineProperty,Hf=Object.getOwnPropertyDescriptor,De=(n,r,e,t)=>{for(var i=t>1?void 0:t?Hf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Xf(r,e,i),i};let xe=class extends Ie{constructor(n=new ArrayBuffer(32),r){super(n,r,Math.min(32,n.byteLength-(r??0)))}};De([b("fixed")],xe.prototype,"version",2),De([b("uint16")],xe.prototype,"numGlyphs",2),De([b("uint16")],xe.prototype,"maxPoints",2),De([b("uint16")],xe.prototype,"maxContours",2),De([b("uint16")],xe.prototype,"maxComponentPoints",2),De([b("uint16")],xe.prototype,"maxComponentContours",2),De([b("uint16")],xe.prototype,"maxZones",2),De([b("uint16")],xe.prototype,"maxTwilightPoints",2),De([b("uint16")],xe.prototype,"maxStorage",2),De([b("uint16")],xe.prototype,"maxFunctionDefs",2),De([b("uint16")],xe.prototype,"maxInstructionDefs",2),De([b("uint16")],xe.prototype,"maxStackElements",2),De([b("uint16")],xe.prototype,"maxSizeOfInstructions",2),De([b("uint16")],xe.prototype,"maxComponentElements",2),De([b("uint16")],xe.prototype,"maxComponentDepth",2),xe=De([Ce("maxp")],xe);var Yf=Object.defineProperty,Zf=Object.getOwnPropertyDescriptor,Ii=(n,r,e,t)=>{for(var i=t>1?void 0:t?Zf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Yf(r,e,i),i};const Ua={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},nn={Unicode:0,Macintosh:1,reserved:2,Microsoft:3},Kf={Default:0,"Version1.1":1,ISO10646:2,UnicodeBMP:3,UnicodenonBMP:4,UnicodeVariationSequences:5,FullUnicodecoverage:6},Ia={Symbol:0,UCS2:1,ShiftJIS:2,PRC:3,BigFive:4,Johab:5,UCS4:6};let cr=class extends Ie{constructor(){super(...arguments);u(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const r=this.count;this.view.seek(6);const e=[];for(let l=0;l<r;++l)e.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const t=this.stringOffset;for(let l=0;l<r;++l){const h=e[l];h.name=this.view.readBytes(t+h.offset,h.length)}let i=nn.Macintosh,s=Kf.Default,o=0;e.some(l=>l.platform===nn.Microsoft&&l.encoding===Ia.UCS2&&l.language===1033)&&(i=nn.Microsoft,s=Ia.UCS2,o=1033);const a={};for(let l=0;l<r;++l){const h=e[l];h.platform===i&&h.encoding===s&&h.language===o&&Ua[h.nameId]&&(a[Ua[h.nameId]]=o===0?Ju(h.name):Qu(h.name))}return a}};Ii([b("uint16")],cr.prototype,"format",2),Ii([b("uint16")],cr.prototype,"count",2),Ii([b("uint16")],cr.prototype,"stringOffset",2),cr=Ii([Ce("name")],cr);var Jf=Object.defineProperty,Qf=Object.getOwnPropertyDescriptor,z=(n,r,e,t)=>{for(var i=t>1?void 0:t?Qf(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Jf(r,e,i),i};let $=class extends Ie{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};z([b("uint16")],$.prototype,"version",2),z([b("int16")],$.prototype,"xAvgCharWidth",2),z([b("uint16")],$.prototype,"usWeightClass",2),z([b("uint16")],$.prototype,"usWidthClass",2),z([b("uint16")],$.prototype,"fsType",2),z([b("uint16")],$.prototype,"ySubscriptXSize",2),z([b("uint16")],$.prototype,"ySubscriptYSize",2),z([b("uint16")],$.prototype,"ySubscriptXOffset",2),z([b("uint16")],$.prototype,"ySubscriptYOffset",2),z([b("uint16")],$.prototype,"ySuperscriptXSize",2),z([b("uint16")],$.prototype,"ySuperscriptYSize",2),z([b("uint16")],$.prototype,"ySuperscriptXOffset",2),z([b("uint16")],$.prototype,"ySuperscriptYOffset",2),z([b("uint16")],$.prototype,"yStrikeoutSize",2),z([b("uint16")],$.prototype,"yStrikeoutPosition",2),z([b("uint16")],$.prototype,"sFamilyClass",2),z([b({type:"uint8"})],$.prototype,"bFamilyType",2),z([b({type:"uint8"})],$.prototype,"bSerifStyle",2),z([b({type:"uint8"})],$.prototype,"bWeight",2),z([b({type:"uint8"})],$.prototype,"bProportion",2),z([b({type:"uint8"})],$.prototype,"bContrast",2),z([b({type:"uint8"})],$.prototype,"bStrokeVariation",2),z([b({type:"uint8"})],$.prototype,"bArmStyle",2),z([b({type:"uint8"})],$.prototype,"bLetterform",2),z([b({type:"uint8"})],$.prototype,"bMidline",2),z([b({type:"uint8"})],$.prototype,"bXHeight",2),z([b({type:"uint8",size:16})],$.prototype,"ulUnicodeRange",2),z([b({type:"char",size:4})],$.prototype,"achVendID",2),z([b("uint16")],$.prototype,"fsSelection",2),z([b("uint16")],$.prototype,"usFirstCharIndex",2),z([b("uint16")],$.prototype,"usLastCharIndex",2),z([b("int16")],$.prototype,"sTypoAscender",2),z([b("int16")],$.prototype,"sTypoDescender",2),z([b("int16")],$.prototype,"sTypoLineGap",2),z([b("uint16")],$.prototype,"usWinAscent",2),z([b("uint16")],$.prototype,"usWinDescent",2),z([b({offset:72,type:"uint8",size:8})],$.prototype,"ulCodePageRange",2),z([b({offset:72,type:"int16"})],$.prototype,"sxHeight",2),z([b("int16")],$.prototype,"sCapHeight",2),z([b("uint16")],$.prototype,"usDefaultChar",2),z([b("uint16")],$.prototype,"usBreakChar",2),z([b("uint16")],$.prototype,"usMaxContext",2),$=z([Ce("OS/2","os2")],$);var ed=Object.defineProperty,td=Object.getOwnPropertyDescriptor,ft=(n,r,e,t)=>{for(var i=t>1?void 0:t?td(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ed(r,e,i),i};let Ye=class extends Ie{constructor(n=new ArrayBuffer(32),r,e){super(n,r,e)}};ft([b("fixed")],Ye.prototype,"format",2),ft([b("fixed")],Ye.prototype,"italicAngle",2),ft([b("int16")],Ye.prototype,"underlinePosition",2),ft([b("int16")],Ye.prototype,"underlineThickness",2),ft([b("uint32")],Ye.prototype,"isFixedPitch",2),ft([b("uint32")],Ye.prototype,"minMemType42",2),ft([b("uint32")],Ye.prototype,"maxMemType42",2),ft([b("uint32")],Ye.prototype,"minMemType1",2),ft([b("uint32")],Ye.prototype,"maxMemType1",2),Ye=ft([Ce("post")],Ye);var rd=Object.defineProperty,id=Object.getOwnPropertyDescriptor,Le=(n,r,e,t)=>{for(var i=t>1?void 0:t?id(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&rd(r,e,i),i};let Se=class extends Ie{constructor(n=new ArrayBuffer(36),r){super(n,r,Math.min(36,n.byteLength-(r??0)))}};Le([b("fixed")],Se.prototype,"version",2),Le([b("int16")],Se.prototype,"vertTypoAscender",2),Le([b("int16")],Se.prototype,"vertTypoDescender",2),Le([b("int16")],Se.prototype,"vertTypoLineGap",2),Le([b("int16")],Se.prototype,"advanceHeightMax",2),Le([b("int16")],Se.prototype,"minTopSideBearing",2),Le([b("int16")],Se.prototype,"minBottomSideBearing",2),Le([b("int16")],Se.prototype,"yMaxExtent",2),Le([b("int16")],Se.prototype,"caretSlopeRise",2),Le([b("int16")],Se.prototype,"caretSlopeRun",2),Le([b("int16")],Se.prototype,"caretOffset",2),Le([b({type:"int16",size:4})],Se.prototype,"reserved",2),Le([b("int16")],Se.prototype,"metricDataFormat",2),Le([b("int16")],Se.prototype,"numOfLongVerMetrics",2),Se=Le([Ce("vhea")],Se);var sd=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,od=(n,r,e,t)=>{for(var i=t>1?void 0:t?nd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&sd(r,e,i),i};let Di=class extends Ie{constructor(){super(...arguments);u(this,"_metrics")}static from(r){const e=r.length*4,t=new Di(new ArrayBuffer(e));return r.forEach(i=>{t.view.writeUint16(i.advanceHeight),t.view.writeInt16(i.topSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){var s;const r=this._sfnt.maxp.numGlyphs,e=((s=this._sfnt.vhea)==null?void 0:s.numOfLongVerMetrics)??0,t=this.view;t.seek(0);let i=0;return Array.from({length:r}).map((o,a)=>(a<e&&(i=t.readUint16()),{advanceHeight:i,topSideBearing:t.readUint8()}))}};Di=od([Ce("vmtx")],Di);var ad=Object.defineProperty,qr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&ad(r,e,i),i};class Ze extends xi{constructor(){super(...arguments);u(this,"format","TrueType");u(this,"mimeType","font/ttf");u(this,"_sfnt")}get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(or(e).getUint32(0))}static checksum(e){const t=or(e);let i=t.byteLength;for(;i%4;)i++;let s=0;for(let o=0,a=i/4;o<a;o+=4)o*4<i-4&&(s+=t.getUint32(o*4,!1));return s&4294967295}static from(e){const t=p=>p+3&-4,i=e.tableViews.size,s=Array.from(e.tableViews.values()).reduce((p,m)=>p+t(m.byteLength),0),o=new this(new ArrayBuffer(12+i*16+s));o.scalerType=65536,o.numTables=i;const a=Math.log(2);o.searchRange=Math.floor(Math.log(i)/a)*16,o.entrySelector=Math.floor(o.searchRange/a),o.rangeShift=i*16-o.searchRange;let l=12+i*16,h=0;const c=o.getDirectories();e.tableViews.forEach((p,m)=>{const g=c[h++];g.tag=m,g.checkSum=this.checksum(p),g.offset=l,g.length=p.byteLength,o.view.writeBytes(p,l),l+=t(g.length)});const f=o.createSFNT().head;return f.checkSumAdjustment=0,f.checkSumAdjustment=2981146554-this.checksum(o.view),o}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new ar(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new zt(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}u(Ze,"signature",new Set([65536,1953658213,1954115633])),qr([b("uint32")],Ze.prototype,"scalerType"),qr([b("uint16")],Ze.prototype,"numTables"),qr([b("uint16")],Ze.prototype,"searchRange"),qr([b("uint16")],Ze.prototype,"entrySelector"),qr([b("uint16")],Ze.prototype,"rangeShift");class Ri extends Ze{constructor(){super(...arguments);u(this,"format","OpenType");u(this,"mimeType","font/otf")}static from(e){return super.from(e)}}u(Ri,"signature",new Set([1330926671]));var ld=Object.defineProperty,Wr=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&ld(r,e,i),i};class Wt extends qe{constructor(r,e){super(r,e,20)}}Wr([b({type:"char",size:4})],Wt.prototype,"tag"),Wr([b("uint32")],Wt.prototype,"offset"),Wr([b("uint32")],Wt.prototype,"compLength"),Wr([b("uint32")],Wt.prototype,"origLength"),Wr([b("uint32")],Wt.prototype,"origChecksum");var hd=Object.defineProperty,We=(n,r,e,t)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(r,e,i)||i);return i&&hd(r,e,i),i};const $e=(Bt=class extends xi{constructor(){super(...arguments);u(this,"format","WOFF");u(this,"mimeType","font/woff");u(this,"_sfnt")}get subfontFormat(){return Ze.is(this.flavor)?"TrueType":Ri.is(this.flavor)?"OpenType":"Open"}get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(or(e).getUint32(0))}static checkSum(e){const t=or(e),i=t.byteLength,s=Math.floor(i/4);let o=0,a=0;for(;a<s;)o+=t.getUint32(4*a++,!1);let l=i-s*4;if(l){let h=s*4;for(;l>0;)o+=t.getUint8(h)<<l*8,h++,l--}return o%4294967296}static from(e,t=new ArrayBuffer(0)){const i=p=>p+3&-4,s=[];e.tableViews.forEach((p,m)=>{const g=or(qu(new Uint8Array(p.buffer,p.byteOffset,p.byteLength)));s.push({tag:m,view:g.byteLength<p.byteLength?g:p,rawView:p})});const o=s.length,a=s.reduce((p,m)=>p+i(m.view.byteLength),0),l=new Bt(new ArrayBuffer(44+20*o+a+t.byteLength));l.signature=2001684038,l.flavor=65536,l.length=l.view.byteLength,l.numTables=o,l.totalSFNTSize=12+16*o+s.reduce((p,m)=>p+i(m.rawView.byteLength),0);let h=44+o*20,c=0;const f=l.getDirectories();return s.forEach(p=>{const m=f[c++];m.tag=p.tag,m.offset=h,m.compLength=p.view.byteLength,m.origChecksum=Bt.checkSum(p.rawView),m.origLength=p.rawView.byteLength,l.view.writeBytes(p.view,h),h+=i(m.compLength)}),l.view.writeBytes(t),l}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new Wt(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new zt(this.getDirectories().reduce((e,t)=>{const i=t.tag,s=this.view.byteOffset+t.offset,o=t.compLength,a=t.origLength,l=s+o;return e[i]=o>=a?new DataView(this.view.buffer,s,o):new DataView(Wu(new Uint8Array(this.view.buffer.slice(s,l))).buffer),e},{}))}},u(Bt,"signature",new Set([2001684038])),Bt);We([b("uint32")],$e.prototype,"signature"),We([b("uint32")],$e.prototype,"flavor"),We([b("uint32")],$e.prototype,"length"),We([b("uint16")],$e.prototype,"numTables"),We([b("uint16")],$e.prototype,"reserved"),We([b("uint32")],$e.prototype,"totalSFNTSize"),We([b("uint16")],$e.prototype,"majorVersion"),We([b("uint16")],$e.prototype,"minorVersion"),We([b("uint32")],$e.prototype,"metaOffset"),We([b("uint32")],$e.prototype,"metaLength"),We([b("uint32")],$e.prototype,"metaOrigLength"),We([b("uint32")],$e.prototype,"privOffset"),We([b("uint32")],$e.prototype,"privLength");let Bi=$e;function Da(n,r=!0){if(Ze.is(n))return new Ze(n);if(Ri.is(n))return new Ri(n);if(Bi.is(n))return new Bi(n);if(r)throw new Error("Failed to parseFont")}function Ra(n,r=!0){const e=Da(n,!1);if(e)return e;if(r)throw new Error("Failed to parseFont")}const Wi=class Wi{constructor(){u(this,"fallbackFont");u(this,"loading",new Map);u(this,"loaded",new Map);u(this,"familyToUrl",new Map)}_createRequest(r,e){const t=new AbortController;return{url:r,when:fetch(r,{...Wi.defaultRequestInit,...e,signal:t.signal}).then(i=>i.arrayBuffer()),cancel:()=>t.abort()}}injectFontFace(r,e){return document.fonts.add(new FontFace(r,e)),this}injectStyleTag(r,e){const t=document.createElement("style");return t.appendChild(document.createTextNode(`@font-face {
748
- font-family: "${r}";
747
+ }`})),Qi([_()],f.ZoomBlurEffect.prototype,"center",2),Qi([_()],f.ZoomBlurEffect.prototype,"innerRadius",2),Qi([_()],f.ZoomBlurEffect.prototype,"radius",2),Qi([_()],f.ZoomBlurEffect.prototype,"strength",2),f.ZoomBlurEffect=Qi([ae("ZoomBlurEffect")],f.ZoomBlurEffect);var zc=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,Os=(r,A,e,t)=>{for(var i=t>1?void 0:t?jc(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&zc(A,e,i),i};f.CanvasItem=class extends f.TimelineNode{constructor(e,t=[]){super();g(this,"opacity",1);g(this,"visible",!0);g(this,"_parentOpacity");g(this,"_parentVisible");g(this,"_modulate",new Rt(4294967295));g(this,"_backgroundImage");g(this,"context",new Ps);g(this,"_resetContext",!0);g(this,"_redrawing",!1);g(this,"_reflowing",!1);g(this,"_repainting",!1);g(this,"_originalBatchables",[]);g(this,"_layoutedBatchables",[]);g(this,"_batchables",[]);this._updateStyleProperty=this._updateStyleProperty.bind(this),this.style=new ve,this.setProperties(e).append(t)}get style(){return this._style}set style(e){var i;const t=(...s)=>{this.emit("updateStyleProperty",...s),this._updateStyleProperty(s[0],s[1],s[2],s[3])};e.on("updateProperty",t),(i=this._style)==null||i.off("updateProperty",t),this._style=e}setProperties(e){if(e){const{style:t,...i}=e;t&&this.style.setProperties(t),super.setProperties(i)}return this}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"modulate":this._modulate.value=t,this.requestRepaint();break;case"blendMode":this.requestRepaint();break}}_updateStyleProperty(e,t,i,s){switch(e){case"backgroundColor":this._updateBackgroundColor();break;case"backgroundImage":this._updateBackgroundImage();break;case"opacity":this._updateOpacity();break;case"visibility":this._updateVisible();break;case"filter":this.requestRepaint();break;case"boxShadow":this._updateBoxShadow();break;case"maskImage":this._updateMaskImage();break;case"borderRadius":this.requestRedraw();break}}_updateBoxShadow(){const e="__$style.shadow";if(this.style.boxShadow!=="none")this.getNode(e)||this.appendChild(new f.ShadowEffect,"back");else{const t=this.getNode(e);t&&this.removeChild(t)}}_updateMaskImage(){const e="__$style.maskImage",t=this.style.maskImage;if(t&&t!=="none"){const i=this.getNode(e);i?i.src=t:this.appendChild(new f.MaskEffect({src:t}),"back")}else{const i=this.getNode(e);i&&this.removeChild(i)}}_updateBackgroundColor(){const e=this.style.getComputedBackgroundColor();this._originalBatchables.length?this.requestRepaint():e.a>0&&this.requestRedraw()}async _updateBackgroundImage(){this._backgroundImage=await this.style.loadBackgroundImage(),this.requestRedraw()}_updateOpacity(){var t;const e=this.style.getComputedOpacity()*(((t=this.getParent())==null?void 0:t.opacity)??1);this.opacity!==e&&(this.opacity=e,this.requestRepaint())}_updateCurrentTime(e=!1){super._updateCurrentTime(e),this._updateVisible()}_updateVisible(){var t;let e=this.style.visibility==="visible"&&(((t=this.getParent())==null?void 0:t.visible)??!0);e&&!this.isInsideTimeRange()&&(e=!1),this.visible=e}show(){this.style.visibility="visible"}hide(){this.style.visibility="hidden"}isVisibleInTree(){return this.opacity>0&&this.visible}canRender(){return super.canRender()&&this.isVisibleInTree()}requestRedraw(){this._redrawing=!0}requestReflow(){this._reflowing=!0}requestRepaint(){this._repainting=!0}_process(e){const t=this.getParent();this._parentVisible!==(t==null?void 0:t.visible)&&(this._parentVisible=t==null?void 0:t.visible,this._updateVisible()),this._parentOpacity!==(t==null?void 0:t.opacity)&&(this._parentOpacity=t==null?void 0:t.opacity,this._updateOpacity()),super._process(e)}_draw(){this._drawBackground(),this._drawContent(),this._drawBorder(),this._drawOutline()}_drawBackground(){const e=this._backgroundImage;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new Ze().scale(this.style.width/e.width,this.style.height/e.height),this._fillBoundingRect())}_drawContent(){this._fillBoundingRect()}_drawBorder(){this.style.borderWidth&&this.style.borderStyle!=="none"&&(this.context.lineWidth=this.style.borderWidth,this.context.strokeStyle=this.style.borderColor,this._strokeBoundingRect())}_drawOutline(){this.style.outlineWidth&&this.style.outlineColor!=="none"&&(this.context.lineWidth=this.style.outlineWidth,this.context.strokeStyle=this.style.outlineColor,this._strokeBoundingRect())}_drawBoundingRect(){const{borderRadius:e,width:t,height:i}=this.style;t&&i&&(e?this.context.roundRect(0,0,t,i,e):this.context.rect(0,0,t,i))}_fillBoundingRect(){this._drawBoundingRect(),this.context.fill()}_strokeBoundingRect(){this._drawBoundingRect(),this.context.stroke()}_relayout(e){return this._reflow(e)}_reflow(e){return this._repaint(e)}_repaint(e){const t=this.style.getComputedFilterColorMatrix();return e.map(i=>({...i,backgroundColor:this.style.getComputedBackgroundColor().abgr,modulate:this._modulate.toArgb(this.opacity,!0),colorMatrix:t.toMatrix4().toArray(!0),colorMatrixOffset:t.toVector4().toArray(),blendMode:this.blendMode}))}_render(e){let t;this._redrawing?(this.emit("draw"),this._draw(),this._originalBatchables=this.context.toBatchables(),this._layoutedBatchables=this._relayout(this._originalBatchables),t=this._layoutedBatchables,this._resetContext&&this.context.reset()):this._reflowing?(this._layoutedBatchables=this._reflow(this._originalBatchables),t=this._layoutedBatchables):this._repainting&&(t=this._repaint(this._layoutedBatchables)),t&&(this._batchables=t,this._redrawing=!1,this._reflowing=!1,this._repainting=!1),this._batchables.forEach(i=>{var s,n;(s=i.texture)==null||s.upload(e),e.batch2D.render({...i,texture:(n=i.texture)==null?void 0:n._glTexture(e)})}),super._render(e)}toJSON(){const e=super.toJSON();return{...e,props:{style:this.style.toJSON(),...e.props}}}},Os([_()],f.CanvasItem.prototype,"modulate",2),Os([_()],f.CanvasItem.prototype,"blendMode",2),f.CanvasItem=Os([ae("CanvasItem")],f.CanvasItem);class Zc{constructor(){g(this,"currentCall");g(this,"calls",[])}createCall(A){return{renderable:A,parentCall:this.currentCall,fn:A.render.bind(A),calls:[]}}push(A){var t;const e=this.createCall(A);return(((t=this.currentCall)==null?void 0:t.calls)??this.calls).push(e),e}render(A){this.calls.forEach(function e(t){t.fn(A,()=>{t.calls.forEach(e)})}),this.calls=[]}}var $c=Object.defineProperty,eu=Object.getOwnPropertyDescriptor,yi=(r,A,e,t)=>{for(var i=t>1?void 0:t?eu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&$c(A,e,i),i};f.Timeline=class extends f.Node{static from(A,e=!1){const[t,i]=A?Array.isArray(A)?A:[0,A]:[];return new f.Timeline({startTime:t,endTime:i,loop:e})}constructor(A){super(),this.setProperties(A)}_updateProperty(A,e,t){switch(super._updateProperty(A,e,t),A){case"startTime":this.startTime=Math.min(e,this.endTime);break;case"endTime":this.endTime=e||Number.MAX_SAFE_INTEGER;break}}addTime(A){const e=this.startTime,t=this.endTime;let i=this.currentTime;return i=i+A,this.loop&&i>t&&(i=e+i%t),i=_t(e,i,t),this.currentTime=i,this.emit("updateCurrentTime",i,A),this}_process(A){super._process(A),this.addTime(A)}},yi([_({default:0})],f.Timeline.prototype,"startTime",2),yi([_({default:0})],f.Timeline.prototype,"currentTime",2),yi([_({default:Number.MAX_SAFE_INTEGER})],f.Timeline.prototype,"endTime",2),yi([_({default:!1})],f.Timeline.prototype,"loop",2),f.Timeline=yi([ae("Timeline")],f.Timeline);var tu=Object.defineProperty,Sa=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&tu(A,e,i),i};class nr extends ji{constructor(e=new f.Timeline){super();g(this,"renderStack",new Zc);g(this,"root",new f.Viewport(!0).setTree(this));g(this,"timeline");g(this,"_backgroundColor",new Rt);g(this,"_currentViewport");this.timeline=e.setTree(this)}getCurrentViewport(){return this._currentViewport}setCurrentViewport(e){this._currentViewport=e}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"backgroundColor":this._backgroundColor.value=t;break}}_render(e,t=0){return this.timeline.addTime(t),this.emit("processing"),this.root.emit("process",t),this.emit("processed"),e.program.uniforms.projectionMatrix=this.root.toProjectionArray(!0),this.renderStack.render(e),this._renderScreen(e),this}_renderScreen(e){e.state.reset();const{pixelRatio:t}=e,{width:i,height:s}=this.root;e.framebuffer.bind(null),e.viewport.bind({x:0,y:0,width:i*t,height:s*t}),this.backgroundColor&&e.gl.clearColor(...this._backgroundColor.toArray()),e.clear(),this.backgroundColor&&e.gl.clearColor(0,0,0,0);const n=this.root.texture;n.activate(e,0),Ie.draw(e),e.texture.unbind(n)}}Sa([_({default:!1})],nr.prototype,"paused"),Sa([_()],nr.prototype,"backgroundColor");var Au=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,ru=(r,A,e,t)=>{for(var i=t>1?void 0:t?iu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Au(A,e,i),i};f.Transition=class extends f.Effect{constructor(A,e=[]){super(),this.setProperties(A).append(e)}},f.Transition=ru([ae("Transition",{effectMode:"transition",processMode:"pausable",duration:2e3})],f.Transition);var su=Object.defineProperty,nu=Object.getOwnPropertyDescriptor,ou=(r,A,e,t)=>{for(var i=t>1?void 0:t?nu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&su(A,e,i),i};f.Node2D=class extends f.CanvasItem{constructor(e,t=[]){super();g(this,"transform",new Ze);g(this,"_parentTransformDirtyId");this.setProperties(e).append(t)}_updateStyleProperty(e,t,i){switch(super._updateStyleProperty(e,t,i),e){case"width":case"height":this.mask instanceof f.Node2D&&(this.mask.style.width=this.style.width,this.mask.style.height=this.style.height),this.requestRedraw();case"scaleX":case"scaleY":case"left":case"top":case"rotate":case"transform":case"transformOrigin":this._updateTransform();break;case"overflow":this._updateOverflow();break}}_updateTransform(){const e=this.getParent(),t=e==null?void 0:e.transform;this._parentTransformDirtyId=t==null?void 0:t.dirtyId;const i=this.style.getComputedTransform().toArray();let s;if(t){const n=t.toArray();s=[i[0]*n[0]+i[3]*n[1],i[1]*n[0]+i[4]*n[1],i[2]*n[0]+i[5]*n[1]+n[2],i[0]*n[3]+i[3]*n[4],i[1]*n[3]+i[4]*n[4],i[2]*n[3]+i[5]*n[4]+n[5],0,0,1]}else s=i;this.transform.set(s),this._updateOverflow(),this.requestReflow()}getRect(){const[e,t,i,s,n,o]=this.transform.toArray(),a=this.style.width,l=this.style.height;return new hi(i,o,e*a+t*l,s*a+n*l)}_updateOverflow(){if(this.style.overflow==="hidden"){const e=this.getRect();this.mask={x:e.x,y:e.y,width:e.width,height:e.height}}else this.mask=void 0}_transformVertices(e){const[t,i,s,n,o,a]=this.transform.toArray(),l=e.slice();for(let h=e.length,c=0;c<h;c+=2){const u=e[c],d=e[c+1];l[c]=t*u+i*d+s,l[c+1]=n*u+o*d+a}return l}_reflow(e){return super._reflow(e.map(t=>({...t,vertices:this._transformVertices(t.vertices)})))}_process(e){var i;const t=this.getParent();((i=t==null?void 0:t.transform)==null?void 0:i.dirtyId)!==this._parentTransformDirtyId&&this._updateTransform(),super._process(e)}_input(e,t){if(super._input(e,t),!e.target&&this.isVisibleInTree()&&this.style.canPointeEvents())switch(t){case"pointerdown":case"pointermove":case"pointerup":{const{screenX:i,screenY:s}=e;if(i&&s){const{width:n,height:o}=this.style,[a,l]=this.transform.inverse().applyToPoint(i,s);a>=0&&a<n&&l>=0&&l<o&&(e.target=this,this.emit(t,e))}break}}}clone(){return new this.constructor(this.toJSON(),this.getChildren(!0))}},f.Node2D=ou([ae("Node2D")],f.Node2D);var au=Object.defineProperty,lu=Object.getOwnPropertyDescriptor,Fe=(r,A,e,t)=>{for(var i=t>1?void 0:t?lu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&au(A,e,i),i};function Ge(r){return function(A,e){Object.defineProperty(A.constructor.prototype,e,{get(){return r!=null&&r.method?(...t)=>(this.context[e].call(this.context,...t),r.redraw&&this.requestRedraw(),A):this.context[e]},set(t){this.context[e]=t},configurable:!0,enumerable:!0})}}f.Graphics2D=class extends f.Node2D{constructor(){super(...arguments);g(this,"_resetContext",!1);g(this,"lineCap");g(this,"lineJoin");g(this,"fillStyle");g(this,"strokeStyle");g(this,"lineWidth");g(this,"miterLimit")}drawCircle(e,t,i){return this.arc(e+i,t+i,i,0,Ce),this.fill(),this}drawEllipse(e,t,i,s){const n=i/2,o=s/2;return this.ellipse(e+n,t+o,n,o,0,0,Ce),this.fill(),this}},Fe([Ge()],f.Graphics2D.prototype,"lineCap",2),Fe([Ge()],f.Graphics2D.prototype,"lineJoin",2),Fe([Ge()],f.Graphics2D.prototype,"fillStyle",2),Fe([Ge()],f.Graphics2D.prototype,"strokeStyle",2),Fe([Ge()],f.Graphics2D.prototype,"lineWidth",2),Fe([Ge()],f.Graphics2D.prototype,"miterLimit",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"rect",2),Fe([Ge({method:!0,redraw:!0})],f.Graphics2D.prototype,"fillRect",2),Fe([Ge({method:!0,redraw:!0})],f.Graphics2D.prototype,"strokeRect",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"roundRect",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"ellipse",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"arc",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"beginPath",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"moveTo",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"lineTo",2),Fe([Ge({method:!0})],f.Graphics2D.prototype,"closePath",2),Fe([Ge({method:!0,redraw:!0})],f.Graphics2D.prototype,"fill",2),Fe([Ge({method:!0,redraw:!0})],f.Graphics2D.prototype,"stroke",2),f.Graphics2D=Fe([ae("Graphics2D")],f.Graphics2D);class or extends St{constructor(e){super();g(this,"frames");let t;if(Array.isArray(e))t=e;else if(e instanceof Ne)t=[{texture:e,duration:0}];else throw new TypeError("Failed new Image2DResource");this.frames=t,this.updateDuration()}updateDuration(){return this.duration=this.frames.reduce((e,t)=>t.duration+e,0),this}destroy(){this.frames.forEach(e=>{e.texture.destroy()})}}var hu=Object.defineProperty,gu=Object.getOwnPropertyDescriptor,ar=(r,A,e,t)=>{for(var i=t>1?void 0:t?gu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&hu(A,e,i),i};f.Image2D=class extends f.Node2D{constructor(e,t=[]){super();g(this,"resource");g(this,"_frameIndex",0);g(this,"_complete",!1);g(this,"_wait",Promise.resolve());this.setProperties(e),this.append(t)}get currentTexture(){var e,t;return(t=(e=this.resource)==null?void 0:e.frames[this._frameIndex])==null?void 0:t.texture}get framesDuration(){var e;return((e=this.resource)==null?void 0:e.duration)??0}get naturalWidth(){var e;return((e=this.currentTexture)==null?void 0:e.realWidth)??0}get naturalHeight(){var e;return((e=this.currentTexture)==null?void 0:e.realHeight)??0}get complete(){return this._complete}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._wait=this._load(t);break}}decode(){return this._wait}setResource(e){let t;if(e instanceof or?t=e:t=new or(e),this.resource=t.updateDuration(),this.currentTexture&&(!this.style.width||!this.style.height)){const i=this.currentTexture;this.style.width=i.realWidth,this.style.height=i.realHeight}return this}async _load(e){if(this._complete=!1,e)try{this.setResource(this.gif?await Ot.gif.load(e):await Ot.texture.load(e)),this.requestRedraw(),this.emit("load")}catch(t){console.warn(t),this.emit("error",t)}else this.resource=void 0;this._complete=!0}_getFrameCurrentTime(){const e=this.framesDuration;if(!e||!this._tree)return 0;const t=this._currentTime;return t<0?0:t%e}_updateFrameIndex(){if(!this.resource)return this;const e=this._getFrameCurrentTime(),t=this.resource.frames,i=t.length;if(i<=1&&this._frameIndex===0)return this;let s=i-1;for(let n=0,o=0;o<i;o++)if(n+=t[o].duration??0,n>=e){s=o;break}return this._frameIndex!==s&&(this._frameIndex=s,this.requestRepaint()),this}_process(e){this._updateFrameIndex(),super._process(e)}_drawContent(){const e=this.currentTexture;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new Ze().scale(this.style.width/e.width,this.style.height/e.height),super._drawContent())}},ar([Me()],f.Image2D.prototype,"resource",2),ar([_({default:!1})],f.Image2D.prototype,"gif",2),ar([_({default:""})],f.Image2D.prototype,"src",2),f.Image2D=ar([ae("Image2D")],f.Image2D);class lr extends f.Node2D{constructor(){super(...arguments);g(this,"texture")}_drawContent(){var e;(e=this.texture)!=null&&e.valid&&(this.context.fillStyle=this.texture,this.context.textureTransform=new Ze().scale(this.style.width/this.texture.width,this.style.height/this.texture.height),super._drawContent())}}var cu=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,Ma=(r,A,e,t)=>{for(var i=t>1?void 0:t?uu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&cu(A,e,i),i};f.Lottie2D=class extends lr{constructor(e,t=[]){super();g(this,"texture",new Ii);g(this,"animation");this.setProperties(e),this.append(t)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._load();break}}_updateStyleProperty(e,t,i){switch(super._updateStyleProperty(e,t,i),e){case"width":this.texture.width=this.style.width;break;case"height":this.texture.height=this.style.height;break}}async _load(){this.animation=await Ot.lottie.load(this.src,this.texture.source),this.duration=this.animation.getDuration(!1)*1e3,this.texture.requestUpload(),this.requestRedraw()}_process(e){var t;(t=this.animation)==null||t.goToAndStop(this.currentTime,!1),this.texture.requestUpload(),this.requestRepaint(),super._process(e)}},Ma([_({default:""})],f.Lottie2D.prototype,"src",2),f.Lottie2D=Ma([ae("Lottie2D")],f.Lottie2D);var $e=Uint8Array,dt=Uint16Array,Hs=Int32Array,hr=new $e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),gr=new $e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Js=new $e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ra=function(r,A){for(var e=new dt(31),t=0;t<31;++t)e[t]=A+=1<<r[t-1];for(var i=new Hs(e[30]),t=1;t<30;++t)for(var s=e[t];s<e[t+1];++s)i[s]=s-e[t]<<5|t;return{b:e,r:i}},Ua=Ra(hr,2),ka=Ua.b,Ks=Ua.r;ka[28]=258,Ks[258]=28;for(var Pa=Ra(gr,0),fu=Pa.b,Na=Pa.r,Ys=new dt(32768),Qe=0;Qe<32768;++Qe){var iA=(Qe&43690)>>1|(Qe&21845)<<1;iA=(iA&52428)>>2|(iA&13107)<<2,iA=(iA&61680)>>4|(iA&3855)<<4,Ys[Qe]=((iA&65280)>>8|(iA&255)<<8)>>1}for(var Ft=function(r,A,e){for(var t=r.length,i=0,s=new dt(A);i<t;++i)r[i]&&++s[r[i]-1];var n=new dt(A);for(i=1;i<A;++i)n[i]=n[i-1]+s[i-1]<<1;var o;if(e){o=new dt(1<<A);var a=15-A;for(i=0;i<t;++i)if(r[i])for(var l=i<<4|r[i],h=A-r[i],c=n[r[i]-1]++<<h,u=c|(1<<h)-1;c<=u;++c)o[Ys[c]>>a]=l}else for(o=new dt(t),i=0;i<t;++i)r[i]&&(o[i]=Ys[n[r[i]-1]++]>>15-r[i]);return o},rA=new $e(288),Qe=0;Qe<144;++Qe)rA[Qe]=8;for(var Qe=144;Qe<256;++Qe)rA[Qe]=9;for(var Qe=256;Qe<280;++Qe)rA[Qe]=7;for(var Qe=280;Qe<288;++Qe)rA[Qe]=8;for(var mi=new $e(32),Qe=0;Qe<32;++Qe)mi[Qe]=5;var du=Ft(rA,9,0),Iu=Ft(rA,9,1),Bu=Ft(mi,5,0),Eu=Ft(mi,5,1),Ws=function(r){for(var A=r[0],e=1;e<r.length;++e)r[e]>A&&(A=r[e]);return A},vt=function(r,A,e){var t=A/8|0;return(r[t]|r[t+1]<<8)>>(A&7)&e},Vs=function(r,A){var e=A/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(A&7)},Xs=function(r){return(r+7)/8|0},Fa=function(r,A,e){return(e==null||e>r.length)&&(e=r.length),new $e(r.subarray(A,e))},pu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],bt=function(r,A,e){var t=new Error(A||pu[r]);if(t.code=r,Error.captureStackTrace&&Error.captureStackTrace(t,bt),!e)throw t;return t},Cu=function(r,A,e,t){var i=r.length,s=0;if(!i||A.f&&!A.l)return e||new $e(0);var n=!e,o=n||A.i!=2,a=A.i;n&&(e=new $e(i*3));var l=function(Ye){var ce=e.length;if(Ye>ce){var _e=new $e(Math.max(ce*2,Ye));_e.set(e),e=_e}},h=A.f||0,c=A.p||0,u=A.b||0,d=A.l,I=A.d,C=A.m,B=A.n,U=i*8;do{if(!d){h=vt(r,c,1);var M=vt(r,c+1,3);if(c+=3,M)if(M==1)d=Iu,I=Eu,C=9,B=5;else if(M==2){var Q=vt(r,c,31)+257,v=vt(r,c+10,15)+4,x=Q+vt(r,c+5,31)+1;c+=14;for(var k=new $e(x),Z=new $e(19),Y=0;Y<v;++Y)Z[Js[Y]]=vt(r,c+Y*3,7);c+=v*3;for(var L=Ws(Z),te=(1<<L)-1,N=Ft(Z,L,1),Y=0;Y<x;){var $=N[vt(r,c,te)];c+=$&15;var D=$>>4;if(D<16)k[Y++]=D;else{var Ae=0,J=0;for(D==16?(J=3+vt(r,c,3),c+=2,Ae=k[Y-1]):D==17?(J=3+vt(r,c,7),c+=3):D==18&&(J=11+vt(r,c,127),c+=7);J--;)k[Y++]=Ae}}var H=k.subarray(0,Q),oe=k.subarray(Q);C=Ws(H),B=Ws(oe),d=Ft(H,C,1),I=Ft(oe,B,1)}else bt(1);else{var D=Xs(c)+4,R=r[D-4]|r[D-3]<<8,b=D+R;if(b>i){a&&bt(0);break}o&&l(u+R),e.set(r.subarray(D,b),u),A.b=u+=R,A.p=c=b*8,A.f=h;continue}if(c>U){a&&bt(0);break}}o&&l(u+131072);for(var z=(1<<C)-1,X=(1<<B)-1,ge=c;;ge=c){var Ae=d[Vs(r,c)&z],ie=Ae>>4;if(c+=Ae&15,c>U){a&&bt(0);break}if(Ae||bt(2),ie<256)e[u++]=ie;else if(ie==256){ge=c,d=null;break}else{var le=ie-254;if(ie>264){var Y=ie-257,re=hr[Y];le=vt(r,c,(1<<re)-1)+ka[Y],c+=re}var he=I[Vs(r,c)&X],V=he>>4;he||bt(3),c+=he&15;var oe=fu[V];if(V>3){var re=gr[V];oe+=Vs(r,c)&(1<<re)-1,c+=re}if(c>U){a&&bt(0);break}o&&l(u+131072);var Ee=u+le;if(u<oe){var ht=s-oe,gt=Math.min(oe,Ee);for(ht+u<0&&bt(3);u<gt;++u)e[u]=t[ht+u]}for(;u<Ee;++u)e[u]=e[u-oe]}}A.l=d,A.p=ge,A.b=u,A.f=h,d&&(h=1,A.m=C,A.d=I,A.n=B)}while(!h);return u!=e.length&&n?Fa(e,0,u):e.subarray(0,u)},qt=function(r,A,e){e<<=A&7;var t=A/8|0;r[t]|=e,r[t+1]|=e>>8},wi=function(r,A,e){e<<=A&7;var t=A/8|0;r[t]|=e,r[t+1]|=e>>8,r[t+2]|=e>>16},qs=function(r,A){for(var e=[],t=0;t<r.length;++t)r[t]&&e.push({s:t,f:r[t]});var i=e.length,s=e.slice();if(!i)return{t:Oa,l:0};if(i==1){var n=new $e(e[0].s+1);return n[e[0].s]=1,{t:n,l:1}}e.sort(function(b,Q){return b.f-Q.f}),e.push({s:-1,f:25001});var o=e[0],a=e[1],l=0,h=1,c=2;for(e[0]={s:-1,f:o.f+a.f,l:o,r:a};h!=i-1;)o=e[e[l].f<e[c].f?l++:c++],a=e[l!=h&&e[l].f<e[c].f?l++:c++],e[h++]={s:-1,f:o.f+a.f,l:o,r:a};for(var u=s[0].s,t=1;t<i;++t)s[t].s>u&&(u=s[t].s);var d=new dt(u+1),I=zs(e[h-1],d,0);if(I>A){var t=0,C=0,B=I-A,U=1<<B;for(s.sort(function(Q,v){return d[v.s]-d[Q.s]||Q.f-v.f});t<i;++t){var M=s[t].s;if(d[M]>A)C+=U-(1<<I-d[M]),d[M]=A;else break}for(C>>=B;C>0;){var D=s[t].s;d[D]<A?C-=1<<A-d[D]++-1:++t}for(;t>=0&&C;--t){var R=s[t].s;d[R]==A&&(--d[R],++C)}I=A}return{t:new $e(d),l:I}},zs=function(r,A,e){return r.s==-1?Math.max(zs(r.l,A,e+1),zs(r.r,A,e+1)):A[r.s]=e},Ta=function(r){for(var A=r.length;A&&!r[--A];);for(var e=new dt(++A),t=0,i=r[0],s=1,n=function(a){e[t++]=a},o=1;o<=A;++o)if(r[o]==i&&o!=A)++s;else{if(!i&&s>2){for(;s>138;s-=138)n(32754);s>2&&(n(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(n(i),--s;s>6;s-=6)n(8304);s>2&&(n(s-3<<5|8208),s=0)}for(;s--;)n(i);s=1,i=r[o]}return{c:e.subarray(0,t),n:A}},_i=function(r,A){for(var e=0,t=0;t<A.length;++t)e+=r[t]*A[t];return e},La=function(r,A,e){var t=e.length,i=Xs(A+2);r[i]=t&255,r[i+1]=t>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var s=0;s<t;++s)r[i+s+4]=e[s];return(i+4+t)*8},Ga=function(r,A,e,t,i,s,n,o,a,l,h){qt(A,h++,e),++i[256];for(var c=qs(i,15),u=c.t,d=c.l,I=qs(s,15),C=I.t,B=I.l,U=Ta(u),M=U.c,D=U.n,R=Ta(C),b=R.c,Q=R.n,v=new dt(19),x=0;x<M.length;++x)++v[M[x]&31];for(var x=0;x<b.length;++x)++v[b[x]&31];for(var k=qs(v,7),Z=k.t,Y=k.l,L=19;L>4&&!Z[Js[L-1]];--L);var te=l+5<<3,N=_i(i,rA)+_i(s,mi)+n,$=_i(i,u)+_i(s,C)+n+14+3*L+_i(v,Z)+2*v[16]+3*v[17]+7*v[18];if(a>=0&&te<=N&&te<=$)return La(A,h,r.subarray(a,a+l));var Ae,J,H,oe;if(qt(A,h,1+($<N)),h+=2,$<N){Ae=Ft(u,d,0),J=u,H=Ft(C,B,0),oe=C;var z=Ft(Z,Y,0);qt(A,h,D-257),qt(A,h+5,Q-1),qt(A,h+10,L-4),h+=14;for(var x=0;x<L;++x)qt(A,h+3*x,Z[Js[x]]);h+=3*L;for(var X=[M,b],ge=0;ge<2;++ge)for(var ie=X[ge],x=0;x<ie.length;++x){var le=ie[x]&31;qt(A,h,z[le]),h+=Z[le],le>15&&(qt(A,h,ie[x]>>5&127),h+=ie[x]>>12)}}else Ae=du,J=rA,H=Bu,oe=mi;for(var x=0;x<o;++x){var re=t[x];if(re>255){var le=re>>18&31;wi(A,h,Ae[le+257]),h+=J[le+257],le>7&&(qt(A,h,re>>23&31),h+=hr[le]);var he=re&31;wi(A,h,H[he]),h+=oe[he],he>3&&(wi(A,h,re>>5&8191),h+=gr[he])}else wi(A,h,Ae[re]),h+=J[re]}return wi(A,h,Ae[256]),h+J[256]},Qu=new Hs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Oa=new $e(0),yu=function(r,A,e,t,i,s){var n=s.z||r.length,o=new $e(t+n+5*(1+Math.ceil(n/7e3))+i),a=o.subarray(t,o.length-i),l=s.l,h=(s.r||0)&7;if(A){h&&(a[0]=s.r>>3);for(var c=Qu[A-1],u=c>>13,d=c&8191,I=(1<<e)-1,C=s.p||new dt(32768),B=s.h||new dt(I+1),U=Math.ceil(e/3),M=2*U,D=function(We){return(r[We]^r[We+1]<<U^r[We+2]<<M)&I},R=new Hs(25e3),b=new dt(288),Q=new dt(32),v=0,x=0,k=s.i||0,Z=0,Y=s.w||0,L=0;k+2<n;++k){var te=D(k),N=k&32767,$=B[te];if(C[N]=$,B[te]=N,Y<=k){var Ae=n-k;if((v>7e3||Z>24576)&&(Ae>423||!l)){h=Ga(r,a,0,R,b,Q,x,Z,L,k-L,h),Z=v=x=0,L=k;for(var J=0;J<286;++J)b[J]=0;for(var J=0;J<30;++J)Q[J]=0}var H=2,oe=0,z=d,X=N-$&32767;if(Ae>2&&te==D(k-X))for(var ge=Math.min(u,Ae)-1,ie=Math.min(32767,k),le=Math.min(258,Ae);X<=ie&&--z&&N!=$;){if(r[k+H]==r[k+H-X]){for(var re=0;re<le&&r[k+re]==r[k+re-X];++re);if(re>H){if(H=re,oe=X,re>ge)break;for(var he=Math.min(X,re-2),V=0,J=0;J<he;++J){var Ee=k-X+J&32767,ht=C[Ee],gt=Ee-ht&32767;gt>V&&(V=gt,$=Ee)}}}N=$,$=C[N],X+=N-$&32767}if(oe){R[Z++]=268435456|Ks[H]<<18|Na[oe];var Ye=Ks[H]&31,ce=Na[oe]&31;x+=hr[Ye]+gr[ce],++b[257+Ye],++Q[ce],Y=k+H,++v}else R[Z++]=r[k],++b[r[k]]}}for(k=Math.max(k,Y);k<n;++k)R[Z++]=r[k],++b[r[k]];h=Ga(r,a,l,R,b,Q,x,Z,L,k-L,h),l||(s.r=h&7|a[h/8|0]<<3,h-=7,s.h=B,s.p=C,s.i=k,s.w=Y)}else{for(var k=s.w||0;k<n+l;k+=65535){var _e=k+65535;_e>=n&&(a[h/8|0]=l,_e=n),h=La(a,h+1,r.subarray(k,_e))}s.i=n}return Fa(o,0,t+Xs(h)+i)},Ha=function(){var r=1,A=0;return{p:function(e){for(var t=r,i=A,s=e.length|0,n=0;n!=s;){for(var o=Math.min(n+2655,s);n<o;++n)i+=t+=e[n];t=(t&65535)+15*(t>>16),i=(i&65535)+15*(i>>16)}r=t,A=i},d:function(){return r%=65521,A%=65521,(r&255)<<24|(r&65280)<<8|(A&255)<<8|A>>8}}},mu=function(r,A,e,t,i){if(!i&&(i={l:1},A.dictionary)){var s=A.dictionary.subarray(-32768),n=new $e(s.length+r.length);n.set(s),n.set(r,s.length),r=n,i.w=s.length}return yu(r,A.level==null?6:A.level,A.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+A.mem,e,t,i)},Ja=function(r,A,e){for(;e;++A)r[A]=e,e>>>=8},wu=function(r,A){var e=A.level,t=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=t<<6|(A.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,A.dictionary){var i=Ha();i.p(A.dictionary),Ja(r,2,i.d())}},_u=function(r,A){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&bt(6,"invalid zlib data"),(r[1]>>5&1)==1&&bt(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function vu(r,A){A||(A={});var e=Ha();e.p(r);var t=mu(r,A,A.dictionary?6:2,4);return wu(t,A),Ja(t,t.length-4,e.d()),t}function bu(r,A){return Cu(r.subarray(_u(r),-4),{i:2},A,A)}var Du=typeof TextDecoder<"u"&&new TextDecoder,xu=0;try{Du.decode(Oa,{stream:!0}),xu=1}catch{}const Su="modern-font";function vi(r,A){if(!r)throw new Error(`[${Su}] ${A}`)}function Mu(r){if("buffer"in r){const A=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?A.slice(r.byteOffset,r.byteOffset+r.byteLength):A}else return r}function HA(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function Ru(r){let A="";for(let e=0,t=r.length,i;e<t;e++)i=r.charCodeAt(e),i!==0&&(A+=String.fromCharCode(i));return A}function cr(r){r=Ru(r);const A=[];for(let e=0,t=r.length,i;e<t;e++)i=r.charCodeAt(e),A.push(i>>8),A.push(i&255);return A}function Uu(r){let A="";for(let e=0,t=r.length;e<t;e++)r[e]<127?A+=String.fromCharCode(r[e]):A+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(A)}function ku(r){let A="";for(let e=0,t=r.length;e<t;e+=2)A+=String.fromCharCode((r[e]<<8)+r[e+1]);return A}var Pu=Object.defineProperty,et=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Pu(A,e,i),i};const bi={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function tt(){return function(r,A){Object.defineProperty(r.constructor.prototype,A,{get(){if(typeof A=="string"){if(A.startsWith("read"))return(...e)=>this.read(A.substring(4).toLowerCase(),...e);if(A.startsWith("write"))return(...e)=>this.write(A.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class Oe extends DataView{constructor(e,t,i,s){super(Mu(e),t,i);g(this,"cursor",0);this.littleEndian=s}readColumn(e){if(e.size){const t=Array.from({length:e.size},(i,s)=>this.read(e.type,e.offset+s));switch(e.type){case"char":return t.join("");default:return t}}else return this.read(e.type,e.offset)}writeColumn(e,t){e.size?Array.from({length:e.size},(i,s)=>{this.write(e.type,t[s],e.offset+s)}):this.write(e.type,t,e.offset)}read(e,t=this.cursor,i=this.littleEndian){var l;switch(e){case"char":return this.readChar(t);case"fixed":return this.readFixed(t,i);case"longDateTime":return this.readLongDateTime(t,i)}const s=`get${e.replace(/^\S/,h=>h.toUpperCase())}`,n=this,o=(l=n[s])==null?void 0:l.bind(n),a=o==null?void 0:o(t,i);return this.cursor+=bi[e],a}readUint24(e=this.cursor){const[t,i,s]=this.readBytes(e,3);return(t<<16)+(i<<8)+s}readBytes(e,t){t==null&&(t=e,e=this.cursor);const i=[];for(let s=0;s<t;++s)i.push(this.getUint8(e+s));return this.cursor=e+t,i}readString(e,t){const i=this.readBytes(e,t);let s="";for(let n=0,o=i.length;n<o;n++)s+=String.fromCharCode(i[n]);return s}readFixed(e,t){const i=this.readInt32(e,t)/65536;return Math.ceil(i*1e5)/1e5}readLongDateTime(e=this.cursor,t){const i=this.readUint32(e+4,t),s=new Date;return s.setTime(i*1e3+-20775456e5),s}readChar(e){return this.readString(e,1)}write(e,t,i=this.cursor,s=this.littleEndian){var h;switch(e){case"char":return this.writeChar(t,i);case"fixed":return this.writeFixed(t,i);case"longDateTime":return this.writeLongDateTime(t,i)}const n=`set${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,a=(h=o[n])==null?void 0:h.bind(o),l=a==null?void 0:a(i,t,s);return this.cursor+=bi[e.toLowerCase()],l}writeString(e="",t=this.cursor){const i=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let s=0,n=e.length,o;s<n;++s)o=e.charCodeAt(s)||0,o>127?this.writeUint16(o):this.writeUint8(o);return this.cursor+=i,this}writeChar(e,t){return this.writeString(e,t)}writeFixed(e,t){return this.writeInt32(Math.round(e*65536),t),this}writeLongDateTime(e,t=this.cursor){typeof e>"u"?e=-20775456e5:typeof e.getTime=="function"?e=e.getTime():/^\d+$/.test(e)?e=+e:e=Date.parse(e);const s=Math.round((e- -20775456e5)/1e3);return this.writeUint32(0,t),this.writeUint32(s,t+4),this}writeBytes(e,t=this.cursor){let i;if(Array.isArray(e)){i=e.length;for(let s=0;s<i;++s)this.setUint8(t+s,e[s])}else{const s=HA(e);i=s.byteLength;for(let n=0;n<i;++n)this.setUint8(t+n,s.getUint8(n))}return this.cursor=t+i,this}seek(e){return this.cursor=e,this}}et([tt()],Oe.prototype,"readInt8"),et([tt()],Oe.prototype,"readInt16"),et([tt()],Oe.prototype,"readInt32"),et([tt()],Oe.prototype,"readUint8"),et([tt()],Oe.prototype,"readUint16"),et([tt()],Oe.prototype,"readUint32"),et([tt()],Oe.prototype,"readFloat32"),et([tt()],Oe.prototype,"readFloat64"),et([tt()],Oe.prototype,"writeInt8"),et([tt()],Oe.prototype,"writeInt16"),et([tt()],Oe.prototype,"writeInt32"),et([tt()],Oe.prototype,"writeUint8"),et([tt()],Oe.prototype,"writeUint16"),et([tt()],Oe.prototype,"writeUint32"),et([tt()],Oe.prototype,"writeFloat32"),et([tt()],Oe.prototype,"writeFloat64");const Ka=new WeakMap;function m(r){const A=typeof r=="object"?r:{type:r},{size:e=1,type:t}=A;return(i,s)=>{if(typeof s!="string")return;let n=Ka.get(i);n||(n={columns:[],byteLength:0},Ka.set(i,n));const o={...A,name:s,byteLength:e*bi[t],offset:A.offset??n.columns.reduce((a,l)=>a+l.byteLength,0)};n.columns.push(o),n.byteLength=n.columns.reduce((a,l)=>a+bi[l.type]*(l.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(o)},set(a){this.view.writeColumn(o,a)},configurable:!0,enumerable:!0})}}class It{constructor(A,e,t,i){g(this,"view");this.view=new Oe(A,e,t,i)}}class ur extends It{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(A){return new FontFace(A,this.view.buffer)}}var Nu=Object.defineProperty,nt=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Nu(A,e,i),i};const ot=class Yl extends ur{constructor(){super(...arguments);g(this,"format","EmbeddedOpenType");g(this,"mimeType","application/vnd.ms-fontobject")}static from(e){const t=e.sfnt,s=t.name.names,n=cr(s.fontFamily||""),o=n.length,a=cr(s.fontStyle||""),l=a.length,h=cr(s.version||""),c=h.length,u=cr(s.fullName||""),d=u.length,I=86+o+4+l+4+c+4+d+2+e.view.byteLength,C=new Yl(new ArrayBuffer(I),0,I,!0);C.EOTSize=C.view.byteLength,C.FontDataSize=e.view.byteLength,C.Version=131073,C.Flags=0,C.Charset=1,C.MagicNumber=20556,C.Padding1=0,C.CheckSumAdjustment=t.head.checkSumAdjustment;const B=t.os2;return B&&(C.FontPANOSE=B.fontPANOSE,C.Italic=B.fsSelection,C.Weight=B.usWeightClass,C.fsType=B.fsType,C.UnicodeRange=B.ulUnicodeRange,C.CodePageRange=B.ulCodePageRange),C.view.writeUint16(o),C.view.writeBytes(n),C.view.writeUint16(0),C.view.writeUint16(l),C.view.writeBytes(a),C.view.writeUint16(0),C.view.writeUint16(c),C.view.writeBytes(h),C.view.writeUint16(0),C.view.writeUint16(d),C.view.writeBytes(u),C.view.writeUint16(0),C.view.writeUint16(0),C.view.writeBytes(e.view),C}};nt([m("uint32")],ot.prototype,"EOTSize"),nt([m("uint32")],ot.prototype,"FontDataSize"),nt([m("uint32")],ot.prototype,"Version"),nt([m("uint32")],ot.prototype,"Flags"),nt([m({type:"uint8",size:10})],ot.prototype,"FontPANOSE"),nt([m("uint8")],ot.prototype,"Charset"),nt([m("uint8")],ot.prototype,"Italic"),nt([m("uint32")],ot.prototype,"Weight"),nt([m("uint16")],ot.prototype,"fsType"),nt([m("uint16")],ot.prototype,"MagicNumber"),nt([m({type:"uint8",size:16})],ot.prototype,"UnicodeRange"),nt([m({type:"uint8",size:8})],ot.prototype,"CodePageRange"),nt([m("uint32")],ot.prototype,"CheckSumAdjustment"),nt([m({type:"uint8",size:16})],ot.prototype,"Reserved"),nt([m("uint16")],ot.prototype,"Padding1");var Fu=Object.defineProperty,fr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Fu(A,e,i),i};class JA extends It{constructor(A,e){super(A,e,16)}}fr([m({type:"char",size:4})],JA.prototype,"tag"),fr([m("uint32")],JA.prototype,"checkSum"),fr([m("uint32")],JA.prototype,"offset"),fr([m("uint32")],JA.prototype,"length");const js=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Tu=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Zs{constructor(A){g(this,"index");g(this,"name");g(this,"isComposite",!1);g(this,"components",[]);g(this,"pathCommands",[]);const e={...A};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(A=0,e=0,t=72,i={},s){const n=1/((s==null?void 0:s.unitsPerEm)??1e3)*t,{xScale:o=n,yScale:a=n}=i,l=this.pathCommands,h=[];for(let c=0,u=l.length;c<u;c+=1){const d=l[c];d.type==="M"?h.push({type:"M",x:A+d.x*o,y:e+-d.y*a}):d.type==="L"?h.push({type:"L",x:A+d.x*o,y:e+-d.y*a}):d.type==="Q"?h.push({type:"Q",x1:A+d.x1*o,y1:e+-d.y1*a,x:A+d.x*o,y:e+-d.y*a}):d.type==="C"?h.push({type:"C",x1:A+d.x1*o,y1:e+-d.y1*a,x2:A+d.x2*o,y2:e+-d.y2*a,x:A+d.x*o,y:e+-d.y*a}):d.type==="Z"&&h.push({type:"Z"})}return h}}class Lu extends Zs{parse(A,e,t){const i=this,{nominalWidthX:s,defaultWidthX:n,gsubrsBias:o,subrsBias:a}=A,l=A.topDict.paintType,h=this.index;let c,u,d,I;const C=[],B=[];let U=0,M=!1,D=!1,R=n,b=0,Q=0;function v(N,$){C.push({type:"L",x:N,y:$})}function x(N,$,Ae,J,H,oe){C.push({type:"C",x1:N,y1:$,x2:Ae,y2:J,x:H,y:oe})}function k(N,$){D&&l!==2&&Z(),D=!0,C.push({type:"M",x:N,y:$})}function Z(){C.push({type:"Z"})}function Y(N){C.push(...N)}function L(){B.length%2!==0&&!M&&(R=B.shift()+s),U+=B.length>>1,B.length=0,M=!0}function te(N){let $,Ae,J,H,oe,z,X,ge,ie,le,re,he,V=0;for(;V<N.length;){let Ee=N[V++];switch(Ee){case 1:L();break;case 3:L();break;case 4:B.length>1&&!M&&(R=B.shift()+s,M=!0),Q+=B.pop(),k(b,Q);break;case 5:for(;B.length>0;)b+=B.shift(),Q+=B.shift(),v(b,Q);break;case 6:for(;B.length>0&&(b+=B.shift(),v(b,Q),B.length!==0);)Q+=B.shift(),v(b,Q);break;case 7:for(;B.length>0&&(Q+=B.shift(),v(b,Q),B.length!==0);)b+=B.shift(),v(b,Q);break;case 8:for(;B.length>0;)c=b+B.shift(),u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),b=d+B.shift(),Q=I+B.shift(),x(c,u,d,I,b,Q);break;case 10:oe=B.pop()+a,z=A.subrs[oe],z&&te(z);break;case 11:return;case 12:switch(Ee=N[V],V+=1,Ee){case 35:c=b+B.shift(),u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),X=d+B.shift(),ge=I+B.shift(),ie=X+B.shift(),le=ge+B.shift(),re=ie+B.shift(),he=le+B.shift(),b=re+B.shift(),Q=he+B.shift(),B.shift(),x(c,u,d,I,X,ge),x(ie,le,re,he,b,Q);break;case 34:c=b+B.shift(),u=Q,d=c+B.shift(),I=u+B.shift(),X=d+B.shift(),ge=I,ie=X+B.shift(),le=I,re=ie+B.shift(),he=Q,b=re+B.shift(),x(c,u,d,I,X,ge),x(ie,le,re,he,b,Q);break;case 36:c=b+B.shift(),u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),X=d+B.shift(),ge=I,ie=X+B.shift(),le=I,re=ie+B.shift(),he=le+B.shift(),b=re+B.shift(),x(c,u,d,I,X,ge),x(ie,le,re,he,b,Q);break;case 37:c=b+B.shift(),u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),X=d+B.shift(),ge=I+B.shift(),ie=X+B.shift(),le=ge+B.shift(),re=ie+B.shift(),he=le+B.shift(),Math.abs(re-b)>Math.abs(he-Q)?b=re+B.shift():Q=he+B.shift(),x(c,u,d,I,X,ge),x(ie,le,re,he,b,Q);break;default:console.warn(`Glyph ${h}: unknown operator ${1200+Ee}`),B.length=0}break;case 14:if(B.length>=4){const ht=js[B.pop()],gt=js[B.pop()],Ye=B.pop(),ce=B.pop();if(ht&&gt){i.isComposite=!0,i.components=[];const _e=A.charset.indexOf(ht),We=A.charset.indexOf(gt);i.components.push({glyphIndex:We,dx:0,dy:0}),i.components.push({glyphIndex:_e,dx:ce,dy:Ye}),Y(t.get(We).pathCommands);const je=JSON.parse(JSON.stringify(t.get(_e).pathCommands));for(let Se=0;Se<je.length;Se+=1){const rt=je[Se];rt.type!=="Z"&&(rt.x+=ce,rt.y+=Ye),(rt.type==="Q"||rt.type==="C")&&(rt.x1+=ce,rt.y1+=Ye),rt.type==="C"&&(rt.x2+=ce,rt.y2+=Ye)}Y(je)}}else B.length>0&&!M&&(R=B.shift()+s,M=!0);D&&l!==2&&(Z(),D=!1);break;case 18:L();break;case 19:case 20:L(),V+=U+7>>3;break;case 21:B.length>2&&!M&&(R=B.shift()+s,M=!0),Q+=B.pop(),b+=B.pop(),k(b,Q);break;case 22:B.length>1&&!M&&(R=B.shift()+s,M=!0),b+=B.pop(),k(b,Q);break;case 23:L();break;case 24:for(;B.length>2;)c=b+B.shift(),u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),b=d+B.shift(),Q=I+B.shift(),x(c,u,d,I,b,Q);b+=B.shift(),Q+=B.shift(),v(b,Q);break;case 25:for(;B.length>6;)b+=B.shift(),Q+=B.shift(),v(b,Q);c=b+B.shift(),u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),b=d+B.shift(),Q=I+B.shift(),x(c,u,d,I,b,Q);break;case 26:for(B.length%2&&(b+=B.shift());B.length>0;)c=b,u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),b=d,Q=I+B.shift(),x(c,u,d,I,b,Q);break;case 27:for(B.length%2&&(Q+=B.shift());B.length>0;)c=b+B.shift(),u=Q,d=c+B.shift(),I=u+B.shift(),b=d+B.shift(),Q=I,x(c,u,d,I,b,Q);break;case 28:$=N[V],Ae=N[V+1],B.push(($<<24|Ae<<16)>>16),V+=2;break;case 29:oe=B.pop()+o,z=A.gsubrs[oe],z&&te(z);break;case 30:for(;B.length>0&&(c=b,u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),b=d+B.shift(),Q=I+(B.length===1?B.shift():0),x(c,u,d,I,b,Q),B.length!==0);)c=b+B.shift(),u=Q,d=c+B.shift(),I=u+B.shift(),Q=I+B.shift(),b=d+(B.length===1?B.shift():0),x(c,u,d,I,b,Q);break;case 31:for(;B.length>0&&(c=b+B.shift(),u=Q,d=c+B.shift(),I=u+B.shift(),Q=I+B.shift(),b=d+(B.length===1?B.shift():0),x(c,u,d,I,b,Q),B.length!==0);)c=b,u=Q+B.shift(),d=c+B.shift(),I=u+B.shift(),b=d+B.shift(),Q=I+(B.length===1?B.shift():0),x(c,u,d,I,b,Q);break;default:Ee<32?console.warn(`Glyph ${h}: unknown operator ${Ee}`):Ee<247?B.push(Ee-139):Ee<251?($=N[V],V+=1,B.push((Ee-247)*256+$+108)):Ee<255?($=N[V],V+=1,B.push(-(Ee-251)*256-$-108)):($=N[V],Ae=N[V+1],J=N[V+2],H=N[V+3],V+=4,B.push(($<<24|Ae<<16|J<<8|H)/65536))}}}te(e),this.pathCommands=C,M&&(this.advanceWidth=R)}}class $s{constructor(A){g(this,"_items",[]);this._sfnt=A}get(A){const e=this._items[A];let t;if(e)t=e;else{t=this._get(A);const i=this._sfnt.hmtx.metrics[A];i&&(t.advanceWidth=t.advanceWidth||i.advanceWidth,t.leftSideBearing=t.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(A);s&&(t.unicode??(t.unicode=s[0]),t.unicodes??(t.unicodes=s)),this._items[A]=t}return t}}class Gu extends $s{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(A){const e=this._sfnt.cff,t=new Lu({index:A});return t.parse(e,e.charStringsIndex.get(A),this),t.name=e.charset[A],t}}var Ou=Object.defineProperty,Ya=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Ou(A,e,i),i};class dr extends It{constructor(e,t,i,s){super(e,t,i,s);g(this,"_offsets");g(this,"_objects");this._init()}get offsets(){return this._offsets??(this._offsets=this.readOffsets())}get objects(){return this._objects??(this._objects=this.readObjects())}_init(){const e=this.view,t=this.count,i=this.offsetSize;this.objectOffset=(t+1)*i+2,this.endOffset=e.byteOffset+this.objectOffset+this.offsets[t]}readOffsets(){const e=this.view,t=this.count,i=this.offsetSize;e.seek(3);const s=[];for(let n=0,o=t+1;n<o;n++){const a=this.view;let l=0;for(let h=0;h<i;h++)l<<=8,l+=a.readUint8();s.push(l)}return s}readObjects(){const e=[];for(let t=0,i=this.count;t<i;t++)e.push(this.get(t));return e}get(e){const t=this.offsets,i=this.objectOffset,s=i+t[e],o=i+t[e+1]-s;return this._isString?this.view.readString(s,o):this.view.readBytes(s,o)}}Ya([m("uint16")],dr.prototype,"count"),Ya([m("uint8")],dr.prototype,"offsetSize");class Ir extends dr{constructor(){super(...arguments);g(this,"_isString",!1)}}class Wa extends dr{constructor(){super(...arguments);g(this,"_isString",!0)}}const Hu=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Ju=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Ku=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Yu=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function Br(r,A){return A<=390?Hu[A]:r[A-391]}function ye(r,A="number",e){return(t,i)=>{if(typeof i!="string")return;const s={type:A,operator:r,default:e??A==="number"?0:void 0};Object.defineProperty(t.constructor.prototype,i,{get(){return this._getProp(s)},set(n){this._setProp(s,n)},configurable:!0,enumerable:!0})}}class Va extends It{constructor(){super(...arguments);g(this,"_dict");g(this,"_stringIndex")}get dict(){return this._dict??(this._dict=this._readDict())}setStringIndex(e){return this._stringIndex=e,this}_readFloatOperand(){const e=this.view;let t="";const i=15,s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const n=e.readUint8(),o=n>>4,a=n&15;if(o===i||(t+=s[o],a===i))break;t+=s[a]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let i,s,n,o;if(e===28)return i=t.readUint8(),s=t.readUint8(),i<<8|s;if(e===29)return i=t.readUint8(),s=t.readUint8(),n=t.readUint8(),o=t.readUint8(),i<<24|s<<16|n<<8|o;if(e===30)return this._readFloatOperand();if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return i=t.readUint8(),(e-247)*256+i+108;if(e>=251&&e<=254)return i=t.readUint8(),-(e-251)*256-i-108;throw new Error(`invalid b0 ${e}, at: ${t.cursor}`)}_readDict(){const e=this.view;e.seek(0);let t=[];const i=e.cursor+e.byteLength,s={};for(;e.cursor<i;){let n=e.readUint8();n<=21?(n===12&&(n=1200+e.readUint8()),s[n]=t,t=[]):t.push(this._readOperand(n))}return s}_getProp(e){var i;const t=this.dict[e.operator]??e.default;switch(e.type){case"number":return t[0];case"string":return Br(((i=this._stringIndex)==null?void 0:i.objects)??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var Wu=Object.defineProperty,en=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Wu(A,e,i),i};class Er extends Va{}en([ye(19)],Er.prototype,"subrs"),en([ye(20)],Er.prototype,"defaultWidthX"),en([ye(21)],Er.prototype,"nominalWidthX");var Vu=Object.defineProperty,xe=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Vu(A,e,i),i};class be extends Va{}xe([ye(0,"string")],be.prototype,"version"),xe([ye(1,"string")],be.prototype,"notice"),xe([ye(1200,"string")],be.prototype,"copyright"),xe([ye(2,"string")],be.prototype,"fullName"),xe([ye(3,"string")],be.prototype,"familyName"),xe([ye(4,"string")],be.prototype,"weight"),xe([ye(1201)],be.prototype,"isFixedPitch"),xe([ye(1202)],be.prototype,"italicAngle"),xe([ye(1203,"number",-100)],be.prototype,"underlinePosition"),xe([ye(1204,"number",50)],be.prototype,"underlineThickness"),xe([ye(1205)],be.prototype,"paintType"),xe([ye(1206,"number",2)],be.prototype,"charstringType"),xe([ye(1207,"number[]",[.001,0,0,.001,0,0])],be.prototype,"fontMatrix"),xe([ye(13)],be.prototype,"uniqueId"),xe([ye(5,"number[]",[0,0,0,0])],be.prototype,"fontBBox"),xe([ye(1208)],be.prototype,"strokeWidth"),xe([ye(14)],be.prototype,"xuid"),xe([ye(15)],be.prototype,"charset"),xe([ye(16)],be.prototype,"encoding"),xe([ye(17)],be.prototype,"charStrings"),xe([ye(18,"number[]",[0,0])],be.prototype,"private");function Xe(r,A=r){return e=>{mA.tableDefinitions.set(r,{tag:r,prop:A,class:e}),Object.defineProperty(mA.prototype,A,{get(){return this.get(r)},set(t){return this.set(r,t)},configurable:!0,enumerable:!0})}}const SA=class SA{constructor(A){g(this,"tables",new Map);g(this,"tableViews",new Map);(A instanceof Map?A:new Map(Object.entries(A))).forEach((t,i)=>{this.tableViews.set(i,new DataView(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)))})}get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(A){let e=this.cmap.unicodeToGlyphIndexMap.get(A.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:t,charset:i}=this.cff;e=i.indexOf(t[A.codePointAt(0)])}return e??0}charToGlyph(A){return this.glyphs.get(this.charToGlyphIndex(A))}textToGlyphIndexes(A){const e=[];for(const t of A)e.push(this.charToGlyphIndex(t));return e}textToGlyphs(A){const e=this.glyphs,t=this.textToGlyphIndexes(A),i=t.length,s=Array.from({length:i}),n=e.get(0);for(let o=0;o<i;o+=1)s[o]=e.get(t[o])||n;return s}getPathCommands(A,e,t,i,s){const n=[];return this.forEachGlyph(A,e,t,i,s,(o,a,l,h,c)=>{n.push(...o.getPathCommands(a,l,h,c,this))}),n}getAdvanceWidth(A,e,t){return this.forEachGlyph(A,0,0,e,t,()=>{})}forEachGlyph(A,e=0,t=0,i=72,s={},n){const o=1/this.unitsPerEm*i,a=this.textToGlyphs(A);for(let l=0;l<a.length;l+=1){const h=a[l];n.call(this,h,e,t,i,s),h.advanceWidth&&(e+=h.advanceWidth*o),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}clone(){return new SA(this.tableViews)}delete(A){const e=SA.tableDefinitions.get(A);return e?(this.tableViews.delete(A),this.tables.delete(e.prop),this):this}set(A,e){const t=SA.tableDefinitions.get(A);return t&&this.tables.set(t.prop,e),this.tableViews.set(A,e.view),this}get(A){const e=SA.tableDefinitions.get(A);if(!e)return;let t=this.tables.get(e.prop);if(!t){const i=e.class;if(i){const s=this.tableViews.get(A);if(!s)return;t=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,t)}}return t}};g(SA,"tableDefinitions",new Map);let mA=SA;class At extends It{setSFNT(A){return this._sfnt=A,this}getSFNT(){return this._sfnt}}var Xu=Object.defineProperty,qu=Object.getOwnPropertyDescriptor,Di=(r,A,e,t)=>{for(var i=t>1?void 0:t?qu(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Xu(A,e,i),i};let wA=class extends At{constructor(A,e,t,i){super(A,e,t,i);g(this,"_glyphs");g(this,"privateDict");g(this,"subrsIndex");this._init()}get glyphs(){return this._glyphs??(this._glyphs=new Gu(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var A;return((A=this.privateDict)==null?void 0:A.defaultWidthX)??0}get nominalWidthX(){var A;return((A=this.privateDict)==null?void 0:A.nominalWidthX)??0}get subrs(){var A;return((A=this.subrsIndex)==null?void 0:A.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const A=this.view,{buffer:e,byteOffset:t}=A,i=t+4;this.nameIndex=new Wa(e,i),this.topDictIndex=new Ir(e,this.nameIndex.endOffset),this.stringIndex=new Wa(e,this.topDictIndex.endOffset),this.globalSubrIndex=new Ir(e,this.stringIndex.endOffset),this.topDict=new be(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const s=this.topDict.private[0],n=this.topDict.private[1];s&&(this.privateDict=new Er(e,t+n,s).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new Ir(e,t+n+this.privateDict.subrs))),this.charStringsIndex=new Ir(e,t+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Ju:this.topDict.charset===1?this.charset=Ku:this.topDict.charset===2?this.charset=Yu:this.charset=this._readCharset(t+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=js:this.topDict.encoding===1?this.encoding=Tu:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(A,e,t){const i=this.view;i.seek(A);let s,n,o;e-=1;const a=[".notdef"],l=i.readUint8();if(l===0)for(s=0;s<e;s+=1)n=i.readUint16(),a.push(Br(t,n));else if(l===1)for(;a.length<=e;)for(n=i.readUint16(),o=i.readUint8(),s=0;s<=o;s+=1)a.push(Br(t,n)),n+=1;else if(l===2)for(;a.length<=e;)for(n=i.readUint16(),o=i.readUint16(),s=0;s<=o;s+=1)a.push(Br(t,n)),n+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(A){const e=this.view;e.seek(A);let t,i;const s={},n=e.readUint8();if(n===0){const o=e.readUint8();for(t=0;t<o;t+=1)i=e.readUint8(),s[i]=t}else if(n===1){const o=e.readUint8();for(i=1,t=0;t<o;t+=1){const a=e.readUint8(),l=e.readUint8();for(let h=a;h<=a+l;h+=1)s[h]=i,i+=1}}else console.warn(`unknown encoding format:${n}`);return s}_calcSubroutineBias(A){let e;return A.length<1240?e=107:A.length<33900?e=1131:e=32768,e}};Di([m("uint8")],wA.prototype,"majorVersion",2),Di([m("uint8")],wA.prototype,"minorVersion",2),Di([m("uint8")],wA.prototype,"headerSize",2),Di([m("uint8")],wA.prototype,"offsetSize",2),wA=Di([Xe("CFF ","cff")],wA);var zu=Object.defineProperty,pr=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&zu(A,e,i),i};const xi=class Wl extends It{constructor(A=new ArrayBuffer(262),e){super(A,e,262)}static from(A){const e=new Wl;return e.format=0,e.length=e.view.byteLength,e.language=0,A.forEach((t,i)=>{i<256&&t<256&&e.view.writeUint8(t,6+i)}),e}getUnicodeToGlyphIndexMap(){const A=new Map;return this.glyphIndexArray.forEach((e,t)=>{A.set(t,e)}),A}};pr([m("uint16")],xi.prototype,"format"),pr([m("uint16")],xi.prototype,"length"),pr([m("uint16")],xi.prototype,"language"),pr([m({type:"uint8",size:256})],xi.prototype,"glyphIndexArray");let tn=xi;var ju=Object.defineProperty,An=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ju(A,e,i),i};class Si extends It{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((A,e)=>Math.max(A,e),0)}get subHeaders(){const A=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:A},(e,t)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(A-t)*8-2)/2}))}get glyphIndexArray(){const A=this.maxSubHeaderKey,e=6+256*2+A*8;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(A){const e=new Map,t=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,n=this.glyphIndexArray,o=t.findIndex(l=>l===i);let a=0;for(let l=0;l<256;l++)if(t[l]===0)l>=o||l<s[0].firstCode||l>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(l-s[0].firstCode)>=n.length?a=0:(a=n[s[0].idRangeOffset+(l-s[0].firstCode)],a!==0&&(a=a+s[0].idDelta)),a!==0&&a<A&&e.set(l,a);else{const h=t[l];for(let c=0,u=s[h].entryCount;c<u;c++)if(s[h].idRangeOffset+c>=n.length?a=0:(a=n[s[h].idRangeOffset+c],a!==0&&(a=a+s[h].idDelta)),a!==0&&a<A){const d=(l<<8|c+s[h].firstCode)%65535;e.set(d,a)}}return e}}An([m("uint16")],Si.prototype,"format"),An([m("uint16")],Si.prototype,"length"),An([m("uint16")],Si.prototype,"language");function Xa(r){return r>32767?r-65536:r<-32767?r+65536:r}function rn(r,A){let e;const t=[];let i={};return r.forEach((s,n)=>{A&&n>A||((!e||n!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,t.push(i),i={start:n,startId:s,delta:Xa(s-n)}):(i.start=Number(n),i.startId=s,i.delta=Xa(s-n))),e={unicode:n,glyphIndex:s})}),e&&(i.end=e.unicode,t.push(i)),t}var Zu=Object.defineProperty,_A=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Zu(A,e,i),i};const sA=class Vl extends It{get endCode(){const A=this.segCountX2;return this.view.seek(14),Array.from({length:A/2},()=>this.view.readUint16())}set endCode(A){this.view.seek(14),A.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(A){this.view.writeUint16(A,14+this.segCountX2)}get startCode(){const A=this.segCountX2;return this.view.seek(14+A+2),Array.from({length:A/2},()=>this.view.readUint16())}set startCode(A){this.view.seek(14+this.segCountX2+2),A.forEach(e=>this.view.writeUint16(e))}get idDelta(){const A=this.segCountX2;return this.view.seek(14+A+2+A),Array.from({length:A/2},()=>this.view.readUint16())}set idDelta(A){const e=this.segCountX2;this.view.seek(14+e+2+e),A.forEach(t=>this.view.writeUint16(t))}get idRangeOffsetCursor(){const A=this.segCountX2;return 14+A+2+A*2}get idRangeOffset(){const A=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:A/2},()=>this.view.readUint16())}set idRangeOffset(A){this.view.seek(this.idRangeOffsetCursor),A.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const A=this.segCountX2;return 14+A+2+A*3}get glyphIndexArray(){const A=this.glyphIndexArrayCursor;this.view.seek(A);const e=(this.view.byteLength-A)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(A){const e=rn(A,65535),t=e.length+1,i=Math.floor(Math.log(t)/Math.LN2),s=2*2**i,n=new Vl(new ArrayBuffer(24+e.length*8));return n.format=4,n.length=n.view.byteLength,n.language=0,n.segCountX2=t*2,n.searchRange=s,n.entrySelector=i,n.rangeShift=2*t-s,n.endCode=[...e.map(o=>o.end),65535],n.reservedPad=0,n.startCode=[...e.map(o=>o.start),65535],n.idDelta=[...e.map(o=>o.delta),1],n.idRangeOffset=Array.from({length:t},()=>0),n}getUnicodeToGlyphIndexMap(){const A=new Map,e=this.segCountX2/2,t=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,n=this.idRangeOffset,o=this.idDelta,a=this.glyphIndexArray;for(let l=0;l<e;++l)for(let h=i[l],c=s[l];h<=c;++h)if(n[l]===0)A.set(h,(h+o[l])%65536);else{const u=l+n[l]/2+(h-i[l])-t,d=a[u];d!==0?A.set(h,(d+o[l])%65536):A.set(h,0)}return A.delete(65535),A}};_A([m("uint16")],sA.prototype,"format"),_A([m("uint16")],sA.prototype,"length"),_A([m("uint16")],sA.prototype,"language"),_A([m("uint16")],sA.prototype,"segCountX2"),_A([m("uint16")],sA.prototype,"searchRange"),_A([m("uint16")],sA.prototype,"entrySelector"),_A([m("uint16")],sA.prototype,"rangeShift");let sn=sA;var $u=Object.defineProperty,Mi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&$u(A,e,i),i};class vA extends It{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const A=this.glyphIndexArray,e=new Map;return A.forEach((t,i)=>{e.set(i,t)}),e}}Mi([m("uint16")],vA.prototype,"format"),Mi([m("uint16")],vA.prototype,"length"),Mi([m("uint16")],vA.prototype,"language"),Mi([m("uint16")],vA.prototype,"firstCode"),Mi([m("uint16")],vA.prototype,"entryCount");var ef=Object.defineProperty,Ri=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&ef(A,e,i),i};const KA=class Xl extends It{get groups(){const A=this.nGroups;return this.view.seek(16),Array.from({length:A},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(A){const e=rn(A),t=new Xl(new ArrayBuffer(16+e.length*12));return t.format=12,t.reserved=0,t.length=t.view.byteLength,t.language=0,t.nGroups=e.length,e.forEach(i=>{t.view.writeUint32(i.start),t.view.writeUint32(i.end),t.view.writeUint32(i.startId)}),t}getUnicodeToGlyphIndexMap(){const A=new Map,e=this.groups;for(let t=0,i=e.length;t<i;t++){const s=e[t];let n=s.startGlyphCode,o=s.startCharCode;const a=s.endCharCode;for(;o<=a;)A.set(o++,n++)}return A}};Ri([m("uint16")],KA.prototype,"format"),Ri([m("uint16")],KA.prototype,"reserved"),Ri([m("uint32")],KA.prototype,"length"),Ri([m("uint32")],KA.prototype,"language"),Ri([m("uint32")],KA.prototype,"nGroups");let nn=KA;var tf=Object.defineProperty,on=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&tf(A,e,i),i};class Ui extends It{getVarSelectorRecords(){const A=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:A},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const t=this.view.readUint32();e.unicodeValueRanges=Array.from({length:t},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const t=this.view.readUint32();e.uVSMappings=Array.from({length:t},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const A=new Map,e=this.getVarSelectorRecords();for(let t=0,i=e.length;t<i;t++){const{uVSMappings:s}=e[t];s.forEach(n=>{A.set(n.unicodeValue,n.glyphID)})}return A}}on([m("uint16")],Ui.prototype,"format"),on([m("uint32")],Ui.prototype,"length"),on([m("uint32")],Ui.prototype,"numVarSelectorRecords");var Af=Object.defineProperty,rf=Object.getOwnPropertyDescriptor,an=(r,A,e,t)=>{for(var i=t>1?void 0:t?rf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Af(A,e,i),i};let YA=class extends At{constructor(){super(...arguments);g(this,"_unicodeToGlyphIndexMap");g(this,"_glyphIndexToUnicodesMap")}static from(A){const e=Array.from(A.keys()).some(c=>c>65535),t=sn.from(A),i=tn.from(A),s=e?nn.from(A):void 0,n=4+(s?32:24),o=n+t.view.byteLength,a=o+i.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:n},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:n},s&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),h=new YA(new ArrayBuffer(4+8*l.length+t.view.byteLength+i.view.byteLength+((s==null?void 0:s.view.byteLength)??0)));return h.numberSubtables=l.length,h.view.seek(4),l.forEach(c=>{h.view.writeUint16(c.platformID),h.view.writeUint16(c.platformSpecificID),h.view.writeUint32(c.offset)}),h.view.writeBytes(t.view,n),h.view.writeBytes(i.view,o),s&&h.view.writeBytes(s.view,a),h}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const A=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let i=0,s=t.length;i<s;i++){const n=t[i],o=e.get(n);A.has(o)?A.get(o).push(n):A.set(o,[n])}this._glyphIndexToUnicodesMap=A}return this._glyphIndexToUnicodesMap}readSubtables(){const A=this.numberSubtables;return this.view.seek(4),Array.from({length:A},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(e=>{this.view.seek(e.offset);const t=this.view.readUint16();let i;switch(t){case 0:i=new tn(this.view.buffer,e.offset);break;case 2:i=new Si(this.view.buffer,e.offset,this.view.readUint16());break;case 4:i=new sn(this.view.buffer,e.offset,this.view.readUint16());break;case 6:i=new vA(this.view.buffer,e.offset,this.view.readUint16());break;case 12:i=new nn(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:i=new Ui(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:i}})}readunicodeToGlyphIndexMap(){var o,a,l,h,c;const A=this.readSubtables(),e=(o=A.find(u=>u.format===0))==null?void 0:o.view,t=(a=A.find(u=>u.platformID===3&&u.platformSpecificID===3&&u.format===2))==null?void 0:a.view,i=(l=A.find(u=>u.platformID===3&&u.platformSpecificID===1&&u.format===4))==null?void 0:l.view,s=(h=A.find(u=>u.platformID===3&&u.platformSpecificID===10&&u.format===12))==null?void 0:h.view,n=(c=A.find(u=>u.platformID===0&&u.platformSpecificID===5&&u.format===14))==null?void 0:c.view;return new Map([...(e==null?void 0:e.getUnicodeToGlyphIndexMap())??[],...(t==null?void 0:t.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs))??[],...(i==null?void 0:i.getUnicodeToGlyphIndexMap())??[],...(s==null?void 0:s.getUnicodeToGlyphIndexMap())??[],...(n==null?void 0:n.getUnicodeToGlyphIndexMap())??[]])}};an([m("uint16")],YA.prototype,"version",2),an([m("uint16")],YA.prototype,"numberSubtables",2),YA=an([Xe("cmap")],YA);class sf extends Zs{_parseContours(A){const e=[];let t=[];for(let i=0;i<A.length;i+=1){const s=A[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return vi(t.length===0,"There are still points left in the current contour."),e}_transformPoints(A,e){const t=[];for(let i=0;i<A.length;i+=1){const s=A[i],n={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};t.push(n)}return t}_parseGlyphCoordinate(A,e,t,i,s){let n;return(e&i)>0?(n=A.view.readUint8(),e&s||(n=-n),n=t+n):(e&s)>0?n=t:n=t+A.view.readInt16(),n}parse(A,e,t){A.view.seek(e);const i=this.numberOfContours=A.view.readInt16();if(this.xMin=A.view.readInt16(),this.yMin=A.view.readInt16(),this.xMax=A.view.readInt16(),this.yMax=A.view.readInt16(),i>0){const o=this.endPointIndices=[];for(let C=0;C<i;C++)o.push(A.view.readUint16());const a=this.instructionLength=A.view.readUint16();vi(a<5e3,`Bad instructionLength:${a}`);const l=this.instructions=[];for(let C=0;C<a;++C)l.push(A.view.readUint8());const h=A.view.byteOffset,c=o[o.length-1]+1;vi(c<2e4,`Bad numberOfCoordinates:${h}`);const u=[];let d,I=0;for(;I<c;)if(d=A.view.readUint8(),u.push(d),I++,d&8&&I<c){const C=A.view.readUint8();for(let B=0;B<C;B++)u.push(d),I++}if(vi(u.length===c,`Bad flags length: ${u.length}, numberOfCoordinates: ${c}`),o.length>0){const C=[];let B;if(c>0){for(let D=0;D<c;D+=1)d=u[D],B={},B.onCurve=!!(d&1),B.lastPointOfContour=o.includes(D),C.push(B);let U=0;for(let D=0;D<c;D+=1)d=u[D],B=C[D],B.x=this._parseGlyphCoordinate(A,d,U,2,16),U=B.x;let M=0;for(let D=0;D<c;D+=1)d=u[D],B=C[D],B.y=this._parseGlyphCoordinate(A,d,M,4,32),M=B.y}this.points=C}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let o,a=!0;for(;a;){o=A.view.readUint16();const l={glyphIndex:A.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(o&1)>0?(o&2)>0?(l.dx=A.view.readInt16(),l.dy=A.view.readInt16()):l.matchedPoints=[A.view.readUint16(),A.view.readUint16()]:(o&2)>0?(l.dx=A.view.readInt8(),l.dy=A.view.readInt8()):l.matchedPoints=[A.view.readUint8(),A.view.readUint8()],(o&8)>0?l.xScale=l.yScale=A.view.readInt16()/16384:(o&64)>0?(l.xScale=A.view.readInt16()/16384,l.yScale=A.view.readInt16()/16384):(o&128)>0&&(l.xScale=A.view.readInt16()/16384,l.scale01=A.view.readInt16()/16384,l.scale10=A.view.readInt16()/16384,l.yScale=A.view.readInt16()/16384),this.components.push(l),a=!!(o&32)}if(o&256){this.instructionLength=A.view.readUint16(),this.instructions=[];for(let l=0;l<this.instructionLength;l+=1)this.instructions.push(A.view.readUint8())}}if(this.isComposite)for(let o=0;o<this.components.length;o+=1){const a=this.components[o],l=t.get(a.glyphIndex);if(l.getPathCommands(),l.points){let h;if(a.matchedPoints===void 0)h=this._transformPoints(l.points,a);else{vi(a.matchedPoints[0]>this.points.length-1||a.matchedPoints[1]>l.points.length-1,`Matched points out of range in ${this.name}`);const c=this.points[a.matchedPoints[0]];let u=l.points[a.matchedPoints[1]];const d={xScale:a.xScale,scale01:a.scale01,scale10:a.scale10,yScale:a.yScale,dx:0,dy:0};u=this._transformPoints([u],d)[0],d.dx=c.x-u.x,d.dy=c.y-u.y,h=this._transformPoints(l.points,d)}this.points=this.points.concat(h)}}const s=[],n=this._parseContours(this.points);for(let o=0,a=n.length;o<a;++o){const l=n[o];let h=l[l.length-1],c=l[0];h.onCurve?s.push({type:"M",x:h.x,y:h.y}):c.onCurve?s.push({type:"M",x:c.x,y:c.y}):s.push({type:"M",x:(h.x+c.x)*.5,y:(h.y+c.y)*.5});for(let u=0,d=l.length;u<d;++u)if(h=c,c=l[(u+1)%d],h.onCurve)s.push({type:"L",x:h.x,y:h.y});else{let I=c;c.onCurve||(I={x:(h.x+c.x)*.5,y:(h.y+c.y)*.5}),s.push({type:"Q",x1:h.x,y1:h.y,x:I.x,y:I.y})}s.push({type:"Z"})}this.pathCommands=s}}class nf extends $s{get length(){return this._sfnt.loca.locations.length}_get(A){const e=this._sfnt.loca.locations,t=e[A],i=new sf({index:A});return t!==e[A+1]&&i.parse(this._sfnt.glyf,t,this),i}}var of=Object.defineProperty,af=Object.getOwnPropertyDescriptor,lf=(r,A,e,t)=>{for(var i=t>1?void 0:t?af(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&of(A,e,i),i};let Cr=class extends At{constructor(){super(...arguments);g(this,"_glyphs")}static from(A){const e=A.reduce((i,s)=>i+s.byteLength,0),t=new Cr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeBytes(i)}),t}get glyphs(){return this._glyphs??(this._glyphs=new nf(this._sfnt))}};Cr=lf([Xe("glyf")],Cr);var hf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,cf=(r,A,e,t)=>{for(var i=t>1?void 0:t?gf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&hf(A,e,i),i};let ln=class extends At{};ln=cf([Xe("GPOS","gpos")],ln);var uf=Object.defineProperty,ff=Object.getOwnPropertyDescriptor,bA=(r,A,e,t)=>{for(var i=t>1?void 0:t?ff(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&uf(A,e,i),i};let zt=class extends At{};bA([m("uint16")],zt.prototype,"majorVersion",2),bA([m("uint16")],zt.prototype,"minorVersion",2),bA([m("uint16")],zt.prototype,"scriptListOffset",2),bA([m("uint16")],zt.prototype,"featureListOffset",2),bA([m("uint16")],zt.prototype,"lookupListOffset",2),bA([m("uint16")],zt.prototype,"featureVariationsOffset",2),zt=bA([Xe("GSUB","gsub")],zt);var df=Object.defineProperty,If=Object.getOwnPropertyDescriptor,He=(r,A,e,t)=>{for(var i=t>1?void 0:t?If(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&df(A,e,i),i};let ke=class extends At{constructor(r=new ArrayBuffer(54),A){super(r,A,Math.min(54,r.byteLength-(A??0)))}};He([m("fixed")],ke.prototype,"version",2),He([m("fixed")],ke.prototype,"fontRevision",2),He([m("uint32")],ke.prototype,"checkSumAdjustment",2),He([m("uint32")],ke.prototype,"magickNumber",2),He([m("uint16")],ke.prototype,"flags",2),He([m("uint16")],ke.prototype,"unitsPerEm",2),He([m({type:"longDateTime"})],ke.prototype,"created",2),He([m({type:"longDateTime"})],ke.prototype,"modified",2),He([m("int16")],ke.prototype,"xMin",2),He([m("int16")],ke.prototype,"yMin",2),He([m("int16")],ke.prototype,"xMax",2),He([m("int16")],ke.prototype,"yMax",2),He([m("uint16")],ke.prototype,"macStyle",2),He([m("uint16")],ke.prototype,"lowestRecPPEM",2),He([m("int16")],ke.prototype,"fontDirectionHint",2),He([m("int16")],ke.prototype,"indexToLocFormat",2),He([m("int16")],ke.prototype,"glyphDataFormat",2),ke=He([Xe("head")],ke);var Bf=Object.defineProperty,Ef=Object.getOwnPropertyDescriptor,at=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ef(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Bf(A,e,i),i};let qe=class extends At{constructor(r=new ArrayBuffer(36),A){super(r,A,Math.min(36,r.byteLength-(A??0)))}};at([m("fixed")],qe.prototype,"version",2),at([m("int16")],qe.prototype,"ascent",2),at([m("int16")],qe.prototype,"descent",2),at([m("int16")],qe.prototype,"lineGap",2),at([m("uint16")],qe.prototype,"advanceWidthMax",2),at([m("int16")],qe.prototype,"minLeftSideBearing",2),at([m("int16")],qe.prototype,"minRightSideBearing",2),at([m("int16")],qe.prototype,"xMaxExtent",2),at([m("int16")],qe.prototype,"caretSlopeRise",2),at([m("int16")],qe.prototype,"caretSlopeRun",2),at([m("int16")],qe.prototype,"caretOffset",2),at([m({type:"int16",size:4})],qe.prototype,"reserved",2),at([m("int16")],qe.prototype,"metricDataFormat",2),at([m("uint16")],qe.prototype,"numOfLongHorMetrics",2),qe=at([Xe("hhea")],qe);var pf=Object.defineProperty,Cf=Object.getOwnPropertyDescriptor,Qf=(r,A,e,t)=>{for(var i=t>1?void 0:t?Cf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&pf(A,e,i),i};let Qr=class extends At{constructor(){super(...arguments);g(this,"_metrics")}static from(A){const e=A.length*4,t=new Qr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeUint16(i.advanceWidth),t.view.writeUint16(i.leftSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const A=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const i=this.view;return i.seek(0),Array.from({length:A}).map((s,n)=>(n<e&&(t=i.readUint16()),{advanceWidth:t,leftSideBearing:i.readUint16()}))}};Qr=Qf([Xe("hmtx")],Qr);var yf=Object.defineProperty,mf=Object.getOwnPropertyDescriptor,wf=(r,A,e,t)=>{for(var i=t>1?void 0:t?mf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&yf(A,e,i),i};let hn=class extends At{};hn=wf([Xe("kern","kern")],hn);var _f=Object.defineProperty,vf=Object.getOwnPropertyDescriptor,bf=(r,A,e,t)=>{for(var i=t>1?void 0:t?vf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&_f(A,e,i),i};let yr=class extends At{constructor(){super(...arguments);g(this,"_locations")}static from(A,e=1){const t=A.length*(e?4:2),i=new yr(new ArrayBuffer(t));return A.forEach(s=>{e?i.view.writeUint32(s):i.view.writeUint16(s/2)}),i}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const A=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:A}).map(()=>e?t.readUint32():t.readUint16()*2)}};yr=bf([Xe("loca")],yr);var Df=Object.defineProperty,xf=Object.getOwnPropertyDescriptor,it=(r,A,e,t)=>{for(var i=t>1?void 0:t?xf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Df(A,e,i),i};let Je=class extends At{constructor(r=new ArrayBuffer(32),A){super(r,A,Math.min(32,r.byteLength-(A??0)))}};it([m("fixed")],Je.prototype,"version",2),it([m("uint16")],Je.prototype,"numGlyphs",2),it([m("uint16")],Je.prototype,"maxPoints",2),it([m("uint16")],Je.prototype,"maxContours",2),it([m("uint16")],Je.prototype,"maxComponentPoints",2),it([m("uint16")],Je.prototype,"maxComponentContours",2),it([m("uint16")],Je.prototype,"maxZones",2),it([m("uint16")],Je.prototype,"maxTwilightPoints",2),it([m("uint16")],Je.prototype,"maxStorage",2),it([m("uint16")],Je.prototype,"maxFunctionDefs",2),it([m("uint16")],Je.prototype,"maxInstructionDefs",2),it([m("uint16")],Je.prototype,"maxStackElements",2),it([m("uint16")],Je.prototype,"maxSizeOfInstructions",2),it([m("uint16")],Je.prototype,"maxComponentElements",2),it([m("uint16")],Je.prototype,"maxComponentDepth",2),Je=it([Xe("maxp")],Je);var Sf=Object.defineProperty,Mf=Object.getOwnPropertyDescriptor,mr=(r,A,e,t)=>{for(var i=t>1?void 0:t?Mf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Sf(A,e,i),i};const qa={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},gn={Unicode:0,Macintosh:1,reserved:2,Microsoft:3},Rf={Default:0,"Version1.1":1,ISO10646:2,UnicodeBMP:3,UnicodenonBMP:4,UnicodeVariationSequences:5,FullUnicodecoverage:6},za={Symbol:0,UCS2:1,ShiftJIS:2,PRC:3,BigFive:4,Johab:5,UCS4:6};let WA=class extends At{constructor(){super(...arguments);g(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const A=this.count;this.view.seek(6);const e=[];for(let a=0;a<A;++a)e.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const t=this.stringOffset;for(let a=0;a<A;++a){const l=e[a];l.name=this.view.readBytes(t+l.offset,l.length)}let i=gn.Macintosh,s=Rf.Default,n=0;e.some(a=>a.platform===gn.Microsoft&&a.encoding===za.UCS2&&a.language===1033)&&(i=gn.Microsoft,s=za.UCS2,n=1033);const o={};for(let a=0;a<A;++a){const l=e[a];l.platform===i&&l.encoding===s&&l.language===n&&qa[l.nameId]&&(o[qa[l.nameId]]=n===0?Uu(l.name):ku(l.name))}return o}};mr([m("uint16")],WA.prototype,"format",2),mr([m("uint16")],WA.prototype,"count",2),mr([m("uint16")],WA.prototype,"stringOffset",2),WA=mr([Xe("name")],WA);var Uf=Object.defineProperty,kf=Object.getOwnPropertyDescriptor,ne=(r,A,e,t)=>{for(var i=t>1?void 0:t?kf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Uf(A,e,i),i};let se=class extends At{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};ne([m("uint16")],se.prototype,"version",2),ne([m("int16")],se.prototype,"xAvgCharWidth",2),ne([m("uint16")],se.prototype,"usWeightClass",2),ne([m("uint16")],se.prototype,"usWidthClass",2),ne([m("uint16")],se.prototype,"fsType",2),ne([m("uint16")],se.prototype,"ySubscriptXSize",2),ne([m("uint16")],se.prototype,"ySubscriptYSize",2),ne([m("uint16")],se.prototype,"ySubscriptXOffset",2),ne([m("uint16")],se.prototype,"ySubscriptYOffset",2),ne([m("uint16")],se.prototype,"ySuperscriptXSize",2),ne([m("uint16")],se.prototype,"ySuperscriptYSize",2),ne([m("uint16")],se.prototype,"ySuperscriptXOffset",2),ne([m("uint16")],se.prototype,"ySuperscriptYOffset",2),ne([m("uint16")],se.prototype,"yStrikeoutSize",2),ne([m("uint16")],se.prototype,"yStrikeoutPosition",2),ne([m("uint16")],se.prototype,"sFamilyClass",2),ne([m({type:"uint8"})],se.prototype,"bFamilyType",2),ne([m({type:"uint8"})],se.prototype,"bSerifStyle",2),ne([m({type:"uint8"})],se.prototype,"bWeight",2),ne([m({type:"uint8"})],se.prototype,"bProportion",2),ne([m({type:"uint8"})],se.prototype,"bContrast",2),ne([m({type:"uint8"})],se.prototype,"bStrokeVariation",2),ne([m({type:"uint8"})],se.prototype,"bArmStyle",2),ne([m({type:"uint8"})],se.prototype,"bLetterform",2),ne([m({type:"uint8"})],se.prototype,"bMidline",2),ne([m({type:"uint8"})],se.prototype,"bXHeight",2),ne([m({type:"uint8",size:16})],se.prototype,"ulUnicodeRange",2),ne([m({type:"char",size:4})],se.prototype,"achVendID",2),ne([m("uint16")],se.prototype,"fsSelection",2),ne([m("uint16")],se.prototype,"usFirstCharIndex",2),ne([m("uint16")],se.prototype,"usLastCharIndex",2),ne([m("int16")],se.prototype,"sTypoAscender",2),ne([m("int16")],se.prototype,"sTypoDescender",2),ne([m("int16")],se.prototype,"sTypoLineGap",2),ne([m("uint16")],se.prototype,"usWinAscent",2),ne([m("uint16")],se.prototype,"usWinDescent",2),ne([m({offset:72,type:"uint8",size:8})],se.prototype,"ulCodePageRange",2),ne([m({offset:72,type:"int16"})],se.prototype,"sxHeight",2),ne([m("int16")],se.prototype,"sCapHeight",2),ne([m("uint16")],se.prototype,"usDefaultChar",2),ne([m("uint16")],se.prototype,"usBreakChar",2),ne([m("uint16")],se.prototype,"usMaxContext",2),se=ne([Xe("OS/2","os2")],se);var Pf=Object.defineProperty,Nf=Object.getOwnPropertyDescriptor,Tt=(r,A,e,t)=>{for(var i=t>1?void 0:t?Nf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Pf(A,e,i),i};let Qt=class extends At{constructor(r=new ArrayBuffer(32),A,e){super(r,A,e)}};Tt([m("fixed")],Qt.prototype,"format",2),Tt([m("fixed")],Qt.prototype,"italicAngle",2),Tt([m("int16")],Qt.prototype,"underlinePosition",2),Tt([m("int16")],Qt.prototype,"underlineThickness",2),Tt([m("uint32")],Qt.prototype,"isFixedPitch",2),Tt([m("uint32")],Qt.prototype,"minMemType42",2),Tt([m("uint32")],Qt.prototype,"maxMemType42",2),Tt([m("uint32")],Qt.prototype,"minMemType1",2),Tt([m("uint32")],Qt.prototype,"maxMemType1",2),Qt=Tt([Xe("post")],Qt);var Ff=Object.defineProperty,Tf=Object.getOwnPropertyDescriptor,lt=(r,A,e,t)=>{for(var i=t>1?void 0:t?Tf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ff(A,e,i),i};let ze=class extends At{constructor(r=new ArrayBuffer(36),A){super(r,A,Math.min(36,r.byteLength-(A??0)))}};lt([m("fixed")],ze.prototype,"version",2),lt([m("int16")],ze.prototype,"vertTypoAscender",2),lt([m("int16")],ze.prototype,"vertTypoDescender",2),lt([m("int16")],ze.prototype,"vertTypoLineGap",2),lt([m("int16")],ze.prototype,"advanceHeightMax",2),lt([m("int16")],ze.prototype,"minTopSideBearing",2),lt([m("int16")],ze.prototype,"minBottomSideBearing",2),lt([m("int16")],ze.prototype,"yMaxExtent",2),lt([m("int16")],ze.prototype,"caretSlopeRise",2),lt([m("int16")],ze.prototype,"caretSlopeRun",2),lt([m("int16")],ze.prototype,"caretOffset",2),lt([m({type:"int16",size:4})],ze.prototype,"reserved",2),lt([m("int16")],ze.prototype,"metricDataFormat",2),lt([m("int16")],ze.prototype,"numOfLongVerMetrics",2),ze=lt([Xe("vhea")],ze);var Lf=Object.defineProperty,Gf=Object.getOwnPropertyDescriptor,Of=(r,A,e,t)=>{for(var i=t>1?void 0:t?Gf(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Lf(A,e,i),i};let wr=class extends At{constructor(){super(...arguments);g(this,"_metrics")}static from(A){const e=A.length*4,t=new wr(new ArrayBuffer(e));return A.forEach(i=>{t.view.writeUint16(i.advanceHeight),t.view.writeInt16(i.topSideBearing)}),t}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){var s;const A=this._sfnt.maxp.numGlyphs,e=((s=this._sfnt.vhea)==null?void 0:s.numOfLongVerMetrics)??0,t=this.view;t.seek(0);let i=0;return Array.from({length:A}).map((n,o)=>(o<e&&(i=t.readUint16()),{advanceHeight:i,topSideBearing:t.readUint8()}))}};wr=Of([Xe("vmtx")],wr);var Hf=Object.defineProperty,ki=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Hf(A,e,i),i};class yt extends ur{constructor(){super(...arguments);g(this,"format","TrueType");g(this,"mimeType","font/ttf");g(this,"_sfnt")}get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(HA(e).getUint32(0))}static checksum(e){const t=HA(e);let i=t.byteLength;for(;i%4;)i++;let s=0;for(let n=0,o=i/4;n<o;n+=4)n*4<i-4&&(s+=t.getUint32(n*4,!1));return s&4294967295}static from(e){const t=u=>u+3&-4,i=e.tableViews.size,s=Array.from(e.tableViews.values()).reduce((u,d)=>u+t(d.byteLength),0),n=new this(new ArrayBuffer(12+i*16+s));n.scalerType=65536,n.numTables=i;const o=Math.log(2);n.searchRange=Math.floor(Math.log(i)/o)*16,n.entrySelector=Math.floor(n.searchRange/o),n.rangeShift=i*16-n.searchRange;let a=12+i*16,l=0;const h=n.getDirectories();e.tableViews.forEach((u,d)=>{const I=h[l++];I.tag=d,I.checkSum=this.checksum(u),I.offset=a,I.length=u.byteLength,n.view.writeBytes(u,a),a+=t(I.length)});const c=n.createSFNT().head;return c.checkSumAdjustment=0,c.checkSumAdjustment=2981146554-this.checksum(n.view),n}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new JA(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new mA(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}g(yt,"signature",new Set([65536,1953658213,1954115633])),ki([m("uint32")],yt.prototype,"scalerType"),ki([m("uint16")],yt.prototype,"numTables"),ki([m("uint16")],yt.prototype,"searchRange"),ki([m("uint16")],yt.prototype,"entrySelector"),ki([m("uint16")],yt.prototype,"rangeShift");class _r extends yt{constructor(){super(...arguments);g(this,"format","OpenType");g(this,"mimeType","font/otf")}static from(e){return super.from(e)}}g(_r,"signature",new Set([1330926671]));var Jf=Object.defineProperty,Pi=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Jf(A,e,i),i};class DA extends It{constructor(A,e){super(A,e,20)}}Pi([m({type:"char",size:4})],DA.prototype,"tag"),Pi([m("uint32")],DA.prototype,"offset"),Pi([m("uint32")],DA.prototype,"compLength"),Pi([m("uint32")],DA.prototype,"origLength"),Pi([m("uint32")],DA.prototype,"origChecksum");var Kf=Object.defineProperty,Bt=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Kf(A,e,i),i};const ut=(uA=class extends ur{constructor(){super(...arguments);g(this,"format","WOFF");g(this,"mimeType","font/woff");g(this,"_sfnt")}get subfontFormat(){return yt.is(this.flavor)?"TrueType":_r.is(this.flavor)?"OpenType":"Open"}get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(HA(e).getUint32(0))}static checkSum(e){const t=HA(e),i=t.byteLength,s=Math.floor(i/4);let n=0,o=0;for(;o<s;)n+=t.getUint32(4*o++,!1);let a=i-s*4;if(a){let l=s*4;for(;a>0;)n+=t.getUint8(l)<<a*8,l++,a--}return n%4294967296}static from(e,t=new ArrayBuffer(0)){const i=u=>u+3&-4,s=[];e.tableViews.forEach((u,d)=>{const I=HA(vu(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)));s.push({tag:d,view:I.byteLength<u.byteLength?I:u,rawView:u})});const n=s.length,o=s.reduce((u,d)=>u+i(d.view.byteLength),0),a=new uA(new ArrayBuffer(44+20*n+o+t.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=n,a.totalSFNTSize=12+16*n+s.reduce((u,d)=>u+i(d.rawView.byteLength),0);let l=44+n*20,h=0;const c=a.getDirectories();return s.forEach(u=>{const d=c[h++];d.tag=u.tag,d.offset=l,d.compLength=u.view.byteLength,d.origChecksum=uA.checkSum(u.rawView),d.origLength=u.rawView.byteLength,a.view.writeBytes(u.view,l),l+=i(d.compLength)}),a.view.writeBytes(t),a}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new DA(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new mA(this.getDirectories().reduce((e,t)=>{const i=t.tag,s=this.view.byteOffset+t.offset,n=t.compLength,o=t.origLength,a=s+n;return e[i]=n>=o?new DataView(this.view.buffer,s,n):new DataView(bu(new Uint8Array(this.view.buffer.slice(s,a))).buffer),e},{}))}},g(uA,"signature",new Set([2001684038])),uA);Bt([m("uint32")],ut.prototype,"signature"),Bt([m("uint32")],ut.prototype,"flavor"),Bt([m("uint32")],ut.prototype,"length"),Bt([m("uint16")],ut.prototype,"numTables"),Bt([m("uint16")],ut.prototype,"reserved"),Bt([m("uint32")],ut.prototype,"totalSFNTSize"),Bt([m("uint16")],ut.prototype,"majorVersion"),Bt([m("uint16")],ut.prototype,"minorVersion"),Bt([m("uint32")],ut.prototype,"metaOffset"),Bt([m("uint32")],ut.prototype,"metaLength"),Bt([m("uint32")],ut.prototype,"metaOrigLength"),Bt([m("uint32")],ut.prototype,"privOffset"),Bt([m("uint32")],ut.prototype,"privLength");let vr=ut;function ja(r,A=!0){if(yt.is(r))return new yt(r);if(_r.is(r))return new _r(r);if(vr.is(r))return new vr(r);if(A)throw new Error("Failed to parseFont")}function Za(r,A=!0){const e=ja(r,!1);if(e)return e;if(A)throw new Error("Failed to parseFont")}const Lr=class Lr{constructor(){g(this,"fallbackFont");g(this,"loading",new Map);g(this,"loaded",new Map);g(this,"familyToUrl",new Map)}_createRequest(A,e){const t=new AbortController;return{url:A,when:fetch(A,{...Lr.defaultRequestInit,...e,signal:t.signal}).then(i=>i.arrayBuffer()),cancel:()=>t.abort()}}injectFontFace(A,e){return document.fonts.add(new FontFace(A,e)),this}injectStyleTag(A,e){const t=document.createElement("style");return t.appendChild(document.createTextNode(`@font-face {
748
+ font-family: "${A}";
749
749
  src: url(${e});
750
- }`)),document.head.appendChild(t),this}_parseUrls(r){const e=Array.from(new Set([...r.split(","),r]));return Array.from(new Set(e.map(t=>this.familyToUrl.get(t.trim())??this.familyToUrl.get(t)??t)))}get(r){let e;return r&&(e=this._parseUrls(r).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(r,e){return this.familyToUrl.set(r,e.src),this.loaded.set(e.src,e),this}delete(r){return this._parseUrls(r).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}async load(r,e={}){const{cancelOther:t,injectFontFace:i=!0,injectStyleTag:s=!0,...o}=e,{src:a}=r;if(this.loaded.has(a))return t&&(this.loading.forEach(p=>p.cancel()),this.loading.clear()),c(this.loaded.get(a));let l=this.loading.get(a);return l||(l=this._createRequest(a,o),this.loading.set(a,l)),t&&this.loading.forEach((p,m)=>{p!==l&&(p.cancel(),this.loading.delete(m))}),l.when.then(p=>{if(this.loaded.has(a))return c(this.loaded.get(a));{const m=f(p);return e.noAdd||this.loaded.set(r.src,m),m.familySet.forEach(g=>{this.familyToUrl.set(g,a),typeof document<"u"&&(i&&this.injectFontFace(g,p),s&&this.injectStyleTag(g,a))}),m}}).catch(p=>{if(p instanceof DOMException&&p.message==="The user aborted a request.")return f();throw p}).finally(()=>{this.loading.delete(a)});function h(){return r.family?Array.isArray(r.family)?r.family:[r.family]:[]}function c(p){return h().forEach(m=>{p.familySet.add(m)}),p}function f(p=new ArrayBuffer(0)){let m;function g(){return m||(m=p.byteLength?Ra(p,!1):void 0),m}function _(){const y=g();if(y instanceof Ze||y instanceof Bi)return y.sfnt}return{...r,buffer:p,familySet:new Set(h()),getFont:g,getSFNT:_}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(r=>r.when))}};u(Wi,"defaultRequestInit",{cache:"force-cache"});let ki=Wi;const Ba=new ki,cd=Object.freeze(Object.defineProperty({__proto__:null,BaseFont:xi,get Cff(){return Vt},get Cmap(){return hr},CmapSubtableFormat0:Ys,CmapSubtableFormat12:Qs,CmapSubtableFormat14:Gr,CmapSubtableFormat2:zr,CmapSubtableFormat4:Js,CmapSubtableFormat6:Gt,FontDataObject:qe,FontDataView:be,Fonts:ki,get Glyf(){return Ai},Glyph:Ws,GlyphSet:Xs,get Gpos(){return rn},get Gsub(){return xt},get Head(){return pe},get Hhea(){return Te},get Hmtx(){return Oi},get Kern(){return sn},get Loca(){return Ui},get Maxp(){return xe},get Name(){return cr},get Os2(){return $},get Post(){return Ye},SFNT:zt,TTF:Ze,TableDirectory:ar,get Vhea(){return Se},get Vmtx(){return Di},WOFF:Bi,WOFFTableDirectoryEntry:Wt,createCmapSegments:Ks,dataTypeToByteLength:Nr,defineColumn:b,defineSFNTTable:Ce,fonts:Ba,parseFont:Ra,parseSFNTFont:Da},Symbol.toStringTag,{value:"Module"}));function on(n,r,e){if(typeof r=="string"&&r.startsWith("linear-gradient")){const{x0:t,y0:i,x1:s,y1:o,stops:a}=ud(r,e.left,e.top,e.width,e.height),l=n.createLinearGradient(t,i,s,o);return a.forEach(h=>l.addColorStop(h.offset,h.color)),l}return r}function Li(n,r,e){n!=null&&n.color&&(n.color=on(e,n.color,r)),n!=null&&n.backgroundColor&&(n.backgroundColor=on(e,n.backgroundColor,r)),n!=null&&n.textStrokeColor&&(n.textStrokeColor=on(e,n.textStrokeColor,r))}function ud(n,r,e,t,i){var m;const s=((m=n.match(/linear-gradient\((.+)\)$/))==null?void 0:m[1])??"",o=s.split(",")[0],a=o.includes("deg")?o:"0deg",l=s.replace(a,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),c=(Number(a.replace("deg",""))||0)*Math.PI/180,f=t*Math.sin(c),p=i*Math.cos(c);return{x0:r+t/2-f,y0:e+i/2+p,x1:r+t/2+f,y1:e+i/2-p,stops:Array.from(l).map(g=>{let _=g[2];return _.startsWith("(")?_=_.split(",").length>3?`rgba${_}`:`rgb${_}`:_=`#${_}`,{offset:Number(g[3].replace("%",""))/100,color:_}})}}function Xr(n){const{ctx:r,path:e,fontSize:t,clipRect:i}=n;r.save(),r.beginPath();const s=e.style,o={...s,fill:n.color??s.fill,stroke:n.textStrokeColor??s.stroke,strokeWidth:n.textStrokeWidth?n.textStrokeWidth*t:s.strokeWidth,shadowOffsetX:(n.shadowOffsetX??0)*t,shadowOffsetY:(n.shadowOffsetY??0)*t,shadowBlur:(n.shadowBlur??0)*t,shadowColor:n.shadowColor};i&&(r.rect(i.left,i.top,i.width,i.height),r.clip(),r.beginPath()),e.drawTo(r,o),r.restore()}function fd(n,r,e){const{left:t,top:i,width:s,height:o}=e,a=n.canvas;a.dataset.viewBox=`${t} ${i} ${s} ${o}`,a.dataset.pixelRatio=String(r);const l=s,h=o;a.width=Math.max(1,Math.ceil(l*r)),a.height=Math.max(1,Math.ceil(h*r)),a.style.width=`${l}px`,a.style.height=`${h}px`,n.clearRect(0,0,a.width,a.height),n.scale(r,r),n.translate(-t,-i)}function dd(n,r){const{paragraphs:e,computedStyle:t,glyphBox:i}=r;Li(t,i,n),e.forEach(s=>{Li(s.computedStyle,s.lineBox,n),s.fragments.forEach(o=>{Li(o.computedStyle,o.inlineBox,n)})})}const pd=new Set(["©","®","÷"]),gd=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),md={1:"italic",32:"bold"},yd={1:"italic",2:"bold"},ka={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class _d{constructor(r,e,t){u(this,"path",new Pe);u(this,"lineBox",new Z);u(this,"inlineBox",new Z);u(this,"glyphBox");u(this,"advanceWidth",0);u(this,"advanceHeight",0);u(this,"underlinePosition",0);u(this,"underlineThickness",0);u(this,"strikeoutPosition",0);u(this,"strikeoutSize",0);u(this,"ascender",0);u(this,"descender",0);u(this,"typoAscender",0);u(this,"typoDescender",0);u(this,"typoLineGap",0);u(this,"winAscent",0);u(this,"winDescent",0);u(this,"xHeight",0);u(this,"capHeight",0);u(this,"baseline",0);u(this,"centerDiviation",0);u(this,"fontStyle");this.content=r,this.index=e,this.parent=t}get center(){var r;return(r=this.glyphBox)==null?void 0:r.center}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(r){const e=this.computedStyle.fontFamily,t=r??Ba,i=e?t.get(e):t.fallbackFont;return i==null?void 0:i.getSFNT()}updateGlyph(r=this._getFontSFNT()){if(!r)return this;const{hhea:e,os2:t,post:i,head:s}=r,o=s.unitsPerEm,a=e.ascent,l=e.descent,{content:h,computedStyle:c,isVertical:f}=this,{fontSize:p}=c,m=o/p,g=r.getAdvanceWidth(h,p),_=(a+Math.abs(l))/m,y=a/m;return this.advanceWidth=g,this.advanceHeight=_,this.inlineBox.width=f?_:g,this.inlineBox.height=f?g:_,this.underlinePosition=(a-i.underlinePosition)/m,this.underlineThickness=i.underlineThickness/m,this.strikeoutPosition=(a-t.yStrikeoutPosition)/m,this.strikeoutSize=t.yStrikeoutSize/m,this.ascender=a/m,this.descender=l/m,this.typoAscender=t.sTypoAscender/m,this.typoDescender=t.sTypoDescender/m,this.typoLineGap=t.sTypoLineGap/m,this.winAscent=t.usWinAscent/m,this.winDescent=t.usWinDescent/m,this.xHeight=t.sxHeight/m,this.capHeight=t.sCapHeight/m,this.baseline=y,this.centerDiviation=_/2-y,this.fontStyle=md[t.fsSelection]??yd[s.macStyle],this}update(r){const e=this._getFontSFNT(r);if(!e)return this;this.updateGlyph(e);const{isVertical:t,content:i,computedStyle:s,baseline:o,inlineBox:a,ascender:l,descender:h,typoAscender:c,fontStyle:f,advanceWidth:p,advanceHeight:m}=this,{left:g,top:_}=a,y=s.fontStyle==="italic"&&f!=="italic";let E=g,T=_+o,P;const S=new Pe;if(t&&(E+=(m-p)/2,Math.abs(p-m)>.1&&(T-=(l-c)/(l+Math.abs(h))*m),P=void 0),t&&!pd.has(i)&&(i.codePointAt(0)<=256||gd.has(i))){S.addCommands(e.getPathCommands(i,E,_+o-(m-p)/2,s.fontSize));const v={y:_-(m-p)/2+m/2,x:E+p/2};y&&this._italic(S,t?{x:v.x,y:_-(m-p)/2+o}:void 0),S.rotate(90,v)}else P!==void 0?(S.addCommands(e.glyphs.get(P).getPathCommands(E,T,s.fontSize)),y&&this._italic(S,t?{x:E+p/2,y:_+c/(l+Math.abs(h))*m}:void 0)):(S.addCommands(e.getPathCommands(i,E,T,s.fontSize)),y&&this._italic(S,t?{x:E+m/2,y:T}:void 0));const w=s.fontWeight??400;return w in ka&&(w===700||w==="bold")&&f!=="bold"&&S.bold(ka[w]*s.fontSize*.05),S.style={fill:s.color,stroke:s.textStrokeWidth?s.textStrokeColor:"none",strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=S,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(r,e){r.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(r,e,t){var i;if((i=this.path.curves[0])!=null&&i.curves.length)return this.path.getMinMax(r,e,t)}getGlyphBoundingBox(r){const e=this.getGlyphMinMax(void 0,void 0,r);if(!e)return;const{min:t,max:i}=e;return new Z(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(r,e={}){const t=this.computedStyle,i={ctx:r,path:this.path,fontSize:t.fontSize,color:t.color,...e};if(this.glyphBox)Xr(i);else{r.save(),r.beginPath();const s=this.path.style,o={...s,fill:i.color??s.fill,stroke:i.textStrokeColor??s.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:s.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};ys(r,o),r.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(r.textBaseline="middle",r.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(r.textBaseline="alphabetic",r.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),r.restore()}}}function an(n,r){return typeof n=="number"?n:n.endsWith("%")?(n=n.substring(0,n.length-1),Math.ceil(Number(n)/100*r.total)):n.endsWith("rem")?(n=n.substring(0,n.length-3),Number(n)*r.fontSize):n.endsWith("em")?(n=n.substring(0,n.length-2),Number(n)*r.fontSize):Number(n)}function La(n){const r=Ot(n)?{}:n;return Object.keys(r).reduce((e,t)=>{let i=r[t];const s=Na(t),o=Na(i);return s&&(t=s),o&&(i=o),e[t]=i,e},{})}function Ot(n){return!n||n==="none"}function vd(n,r){const e=Object.keys(n),t=Object.keys(r);return Array.from(new Set([...e,...t])).every(s=>ur(n[s],r[s]))}function ur(n,r){const e=typeof n;return e===typeof r?e==="object"?vd(n,r):n===r:!1}function Na(n){const r=n.startsWith("#")?n.slice(1):n;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(r))return null;const t=r.length===3?r.split("").map(a=>a+a).join(""):r,i=Number.parseInt(t.slice(0,2),16),s=Number.parseInt(t.slice(2,4),16),o=Number.parseInt(t.slice(4,6),16);return`rgb(${i}, ${s}, ${o})`}function ln(n){if(!n)return n;const r={};for(const e in n)n[e]!==""&&n[e]!==void 0&&(r[e]=n[e]);return r}function hn(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("blob://")}class bd{constructor(r,e={},t){u(this,"inlineBox",new Z);this.content=r,this.style=e,this.parent=t,this.updateComputedStyle().initCharacters()}get computedContent(){const r=this.computedStyle;return r.textTransform==="uppercase"?this.content.toUpperCase():r.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...ln(this.style)},this}initCharacters(){const r=[];let e=0;for(const t of this.computedContent)r.push(new _d(t,e++,this));return this.characters=r,this}}class Hr{constructor(r,e){u(this,"lineBox",new Z);u(this,"fragments",[]);this.style=r,this.parentStyle=e,this.updateComputedStyle()}updateComputedStyle(){return this.computedStyle={...ln(this.parentStyle),...ln(this.style)},this}addFragment(r,e){const t=new bd(r,e,this);return this.fragments.push(t),t}}function Bp(n){return n}const gr=class gr{_styleToDomStyle(r){const e={};for(const t in r){const i=r[t];gr.notZeroStyles.has(t)&&i===0||(typeof i=="number"&&gr.pxStyles.has(t)?e[t]=`${i}px`:e[t]=i)}return e}createParagraphDom(r,e){const t=document.createDocumentFragment(),i=document.createElement("section"),s={...e},o=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":s.justifyContent="start";break;case"center":s.justifyContent="center";break;case"end":case"right":s.justifyContent="end";break}switch(e.verticalAlign){case"top":s.alignItems="top";break;case"middle":s.alignItems="center";break;case"bottom":s.alignItems="end";break}const a=!!(s.justifyContent||s.alignItems);Object.assign(i.style,{boxSizing:"border-box",display:a?"inline-flex":void 0,width:"max-content",height:"max-content",whiteSpace:"pre-wrap",wordBreak:"break-all",...this._styleToDomStyle(s),position:"fixed",visibility:"hidden"});const l=document.createElement("ul");return Object.assign(l.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:a&&o?"100%":void 0,height:a&&!o?"100%":void 0}),r.forEach(h=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._styleToDomStyle(h.style)}),h.fragments.forEach(f=>{const p=document.createElement("span");Object.assign(p.style,{verticalAlign:"inherit",...this._styleToDomStyle(f.style)}),p.appendChild(document.createTextNode(f.content)),c.appendChild(p)}),l.appendChild(c)}),i.appendChild(l),t.appendChild(i),document.body.appendChild(t),{dom:i,destory:()=>{var h;return(h=i.parentNode)==null?void 0:h.removeChild(i)}}}measureDomText(r){const e=document.createRange();e.selectNodeContents(r);const t=r.data??"";let i=0;return Array.from(t).map(s=>{var f;const o=i+=t.substring(i).indexOf(s),a=o+s.length;i+=s.length,e.setStart(r,Math.max(o,0)),e.setEnd(r,a);const l=((f=e.getClientRects)==null?void 0:f.call(e))??[e.getBoundingClientRect()];let h=l[l.length-1];l.length>1&&h.width<2&&(h=l[l.length-2]);const c=e.toString();if(c!==""&&h&&h.width+h.height!==0)return{content:c,top:h.top,left:h.left,height:h.height,width:h.width}}).filter(Boolean)}measureDom(r){const e=[],t=[],i=[];return r.querySelectorAll("li").forEach((s,o)=>{const a=s.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),s.querySelectorAll(":scope > *").forEach((l,h)=>{const c=l.getBoundingClientRect();t.push({paragraphIndex:o,fragmentIndex:h,left:c.left,top:c.top,width:c.width,height:c.height});let f=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDomText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:h,characterIndex:f++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDomText(p.firstChild).forEach(m=>{i.push({...m,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:h,characterIndex:f++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:t,characters:i}}measureParagraphDom(r,e){const t=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(a=>{const l=r[a.paragraphIndex];l.lineBox.left=a.left-t.left,l.lineBox.top=a.top-t.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=r[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-t.left,l.inlineBox.top=a.top-t.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const s=[];let o=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:h,characterIndex:c}=a;s.push({...a,newParagraphIndex:l,left:a.left-t.left,top:a.top-t.top});const f=r[l].fragments[h].characters[c],{fontHeight:p,isVertical:m}=f,g=s[o];f.inlineBox.left=g.left,f.inlineBox.top=g.top,f.inlineBox.width=g.width,f.inlineBox.height=g.height,m?(f.lineBox.left=g.left+(g.width-p)/2,f.lineBox.top=g.top,f.lineBox.width=p,f.lineBox.height=g.height):(f.lineBox.left=g.left,f.lineBox.top=g.top+(g.height-p)/2,f.lineBox.width=g.width,f.lineBox.height=p),o++}),{paragraphs:r,boundingBox:new Z(0,0,t.width,t.height)}}measure(r,e,t){let i;t||({dom:t,destory:i}=this.createParagraphDom(r,e));const s=this.measureParagraphDom(r,t);return i==null||i(),s}};u(gr,"notZeroStyles",new Set(["width","height"])),u(gr,"pxStyles",new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"]));let cn=gr;class wd{constructor(){u(this,"eventListeners",new Map)}addEventListener(r,e,t){const i={value:e,options:t},s=this.eventListeners.get(r);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(r,[s,i]):this.eventListeners.set(r,i),this}removeEventListener(r,e,t){var s,o;if(!e)return this.eventListeners.delete(r),this;const i=this.eventListeners.get(r);if(!i)return this;if(Array.isArray(i)){const a=[];for(let l=0,h=i.length;l<h;l++){const c=i[l];(c.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof c.options=="boolean"||!((s=c.options)!=null&&s.once)))&&a.push(c)}a.length?this.eventListeners.set(r,a.length===1?a[0]:a):this.eventListeners.delete(r)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(o=i.options)!=null&&o.once)&&this.eventListeners.delete(r);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(r){return this.eventListeners.has(r)}dispatchEvent(r,e){var i,s;const t=this.eventListeners.get(r);if(t){if(Array.isArray(t))for(let o=t.length,a=0;a<o;a++){const l=t[a];typeof l.options=="object"&&((i=l.options)!=null&&i.once)&&this.off(r,l.value,l.options),l.value.apply(this,[e])}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(r,t.value,t.options),t.value.apply(this,[e]);return!0}else return!1}on(r,e,t){return this.addEventListener(r,e,t)}once(r,e){return this.addEventListener(r,e,{once:!0})}off(r,e,t){return this.removeEventListener(r,e,t)}emit(r,e){this.dispatchEvent(r,e)}}function un(n){const{highlight:r,highlightImage:e,highlightReferImage:t,highlightColormap:i,highlightLine:s,highlightSize:o,highlightThickness:a}=n;return{image:(r==null?void 0:r.image)??e??"none",referImage:(r==null?void 0:r.referImage)??t??"none",colormap:(r==null?void 0:r.colormap)??i??"none",line:(r==null?void 0:r.line)??s??"none",size:(r==null?void 0:r.size)??o??"cover",thickness:(r==null?void 0:r.thickness)??a??"100%"}}function xd(){const n=[],r=[],e=new Map,t=new Map;async function i(o){if(!e.has(o)){e.set(o,o);try{e.set(o,await fetch(o).then(a=>a.text()))}catch(a){console.warn(a),e.delete(o)}}}function s(o){let a=t.get(o);if(!a){const l=Io(hn(o)?e.get(o)??o:o),h=Lo(l);a={dom:l,pathSet:h},t.set(o,a)}return a}return{name:"highlight",paths:n,load:async o=>{const a=new Set;o.forEachCharacter(l=>{const{computedStyle:h}=l,{image:c,referImage:f}=un(h);hn(c)&&a.add(c),hn(f)&&a.add(f)}),await Promise.all(Array.from(a).map(l=>i(l)))},update:o=>{r.length=0,n.length=0;let a=[],l,h;o.forEachCharacter(c=>{const{computedStyle:f}=c,p=un(f),{image:m,colormap:g,line:_,size:y,thickness:E}=p;if(Ot(m))l!=null&&l.length&&(l=[],a.push(l));else{const{inlineBox:T,isVertical:P}=c,{fontSize:S}=f;(!h||ur(h.image,m)&&ur(h.colormap,g)&&ur(h.line,_)&&ur(h.size,y)&&ur(h.thickness,E))&&(l!=null&&l.length)&&(P?l[0].inlineBox.left===T.left:l[0].inlineBox.top===T.top)&&l[0].fontSize===S?l.push(c):(l=[],l.push(c),a.push(l))}h=p}),a=a.filter(c=>c.length);for(let c=0;c<a.length;c++){const f=a[c],p=f[0],m=Z.from(...f.filter(D=>D.glyphBox).map(D=>D.glyphBox)),{computedStyle:g}=p,{fontSize:_,writingMode:y}=g,{image:E,referImage:T,colormap:P,line:S,size:w,thickness:v}=un(g),x=y.includes("vertical"),C=an(v,{fontSize:_,total:m.width})/m.width,I=La(P),{pathSet:F,dom:B}=s(E),U=F.getBoundingBox(!0),V=_/U.width*2,A=new Z().copy(m);x&&(A.width=m.height,A.height=m.width,A.left=m.left+m.width);const N=Math.floor(A.width);let W=N;if(w!=="cover"&&(W=an(w,{fontSize:_,total:m.width})||N,A.width=W),!Ot(T)&&Ot(S)){const D=s(T).pathSet.getBoundingBox(!0);U.copy(D)}else{let D;if(Ot(S))if(U.width/U.height>4){D="underline";const G=B.getAttribute("viewBox");if(G){const[L,k,K,H]=G.split(" ").map(q=>Number(q)),X=k+H/2;U.y<X&&U.y+U.height>X?D="line-through":U.y+U.height<X?D="overline":D="underline"}}else D="outline";else D=S;switch(D){case"outline":{const G=A.width*.2,L=A.height*.2;A.width+=G,A.height+=L,x?(A.x-=L/2,A.y-=G/2,A.x+=A.height):(A.x-=G/2,A.y-=L/2);break}case"overline":A.height=U.height*V,x?A.x=p.inlineBox.left+p.inlineBox.width:A.y=p.inlineBox.top;break;case"line-through":A.height=U.height*V,x?A.x=p.inlineBox.left+p.inlineBox.width-p.strikeoutPosition+A.height/2:A.y=p.inlineBox.top+p.strikeoutPosition-A.height/2;break;case"underline":A.height=U.height*V,x?A.x=p.inlineBox.left+p.inlineBox.width-p.underlinePosition:A.y=p.inlineBox.top+p.underlinePosition;break}}const R=new Fe().translate(-U.x,-U.y).scale(A.width/U.width,A.height/U.height);x&&R.rotate(-Math.PI/2),R.translate(A.x,A.y);for(let D=0;D<Math.ceil(N/W);D++){const G=R.clone();x?G.translate(0,D*A.width):G.translate(D*A.width,0),F.paths.forEach(L=>{const k=L.clone().applyTransform(G);k.style.strokeWidth&&(k.style.strokeWidth*=V*C),k.style.strokeMiterlimit&&(k.style.strokeMiterlimit*=V),k.style.strokeDashoffset&&(k.style.strokeDashoffset*=V),k.style.strokeDasharray&&(k.style.strokeDasharray=k.style.strokeDasharray.map(K=>K*V)),k.style.fill&&k.style.fill in I&&(k.style.fill=I[k.style.fill]),k.style.stroke&&k.style.stroke in I&&(k.style.stroke=I[k.style.stroke]),n.push(k),N!==W&&(x?r[n.length-1]=new Z(m.left-m.width*2,m.top,m.width*4,m.height):r[n.length-1]=new Z(m.left,m.top-m.height*2,m.width,m.height*4))})}}},renderOrder:-1,render:(o,a)=>{n.forEach((l,h)=>{if(Xr({ctx:o,path:l,fontSize:a.computedStyle.fontSize,clipRect:r[h]}),a.debug){const c=new Cs([l]).getBoundingBox();c&&o.strokeRect(c.x,c.y,c.width,c.height)}})}}}function Pd(n,r){return`<svg width="${n*2}" height="${n*2}" xmlns="http://www.w3.org/2000/svg">
751
- <circle cx="${n}" cy="${n}" r="${n}" fill="${r}" />
752
- </svg>`}function Cd(){const n=[];return{name:"listStyle",paths:n,update:r=>{n.length=0;const{paragraphs:e,isVertical:t,fontSize:i}=r,s=i*.45;e.forEach(o=>{const{computedStyle:a}=o,{color:l,listStyleImage:h,listStyleColormap:c,listStyleSize:f,listStyleType:p}=a,m=La(c);let g=f,_;if(!Ot(h))_=h;else if(!Ot(p)){const P=i*.38/2;switch(g=g==="cover"?P*2:g,p){case"disc":_=Pd(P,String(l));break}}if(!_)return;const y=Lo(_),E=y.getBoundingBox();let T;o.fragments.forEach(P=>{P.characters.forEach(S=>{const{inlineBox:w}=S;if(t?(T==null?void 0:T.inlineBox.left)!==w.left:(T==null?void 0:T.inlineBox.top)!==w.top){T=S;const v=g==="cover"?1:an(g,{total:i,fontSize:i})/i,x=new Fe;if(t){const C=i/E.height*v;x.translate(-E.left,-E.top).rotate(Math.PI/2).scale(C,C).translate(w.left+(w.width-E.height*C)/2,w.top-s)}else{const C=i/E.height*v;x.translate(-E.left,-E.top).scale(C,C).translate(w.left-E.width*C-s,w.top+(w.height-E.height*C)/2)}n.push(...y.paths.map(C=>{const I=C.clone();return I.applyTransform(x),I.style.fill&&I.style.fill in m&&(I.style.fill=m[I.style.fill]),I.style.stroke&&I.style.stroke in m&&(I.style.stroke=m[I.style.stroke]),I}))}})})})}}}const Ut=new O,fr=new Fe,It=new Fe;function Td(){return{name:"render",getBoundingBox:n=>{const{characters:r,fontSize:e,effects:t}=n,i=[];return r.forEach(s=>{t==null||t.forEach(o=>{if(!s.glyphBox)return;const a=s.glyphBox.clone(),l=fn(n,o);Ut.set(a.left,a.top),Ut.applyMatrix3(l),a.left=Ut.x,a.top=Ut.y,Ut.set(a.right,a.bottom),Ut.applyMatrix3(l),a.width=Ut.x-a.left,a.height=Ut.y-a.top;const h=(o.shadowOffsetX??0)*e,c=(o.shadowOffsetY??0)*e,f=Math.max(.1,o.textStrokeWidth??0)*e;a.left+=h-f,a.top+=c-f,a.width+=f*2,a.height+=f*2,i.push(a)})}),i.length?Z.from(...i):void 0},render:(n,r)=>{const{paragraphs:e,glyphBox:t,effects:i,style:s}=r;function o(a,l){n.fillStyle=a,n.fillRect(l.left,l.top,l.width,l.height)}s!=null&&s.backgroundColor&&o(s.backgroundColor,new Z(0,0,n.canvas.width,n.canvas.height)),e.forEach(a=>{var l;(l=a.style)!=null&&l.backgroundColor&&o(a.style.backgroundColor,a.lineBox)}),i?i.forEach(a=>{Li(a,t,n),n.save();const[l,h,c,f,p,m]=fn(r,a).transpose().elements;n.transform(l,f,h,p,c,m),r.forEachCharacter(g=>{var _;(_=g.parent.style)!=null&&_.backgroundColor&&o(g.parent.style.backgroundColor,g.inlineBox),g.drawTo(n,a)}),n.restore()}):e.forEach(a=>{a.fragments.forEach(l=>{var h;(h=l.style)!=null&&h.backgroundColor&&o(l.computedStyle.backgroundColor,l.inlineBox),l.characters.forEach(c=>{c.drawTo(n)})})}),r.debug&&e.forEach(a=>{n.strokeRect(a.lineBox.x,a.lineBox.y,a.lineBox.width,a.lineBox.height)})}}}function fn(n,r){const{fontSize:e,glyphBox:t}=n,i=(r.translateX??0)*e,s=(r.translateY??0)*e,o=Math.PI*2,a=(r.skewX??0)/360*o,l=(r.skewY??0)/360*o,{left:h,top:c,width:f,height:p}=t,m=h+f/2,g=c+p/2;return fr.identity(),It.makeTranslation(i,s),fr.multiply(It),It.makeTranslation(m,g),fr.multiply(It),It.set(1,Math.tan(a),0,Math.tan(l),1,0,0,0,1),fr.multiply(It),It.makeTranslation(-m,-g),fr.multiply(It),fr.clone()}function Sd(){const n=[];return{name:"textDecoration",paths:n,update:r=>{n.length=0;const e=[];let t,i;r.forEachCharacter(s=>{const{computedStyle:o,isVertical:a,inlineBox:l,underlinePosition:h,underlineThickness:c,strikeoutPosition:f,strikeoutSize:p}=s,{color:m,textDecoration:g,writingMode:_}=o;if(Ot(g))i=void 0;else{let y=!1;if((i==null?void 0:i.textDecoration)===g&&(i==null?void 0:i.writingMode)===_&&(i==null?void 0:i.color)===m&&(a?t[0].inlineBox.left===l.left:t[0].inlineBox.top===l.top))switch(g){case"underline":t[0].underlinePosition===h&&t[0].underlineThickness===c&&(y=!0);break;case"line-through":t[0].strikeoutPosition===f&&t[0].strikeoutSize===p&&(y=!0);break}y?t.push(s):(t=[],t.push(s),e.push(t)),i=o}}),e.forEach(s=>{const{computedStyle:o,isVertical:a,underlinePosition:l,underlineThickness:h,strikeoutPosition:c,strikeoutSize:f}=s[0],{color:p,textDecoration:m}=o,{left:g,top:_,width:y,height:E}=Z.from(...s.map(v=>v.inlineBox));let T=a?g+y:_;const P=a?-1:1;let S=0;switch(m){case"overline":S=h*2;break;case"underline":T+=P*l,S=h*2;break;case"line-through":T+=P*c,S=f*2;break}T-=S;let w;a?w=new Pe([{type:"M",x:T,y:_},{type:"L",x:T,y:_+E},{type:"L",x:T+S,y:_+E},{type:"L",x:T+S,y:_},{type:"Z"}],{fill:p}):w=new Pe([{type:"M",x:g,y:T},{type:"L",x:g+y,y:T},{type:"L",x:g+y,y:T+S},{type:"L",x:g,y:T+S},{type:"Z"}],{fill:p}),n.push(w)})},render:(r,e)=>{const{effects:t,computedStyle:i}=e;t?t.forEach(s=>{r.save();const[o,a,l,h,c,f]=fn(e,s).transpose().elements;r.transform(o,h,a,c,l,f),n.forEach(p=>{Xr({ctx:r,path:p,fontSize:i.fontSize,...s})}),r.restore()}):n.forEach(s=>{Xr({ctx:r,path:s,fontSize:i.fontSize})})}}}const dn=uc();class Ed extends wd{constructor(e={}){super();u(this,"debug");u(this,"content");u(this,"style");u(this,"effects");u(this,"measureDom");u(this,"needsUpdate",!0);u(this,"computedStyle",{...dn});u(this,"paragraphs",[]);u(this,"lineBox",new Z);u(this,"rawGlyphBox",new Z);u(this,"glyphBox",new Z);u(this,"pathBox",new Z);u(this,"boundingBox",new Z);u(this,"measurer",new cn);u(this,"plugins",new Map);u(this,"fonts");this.debug=e.debug??!1,this.content=e.content??"",this.style=e.style??{},this.measureDom=e.measureDom,this.effects=e.effects,this.fonts=e.fonts,this.use(Cd()).use(Sd()).use(xd()).use(Td()),this.updateParagraphs()}get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(e=>e.fragments.flatMap(t=>t.characters))}use(e){return this.plugins.set(e.name,e),this}forEachCharacter(e){return this.paragraphs.forEach((t,i)=>{t.fragments.forEach((s,o)=>{s.characters.forEach((a,l)=>{e(a,{paragraphIndex:i,fragmentIndex:o,characterIndex:l})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(e=>{var t;return(t=e.load)==null?void 0:t.call(e,this)}))}updateParagraphs(){this.computedStyle={...dn,...this.style};let{content:e,computedStyle:t}=this;const i=[];if(typeof e=="string"){const s=new Hr({},t);s.addFragment(e),i.push(s)}else{e=Array.isArray(e)?e:[e];for(const s of e)if(typeof s=="string"){const o=new Hr({},t);o.addFragment(s),i.push(o)}else if(Array.isArray(s)){const o=new Hr({},t);s.forEach(a=>{if(typeof a=="string")o.addFragment(a);else{const{content:l,...h}=a;l!==void 0&&o.addFragment(l,h)}}),i.push(o)}else if("fragments"in s){const{fragments:o,...a}=s,l=new Hr(a,t);o.forEach(h=>{const{content:c,...f}=h;c!==void 0&&l.addFragment(c,f)}),i.push(l)}else if("content"in s){const{content:o,...a}=s;if(o!==void 0){const l=new Hr(a,t);l.addFragment(o),i.push(l)}}}return this.paragraphs=i,this}measure(e=this.measureDom){const t={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this.updateParagraphs();const i=this.measurer.measure(this.paragraphs,this.computedStyle,e);this.paragraphs=i.paragraphs,this.lineBox=i.boundingBox,this.characters.forEach(s=>{s.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((s,o)=>(s.updateOrder??0)-(o.updateOrder??0)).forEach(s=>{var o;(o=s.update)==null||o.call(s,this)}),this.glyphBox=this.getGlyphBox(),this.updatePathBox().updateBoundingBox();for(const s in t)i[s]=this[s],this[s]=t[s];return this.emit("measure",{text:this,result:i}),i}getGlyphBox(){const e=O.MAX,t=O.MIN;return this.characters.forEach(i=>{if(!i.getGlyphMinMax(e,t)){const{inlineBox:s}=i,o=new O(s.left,s.top),a=new O(s.left+s.width,s.top+s.height);e.min(o,a),t.max(o,a)}}),new Z(e.x,e.y,t.x-e.x,t.y-e.y)}updatePathBox(){return this.pathBox=Z.from(this.glyphBox,...Array.from(this.plugins.values()).map(e=>e.getBoundingBox?e.getBoundingBox(this):new Cs(e.paths??[]).getBoundingBox()).filter(Boolean)),this}updateBoundingBox(){const{lineBox:e,rawGlyphBox:t,pathBox:i}=this,s=Math.min(i.left,i.left+e.left-t.left),o=Math.min(i.top,i.top+e.top-t.top),a=Math.max(i.right,i.right+e.right-t.right),l=Math.max(i.bottom,i.bottom+e.bottom-t.bottom);return this.boundingBox=new Z(s,o,a-s,l-o),this}requestUpdate(){return this.needsUpdate=!0,this}update(){const e=this.measure();for(const t in e)this[t]=e[t];return this.emit("update",{text:this}),this.needsUpdate=!1,this}render(e){const{view:t,pixelRatio:i=2}=e,s=t.getContext("2d");s&&(this.needsUpdate&&this.update(),fd(s,i,this.boundingBox),dd(s,this),Array.from(this.plugins.values()).sort((o,a)=>(o.renderOrder??0)-(a.renderOrder??0)).forEach(o=>{var a;if(o.render)(a=o.render)==null||a.call(o,s,this);else if(o.paths){const l=this.computedStyle;o.paths.forEach(h=>{Xr({ctx:s,path:h,fontSize:l.fontSize})})}}),this.emit("render",{text:this,view:t,pixelRatio:i}))}}var Md=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,dr=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ad(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Md(r,e,i),i};const Od=new Set(Object.keys(dn));d.Text2D=class extends _i{constructor(e,t=[]){super();u(this,"effects");u(this,"measureDom");u(this,"fonts");u(this,"texture",new Er);u(this,"text",new Ed);u(this,"_subTextsCount",0);this.setProperties(e),this.append(t)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"content":case"effects":case"measureDom":case"fonts":case"split":this._updateSplit(),this.requestRedraw();break}this._subTextsCount&&e==="effects"&&this._getSubTexts().forEach(o=>{o.setProperties({[e]:t})})}_updateText(){this.text.style=this.style.toJSON(),this.text.content=this.content??"",this.text.effects=this.effects,this.text.fonts=this.fonts,this.text.measureDom=this.measureDom,this.text.requestUpdate()}_updateStyleProperty(e,t,i){switch(super._updateStyleProperty(e,t,i),e){case"width":this.split&&this._updateSubTexts();break}typeof e=="string"&&Od.has(e)&&(this._subTextsCount&&e!=="width"&&e!=="height"&&this._getSubTexts().forEach(s=>{s.style.setProperties({[e]:t})}),this.requestRedraw())}_getSubTexts(){return this.getChildren("front").filter(e=>e instanceof d.Text2D)}_updateSubTexts(){const e=this._getSubTexts(),t=this.measure();let i=0;this.split&&t.paragraphs.forEach(s=>{s.fragments.forEach(o=>{o.characters.forEach(a=>{const l=e[i];l&&(l.style.left=a.inlineBox.left,l.style.top=a.inlineBox.top),i++})})})}measure(){this._updateText();const e=this.text.measure();return this.style.width||(this.style.width=e.boundingBox.width),this.style.height||(this.style.height=e.boundingBox.height),e}_updateSplit(){this._subTextsCount&&(this.getChildren("front").forEach(t=>this.removeChild(t)),this._subTextsCount=0);const e=this.measure();this.split&&e.paragraphs.forEach(t=>{t.fragments.forEach(i=>{i.characters.forEach(s=>{this.addChild(new d.Text2D({content:s.content,style:{...s.computedStyle,left:s.inlineBox.x,top:s.inlineBox.y,width:0,height:0,effects:this.effects}}),"front"),this._subTextsCount++})})})}_drawContent(){var e,t;if(!this.split){const i=(t=(e=this.getChildren())==null?void 0:e.find(s=>"onText2DRender"in s))==null?void 0:t.onText2DRender;i?i():(this._updateText(),this.text.render({pixelRatio:this.texture.pixelRatio,view:this.texture.source})),this.texture.requestUpload(),super._drawContent()}}},dr([M({default:!1})],d.Text2D.prototype,"split",2),dr([M({default:""})],d.Text2D.prototype,"content",2),dr([M()],d.Text2D.prototype,"effects",2),dr([ue()],d.Text2D.prototype,"measureDom",2),dr([ue()],d.Text2D.prototype,"fonts",2),d.Text2D=dr([j("Text2D")],d.Text2D);var Ud=Object.defineProperty,Id=Object.getOwnPropertyDescriptor,Fa=(n,r,e,t)=>{for(var i=t>1?void 0:t?Id(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ud(r,e,i),i};d.Video2D=class extends _i{constructor(e,t=[]){super();u(this,"_wait",Promise.resolve());this.setProperties(e),this.append(t)}get videoDuration(){var e;return(((e=this.texture)==null?void 0:e.duration)??0)*1e3}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._wait=this._load(t);break}}waitLoad(){return this._wait}async _load(e){this.texture=await Pt.video.load(e),(!this.style.width||!this.style.height)&&(this.style.width=this.texture.width,this.style.height=this.texture.height),this.requestRedraw()}_updateVideoCurrentTime(){let e=this._currentTime;if(e<0)return;const t=this.texture;if(!t)return;const i=t.duration;e=i?e%(i*1e3):0,!t.isPlaying&&!t.seeking&&(e=~~e/1e3,t.currentTime!==e&&(t.currentTime=e))}_process(e){this._updateVideoCurrentTime(),super._process(e)}},Fa([M({default:""})],d.Video2D.prototype,"src",2),d.Video2D=Fa([j("Video2D")],d.Video2D);var Dd=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,Yr=(n,r,e,t)=>{for(var i=t>1?void 0:t?Rd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Dd(r,e,i),i};const $a=n=>n,za=pr(.25,.1,.25,1),Va=pr(.42,0,1,1),ja=pr(0,0,.58,1),Ga=pr(.42,0,.58,1);function pr(n,r,e,t){const s=3*n-3*e+1,o=3*e-6*n,a=3*n,l=3*r-3*t+1,h=3*t-6*r,c=3*r,f=_=>(3*s*_+2*o)*_+a,p=_=>((s*_+o)*_+a)*_,m=_=>((l*_+h)*_+c)*_;function g(_){let y=_,E,T;for(let w=0;w<8;w++){if(T=p(y)-_,Math.abs(T)<1e-6)return y;if(E=f(y),Math.abs(E)<1e-6)break;y-=T/E}let P=1,S=0;for(y=_;P>S;){if(T=p(y)-_,Math.abs(T)<1e-6)return y;T>0?P=y:S=y,y=(P+S)/2}return y}return _=>m(g(_))}const Ni={linear:$a,ease:za,easeIn:Va,easeOut:ja,easeInOut:Ga};d.Animation=class extends d.TimelineNode{constructor(e,t=[]){super();u(this,"easing");u(this,"_keyframes",[]);u(this,"_isFirstUpdatePosition",!1);u(this,"_cachedProps",new Zt);u(this,"_stoped",!1);this._process=this._process.bind(this),this.setProperties(e).append(t)}_treeEnter(e){e.timeline.on("updateCurrentTime",this._process),this._updateCachedProps()}_treeExit(e){e.timeline.on("updateCurrentTime",this._process),this.cancel()}_onProcess(){}_process(){this.canProcess()&&this.commitStyles()}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"effectMode":case"keyframes":this._updateKeyframes();break}}_getTargets(){var t;let e;switch(this.effectMode){case"sibling":e=((t=this.getParent())==null?void 0:t.getChildren(!0).filter(i=>i instanceof d.CanvasItem))??[];break;case"parent":default:e=[this.getParent()].filter(Boolean);break}return e.map(i=>i.style)}_updateKeyframes(){const e=[],t=this.keyframes;for(let o=t.length,a=0;a<o;a++){const{offset:l=a===0?0:a/(o-1),easing:h="linear",...c}=t[a];e.push({offset:l,easing:this._parseEasing(h),props:c})}const i=e[0],s=e[e.length-1];i&&i.offset!==0&&e.unshift({offset:0,easing:this._parseEasing("linear"),props:{}}),s&&s.offset!==1&&e.push({offset:1,easing:this._parseEasing("linear"),props:{}}),this._keyframes=e,this._updateCachedProps()}commitStyles(){if(!this.keyframes.length)return;if(this._updateCurrentTime(),this.isInsideTimeRange())this._isFirstUpdatePosition||(this._isFirstUpdatePosition=!0,this._updateCachedProps());else{if(!this._isFirstUpdatePosition)return;this._isFirstUpdatePosition=!1}const e=this._getTargets(),t=1/e.length,i=this.currentTimeProgress;e.forEach((s,o)=>{const a=t===1?i:at(0,Math.max(0,i-t*o)/t,1),l=this._cachedProps.get(s);if(!l)return;const h=this._parseKeyframes(a,l);h!=null&&h.length&&this._commitStyle(a,s,l,h[0],h[1])})}_updateCachedProps(){this.cancel(),this._getTargets().forEach(e=>{const t=new Map,i=this._keyframes;for(let s=i.length,o=0;o<s;o++)Object.keys(i[o].props).forEach(a=>{t.set(a,e[a])});this._cachedProps.set(e,t)})}_parseEasing(e){if(!e)return Ni.linear;if(e in Ni)return Ni[e];const t=e.replace(/cubic-bezier\((.+)\)/,"$1").split(",").map(i=>Number(i));return pr(t[0],t[1],t[2],t[3])}_parseKeyframes(e,t){let i;const s=this._keyframes;for(let o=s.length,a=0;a<o;a++){const l=s[a],{offset:h,easing:c}=l,f={...l.props};if(i&&e<=h){const{offset:p,easing:m}=i,g={...i.props};return t.forEach((_,y)=>{(!(y in g)||g[y]===null)&&(g[y]=_),(!(y in f)||f[y]===null)&&(f[y]=_)}),[{offset:p,easing:m,props:g},{offset:h,easing:c,props:f}]}i=l}return null}_commitStyle(e,t,i,s,o){const{offset:a,easing:l,props:h}=s,{offset:c,props:f}=o,p=c-a,m=l((e-a)/p),g={width:t.width,height:t.height,fontSize:t.fontSize};i.forEach((_,y)=>{t[y]=this._getDiffValue(y,h[y],f[y],m,g)})}_getDiffValue(e,t,i,s,o){let a,l;if(t===void 0||i===void 0)if(t!==void 0)a=mr(e,String(t),o),l=Ki(a);else if(i!==void 0)l=mr(e,String(i),o),a=Ki(l);else return;else a=mr(e,String(t),o),l=mr(e,String(i),o);if(Array.isArray(a)&&Array.isArray(l)){const h=new Set,c={},f={};a.forEach(({name:m,args:g})=>{c[m]=g,h.add(m)}),l.forEach(({name:m,args:g})=>{f[m]=g,h.add(m)});let p="";return h.forEach(m=>{var E,T;const g=Math.max(((E=c[m])==null?void 0:E.length)??0,((T=f[m])==null?void 0:T.length)??0),_=c[m],y=f[m];p+=`${m}(${Array.from({length:g},(P,S)=>{const w=_==null?void 0:_[S],v=y==null?void 0:y[S],x=(w==null?void 0:w.normalizedIntValue)??0,C=(v==null?void 0:v.normalizedIntValue)??0;return Number.isNaN(x)||Number.isNaN(C)?(v==null?void 0:v.value)??0:de(x,C,s)}).join(", ")}) `}),p}else if(!Array.isArray(a)&&!Array.isArray(l))return Number.isNaN(a.normalizedIntValue)||Number.isNaN(l.normalizedIntValue)?l.value:de(a.normalizedIntValue,l.normalizedIntValue,s)}isPlaying(){return!this.paused&&this.isInsideTimeRange()}play(){return this._stoped?(this._stoped=!1,this.startTime=this.timelineCurrentTime):this.startTime=this.timelineCurrentTime-this.currentTime,this.paused=!1,!0}pause(){return this.paused=!0,!0}stop(){return this._stoped=!0,this.paused=!0,this._currentTime=0,!0}cancel(){this._getTargets().forEach(e=>{var t;(t=this._cachedProps.get(e))==null||t.forEach((i,s)=>{e[s]=i}),this._cachedProps.delete(e)})}},Yr([M({default:"parent"})],d.Animation.prototype,"effectMode",2),Yr([M({default:!1})],d.Animation.prototype,"loop",2),Yr([M({default:[]})],d.Animation.prototype,"keyframes",2),Yr([M()],d.Animation.prototype,"easing",2),d.Animation=Yr([j("Animation",{renderMode:"disabled",processMode:"pausable",duration:2e3})],d.Animation);const Xi=class Xi extends mt{constructor(){super(...arguments);u(this,"playbackRate",1);u(this,"muted",!1);u(this,"volume",1);u(this,"paused",!1)}static get instance(){return this._instance||(this._instance=new Xi),this._instance}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(e){console.warn("HTML Audio does not support processors")}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners()}};u(Xi,"_instance");let Fi=Xi;const Jr=class Jr extends mt{constructor(){super(...arguments);u(this,"_source",null);u(this,"_audio",null);u(this,"_end",0);u(this,"_pausedReal",!1);u(this,"_duration",0);u(this,"_start",0);u(this,"_playing",!1);u(this,"_paused",!1);u(this,"_playbackRate",1);u(this,"_volume",1);u(this,"_loop",!1);u(this,"_muted",!1);u(this,"_onUpdate",()=>{this._source&&(this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete())})}get progress(){var e;return(((e=this._source)==null?void 0:e.currentTime)??0)/this._duration}get paused(){return this._paused}set paused(e){this._paused!==e&&(this._paused=e,this.refreshPaused())}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh())}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case"playbackRate":this.playbackRate=t;break;case"volume":this.volume=t;break;case"paused":this.paused=t;break;case"loop":this.loop=t;break;case"muted":this.muted=t;break}return this}_onPlay(){this._playing=!0}_onPause(){this._playing=!1}init(e){this._playing=!1,this._duration=e.source.duration;const t=this._source=e.source.cloneNode(!1);return t.src=e.parent.src,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),e.context.on("refresh",this.refresh),e.context.on("refreshPaused",this.refreshPaused),this._audio=e,this}_stop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())}stop(){this._stop(),this._source&&this.emit("stop")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(e){console.warn("HTML Audio does not support processors")}refresh(){if(!this._audio||!this._source)return;const e=this._audio.context,t=this._audio.parent;this._source.loop=this._loop||t.loop;const i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),o=this._volume*(this._muted?0:1);this._source.volume=o*i*s,this._source.playbackRate=this._playbackRate*e.playbackRate*t.playbackRate}refreshPaused(){if(!this._source||!this._audio)return;const e=this._paused||this._audio.parent.paused||this._audio.context.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,playbackRate:this._playbackRate,loop:this._loop})),this.emit("pause",e))}play(e={}){if(!this._source)return;const{start:t=0,end:i=0}=e;i&&console.assert(i>t,"End time is before start time"),e.playbackRate!==void 0&&(this._playbackRate=e.playbackRate),e.volume!==void 0&&(this._volume=e.volume),e.loop!==void 0&&(this._loop=e.loop),e.muted!==void 0&&(this._muted=e.muted),this.refresh(),this.loop&&i!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=!1),this._start=t,this._end=i||this._duration,this._start=Math.max(0,this._start-Jr.PADDING),this._end=Math.min(this._end+Jr.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t,this._duration),fe.on(this._onUpdate))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")}_onComplete(){fe.off(this._onUpdate),this._stop(),this.emit("progress",1,this._duration),this.emit("end",this)}destroy(){fe.off(this._onUpdate),this.removeAllListeners();const e=this._source;e&&(e.onended=null,e.onplay=null,e.onpause=null,this._stop()),this._source=null,this._playbackRate=1,this._volume=1,this._loop=!1,this._end=0,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._audio&&(this._audio.context.off("refresh",this.refresh),this._audio.context.off("refreshPaused",this.refreshPaused),this._audio=null)}};u(Jr,"PADDING",.1);let $i=Jr;class qa{constructor(r){u(this,"source",new globalThis.Audio);u(this,"_src","");this.parent=r}get src(){return this._src}set src(r){this._src!==r&&(this._src=r,this.load())}get duration(){return this.source.duration}get isPlayable(){return!!this.source&&this.source.readyState===4}get context(){return Fi.instance}async load(){return new Promise(r=>{this.source.onload=()=>r(this),this.source.src=this._src,this.source.load()})}createSound(){return new $i}}class pn extends mt{constructor(e,t){super();u(this,"_processers",[]);this._input=e,this._output=t}get processors(){return this._processers}set processors(e){if(this._processers.forEach(t=>t.disconnect()),this._processers.length=0,this._input.connect(this._output),e.length){this._processers=e.slice(0),this._input.disconnect();let t;e.forEach(i=>{t?t.connect(i.destination):this._input.connect(i.destination),t=i}),t.connect(this._output)}}get destination(){return this._input}}class Bd{constructor(r,e=null){this.destination=r,this.source=e}connect(r){var e;(e=this.source)==null||e.connect(r)}disconnect(){var r;(r=this.source)==null||r.disconnect()}}function kd(){if(Qi)return new AudioContext;if(es){const n=globalThis.webkitAudioContext;return new n}else throw new Error("Failed to createAudioContext")}function Ld(n,r,e){if(ts)return new OfflineAudioContext(n,r,e);if(xn){const t=globalThis.webkitOfflineAudioContext;return new t(n,r,e)}else throw new Error("Failed to createOfflineAudioContext")}const Hi=class Hi extends pn{constructor(){const e=kd(),t=Ld(1,2,ts?Math.max(8e3,Math.min(96e3,e.sampleRate)):44100),i=e.createDynamicsCompressor(),s=e.createAnalyser();s.connect(i),i.connect(e.destination);super(s,i);u(this,"_context");u(this,"_offlineContext");u(this,"_locked");u(this,"muted",!1);u(this,"volume",1);u(this,"playbackRate",1);u(this,"autoPause",!0);u(this,"_paused",!1);u(this,"_pausedOnBlur",!1);u(this,"_compressor");u(this,"_analyser");u(this,"_unlock",()=>{this._locked&&(this.playEmptySound(),this._context.state==="running"&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._locked=!1))});this._context=e,this._offlineContext=t,this._compressor=i,this._analyser=s,this._locked=e.state==="suspended"&&(gt||wn),_r&&(this._locked&&(this._unlock(),document.addEventListener("mousedown",this._unlock,!0),document.addEventListener("touchstart",this._unlock,!0),document.addEventListener("touchend",this._unlock,!0)),globalThis.addEventListener("focus",this._onFocus),globalThis.addEventListener("blur",this._onBlur))}static get instance(){return this._instance||(this._instance=new Hi),this._instance}static get audioContext(){return this.instance.audioContext}static get offlineContext(){return this.instance.offlineContext}static setParamValue(e,t){this.instance.setParamValue(e,t)}static decode(e){return this.instance.decode(e)}get audioContext(){return this._context}get offlineContext(){return this._offlineContext}get paused(){return this._paused}set paused(e){e&&this._context.state==="running"?this._context.suspend():!e&&this._context.state==="suspended"&&this._context.resume(),this._paused=e}_onFocus(){if(!this.autoPause)return;const e=this._context.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused())}_onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=!0,this.refreshPaused()))}playEmptySound(){const e=this._context.createBufferSource();e.buffer=this._context.createBuffer(1,1,22050),e.connect(this._context.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume()}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e){return new Promise((t,i)=>{const s=a=>{i(new Error((a==null?void 0:a.message)||"Unable to decode file"))},o=this._offlineContext.decodeAudioData(e,t,s);o&&o.catch(s)})}setParamValue(e,t){e.setValueAtTime?e.setValueAtTime(t,this._context.currentTime):e.value=t}};u(Hi,"_instance");let Dt=Hi;class Wa extends mt{constructor(){super(...arguments);u(this,"_audio",null);u(this,"_sourceNode",null);u(this,"_gain",null);u(this,"_progress",0);u(this,"_pausedReal",!1);u(this,"_paused",!1);u(this,"_volume",1);u(this,"_playbackRate",1);u(this,"_loop",!1);u(this,"_muted",!1);u(this,"_duration",0);u(this,"_end",0);u(this,"_elapsed",0);u(this,"_lastUpdate",this._now());u(this,"_processors",[]);u(this,"_onComplete",()=>{if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e)}}this._sourceNode=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)});u(this,"_updateListener",()=>this._update())}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused!==e&&(this._paused=e,this.refreshPaused())}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh(),this._update(!0))}get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}init(e){return this._audio=e,e.context.on("refresh",this.refresh),e.context.on("refreshPaused",this.refreshPaused),this}_now(){var e;return((e=this._audio)==null?void 0:e.context.audioContext.currentTime)??0}play(e={}){var a;if(!this._audio)return;const{end:t=0,start:i=0}=e;t&&console.assert(t>i,"End time is before start time"),this._end=t,this._elapsed=i,e.volume!==void 0&&(this._volume=e.volume),e.playbackRate!==void 0&&(this._playbackRate=e.playbackRate),e.muted!==void 0&&(this._muted=e.muted),e.loop!==void 0&&(this._loop=e.loop),e.processors!==void 0&&(this._processors=e.processors),this._paused=!1;const{source:s,gain:o}=this._audio.cloneSource();this._sourceNode=s,this._gain=o,this.refresh(),s.onended=this._onComplete.bind(this),this._duration=((a=s.buffer)==null?void 0:a.duration)??0,this._lastUpdate=this._now(),this._loop?(s.loopStart=i,s.loopEnd=t,s.start(0,i)):t?s.start(0,i,t-i):s.start(0,i),this.emit("start"),this._update(!0),this._enableTicker(!0)}_stop(){if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.stop(0),this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e)}this._sourceNode=null}}stop(){this._sourceNode&&(this._stop(),this.emit("stop"))}_update(e=!1){if(this._sourceNode){const t=this._now(),i=t-this._lastUpdate;if(i>0||e){this._elapsed+=i*this._sourceNode.playbackRate.value,this._lastUpdate=t;const s=this._duration;let o;if(this._sourceNode.loopStart){const a=this._sourceNode.loopEnd-this._sourceNode.loopStart;o=(this._sourceNode.loopStart+this._elapsed%a)/s}else o=this._elapsed%s/s;this._progress=o,this.emit("progress",o,s)}}}refresh(){if(!this._audio||!this._sourceNode)return;const e=this._audio.context,t=this._audio.parent;this._sourceNode.loop=this._loop||t.loop,e.setParamValue(this._gain.gain,this._volume*(this._muted?0:1)*t.volume*(t.muted?0:1)*e.volume*(e.muted?0:1)),e.setParamValue(this._sourceNode.playbackRate,this._playbackRate*t.playbackRate*e.playbackRate),this.applyProcessors()}applyProcessors(){if(this._sourceNode&&this._processors.length){this._sourceNode.disconnect();let e=this._sourceNode;this._processors.forEach(t=>{e.connect(t.destination),e=t}),e.connect(this._gain)}}refreshPaused(){if(!this._audio)return;const e=this._paused||this._audio.parent.paused||this._audio.context.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,playbackRate:this._playbackRate,loop:this._loop,volume:this._volume})),this.emit("pause",e))}_enableTicker(e){fe.off(this._updateListener),e&&fe.on(this._updateListener)}destroy(){var e,t,i;this.removeAllListeners(),this._stop(),(e=this._gain)==null||e.disconnect(),this._gain=null,(t=this._audio)==null||t.context.off("refresh",this.refresh),(i=this._audio)==null||i.context.off("refreshPaused",this.refreshPaused),this._audio=null,this._processors.forEach(s=>s.disconnect()),this._processors.length=0,this._end=0,this._playbackRate=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1}}class Xa extends pn{constructor(e){const t=Dt.audioContext,i=t.createBufferSource(),s=t.createGain(),o=t.createAnalyser();i.connect(o),o.connect(s),s.connect(Dt.instance.destination);super(o,s);u(this,"_sourceBuffer");u(this,"_sourceNode");u(this,"_sourceLoad");u(this,"gain");u(this,"analyser");this.parent=e,this._sourceNode=i,this.gain=s,this.analyser=o}get context(){return Dt.instance}get isPlayable(){return!!this._sourceNode.buffer}get duration(){var e;return((e=this._sourceNode.buffer)==null?void 0:e.duration)??0}get buffer(){return this._sourceNode.buffer}set buffer(e){this._sourceNode.buffer=e}async load(){return this._sourceLoad||(this._sourceLoad=new Promise(e=>{this._sourceBuffer?this._decode(this._sourceBuffer).then(()=>e(this)):this.parent.src?this._loadUrl(this.parent.src).then(()=>e(this)):e(this)})),this._sourceLoad}_loadUrl(e){return new Promise(t=>{fetch(e).then(i=>i.arrayBuffer()).then(i=>this._decode(i)).finally(()=>t(this))})}_decode(e){return Promise.resolve(e instanceof AudioBuffer?e:Dt.decode(e)).then(t=>(this.parent.isLoaded=!0,this.buffer=t,t))}cloneSource(){const e=this.context,t=this._sourceNode,i=e.audioContext.createBufferSource(),s=e.audioContext.createGain();return i.buffer=t.buffer,i.loop=t.loop,e.setParamValue(i.playbackRate,t.playbackRate.value),i.connect(s),s.connect(this.destination),{source:i,gain:s}}createSound(){return new Wa}}var Ha=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Fd=(n,r,e)=>r in n?Ha(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,$d=(n,r,e,t)=>{for(var i=t>1?void 0:t?Nd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ha(r,e,i),i},zd=(n,r,e)=>Fd(n,r+"",e);d.Audio=class extends d.TimelineNode{constructor(e=""){super();u(this,"_sounds",[]);u(this,"_platformAudio",Pn?new Xa(this):new qa(this));u(this,"_src");u(this,"isLoaded",!1);u(this,"_volume",1);u(this,"_muted",!1);u(this,"_loop",!1);u(this,"_playbackRate",1);u(this,"_isPlaying",!1);u(this,"multiple",!1);u(this,"start",0);u(this,"end",0);u(this,"_onComplete",e=>{if(this._sounds){const t=this._sounds.indexOf(e);t>-1&&this._sounds.splice(t,1),this._isPlaying=this._sounds.length>0}this._recycleSound(e)});u(this,"_prevTime",0);u(this,"_timer",0);this.src=e}get platformAudio(){return this._platformAudio}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.load())}get isPlayable(){return this.isLoaded&&this._platformAudio.isPlayable}get audioDuration(){return this._platformAudio.duration*1e3}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh())}get isPlaying(){return this._isPlaying}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"paused":this.refreshPaused();break}}async load(){return await this._platformAudio.load(),this}pause(){return this._isPlaying=!1,this.paused=!0,this}resume(){return this._isPlaying=this._sounds.length>0,this.paused=!1,this}stop(){if(!this.isPlayable)return this;this._isPlaying=!1;for(let e=this._sounds.length-1;e>=0;e--)this._sounds[e].stop();return this}play(e={}){if(!this.isLoaded)return;this.multiple||this._removeSounds(),this._isPlaying=!0;const t=this._createSound();this._sounds.push(t),t.once("end",()=>{var o;(o=e.complete)==null||o.call(e),this._onComplete(t)}),t.once("stop",()=>this._onComplete(t));const i=((e==null?void 0:e.start)??this.start)/1e3,s=((e==null?void 0:e.end)??this.end)/1e3;return t.play({...e,start:i,end:s}),t}_removeSounds(){for(let e=this._sounds.length-1;e>=0;e--)this._recycleSound(this._sounds[e]);this._sounds.length=0}_createSound(){return d.Audio._soundPool.length>0?d.Audio._soundPool.pop().init(this._platformAudio):this._platformAudio.createSound().init(this._platformAudio)}refresh(){for(let e=this._sounds.length,t=0;t<e;t++)this._sounds[t].refresh()}refreshPaused(){for(let e=this._sounds.length,t=0;t<e;t++)this._sounds[t].refreshPaused()}_recycleSound(e){e.destroy(),d.Audio._soundPool.includes(e)||d.Audio._soundPool.push(e)}_process(e){var t;if(super._process(e),this.canProcess()){const i=((t=this._tree)==null?void 0:t.timeline.currentTime)??0;i-this._prevTime>0&&(this._timer||(this._setTimeStop(),this.play({start:this.start+(i-this.delay)%this.duration})),this._isPlaying&&this._setTimeStop()),this._prevTime=i}}_setTimeStop(){this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{this.stop(),this._timer=0},100)}},zd(d.Audio,"_soundPool",[]),d.Audio=$d([j("Audio")],d.Audio);class Vd extends d.Node2D{}var jd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,zi=(n,r,e,t)=>{for(var i=t>1?void 0:t?Gd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&jd(r,e,i),i};d.AudioWaveform=class extends d.Node2D{constructor(e={}){super();u(this,"src");u(this,"gap",0);u(this,"color","#000000");u(this,"_audioBuffer");u(this,"_src",_r?new ge(document.createElement("canvas")):void 0);u(this,"_needsUpdateTexture",!1);this.setProperties(e)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._loadSrc(t);break;case"gap":case"color":case"width":case"height":this._needsUpdateTexture=!0;break}}async _loadSrc(e){await globalThis.fetch(e).then(t=>t.arrayBuffer()).then(t=>Dt.decode(t)).then(t=>{this._audioBuffer=t,this.syncTexture(!0)})}syncTexture(e=!1){var f,p;const t=this._audioBuffer;if(!t||!e&&!this._needsUpdateTexture)return;this._needsUpdateTexture=!1;const i=(f=this._src)==null?void 0:f.source;if(!i)return;const{width:s=0,height:o=0}=this.style;i.width=s,i.height=o;const a=i.getContext("2d");if(!a){console.warn("Failed to getContext('2d') in syncTexture");return}a.fillStyle=this.color;const l=t.getChannelData(0),h=Math.ceil(l.length/s),c=o/2;for(let m=1,g=-1,_=0;_<s;_++){for(let y=0;y<h;y++){const E=l[_*h+y];E<m&&(m=E),E>g&&(g=E)}if(!this.gap||_%(this.gap*2)===0){const y=_,E=(1+m)*c,T=this.gap||1,P=Math.max(1,(g-m)*c);a.fillRect(y,E,T,P),m=1,g=-1}}(p=this._src)==null||p.requestUpload(),this.requestRedraw()}_process(e){this.syncTexture(),super._process(e)}_drawSrc(){const e=this._src;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new et().scale(this.style.width/e.width,this.style.height/e.height))}},zi([M()],d.AudioWaveform.prototype,"src",2),zi([M()],d.AudioWaveform.prototype,"gap",2),zi([M()],d.AudioWaveform.prototype,"color",2),d.AudioWaveform=zi([j("AudioWaveform")],d.AudioWaveform);var qd=Object.defineProperty,Wd=Object.getOwnPropertyDescriptor,Xd=(n,r,e,t)=>{for(var i=t>1?void 0:t?Wd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&qd(r,e,i),i};d.Control=class extends d.CanvasItem{constructor(r,e=[]){super(),this._parentUpdateRect=this._parentUpdateRect.bind(this),this.setProperties(r),this.append(e)}_parented(r){super._parented(r),r.on("updateRect",this._parentUpdateRect)}_unparented(r){super._unparented(r),r.off("updateRect",this._parentUpdateRect)}_parentUpdateRect(){const r=this._parent.getRect();this.style.left=r.left,this.style.top=r.top,this.style.width=r.width,this.style.height=r.height}_input(r,e){super._input(r,e),this._guiInput(r,e)}_updateStyleProperty(r,e,t,i){switch(super._updateStyleProperty(r,e,t,i),r){case"width":case"height":case"left":case"top":this.emit("updateRect");break}}_guiInput(r,e){}getRect(){let{left:r,top:e,width:t,height:i,rotate:s}=this.style;if(s){s=Math.abs(s%180),s=s/180*Math.PI;const o=Math.abs(Math.sin(s)),a=Math.abs(Math.cos(s)),l=i*o+t*a,h=i*a+t*o;r+=(t-l)/2,e+=(i-h)/2,t=l,i=h}return new ni(r,e,t,i)}},d.Control=Xd([j("Control")],d.Control);var Hd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,Rt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Yd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Hd(r,e,i),i};d.Range=class extends d.Control{constructor(r,e=[]){super(),this.setProperties(r).append(e)}_updateProperty(r,e,t,i){switch(super._updateProperty(r,e,t,i),r){case"allowGreater":case"allowLesser":case"page":case"minValue":case"maxValue":case"step":case"value":this.requestRedraw();break}}},Rt([M({default:!1})],d.Range.prototype,"allowGreater",2),Rt([M({default:!1})],d.Range.prototype,"allowLesser",2),Rt([M({default:1})],d.Range.prototype,"page",2),Rt([M({default:0})],d.Range.prototype,"minValue",2),Rt([M({default:100})],d.Range.prototype,"maxValue",2),Rt([M({default:.01})],d.Range.prototype,"step",2),Rt([M({default:0})],d.Range.prototype,"value",2),d.Range=Rt([j("Range")],d.Range);var Zd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,dt=(n,r,e,t)=>{for(var i=t>1?void 0:t?Kd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Zd(r,e,i),i};d.Ruler=class extends d.Control{constructor(e,t=[]){super();u(this,"texture",new Er);this.setProperties(e),this.append(t)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"offsetX":case"offsetY":case"thickness":case"markHeight":case"color":case"markBackgroundColor":case"markColor":case"gap":case"scale":this.requestRedraw();break}}_updateStyleProperty(e,t,i,s){switch(super._updateStyleProperty(e,t,i,s),e){case"width":case"height":this.texture[e]=t,this.requestRedraw();break}}_drawTexture(){const{width:e,height:t}=this.style,{offsetX:i,offsetY:s,thickness:o,markHeight:a,markBackgroundColor:l,markColor:h,color:c,gap:f,scale:p}=this,g=this.texture.source.getContext("2d");g.reset(),g.scale(this.texture.pixelRatio,this.texture.pixelRatio);const _=Math.round(i),y=Math.round(s);g.beginPath(),g.fillStyle=l||"#EEE",g.fillRect(0,0,e,o),g.fillRect(0,0,o,t),g.fill(),g.strokeStyle=h||"#000",g.moveTo(o,0),g.lineTo(o,t),g.moveTo(0,o),g.lineTo(e,o),g.stroke();const E=f,T=f*p;let P,S,w,v,x;for(E>=T?(P=E/T,S=Math.floor(P)*E/20,w=E/20*Math.floor(P)/P):(P=T/E,S=Math.floor(E/20/P),S>=2?S=Math.floor(S/2)*2:S=1,w=S*P),g.fillStyle=g.strokeStyle,v=_,x=0;v<e;x++,v+=w)g.moveTo(v,o-(x%5?a:2*a)),g.lineTo(v,o);for(v=_,x=0;v>o;x++,v-=w)g.moveTo(v,o-(x%5?a:2*a)),g.lineTo(v,o);let C=0;for(v=y,x=0;v>o;x++,v-=w)g.moveTo(o-(x%5?a:2*a),v),g.lineTo(o,v);for(v=y,x=0;v<t;x++,v+=w)g.moveTo(o-(x%5?a:2*a),v),g.lineTo(o,v);for(g.save(),g.fillStyle=c,g.scale(.8,.8),C=o-8,v=_,x=0;v<e;x++,v+=w)x%10===0&&g.fillText(String(Math.ceil(S*x)),v*1.25-3,C*1.25);for(v=_,x=0;v>o;x++,v-=w)x%10===0&&g.fillText(String(Math.ceil(-S*x)),v*1.25-3,C*1.25);for(C=0,v=y,x=0;v>o;x++,v-=w)x%10===0&&g.fillText(String(Math.ceil(S*x)),C*1.25,v*1.25+3);for(v=y,x=0;v<t;x++,v+=w)x%10===0&&g.fillText(String(Math.ceil(-S*x)),C*1.25,v*1.25+3);g.restore(),g.stroke(),this.texture.requestUpload()}_draw(){this._drawTexture();const e=this.texture;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new et().scale(this.style.width/e.width,this.style.height/e.height),this.context.rect(0,0,e.width,e.height),this.context.fill())}},dt([M({default:0})],d.Ruler.prototype,"offsetX",2),dt([M({default:0})],d.Ruler.prototype,"offsetY",2),dt([M({default:20})],d.Ruler.prototype,"thickness",2),dt([M({default:3})],d.Ruler.prototype,"markHeight",2),dt([M({default:"#b2b6bc"})],d.Ruler.prototype,"color",2),dt([M({default:"#f9f9fa"})],d.Ruler.prototype,"markBackgroundColor",2),dt([M({default:"#b2b6bc"})],d.Ruler.prototype,"markColor",2),dt([M({default:300})],d.Ruler.prototype,"gap",2),dt([M({default:1})],d.Ruler.prototype,"scale",2),d.Ruler=dt([j("Ruler")],d.Ruler);var Jd=Object.defineProperty,Qd=Object.getOwnPropertyDescriptor,Ya=(n,r,e,t)=>{for(var i=t>1?void 0:t?Qd(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Jd(r,e,i),i};d.ScrollBar=class extends d.Range{constructor(r,e=[]){super(),this.setProperties(r).append(e)}_updateStyleProperty(r,e,t,i){switch(super._updateStyleProperty(r,e,t,i),r){case"width":case"height":case"left":case"top":this.requestRedraw();break}}_guiInput(r,e){super._guiInput(r,e)}_draw(){let r,e,t,i,s;this.direction==="vertical"?(t=10,i=this.style.height*(this.page/(this.maxValue-this.minValue)),r=this.style.left+this.style.width-t,e=this.style.height*(this.value/(this.maxValue-this.minValue)),s=t/2):(t=this.style.width*(this.page/(this.maxValue-this.minValue)),i=10,r=this.style.width*(this.value/(this.maxValue-this.minValue)),e=this.style.top+this.style.height-i,s=i/2),this.context.roundRect(r,e,t,i,s),this.context.fillStyle=34,this.context.fill()}},Ya([M({default:"vertical"})],d.ScrollBar.prototype,"direction",2),d.ScrollBar=Ya([j("ScrollBar")],d.ScrollBar);var ep=Object.defineProperty,tp=Object.getOwnPropertyDescriptor,rp=(n,r,e,t)=>{for(var i=t>1?void 0:t?tp(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ep(r,e,i),i};d.XScrollBar=class extends d.ScrollBar{constructor(r,e=[]){super(),this.setProperties(r).append(e)}},d.XScrollBar=rp([j("XScrollBar",{direction:"horizontal"})],d.XScrollBar);var ip=Object.defineProperty,sp=Object.getOwnPropertyDescriptor,np=(n,r,e,t)=>{for(var i=t>1?void 0:t?sp(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&ip(r,e,i),i};d.YScrollBar=class extends d.ScrollBar{constructor(r,e=[]){super(),this.setProperties(r).append(e)}},d.YScrollBar=np([j("YScrollBar",{direction:"vertical"})],d.YScrollBar);var op=Object.defineProperty,ap=Object.getOwnPropertyDescriptor,Vi=(n,r,e,t)=>{for(var i=t>1?void 0:t?ap(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&op(r,e,i),i};d.Scaler=class extends d.Node{get target(){var r;if((r=this.parent)!=null&&r.style)return this.parent}constructor(r,e=[]){super(),this.setProperties(r),this.append(e)}_updateProperty(r,e,t,i){switch(super._updateProperty(r,e,t,i),r){case"value":case"min":case"max":{this.value=at(this.minValue,this.value,this.maxValue),this._updateScale();break}}}_updateScale(){const r=this.target;r&&(r.style.scaleX=this.value,r.style.scaleY=this.value,this.emit("updateScale",this.value))}_onWheel(r){if(!this.target)return;if(r.preventDefault(),!(r.wheelDeltaY?Math.abs(Math.abs(r.wheelDeltaY)-Math.abs(3*r.deltaY))<3:r.deltaMode===0)&&r.ctrlKey){r.preventDefault();let i=r.deltaY/(r.ctrlKey?1:100);i*=-.015,this.value+=i}}_input(r,e){switch(super._input(r,e),e){case"wheel":this._onWheel(r);break}}},Vi([M({default:1})],d.Scaler.prototype,"value",2),Vi([M({default:.05})],d.Scaler.prototype,"minValue",2),Vi([M({default:10})],d.Scaler.prototype,"maxValue",2),d.Scaler=Vi([j("Scaler",{processMode:"disabled",renderMode:"disabled"})],d.Scaler);var Za=Object.defineProperty,lp=Object.getOwnPropertyDescriptor,hp=(n,r,e)=>r in n?Za(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,cp=(n,r,e,t)=>{for(var i=t>1?void 0:t?lp(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Za(r,e,i),i},up=(n,r,e)=>hp(n,r+"",e);d.KawaseTransition=class extends d.Transition{constructor(){super(...arguments);u(this,"blur",10);u(this,"quality",10)}apply(e,t){const i=this.currentTimeProgress;let s,o;i<.5?(s=0,o=(.5-i)/.5):(s=1,o=(i-.5)/.5);const a=this.blur,l=this.quality,h=t.width,c=t.height,f=[],p=[a];if(a>0){let T=a;const P=a/l;for(let S=1;S<l;S++)T-=P,p.push(T)}const m=1/h,g=1/c,_=[];let y;const E=l-1;for(let T=0;T<E;T++)y=p[T]+.5,_[0]=y*m,_[1]=y*g,f.push({offset:_});y=p[E]+.5,_[0]=y*m,_[1]=y*g,f.push({offset:_}),f.forEach(T=>{J.draw(e,d.KawaseTransition.material,{sampler:s,progress:o,...T})})}},up(d.KawaseTransition,"material",new se({vert:`attribute vec2 position;
750
+ }`)),document.head.appendChild(t),this}_parseUrls(A){const e=Array.from(new Set([...A.split(","),A]));return Array.from(new Set(e.map(t=>this.familyToUrl.get(t.trim())??this.familyToUrl.get(t)??t)))}get(A){let e;return A&&(e=this._parseUrls(A).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(A,e){return this.familyToUrl.set(A,e.src),this.loaded.set(e.src,e),this}delete(A){return this._parseUrls(A).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}async load(A,e={}){const{cancelOther:t,injectFontFace:i=!0,injectStyleTag:s=!0,...n}=e,{src:o}=A;if(this.loaded.has(o))return t&&(this.loading.forEach(u=>u.cancel()),this.loading.clear()),h(this.loaded.get(o));let a=this.loading.get(o);return a||(a=this._createRequest(o,n),this.loading.set(o,a)),t&&this.loading.forEach((u,d)=>{u!==a&&(u.cancel(),this.loading.delete(d))}),a.when.then(u=>{if(this.loaded.has(o))return h(this.loaded.get(o));{const d=c(u);return e.noAdd||this.loaded.set(A.src,d),d.familySet.forEach(I=>{this.familyToUrl.set(I,o),typeof document<"u"&&(i&&this.injectFontFace(I,u),s&&this.injectStyleTag(I,o))}),d}}).catch(u=>{if(u instanceof DOMException&&u.message==="The user aborted a request.")return c();throw u}).finally(()=>{this.loading.delete(o)});function l(){return A.family?Array.isArray(A.family)?A.family:[A.family]:[]}function h(u){return l().forEach(d=>{u.familySet.add(d)}),u}function c(u=new ArrayBuffer(0)){let d;function I(){return d||(d=u.byteLength?Za(u,!1):void 0),d}function C(){const B=I();if(B instanceof yt||B instanceof vr)return B.sfnt}return{...A,buffer:u,familySet:new Set(l()),getFont:I,getSFNT:C}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(A=>A.when))}};g(Lr,"defaultRequestInit",{cache:"force-cache"});let br=Lr;const $a=new br,Yf=Object.freeze(Object.defineProperty({__proto__:null,BaseFont:ur,get Cff(){return wA},get Cmap(){return YA},CmapSubtableFormat0:tn,CmapSubtableFormat12:nn,CmapSubtableFormat14:Ui,CmapSubtableFormat2:Si,CmapSubtableFormat4:sn,CmapSubtableFormat6:vA,FontDataObject:It,FontDataView:Oe,Fonts:br,get Glyf(){return Cr},Glyph:Zs,GlyphSet:$s,get Gpos(){return ln},get Gsub(){return zt},get Head(){return ke},get Hhea(){return qe},get Hmtx(){return Qr},get Kern(){return hn},get Loca(){return yr},get Maxp(){return Je},get Name(){return WA},get Os2(){return se},get Post(){return Qt},SFNT:mA,TTF:yt,TableDirectory:JA,get Vhea(){return ze},get Vmtx(){return wr},WOFF:vr,WOFFTableDirectoryEntry:DA,createCmapSegments:rn,dataTypeToByteLength:bi,defineColumn:m,defineSFNTTable:Xe,fonts:$a,parseFont:Za,parseSFNTFont:ja},Symbol.toStringTag,{value:"Module"}));function cn(r,A,e){if(typeof A=="string"&&A.startsWith("linear-gradient")){const{x0:t,y0:i,x1:s,y1:n,stops:o}=Wf(A,e.left,e.top,e.width,e.height),a=r.createLinearGradient(t,i,s,n);return o.forEach(l=>a.addColorStop(l.offset,l.color)),a}return A}function Dr(r,A,e){r!=null&&r.color&&(r.color=cn(e,r.color,A)),r!=null&&r.backgroundColor&&(r.backgroundColor=cn(e,r.backgroundColor,A)),r!=null&&r.textStrokeColor&&(r.textStrokeColor=cn(e,r.textStrokeColor,A))}function Wf(r,A,e,t,i){var d;const s=((d=r.match(/linear-gradient\((.+)\)$/))==null?void 0:d[1])??"",n=s.split(",")[0],o=n.includes("deg")?n:"0deg",a=s.replace(o,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),h=(Number(o.replace("deg",""))||0)*Math.PI/180,c=t*Math.sin(h),u=i*Math.cos(h);return{x0:A+t/2-c,y0:e+i/2+u,x1:A+t/2+c,y1:e+i/2-u,stops:Array.from(a).map(I=>{let C=I[2];return C.startsWith("(")?C=C.split(",").length>3?`rgba${C}`:`rgb${C}`:C=`#${C}`,{offset:Number(I[3].replace("%",""))/100,color:C}})}}function Ni(r){const{ctx:A,path:e,fontSize:t,clipRect:i}=r;A.save(),A.beginPath();const s=e.style,n={...s,fill:r.color??s.fill,stroke:r.textStrokeColor??s.stroke,strokeWidth:r.textStrokeWidth?r.textStrokeWidth*t:s.strokeWidth,shadowOffsetX:(r.shadowOffsetX??0)*t,shadowOffsetY:(r.shadowOffsetY??0)*t,shadowBlur:(r.shadowBlur??0)*t,shadowColor:r.shadowColor};i&&(A.rect(i.left,i.top,i.width,i.height),A.clip(),A.beginPath()),e.drawTo(A,n),A.restore()}function Vf(r,A,e){const{left:t,top:i,width:s,height:n}=e,o=r.canvas;o.dataset.viewBox=`${t} ${i} ${s} ${n}`,o.dataset.pixelRatio=String(A);const a=s,l=n;o.width=Math.max(1,Math.ceil(a*A)),o.height=Math.max(1,Math.ceil(l*A)),o.style.width=`${a}px`,o.style.height=`${l}px`,r.clearRect(0,0,o.width,o.height),r.scale(A,A),r.translate(-t,-i)}function Xf(r,A){const{paragraphs:e,computedStyle:t,glyphBox:i}=A;Dr(t,i,r),e.forEach(s=>{Dr(s.computedStyle,s.lineBox,r),s.fragments.forEach(n=>{Dr(n.computedStyle,n.inlineBox,r)})})}const qf=new Set(["©","®","÷"]),zf=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),jf={1:"italic",32:"bold"},Zf={1:"italic",2:"bold"},el={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class $f{constructor(A,e,t){g(this,"path",new Ve);g(this,"lineBox",new fe);g(this,"inlineBox",new fe);g(this,"glyphBox");g(this,"advanceWidth",0);g(this,"advanceHeight",0);g(this,"underlinePosition",0);g(this,"underlineThickness",0);g(this,"strikeoutPosition",0);g(this,"strikeoutSize",0);g(this,"ascender",0);g(this,"descender",0);g(this,"typoAscender",0);g(this,"typoDescender",0);g(this,"typoLineGap",0);g(this,"winAscent",0);g(this,"winDescent",0);g(this,"xHeight",0);g(this,"capHeight",0);g(this,"baseline",0);g(this,"centerDiviation",0);g(this,"fontStyle");this.content=A,this.index=e,this.parent=t}get center(){var A;return(A=this.glyphBox)==null?void 0:A.center}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(A){const e=this.computedStyle.fontFamily,t=A??$a,i=e?t.get(e):t.fallbackFont;return i==null?void 0:i.getSFNT()}updateGlyph(A=this._getFontSFNT()){if(!A)return this;const{hhea:e,os2:t,post:i,head:s}=A,n=s.unitsPerEm,o=e.ascent,a=e.descent,{content:l,computedStyle:h,isVertical:c}=this,{fontSize:u}=h,d=n/u,I=A.getAdvanceWidth(l,u),C=(o+Math.abs(a))/d,B=o/d;return this.advanceWidth=I,this.advanceHeight=C,this.inlineBox.width=c?C:I,this.inlineBox.height=c?I:C,this.underlinePosition=(o-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(o-t.yStrikeoutPosition)/d,this.strikeoutSize=t.yStrikeoutSize/d,this.ascender=o/d,this.descender=a/d,this.typoAscender=t.sTypoAscender/d,this.typoDescender=t.sTypoDescender/d,this.typoLineGap=t.sTypoLineGap/d,this.winAscent=t.usWinAscent/d,this.winDescent=t.usWinDescent/d,this.xHeight=t.sxHeight/d,this.capHeight=t.sCapHeight/d,this.baseline=B,this.centerDiviation=C/2-B,this.fontStyle=jf[t.fsSelection]??Zf[s.macStyle],this}update(A){const e=this._getFontSFNT(A);if(!e)return this;this.updateGlyph(e);const{isVertical:t,content:i,computedStyle:s,baseline:n,inlineBox:o,ascender:a,descender:l,typoAscender:h,fontStyle:c,advanceWidth:u,advanceHeight:d}=this,{left:I,top:C}=o,B=s.fontStyle==="italic"&&c!=="italic";let U=I,M=C+n,D;const R=new Ve;if(t&&(U+=(d-u)/2,Math.abs(u-d)>.1&&(M-=(a-h)/(a+Math.abs(l))*d),D=void 0),t&&!qf.has(i)&&(i.codePointAt(0)<=256||zf.has(i))){R.addCommands(e.getPathCommands(i,U,C+n-(d-u)/2,s.fontSize));const Q={y:C-(d-u)/2+d/2,x:U+u/2};B&&this._italic(R,t?{x:Q.x,y:C-(d-u)/2+n}:void 0),R.rotate(90,Q)}else D!==void 0?(R.addCommands(e.glyphs.get(D).getPathCommands(U,M,s.fontSize)),B&&this._italic(R,t?{x:U+u/2,y:C+h/(a+Math.abs(l))*d}:void 0)):(R.addCommands(e.getPathCommands(i,U,M,s.fontSize)),B&&this._italic(R,t?{x:U+d/2,y:M}:void 0));const b=s.fontWeight??400;return b in el&&(b===700||b==="bold")&&c!=="bold"&&R.bold(el[b]*s.fontSize*.05),R.style={fill:s.color,stroke:s.textStrokeWidth?s.textStrokeColor:"none",strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=R,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(A,e){A.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(A,e,t){var i;if((i=this.path.curves[0])!=null&&i.curves.length)return this.path.getMinMax(A,e,t)}getGlyphBoundingBox(A){const e=this.getGlyphMinMax(void 0,void 0,A);if(!e)return;const{min:t,max:i}=e;return new fe(t.x,t.y,i.x-t.x,i.y-t.y)}drawTo(A,e={}){const t=this.computedStyle,i={ctx:A,path:this.path,fontSize:t.fontSize,color:t.color,...e};if(this.glyphBox)Ni(i);else{A.save(),A.beginPath();const s=this.path.style,n={...s,fill:i.color??s.fill,stroke:i.textStrokeColor??s.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:s.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};Cs(A,n),A.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(A.textBaseline="middle",A.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(A.textBaseline="alphabetic",A.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),A.restore()}}}function un(r,A){return typeof r=="number"?r:r.endsWith("%")?(r=r.substring(0,r.length-1),Math.ceil(Number(r)/100*A.total)):r.endsWith("rem")?(r=r.substring(0,r.length-3),Number(r)*A.fontSize):r.endsWith("em")?(r=r.substring(0,r.length-2),Number(r)*A.fontSize):Number(r)}function tl(r){const A=nA(r)?{}:r;return Object.keys(A).reduce((e,t)=>{let i=A[t];const s=Al(t),n=Al(i);return s&&(t=s),n&&(i=n),e[t]=i,e},{})}function nA(r){return!r||r==="none"}function ed(r,A){const e=Object.keys(r),t=Object.keys(A);return Array.from(new Set([...e,...t])).every(s=>VA(r[s],A[s]))}function VA(r,A){const e=typeof r;return e===typeof A?e==="object"?ed(r,A):r===A:!1}function Al(r){const A=r.startsWith("#")?r.slice(1):r;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(A))return null;const t=A.length===3?A.split("").map(o=>o+o).join(""):A,i=Number.parseInt(t.slice(0,2),16),s=Number.parseInt(t.slice(2,4),16),n=Number.parseInt(t.slice(4,6),16);return`rgb(${i}, ${s}, ${n})`}function fn(r){if(!r)return r;const A={};for(const e in r)r[e]!==""&&r[e]!==void 0&&(A[e]=r[e]);return A}function dn(r){return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("blob://")}class td{constructor(A,e={},t){g(this,"inlineBox",new fe);this.content=A,this.style=e,this.parent=t,this.updateComputedStyle().initCharacters()}get computedContent(){const A=this.computedStyle;return A.textTransform==="uppercase"?this.content.toUpperCase():A.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...fn(this.style)},this}initCharacters(){const A=[];let e=0;for(const t of this.computedContent)A.push(new $f(t,e++,this));return this.characters=A,this}}class Fi{constructor(A,e){g(this,"lineBox",new fe);g(this,"fragments",[]);this.style=A,this.parentStyle=e,this.updateComputedStyle()}updateComputedStyle(){return this.computedStyle={...fn(this.parentStyle),...fn(this.style)},this}addFragment(A,e){const t=new td(A,e,this);return this.fragments.push(t),t}}function eB(r){return r}const ii=class ii{_styleToDomStyle(A){const e={};for(const t in A){const i=A[t];ii.notZeroStyles.has(t)&&i===0||(typeof i=="number"&&ii.pxStyles.has(t)?e[t]=`${i}px`:e[t]=i)}return e}createParagraphDom(A,e){const t=document.createDocumentFragment(),i=document.createElement("section"),s={...e},n=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":s.justifyContent="start";break;case"center":s.justifyContent="center";break;case"end":case"right":s.justifyContent="end";break}switch(e.verticalAlign){case"top":s.alignItems="top";break;case"middle":s.alignItems="center";break;case"bottom":s.alignItems="end";break}const o=!!(s.justifyContent||s.alignItems);Object.assign(i.style,{boxSizing:"border-box",display:o?"inline-flex":void 0,width:"max-content",height:"max-content",whiteSpace:"pre-wrap",wordBreak:"break-all",...this._styleToDomStyle(s),position:"fixed",visibility:"hidden"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:o&&n?"100%":void 0,height:o&&!n?"100%":void 0}),A.forEach(l=>{const h=document.createElement("li");Object.assign(h.style,{verticalAlign:"inherit",...this._styleToDomStyle(l.style)}),l.fragments.forEach(c=>{const u=document.createElement("span");Object.assign(u.style,{verticalAlign:"inherit",...this._styleToDomStyle(c.style)}),u.appendChild(document.createTextNode(c.content)),h.appendChild(u)}),a.appendChild(h)}),i.appendChild(a),t.appendChild(i),document.body.appendChild(t),{dom:i,destory:()=>{var l;return(l=i.parentNode)==null?void 0:l.removeChild(i)}}}measureDomText(A){const e=document.createRange();e.selectNodeContents(A);const t=A.data??"";let i=0;return Array.from(t).map(s=>{var c;const n=i+=t.substring(i).indexOf(s),o=n+s.length;i+=s.length,e.setStart(A,Math.max(n,0)),e.setEnd(A,o);const a=((c=e.getClientRects)==null?void 0:c.call(e))??[e.getBoundingClientRect()];let l=a[a.length-1];a.length>1&&l.width<2&&(l=a[a.length-2]);const h=e.toString();if(h!==""&&l&&l.width+l.height!==0)return{content:h,top:l.top,left:l.left,height:l.height,width:l.width}}).filter(Boolean)}measureDom(A){const e=[],t=[],i=[];return A.querySelectorAll("li").forEach((s,n)=>{const o=s.getBoundingClientRect();e.push({paragraphIndex:n,left:o.left,top:o.top,width:o.width,height:o.height}),s.querySelectorAll(":scope > *").forEach((a,l)=>{const h=a.getBoundingClientRect();t.push({paragraphIndex:n,fragmentIndex:l,left:h.left,top:h.top,width:h.width,height:h.height});let c=0;!a.children.length&&a.firstChild instanceof window.Text?this.measureDomText(a.firstChild).forEach(u=>{i.push({...u,newParagraphIndex:-1,paragraphIndex:n,fragmentIndex:l,characterIndex:c++,textWidth:-1,textHeight:-1})}):a.querySelectorAll(":scope > *").forEach(u=>{u.firstChild instanceof window.Text&&this.measureDomText(u.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:n,fragmentIndex:l,characterIndex:c++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:t,characters:i}}measureParagraphDom(A,e){const t=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(o=>{const a=A[o.paragraphIndex];a.lineBox.left=o.left-t.left,a.lineBox.top=o.top-t.top,a.lineBox.width=o.width,a.lineBox.height=o.height}),i.fragments.forEach(o=>{const a=A[o.paragraphIndex].fragments[o.fragmentIndex];a.inlineBox.left=o.left-t.left,a.inlineBox.top=o.top-t.top,a.inlineBox.width=o.width,a.inlineBox.height=o.height});const s=[];let n=0;return i.characters.forEach(o=>{const{paragraphIndex:a,fragmentIndex:l,characterIndex:h}=o;s.push({...o,newParagraphIndex:a,left:o.left-t.left,top:o.top-t.top});const c=A[a].fragments[l].characters[h],{fontHeight:u,isVertical:d}=c,I=s[n];c.inlineBox.left=I.left,c.inlineBox.top=I.top,c.inlineBox.width=I.width,c.inlineBox.height=I.height,d?(c.lineBox.left=I.left+(I.width-u)/2,c.lineBox.top=I.top,c.lineBox.width=u,c.lineBox.height=I.height):(c.lineBox.left=I.left,c.lineBox.top=I.top+(I.height-u)/2,c.lineBox.width=I.width,c.lineBox.height=u),n++}),{paragraphs:A,boundingBox:new fe(0,0,t.width,t.height)}}measure(A,e,t){let i;t||({dom:t,destory:i}=this.createParagraphDom(A,e));const s=this.measureParagraphDom(A,t);return i==null||i(),s}};g(ii,"notZeroStyles",new Set(["width","height"])),g(ii,"pxStyles",new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"]));let In=ii;class Ad{constructor(){g(this,"eventListeners",new Map)}addEventListener(A,e,t){const i={value:e,options:t},s=this.eventListeners.get(A);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(A,[s,i]):this.eventListeners.set(A,i),this}removeEventListener(A,e,t){var s,n;if(!e)return this.eventListeners.delete(A),this;const i=this.eventListeners.get(A);if(!i)return this;if(Array.isArray(i)){const o=[];for(let a=0,l=i.length;a<l;a++){const h=i[a];(h.value!==e||typeof t=="object"&&(t!=null&&t.once)&&(typeof h.options=="boolean"||!((s=h.options)!=null&&s.once)))&&o.push(h)}o.length?this.eventListeners.set(A,o.length===1?o[0]:o):this.eventListeners.delete(A)}else i.value===e&&(typeof t=="boolean"||!(t!=null&&t.once)||typeof i.options=="boolean"||(n=i.options)!=null&&n.once)&&this.eventListeners.delete(A);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(A){return this.eventListeners.has(A)}dispatchEvent(A,e){var i,s;const t=this.eventListeners.get(A);if(t){if(Array.isArray(t))for(let n=t.length,o=0;o<n;o++){const a=t[o];typeof a.options=="object"&&((i=a.options)!=null&&i.once)&&this.off(A,a.value,a.options),a.value.apply(this,[e])}else typeof t.options=="object"&&((s=t.options)!=null&&s.once)&&this.off(A,t.value,t.options),t.value.apply(this,[e]);return!0}else return!1}on(A,e,t){return this.addEventListener(A,e,t)}once(A,e){return this.addEventListener(A,e,{once:!0})}off(A,e,t){return this.removeEventListener(A,e,t)}emit(A,e){this.dispatchEvent(A,e)}}function Bn(r){const{highlight:A,highlightImage:e,highlightReferImage:t,highlightColormap:i,highlightLine:s,highlightSize:n,highlightThickness:o}=r;return{image:(A==null?void 0:A.image)??e??"none",referImage:(A==null?void 0:A.referImage)??t??"none",colormap:(A==null?void 0:A.colormap)??i??"none",line:(A==null?void 0:A.line)??s??"none",size:(A==null?void 0:A.size)??n??"cover",thickness:(A==null?void 0:A.thickness)??o??"100%"}}function id(){const r=[],A=[],e=new Map,t=new Map;async function i(n){if(!e.has(n)){e.set(n,n);try{e.set(n,await fetch(n).then(o=>o.text()))}catch(o){console.warn(o),e.delete(n)}}}function s(n){let o=t.get(n);if(!o){const a=Zo(dn(n)?e.get(n)??n:n),l=ia(a);o={dom:a,pathSet:l},t.set(n,o)}return o}return{name:"highlight",paths:r,load:async n=>{const o=new Set;n.forEachCharacter(a=>{const{computedStyle:l}=a,{image:h,referImage:c}=Bn(l);dn(h)&&o.add(h),dn(c)&&o.add(c)}),await Promise.all(Array.from(o).map(a=>i(a)))},update:n=>{A.length=0,r.length=0;let o=[],a,l;n.forEachCharacter(h=>{const{computedStyle:c}=h,u=Bn(c),{image:d,colormap:I,line:C,size:B,thickness:U}=u;if(nA(d))a!=null&&a.length&&(a=[],o.push(a));else{const{inlineBox:M,isVertical:D}=h,{fontSize:R}=c;(!l||VA(l.image,d)&&VA(l.colormap,I)&&VA(l.line,C)&&VA(l.size,B)&&VA(l.thickness,U))&&(a!=null&&a.length)&&(D?a[0].inlineBox.left===M.left:a[0].inlineBox.top===M.top)&&a[0].fontSize===R?a.push(h):(a=[],a.push(h),o.push(a))}l=u}),o=o.filter(h=>h.length);for(let h=0;h<o.length;h++){const c=o[h],u=c[0],d=fe.from(...c.filter(H=>H.glyphBox).map(H=>H.glyphBox)),{computedStyle:I}=u,{fontSize:C,writingMode:B}=I,{image:U,referImage:M,colormap:D,line:R,size:b,thickness:Q}=Bn(I),v=B.includes("vertical"),x=un(Q,{fontSize:C,total:d.width})/d.width,k=tl(D),{pathSet:Z,dom:Y}=s(U),L=Z.getBoundingBox(!0),te=C/L.width*2,N=new fe().copy(d);v&&(N.width=d.height,N.height=d.width,N.left=d.left+d.width);const $=Math.floor(N.width);let Ae=$;if(b!=="cover"&&(Ae=un(b,{fontSize:C,total:d.width})||$,N.width=Ae),!nA(M)&&nA(R)){const H=s(M).pathSet.getBoundingBox(!0);L.copy(H)}else{let H;if(nA(R))if(L.width/L.height>4){H="underline";const oe=Y.getAttribute("viewBox");if(oe){const[z,X,ge,ie]=oe.split(" ").map(re=>Number(re)),le=X+ie/2;L.y<le&&L.y+L.height>le?H="line-through":L.y+L.height<le?H="overline":H="underline"}}else H="outline";else H=R;switch(H){case"outline":{const oe=N.width*.2,z=N.height*.2;N.width+=oe,N.height+=z,v?(N.x-=z/2,N.y-=oe/2,N.x+=N.height):(N.x-=oe/2,N.y-=z/2);break}case"overline":N.height=L.height*te,v?N.x=u.inlineBox.left+u.inlineBox.width:N.y=u.inlineBox.top;break;case"line-through":N.height=L.height*te,v?N.x=u.inlineBox.left+u.inlineBox.width-u.strikeoutPosition+N.height/2:N.y=u.inlineBox.top+u.strikeoutPosition-N.height/2;break;case"underline":N.height=L.height*te,v?N.x=u.inlineBox.left+u.inlineBox.width-u.underlinePosition:N.y=u.inlineBox.top+u.underlinePosition;break}}const J=new ct().translate(-L.x,-L.y).scale(N.width/L.width,N.height/L.height);v&&J.rotate(-Math.PI/2),J.translate(N.x,N.y);for(let H=0;H<Math.ceil($/Ae);H++){const oe=J.clone();v?oe.translate(0,H*N.width):oe.translate(H*N.width,0),Z.paths.forEach(z=>{const X=z.clone().applyTransform(oe);X.style.strokeWidth&&(X.style.strokeWidth*=te*x),X.style.strokeMiterlimit&&(X.style.strokeMiterlimit*=te),X.style.strokeDashoffset&&(X.style.strokeDashoffset*=te),X.style.strokeDasharray&&(X.style.strokeDasharray=X.style.strokeDasharray.map(ge=>ge*te)),X.style.fill&&X.style.fill in k&&(X.style.fill=k[X.style.fill]),X.style.stroke&&X.style.stroke in k&&(X.style.stroke=k[X.style.stroke]),r.push(X),$!==Ae&&(v?A[r.length-1]=new fe(d.left-d.width*2,d.top,d.width*4,d.height):A[r.length-1]=new fe(d.left,d.top-d.height*2,d.width,d.height*4))})}}},renderOrder:-1,render:(n,o)=>{r.forEach((a,l)=>{if(Ni({ctx:n,path:a,fontSize:o.computedStyle.fontSize,clipRect:A[l]}),o.debug){const h=new bs([a]).getBoundingBox();h&&n.strokeRect(h.x,h.y,h.width,h.height)}})}}}function rd(r,A){return`<svg width="${r*2}" height="${r*2}" xmlns="http://www.w3.org/2000/svg">
751
+ <circle cx="${r}" cy="${r}" r="${r}" fill="${A}" />
752
+ </svg>`}function sd(){const r=[];return{name:"listStyle",paths:r,update:A=>{r.length=0;const{paragraphs:e,isVertical:t,fontSize:i}=A,s=i*.45;e.forEach(n=>{const{computedStyle:o}=n,{color:a,listStyleImage:l,listStyleColormap:h,listStyleSize:c,listStyleType:u}=o,d=tl(h);let I=c,C;if(!nA(l))C=l;else if(!nA(u)){const D=i*.38/2;switch(I=I==="cover"?D*2:I,u){case"disc":C=rd(D,String(a));break}}if(!C)return;const B=ia(C),U=B.getBoundingBox();let M;n.fragments.forEach(D=>{D.characters.forEach(R=>{const{inlineBox:b}=R;if(t?(M==null?void 0:M.inlineBox.left)!==b.left:(M==null?void 0:M.inlineBox.top)!==b.top){M=R;const Q=I==="cover"?1:un(I,{total:i,fontSize:i})/i,v=new ct;if(t){const x=i/U.height*Q;v.translate(-U.left,-U.top).rotate(Math.PI/2).scale(x,x).translate(b.left+(b.width-U.height*x)/2,b.top-s)}else{const x=i/U.height*Q;v.translate(-U.left,-U.top).scale(x,x).translate(b.left-U.width*x-s,b.top+(b.height-U.height*x)/2)}r.push(...B.paths.map(x=>{const k=x.clone();return k.applyTransform(v),k.style.fill&&k.style.fill in d&&(k.style.fill=d[k.style.fill]),k.style.stroke&&k.style.stroke in d&&(k.style.stroke=d[k.style.stroke]),k}))}})})})}}}const oA=new G,XA=new ct,aA=new ct;function nd(){return{name:"render",getBoundingBox:r=>{const{characters:A,fontSize:e,effects:t}=r,i=[];return A.forEach(s=>{t==null||t.forEach(n=>{if(!s.glyphBox)return;const o=s.glyphBox.clone(),a=En(r,n);oA.set(o.left,o.top),oA.applyMatrix3(a),o.left=oA.x,o.top=oA.y,oA.set(o.right,o.bottom),oA.applyMatrix3(a),o.width=oA.x-o.left,o.height=oA.y-o.top;const l=(n.shadowOffsetX??0)*e,h=(n.shadowOffsetY??0)*e,c=Math.max(.1,n.textStrokeWidth??0)*e;o.left+=l-c,o.top+=h-c,o.width+=c*2,o.height+=c*2,i.push(o)})}),i.length?fe.from(...i):void 0},render:(r,A)=>{const{paragraphs:e,glyphBox:t,effects:i,style:s}=A;function n(o,a){r.fillStyle=o,r.fillRect(a.left,a.top,a.width,a.height)}s!=null&&s.backgroundColor&&n(s.backgroundColor,new fe(0,0,r.canvas.width,r.canvas.height)),e.forEach(o=>{var a;(a=o.style)!=null&&a.backgroundColor&&n(o.style.backgroundColor,o.lineBox)}),i?i.forEach(o=>{Dr(o,t,r),r.save();const[a,l,h,c,u,d]=En(A,o).transpose().elements;r.transform(a,c,l,u,h,d),A.forEachCharacter(I=>{var C;(C=I.parent.style)!=null&&C.backgroundColor&&n(I.parent.style.backgroundColor,I.inlineBox),I.drawTo(r,o)}),r.restore()}):e.forEach(o=>{o.fragments.forEach(a=>{var l;(l=a.style)!=null&&l.backgroundColor&&n(a.computedStyle.backgroundColor,a.inlineBox),a.characters.forEach(h=>{h.drawTo(r)})})}),A.debug&&e.forEach(o=>{r.strokeRect(o.lineBox.x,o.lineBox.y,o.lineBox.width,o.lineBox.height)})}}}function En(r,A){const{fontSize:e,glyphBox:t}=r,i=(A.translateX??0)*e,s=(A.translateY??0)*e,n=Math.PI*2,o=(A.skewX??0)/360*n,a=(A.skewY??0)/360*n,{left:l,top:h,width:c,height:u}=t,d=l+c/2,I=h+u/2;return XA.identity(),aA.makeTranslation(i,s),XA.multiply(aA),aA.makeTranslation(d,I),XA.multiply(aA),aA.set(1,Math.tan(o),0,Math.tan(a),1,0,0,0,1),XA.multiply(aA),aA.makeTranslation(-d,-I),XA.multiply(aA),XA.clone()}function od(){const r=[];return{name:"textDecoration",paths:r,update:A=>{r.length=0;const e=[];let t,i;A.forEachCharacter(s=>{const{computedStyle:n,isVertical:o,inlineBox:a,underlinePosition:l,underlineThickness:h,strikeoutPosition:c,strikeoutSize:u}=s,{color:d,textDecoration:I,writingMode:C}=n;if(nA(I))i=void 0;else{let B=!1;if((i==null?void 0:i.textDecoration)===I&&(i==null?void 0:i.writingMode)===C&&(i==null?void 0:i.color)===d&&(o?t[0].inlineBox.left===a.left:t[0].inlineBox.top===a.top))switch(I){case"underline":t[0].underlinePosition===l&&t[0].underlineThickness===h&&(B=!0);break;case"line-through":t[0].strikeoutPosition===c&&t[0].strikeoutSize===u&&(B=!0);break}B?t.push(s):(t=[],t.push(s),e.push(t)),i=n}}),e.forEach(s=>{const{computedStyle:n,isVertical:o,underlinePosition:a,underlineThickness:l,strikeoutPosition:h,strikeoutSize:c}=s[0],{color:u,textDecoration:d}=n,{left:I,top:C,width:B,height:U}=fe.from(...s.map(Q=>Q.inlineBox));let M=o?I+B:C;const D=o?-1:1;let R=0;switch(d){case"overline":R=l*2;break;case"underline":M+=D*a,R=l*2;break;case"line-through":M+=D*h,R=c*2;break}M-=R;let b;o?b=new Ve([{type:"M",x:M,y:C},{type:"L",x:M,y:C+U},{type:"L",x:M+R,y:C+U},{type:"L",x:M+R,y:C},{type:"Z"}],{fill:u}):b=new Ve([{type:"M",x:I,y:M},{type:"L",x:I+B,y:M},{type:"L",x:I+B,y:M+R},{type:"L",x:I,y:M+R},{type:"Z"}],{fill:u}),r.push(b)})},render:(A,e)=>{const{effects:t,computedStyle:i}=e;t?t.forEach(s=>{A.save();const[n,o,a,l,h,c]=En(e,s).transpose().elements;A.transform(n,l,o,h,a,c),r.forEach(u=>{Ni({ctx:A,path:u,fontSize:i.fontSize,...s})}),A.restore()}):r.forEach(s=>{Ni({ctx:A,path:s,fontSize:i.fontSize})})}}}const pn=Yg();class ad extends Ad{constructor(e={}){super();g(this,"debug");g(this,"content");g(this,"style");g(this,"effects");g(this,"measureDom");g(this,"needsUpdate",!0);g(this,"computedStyle",{...pn});g(this,"paragraphs",[]);g(this,"lineBox",new fe);g(this,"rawGlyphBox",new fe);g(this,"glyphBox",new fe);g(this,"pathBox",new fe);g(this,"boundingBox",new fe);g(this,"measurer",new In);g(this,"plugins",new Map);g(this,"fonts");this.debug=e.debug??!1,this.content=e.content??"",this.style=e.style??{},this.measureDom=e.measureDom,this.effects=e.effects,this.fonts=e.fonts,this.use(sd()).use(od()).use(id()).use(nd()),this.updateParagraphs()}get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(e=>e.fragments.flatMap(t=>t.characters))}use(e){return this.plugins.set(e.name,e),this}forEachCharacter(e){return this.paragraphs.forEach((t,i)=>{t.fragments.forEach((s,n)=>{s.characters.forEach((o,a)=>{e(o,{paragraphIndex:i,fragmentIndex:n,characterIndex:a})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(e=>{var t;return(t=e.load)==null?void 0:t.call(e,this)}))}updateParagraphs(){this.computedStyle={...pn,...this.style};let{content:e,computedStyle:t}=this;const i=[];if(typeof e=="string"){const s=new Fi({},t);s.addFragment(e),i.push(s)}else{e=Array.isArray(e)?e:[e];for(const s of e)if(typeof s=="string"){const n=new Fi({},t);n.addFragment(s),i.push(n)}else if(Array.isArray(s)){const n=new Fi({},t);s.forEach(o=>{if(typeof o=="string")n.addFragment(o);else{const{content:a,...l}=o;a!==void 0&&n.addFragment(a,l)}}),i.push(n)}else if("fragments"in s){const{fragments:n,...o}=s,a=new Fi(o,t);n.forEach(l=>{const{content:h,...c}=l;h!==void 0&&a.addFragment(h,c)}),i.push(a)}else if("content"in s){const{content:n,...o}=s;if(n!==void 0){const a=new Fi(o,t);a.addFragment(n),i.push(a)}}}return this.paragraphs=i,this}measure(e=this.measureDom){const t={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this.updateParagraphs();const i=this.measurer.measure(this.paragraphs,this.computedStyle,e);this.paragraphs=i.paragraphs,this.lineBox=i.boundingBox,this.characters.forEach(s=>{s.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((s,n)=>(s.updateOrder??0)-(n.updateOrder??0)).forEach(s=>{var n;(n=s.update)==null||n.call(s,this)}),this.glyphBox=this.getGlyphBox(),this.updatePathBox().updateBoundingBox();for(const s in t)i[s]=this[s],this[s]=t[s];return this.emit("measure",{text:this,result:i}),i}getGlyphBox(){const e=G.MAX,t=G.MIN;return this.characters.forEach(i=>{if(!i.getGlyphMinMax(e,t)){const{inlineBox:s}=i,n=new G(s.left,s.top),o=new G(s.left+s.width,s.top+s.height);e.min(n,o),t.max(n,o)}}),new fe(e.x,e.y,t.x-e.x,t.y-e.y)}updatePathBox(){return this.pathBox=fe.from(this.glyphBox,...Array.from(this.plugins.values()).map(e=>e.getBoundingBox?e.getBoundingBox(this):new bs(e.paths??[]).getBoundingBox()).filter(Boolean)),this}updateBoundingBox(){const{lineBox:e,rawGlyphBox:t,pathBox:i}=this,s=Math.min(i.left,i.left+e.left-t.left),n=Math.min(i.top,i.top+e.top-t.top),o=Math.max(i.right,i.right+e.right-t.right),a=Math.max(i.bottom,i.bottom+e.bottom-t.bottom);return this.boundingBox=new fe(s,n,o-s,a-n),this}requestUpdate(){return this.needsUpdate=!0,this}update(){const e=this.measure();for(const t in e)this[t]=e[t];return this.emit("update",{text:this}),this.needsUpdate=!1,this}render(e){const{view:t,pixelRatio:i=2}=e,s=t.getContext("2d");s&&(this.needsUpdate&&this.update(),Vf(s,i,this.boundingBox),Xf(s,this),Array.from(this.plugins.values()).sort((n,o)=>(n.renderOrder??0)-(o.renderOrder??0)).forEach(n=>{var o;if(n.render)(o=n.render)==null||o.call(n,s,this);else if(n.paths){const a=this.computedStyle;n.paths.forEach(l=>{Ni({ctx:s,path:l,fontSize:a.fontSize})})}}),this.emit("render",{text:this,view:t,pixelRatio:i}))}}var ld=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,qA=(r,A,e,t)=>{for(var i=t>1?void 0:t?hd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&ld(A,e,i),i};const gd=new Set(Object.keys(pn));f.Text2D=class extends lr{constructor(e,t=[]){super();g(this,"effects");g(this,"measureDom");g(this,"fonts");g(this,"texture",new Ii);g(this,"text",new ad);g(this,"_subTextsCount",0);this.setProperties(e),this.append(t)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"content":case"effects":case"measureDom":case"fonts":case"split":this._updateSplit(),this.requestRedraw();break}this._subTextsCount&&e==="effects"&&this._getSubTexts().forEach(n=>{n.setProperties({[e]:t})})}_updateText(){this.text.style=this.style.toJSON(),this.text.content=this.content??"",this.text.effects=this.effects,this.text.fonts=this.fonts,this.text.measureDom=this.measureDom,this.text.requestUpdate()}_updateStyleProperty(e,t,i){switch(super._updateStyleProperty(e,t,i),e){case"width":this.split&&this._updateSubTexts();break}typeof e=="string"&&gd.has(e)&&(this._subTextsCount&&e!=="width"&&e!=="height"&&this._getSubTexts().forEach(s=>{s.style.setProperties({[e]:t})}),this.requestRedraw())}_getSubTexts(){return this.getChildren("front").filter(e=>e instanceof f.Text2D)}_updateSubTexts(){const e=this._getSubTexts(),t=this.measure();let i=0;this.split&&t.paragraphs.forEach(s=>{s.fragments.forEach(n=>{n.characters.forEach(o=>{const a=e[i];a&&(a.style.left=o.inlineBox.left,a.style.top=o.inlineBox.top),i++})})})}measure(){this._updateText();const e=this.text.measure();return this.style.width||(this.style.width=e.boundingBox.width),this.style.height||(this.style.height=e.boundingBox.height),e}_updateSplit(){this._subTextsCount&&(this.getChildren("front").forEach(t=>this.removeChild(t)),this._subTextsCount=0);const e=this.measure();this.split&&e.paragraphs.forEach(t=>{t.fragments.forEach(i=>{i.characters.forEach(s=>{this.appendChild(new f.Text2D({content:s.content,style:{...s.computedStyle,left:s.inlineBox.x,top:s.inlineBox.y,width:0,height:0,effects:this.effects}}),"front"),this._subTextsCount++})})})}_drawContent(){var e,t;if(!this.split){const i=(t=(e=this.getChildren())==null?void 0:e.find(s=>"onText2DRender"in s))==null?void 0:t.onText2DRender;i?i():(this._updateText(),this.text.render({pixelRatio:this.texture.pixelRatio,view:this.texture.source})),this.texture.requestUpload(),super._drawContent()}}},qA([_({default:!1})],f.Text2D.prototype,"split",2),qA([_({default:""})],f.Text2D.prototype,"content",2),qA([_()],f.Text2D.prototype,"effects",2),qA([Me()],f.Text2D.prototype,"measureDom",2),qA([Me()],f.Text2D.prototype,"fonts",2),f.Text2D=qA([ae("Text2D")],f.Text2D);var cd=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,il=(r,A,e,t)=>{for(var i=t>1?void 0:t?ud(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&cd(A,e,i),i};f.Video2D=class extends lr{constructor(e,t=[]){super();g(this,"_wait",Promise.resolve());this.setProperties(e),this.append(t)}get videoDuration(){var e;return(((e=this.texture)==null?void 0:e.duration)??0)*1e3}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._wait=this._load(t);break}}waitLoad(){return this._wait}async _load(e){this.texture=await Ot.video.load(e),(!this.style.width||!this.style.height)&&(this.style.width=this.texture.width,this.style.height=this.texture.height),this.requestRedraw()}_updateVideoCurrentTime(){let e=this._currentTime;if(e<0)return;const t=this.texture;if(!t)return;const i=t.duration;e=i?e%(i*1e3):0,!t.isPlaying&&!t.seeking&&(e=~~e/1e3,t.currentTime!==e&&(t.currentTime=e))}_process(e){this._updateVideoCurrentTime(),super._process(e)}},il([_({default:""})],f.Video2D.prototype,"src",2),f.Video2D=il([ae("Video2D")],f.Video2D);var fd=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,Ti=(r,A,e,t)=>{for(var i=t>1?void 0:t?dd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&fd(A,e,i),i};const rl=r=>r,sl=zA(.25,.1,.25,1),nl=zA(.42,0,1,1),ol=zA(0,0,.58,1),al=zA(.42,0,.58,1);function zA(r,A,e,t){const s=3*r-3*e+1,n=3*e-6*r,o=3*r,a=3*A-3*t+1,l=3*t-6*A,h=3*A,c=C=>(3*s*C+2*n)*C+o,u=C=>((s*C+n)*C+o)*C,d=C=>((a*C+l)*C+h)*C;function I(C){let B=C,U,M;for(let b=0;b<8;b++){if(M=u(B)-C,Math.abs(M)<1e-6)return B;if(U=c(B),Math.abs(U)<1e-6)break;B-=M/U}let D=1,R=0;for(B=C;D>R;){if(M=u(B)-C,Math.abs(M)<1e-6)return B;M>0?D=B:R=B,B=(D+R)/2}return B}return C=>d(I(C))}const xr={linear:rl,ease:sl,easeIn:nl,easeOut:ol,easeInOut:al};f.Animation=class extends f.TimelineNode{constructor(e,t=[]){super();g(this,"easing");g(this,"_keyframes",[]);g(this,"_isFirstUpdatePosition",!1);g(this,"_cachedProps",new RA);g(this,"_stoped",!1);this._process=this._process.bind(this),this.setProperties(e).append(t)}_treeEnter(e){e.timeline.on("updateCurrentTime",this._process),this._updateCachedProps()}_treeExit(e){e.timeline.on("updateCurrentTime",this._process),this.cancel()}_onProcess(){}_process(){this.canProcess()&&this.commitStyles()}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"effectMode":case"keyframes":this._updateKeyframes();break}}_getTargets(){var t;let e;switch(this.effectMode){case"sibling":e=((t=this.getParent())==null?void 0:t.getChildren(!0).filter(i=>i instanceof f.CanvasItem))??[];break;case"parent":default:e=[this.getParent()].filter(Boolean);break}return e.map(i=>i.style)}_updateKeyframes(){const e=[],t=this.keyframes;for(let n=t.length,o=0;o<n;o++){const{offset:a=o===0?0:o/(n-1),easing:l="linear",...h}=t[o];e.push({offset:a,easing:this._parseEasing(l),props:h})}const i=e[0],s=e[e.length-1];i&&i.offset!==0&&e.unshift({offset:0,easing:this._parseEasing("linear"),props:{}}),s&&s.offset!==1&&e.push({offset:1,easing:this._parseEasing("linear"),props:{}}),this._keyframes=e,this._updateCachedProps()}commitStyles(){if(!this.keyframes.length)return;if(this._updateCurrentTime(),this.isInsideTimeRange())this._isFirstUpdatePosition||(this._isFirstUpdatePosition=!0,this._updateCachedProps());else{if(!this._isFirstUpdatePosition)return;this._isFirstUpdatePosition=!1}const e=this._getTargets(),t=1/e.length,i=this.currentTimeProgress;e.forEach((s,n)=>{const o=t===1?i:_t(0,Math.max(0,i-t*n)/t,1),a=this._cachedProps.get(s);if(!a)return;const l=this._parseKeyframes(o,a);l!=null&&l.length&&this._commitStyle(o,s,a,l[0],l[1])})}_updateCachedProps(){this.cancel(),this._getTargets().forEach(e=>{const t=new Map,i=this._keyframes;for(let s=i.length,n=0;n<s;n++)Object.keys(i[n].props).forEach(o=>{t.set(o,e[o])});this._cachedProps.set(e,t)})}_parseEasing(e){if(!e)return xr.linear;if(e in xr)return xr[e];const t=e.replace(/cubic-bezier\((.+)\)/,"$1").split(",").map(i=>Number(i));return zA(t[0],t[1],t[2],t[3])}_parseKeyframes(e,t){let i;const s=this._keyframes;for(let n=s.length,o=0;o<n;o++){const a=s[o],{offset:l,easing:h}=a,c={...a.props};if(i&&e<=l){const{offset:u,easing:d}=i,I={...i.props};return t.forEach((C,B)=>{(!(B in I)||I[B]===null)&&(I[B]=C),(!(B in c)||c[B]===null)&&(c[B]=C)}),[{offset:u,easing:d,props:I},{offset:l,easing:h,props:c}]}i=a}return null}_commitStyle(e,t,i,s,n){const{offset:o,easing:a,props:l}=s,{offset:h,props:c}=n,u=h-o,d=a((e-o)/u),I={width:t.width,height:t.height,fontSize:t.fontSize};i.forEach((C,B)=>{t[B]=this._getDiffValue(B,l[B],c[B],d,I)})}_getDiffValue(e,t,i,s,n){let o,a;if(t===void 0||i===void 0)if(t!==void 0)o=ni(e,String(t),n),a=es(o);else if(i!==void 0)a=ni(e,String(i),n),o=es(a);else return;else o=ni(e,String(t),n),a=ni(e,String(i),n);if(Array.isArray(o)&&Array.isArray(a)){const l=new Set,h={},c={};o.forEach(({name:d,args:I})=>{h[d]=I,l.add(d)}),a.forEach(({name:d,args:I})=>{c[d]=I,l.add(d)});let u="";return l.forEach(d=>{var U,M;const I=Math.max(((U=h[d])==null?void 0:U.length)??0,((M=c[d])==null?void 0:M.length)??0),C=h[d],B=c[d];u+=`${d}(${Array.from({length:I},(D,R)=>{const b=C==null?void 0:C[R],Q=B==null?void 0:B[R],v=(b==null?void 0:b.normalizedIntValue)??0,x=(Q==null?void 0:Q.normalizedIntValue)??0;return Number.isNaN(v)||Number.isNaN(x)?(Q==null?void 0:Q.value)??0:Ue(v,x,s)}).join(", ")}) `}),u}else if(!Array.isArray(o)&&!Array.isArray(a))return Number.isNaN(o.normalizedIntValue)||Number.isNaN(a.normalizedIntValue)?a.value:Ue(o.normalizedIntValue,a.normalizedIntValue,s)}isPlaying(){return!this.paused&&this.isInsideTimeRange()}play(){return this._stoped?(this._stoped=!1,this.startTime=this.timelineCurrentTime):this.startTime=this.timelineCurrentTime-this.currentTime,this.paused=!1,!0}pause(){return this.paused=!0,!0}stop(){return this._stoped=!0,this.paused=!0,this._currentTime=0,!0}cancel(){this._getTargets().forEach(e=>{var t;(t=this._cachedProps.get(e))==null||t.forEach((i,s)=>{e[s]=i}),this._cachedProps.delete(e)})}},Ti([_({default:"parent"})],f.Animation.prototype,"effectMode",2),Ti([_({default:!1})],f.Animation.prototype,"loop",2),Ti([_({default:[]})],f.Animation.prototype,"keyframes",2),Ti([_()],f.Animation.prototype,"easing",2),f.Animation=Ti([ae("Animation",{renderMode:"disabled",processMode:"pausable",duration:2e3})],f.Animation);const Gr=class Gr extends Yt{constructor(){super(...arguments);g(this,"playbackRate",1);g(this,"muted",!1);g(this,"volume",1);g(this,"paused",!1)}static get instance(){return this._instance||(this._instance=new Gr),this._instance}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(e){console.warn("HTML Audio does not support processors")}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners()}};g(Gr,"_instance");let Sr=Gr;const Oi=class Oi extends Yt{constructor(){super(...arguments);g(this,"_source",null);g(this,"_audio",null);g(this,"_end",0);g(this,"_pausedReal",!1);g(this,"_duration",0);g(this,"_start",0);g(this,"_playing",!1);g(this,"_paused",!1);g(this,"_playbackRate",1);g(this,"_volume",1);g(this,"_loop",!1);g(this,"_muted",!1);g(this,"_onUpdate",()=>{this._source&&(this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete())})}get progress(){var e;return(((e=this._source)==null?void 0:e.currentTime)??0)/this._duration}get paused(){return this._paused}set paused(e){this._paused!==e&&(this._paused=e,this.refreshPaused())}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh())}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case"playbackRate":this.playbackRate=t;break;case"volume":this.volume=t;break;case"paused":this.paused=t;break;case"loop":this.loop=t;break;case"muted":this.muted=t;break}return this}_onPlay(){this._playing=!0}_onPause(){this._playing=!1}init(e){this._playing=!1,this._duration=e.source.duration;const t=this._source=e.source.cloneNode(!1);return t.src=e.parent.src,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),e.context.on("refresh",this.refresh),e.context.on("refreshPaused",this.refreshPaused),this._audio=e,this}_stop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())}stop(){this._stop(),this._source&&this.emit("stop")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(e){console.warn("HTML Audio does not support processors")}refresh(){if(!this._audio||!this._source)return;const e=this._audio.context,t=this._audio.parent;this._source.loop=this._loop||t.loop;const i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);this._source.volume=n*i*s,this._source.playbackRate=this._playbackRate*e.playbackRate*t.playbackRate}refreshPaused(){if(!this._source||!this._audio)return;const e=this._paused||this._audio.parent.paused||this._audio.context.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,playbackRate:this._playbackRate,loop:this._loop})),this.emit("pause",e))}play(e={}){if(!this._source)return;const{start:t=0,end:i=0}=e;i&&console.assert(i>t,"End time is before start time"),e.playbackRate!==void 0&&(this._playbackRate=e.playbackRate),e.volume!==void 0&&(this._volume=e.volume),e.loop!==void 0&&(this._loop=e.loop),e.muted!==void 0&&(this._muted=e.muted),this.refresh(),this.loop&&i!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=!1),this._start=t,this._end=i||this._duration,this._start=Math.max(0,this._start-Oi.PADDING),this._end=Math.min(this._end+Oi.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t,this._duration),Re.on(this._onUpdate))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")}_onComplete(){Re.off(this._onUpdate),this._stop(),this.emit("progress",1,this._duration),this.emit("end",this)}destroy(){Re.off(this._onUpdate),this.removeAllListeners();const e=this._source;e&&(e.onended=null,e.onplay=null,e.onpause=null,this._stop()),this._source=null,this._playbackRate=1,this._volume=1,this._loop=!1,this._end=0,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._audio&&(this._audio.context.off("refresh",this.refresh),this._audio.context.off("refreshPaused",this.refreshPaused),this._audio=null)}};g(Oi,"PADDING",.1);let Mr=Oi;class ll{constructor(A){g(this,"source",new globalThis.Audio);g(this,"_src","");this.parent=A}get src(){return this._src}set src(A){this._src!==A&&(this._src=A,this.load())}get duration(){return this.source.duration}get isPlayable(){return!!this.source&&this.source.readyState===4}get context(){return Sr.instance}async load(){return new Promise(A=>{this.source.onload=()=>A(this),this.source.src=this._src,this.source.load()})}createSound(){return new Mr}}class Cn extends Yt{constructor(e,t){super();g(this,"_processers",[]);this._input=e,this._output=t}get processors(){return this._processers}set processors(e){if(this._processers.forEach(t=>t.disconnect()),this._processers.length=0,this._input.connect(this._output),e.length){this._processers=e.slice(0),this._input.disconnect();let t;e.forEach(i=>{t?t.connect(i.destination):this._input.connect(i.destination),t=i}),t.connect(this._output)}}get destination(){return this._input}}class Id{constructor(A,e=null){this.destination=A,this.source=e}connect(A){var e;(e=this.source)==null||e.connect(A)}disconnect(){var A;(A=this.source)==null||A.disconnect()}}function Bd(){if(As)return new AudioContext;if(is){const r=globalThis.webkitAudioContext;return new r}else throw new Error("Failed to createAudioContext")}function Ed(r,A,e){if(rs)return new OfflineAudioContext(r,A,e);if(Jn){const t=globalThis.webkitOfflineAudioContext;return new t(r,A,e)}else throw new Error("Failed to createOfflineAudioContext")}const Or=class Or extends Cn{constructor(){const e=Bd(),t=Ed(1,2,rs?Math.max(8e3,Math.min(96e3,e.sampleRate)):44100),i=e.createDynamicsCompressor(),s=e.createAnalyser();s.connect(i),i.connect(e.destination);super(s,i);g(this,"_context");g(this,"_offlineContext");g(this,"_locked");g(this,"muted",!1);g(this,"volume",1);g(this,"playbackRate",1);g(this,"autoPause",!0);g(this,"_paused",!1);g(this,"_pausedOnBlur",!1);g(this,"_compressor");g(this,"_analyser");g(this,"_unlock",()=>{this._locked&&(this.playEmptySound(),this._context.state==="running"&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._locked=!1))});this._context=e,this._offlineContext=t,this._compressor=i,this._analyser=s,this._locked=e.state==="suspended"&&(Kt||Hn),oi&&(this._locked&&(this._unlock(),document.addEventListener("mousedown",this._unlock,!0),document.addEventListener("touchstart",this._unlock,!0),document.addEventListener("touchend",this._unlock,!0)),globalThis.addEventListener("focus",this._onFocus),globalThis.addEventListener("blur",this._onBlur))}static get instance(){return this._instance||(this._instance=new Or),this._instance}static get audioContext(){return this.instance.audioContext}static get offlineContext(){return this.instance.offlineContext}static setParamValue(e,t){this.instance.setParamValue(e,t)}static decode(e){return this.instance.decode(e)}get audioContext(){return this._context}get offlineContext(){return this._offlineContext}get paused(){return this._paused}set paused(e){e&&this._context.state==="running"?this._context.suspend():!e&&this._context.state==="suspended"&&this._context.resume(),this._paused=e}_onFocus(){if(!this.autoPause)return;const e=this._context.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused())}_onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=!0,this.refreshPaused()))}playEmptySound(){const e=this._context.createBufferSource();e.buffer=this._context.createBuffer(1,1,22050),e.connect(this._context.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume()}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e){return new Promise((t,i)=>{const s=o=>{i(new Error((o==null?void 0:o.message)||"Unable to decode file"))},n=this._offlineContext.decodeAudioData(e,t,s);n&&n.catch(s)})}setParamValue(e,t){e.setValueAtTime?e.setValueAtTime(t,this._context.currentTime):e.value=t}};g(Or,"_instance");let lA=Or;class hl extends Yt{constructor(){super(...arguments);g(this,"_audio",null);g(this,"_sourceNode",null);g(this,"_gain",null);g(this,"_progress",0);g(this,"_pausedReal",!1);g(this,"_paused",!1);g(this,"_volume",1);g(this,"_playbackRate",1);g(this,"_loop",!1);g(this,"_muted",!1);g(this,"_duration",0);g(this,"_end",0);g(this,"_elapsed",0);g(this,"_lastUpdate",this._now());g(this,"_processors",[]);g(this,"_onComplete",()=>{if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e)}}this._sourceNode=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)});g(this,"_updateListener",()=>this._update())}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused!==e&&(this._paused=e,this.refreshPaused())}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh(),this._update(!0))}get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}init(e){return this._audio=e,e.context.on("refresh",this.refresh),e.context.on("refreshPaused",this.refreshPaused),this}_now(){var e;return((e=this._audio)==null?void 0:e.context.audioContext.currentTime)??0}play(e={}){var o;if(!this._audio)return;const{end:t=0,start:i=0}=e;t&&console.assert(t>i,"End time is before start time"),this._end=t,this._elapsed=i,e.volume!==void 0&&(this._volume=e.volume),e.playbackRate!==void 0&&(this._playbackRate=e.playbackRate),e.muted!==void 0&&(this._muted=e.muted),e.loop!==void 0&&(this._loop=e.loop),e.processors!==void 0&&(this._processors=e.processors),this._paused=!1;const{source:s,gain:n}=this._audio.cloneSource();this._sourceNode=s,this._gain=n,this.refresh(),s.onended=this._onComplete.bind(this),this._duration=((o=s.buffer)==null?void 0:o.duration)??0,this._lastUpdate=this._now(),this._loop?(s.loopStart=i,s.loopEnd=t,s.start(0,i)):t?s.start(0,i,t-i):s.start(0,i),this.emit("start"),this._update(!0),this._enableTicker(!0)}_stop(){if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.stop(0),this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e)}this._sourceNode=null}}stop(){this._sourceNode&&(this._stop(),this.emit("stop"))}_update(e=!1){if(this._sourceNode){const t=this._now(),i=t-this._lastUpdate;if(i>0||e){this._elapsed+=i*this._sourceNode.playbackRate.value,this._lastUpdate=t;const s=this._duration;let n;if(this._sourceNode.loopStart){const o=this._sourceNode.loopEnd-this._sourceNode.loopStart;n=(this._sourceNode.loopStart+this._elapsed%o)/s}else n=this._elapsed%s/s;this._progress=n,this.emit("progress",n,s)}}}refresh(){if(!this._audio||!this._sourceNode)return;const e=this._audio.context,t=this._audio.parent;this._sourceNode.loop=this._loop||t.loop,e.setParamValue(this._gain.gain,this._volume*(this._muted?0:1)*t.volume*(t.muted?0:1)*e.volume*(e.muted?0:1)),e.setParamValue(this._sourceNode.playbackRate,this._playbackRate*t.playbackRate*e.playbackRate),this.applyProcessors()}applyProcessors(){if(this._sourceNode&&this._processors.length){this._sourceNode.disconnect();let e=this._sourceNode;this._processors.forEach(t=>{e.connect(t.destination),e=t}),e.connect(this._gain)}}refreshPaused(){if(!this._audio)return;const e=this._paused||this._audio.parent.paused||this._audio.context.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,playbackRate:this._playbackRate,loop:this._loop,volume:this._volume})),this.emit("pause",e))}_enableTicker(e){Re.off(this._updateListener),e&&Re.on(this._updateListener)}destroy(){var e,t,i;this.removeAllListeners(),this._stop(),(e=this._gain)==null||e.disconnect(),this._gain=null,(t=this._audio)==null||t.context.off("refresh",this.refresh),(i=this._audio)==null||i.context.off("refreshPaused",this.refreshPaused),this._audio=null,this._processors.forEach(s=>s.disconnect()),this._processors.length=0,this._end=0,this._playbackRate=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1}}class gl extends Cn{constructor(e){const t=lA.audioContext,i=t.createBufferSource(),s=t.createGain(),n=t.createAnalyser();i.connect(n),n.connect(s),s.connect(lA.instance.destination);super(n,s);g(this,"_sourceBuffer");g(this,"_sourceNode");g(this,"_sourceLoad");g(this,"gain");g(this,"analyser");this.parent=e,this._sourceNode=i,this.gain=s,this.analyser=n}get context(){return lA.instance}get isPlayable(){return!!this._sourceNode.buffer}get duration(){var e;return((e=this._sourceNode.buffer)==null?void 0:e.duration)??0}get buffer(){return this._sourceNode.buffer}set buffer(e){this._sourceNode.buffer=e}async load(){return this._sourceLoad||(this._sourceLoad=new Promise(e=>{this._sourceBuffer?this._decode(this._sourceBuffer).then(()=>e(this)):this.parent.src?this._loadUrl(this.parent.src).then(()=>e(this)):e(this)})),this._sourceLoad}_loadUrl(e){return new Promise(t=>{fetch(e).then(i=>i.arrayBuffer()).then(i=>this._decode(i)).finally(()=>t(this))})}_decode(e){return Promise.resolve(e instanceof AudioBuffer?e:lA.decode(e)).then(t=>(this.parent.isLoaded=!0,this.buffer=t,t))}cloneSource(){const e=this.context,t=this._sourceNode,i=e.audioContext.createBufferSource(),s=e.audioContext.createGain();return i.buffer=t.buffer,i.loop=t.loop,e.setParamValue(i.playbackRate,t.playbackRate.value),i.connect(s),s.connect(this.destination),{source:i,gain:s}}createSound(){return new hl}}var cl=Object.defineProperty,pd=Object.getOwnPropertyDescriptor,Cd=(r,A,e)=>A in r?cl(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,Qd=(r,A,e,t)=>{for(var i=t>1?void 0:t?pd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&cl(A,e,i),i},yd=(r,A,e)=>Cd(r,A+"",e);f.Audio=class extends f.TimelineNode{constructor(e=""){super();g(this,"_sounds",[]);g(this,"_platformAudio",Kn?new gl(this):new ll(this));g(this,"_src");g(this,"isLoaded",!1);g(this,"_volume",1);g(this,"_muted",!1);g(this,"_loop",!1);g(this,"_playbackRate",1);g(this,"_isPlaying",!1);g(this,"multiple",!1);g(this,"start",0);g(this,"end",0);g(this,"_onComplete",e=>{if(this._sounds){const t=this._sounds.indexOf(e);t>-1&&this._sounds.splice(t,1),this._isPlaying=this._sounds.length>0}this._recycleSound(e)});g(this,"_prevTime",0);g(this,"_timer",0);this.src=e}get platformAudio(){return this._platformAudio}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.load())}get isPlayable(){return this.isLoaded&&this._platformAudio.isPlayable}get audioDuration(){return this._platformAudio.duration*1e3}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh())}get isPlaying(){return this._isPlaying}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"paused":this.refreshPaused();break}}async load(){return await this._platformAudio.load(),this}pause(){return this._isPlaying=!1,this.paused=!0,this}resume(){return this._isPlaying=this._sounds.length>0,this.paused=!1,this}stop(){if(!this.isPlayable)return this;this._isPlaying=!1;for(let e=this._sounds.length-1;e>=0;e--)this._sounds[e].stop();return this}play(e={}){if(!this.isLoaded)return;this.multiple||this._removeSounds(),this._isPlaying=!0;const t=this._createSound();this._sounds.push(t),t.once("end",()=>{var n;(n=e.complete)==null||n.call(e),this._onComplete(t)}),t.once("stop",()=>this._onComplete(t));const i=((e==null?void 0:e.start)??this.start)/1e3,s=((e==null?void 0:e.end)??this.end)/1e3;return t.play({...e,start:i,end:s}),t}_removeSounds(){for(let e=this._sounds.length-1;e>=0;e--)this._recycleSound(this._sounds[e]);this._sounds.length=0}_createSound(){return f.Audio._soundPool.length>0?f.Audio._soundPool.pop().init(this._platformAudio):this._platformAudio.createSound().init(this._platformAudio)}refresh(){for(let e=this._sounds.length,t=0;t<e;t++)this._sounds[t].refresh()}refreshPaused(){for(let e=this._sounds.length,t=0;t<e;t++)this._sounds[t].refreshPaused()}_recycleSound(e){e.destroy(),f.Audio._soundPool.includes(e)||f.Audio._soundPool.push(e)}_process(e){var t;if(super._process(e),this.canProcess()){const i=((t=this._tree)==null?void 0:t.timeline.currentTime)??0;i-this._prevTime>0&&(this._timer||(this._setTimeStop(),this.play({start:this.start+(i-this.delay)%this.duration})),this._isPlaying&&this._setTimeStop()),this._prevTime=i}}_setTimeStop(){this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{this.stop(),this._timer=0},100)}},yd(f.Audio,"_soundPool",[]),f.Audio=Qd([ae("Audio")],f.Audio);class md extends f.Node2D{}var wd=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,Rr=(r,A,e,t)=>{for(var i=t>1?void 0:t?_d(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&wd(A,e,i),i};f.AudioWaveform=class extends f.Node2D{constructor(e={}){super();g(this,"src");g(this,"gap",0);g(this,"color","#000000");g(this,"_audioBuffer");g(this,"_src",oi?new Ne(document.createElement("canvas")):void 0);g(this,"_needsUpdateTexture",!1);this.setProperties(e)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"src":this._loadSrc(t);break;case"gap":case"color":case"width":case"height":this._needsUpdateTexture=!0;break}}async _loadSrc(e){await globalThis.fetch(e).then(t=>t.arrayBuffer()).then(t=>lA.decode(t)).then(t=>{this._audioBuffer=t,this.syncTexture(!0)})}syncTexture(e=!1){var c,u;const t=this._audioBuffer;if(!t||!e&&!this._needsUpdateTexture)return;this._needsUpdateTexture=!1;const i=(c=this._src)==null?void 0:c.source;if(!i)return;const{width:s=0,height:n=0}=this.style;i.width=s,i.height=n;const o=i.getContext("2d");if(!o){console.warn("Failed to getContext('2d') in syncTexture");return}o.fillStyle=this.color;const a=t.getChannelData(0),l=Math.ceil(a.length/s),h=n/2;for(let d=1,I=-1,C=0;C<s;C++){for(let B=0;B<l;B++){const U=a[C*l+B];U<d&&(d=U),U>I&&(I=U)}if(!this.gap||C%(this.gap*2)===0){const B=C,U=(1+d)*h,M=this.gap||1,D=Math.max(1,(I-d)*h);o.fillRect(B,U,M,D),d=1,I=-1}}(u=this._src)==null||u.requestUpload(),this.requestRedraw()}_process(e){this.syncTexture(),super._process(e)}_drawSrc(){const e=this._src;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new Ze().scale(this.style.width/e.width,this.style.height/e.height))}},Rr([_()],f.AudioWaveform.prototype,"src",2),Rr([_()],f.AudioWaveform.prototype,"gap",2),Rr([_()],f.AudioWaveform.prototype,"color",2),f.AudioWaveform=Rr([ae("AudioWaveform")],f.AudioWaveform);var vd=Object.defineProperty,bd=Object.getOwnPropertyDescriptor,Dd=(r,A,e,t)=>{for(var i=t>1?void 0:t?bd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&vd(A,e,i),i};f.Control=class extends f.CanvasItem{constructor(A,e=[]){super(),this._parentUpdateRect=this._parentUpdateRect.bind(this),this.setProperties(A),this.append(e)}_parented(A){super._parented(A),A.on("updateRect",this._parentUpdateRect)}_unparented(A){super._unparented(A),A.off("updateRect",this._parentUpdateRect)}_parentUpdateRect(){const A=this._parent.getRect();this.style.left=A.left,this.style.top=A.top,this.style.width=A.width,this.style.height=A.height}_input(A,e){super._input(A,e),this._guiInput(A,e)}_updateStyleProperty(A,e,t,i){switch(super._updateStyleProperty(A,e,t,i),A){case"width":case"height":case"left":case"top":this.emit("updateRect");break}}_guiInput(A,e){}getRect(){let{left:A,top:e,width:t,height:i,rotate:s}=this.style;if(s){s=Math.abs(s%180),s=s/180*Math.PI;const n=Math.abs(Math.sin(s)),o=Math.abs(Math.cos(s)),a=i*n+t*o,l=i*o+t*n;A+=(t-a)/2,e+=(i-l)/2,t=a,i=l}return new hi(A,e,t,i)}},f.Control=Dd([ae("Control")],f.Control);var xd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,hA=(r,A,e,t)=>{for(var i=t>1?void 0:t?Sd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&xd(A,e,i),i};f.Range=class extends f.Control{constructor(A,e=[]){super(),this.setProperties(A).append(e)}_updateProperty(A,e,t,i){switch(super._updateProperty(A,e,t,i),A){case"allowGreater":case"allowLesser":case"page":case"minValue":case"maxValue":case"step":case"value":this.requestRedraw();break}}},hA([_({default:!1})],f.Range.prototype,"allowGreater",2),hA([_({default:!1})],f.Range.prototype,"allowLesser",2),hA([_({default:1})],f.Range.prototype,"page",2),hA([_({default:0})],f.Range.prototype,"minValue",2),hA([_({default:100})],f.Range.prototype,"maxValue",2),hA([_({default:.01})],f.Range.prototype,"step",2),hA([_({default:0})],f.Range.prototype,"value",2),f.Range=hA([ae("Range")],f.Range);var Md=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,Lt=(r,A,e,t)=>{for(var i=t>1?void 0:t?Rd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Md(A,e,i),i};f.Ruler=class extends f.Control{constructor(e,t=[]){super();g(this,"texture",new Ii);this.setProperties(e),this.append(t)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"offsetX":case"offsetY":case"thickness":case"markHeight":case"color":case"markBackgroundColor":case"markColor":case"gap":case"scale":this.requestRedraw();break}}_updateStyleProperty(e,t,i,s){switch(super._updateStyleProperty(e,t,i,s),e){case"width":case"height":this.texture[e]=t,this.requestRedraw();break}}_drawTexture(){const{width:e,height:t}=this.style,{offsetX:i,offsetY:s,thickness:n,markHeight:o,markBackgroundColor:a,markColor:l,color:h,gap:c,scale:u}=this,I=this.texture.source.getContext("2d");I.reset(),I.scale(this.texture.pixelRatio,this.texture.pixelRatio);const C=Math.round(i),B=Math.round(s);I.beginPath(),I.fillStyle=a||"#EEE",I.fillRect(0,0,e,n),I.fillRect(0,0,n,t),I.fill(),I.strokeStyle=l||"#000",I.moveTo(n,0),I.lineTo(n,t),I.moveTo(0,n),I.lineTo(e,n),I.stroke();const U=c,M=c*u;let D,R,b,Q,v;for(U>=M?(D=U/M,R=Math.floor(D)*U/20,b=U/20*Math.floor(D)/D):(D=M/U,R=Math.floor(U/20/D),R>=2?R=Math.floor(R/2)*2:R=1,b=R*D),I.fillStyle=I.strokeStyle,Q=C,v=0;Q<e;v++,Q+=b)I.moveTo(Q,n-(v%5?o:2*o)),I.lineTo(Q,n);for(Q=C,v=0;Q>n;v++,Q-=b)I.moveTo(Q,n-(v%5?o:2*o)),I.lineTo(Q,n);let x=0;for(Q=B,v=0;Q>n;v++,Q-=b)I.moveTo(n-(v%5?o:2*o),Q),I.lineTo(n,Q);for(Q=B,v=0;Q<t;v++,Q+=b)I.moveTo(n-(v%5?o:2*o),Q),I.lineTo(n,Q);for(I.save(),I.fillStyle=h,I.scale(.8,.8),x=n-8,Q=C,v=0;Q<e;v++,Q+=b)v%10===0&&I.fillText(String(Math.ceil(R*v)),Q*1.25-3,x*1.25);for(Q=C,v=0;Q>n;v++,Q-=b)v%10===0&&I.fillText(String(Math.ceil(-R*v)),Q*1.25-3,x*1.25);for(x=0,Q=B,v=0;Q>n;v++,Q-=b)v%10===0&&I.fillText(String(Math.ceil(R*v)),x*1.25,Q*1.25+3);for(Q=B,v=0;Q<t;v++,Q+=b)v%10===0&&I.fillText(String(Math.ceil(-R*v)),x*1.25,Q*1.25+3);I.restore(),I.stroke(),this.texture.requestUpload()}_draw(){this._drawTexture();const e=this.texture;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new Ze().scale(this.style.width/e.width,this.style.height/e.height),this.context.rect(0,0,e.width,e.height),this.context.fill())}},Lt([_({default:0})],f.Ruler.prototype,"offsetX",2),Lt([_({default:0})],f.Ruler.prototype,"offsetY",2),Lt([_({default:20})],f.Ruler.prototype,"thickness",2),Lt([_({default:3})],f.Ruler.prototype,"markHeight",2),Lt([_({default:"#b2b6bc"})],f.Ruler.prototype,"color",2),Lt([_({default:"#f9f9fa"})],f.Ruler.prototype,"markBackgroundColor",2),Lt([_({default:"#b2b6bc"})],f.Ruler.prototype,"markColor",2),Lt([_({default:300})],f.Ruler.prototype,"gap",2),Lt([_({default:1})],f.Ruler.prototype,"scale",2),f.Ruler=Lt([ae("Ruler")],f.Ruler);var Ud=Object.defineProperty,kd=Object.getOwnPropertyDescriptor,ul=(r,A,e,t)=>{for(var i=t>1?void 0:t?kd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ud(A,e,i),i};f.ScrollBar=class extends f.Range{constructor(A,e=[]){super(),this.setProperties(A).append(e)}_updateStyleProperty(A,e,t,i){switch(super._updateStyleProperty(A,e,t,i),A){case"width":case"height":case"left":case"top":this.requestRedraw();break}}_guiInput(A,e){super._guiInput(A,e)}_draw(){let A,e,t,i,s;this.direction==="vertical"?(t=10,i=this.style.height*(this.page/(this.maxValue-this.minValue)),A=this.style.left+this.style.width-t,e=this.style.height*(this.value/(this.maxValue-this.minValue)),s=t/2):(t=this.style.width*(this.page/(this.maxValue-this.minValue)),i=10,A=this.style.width*(this.value/(this.maxValue-this.minValue)),e=this.style.top+this.style.height-i,s=i/2),this.context.roundRect(A,e,t,i,s),this.context.fillStyle=34,this.context.fill()}},ul([_({default:"vertical"})],f.ScrollBar.prototype,"direction",2),f.ScrollBar=ul([ae("ScrollBar")],f.ScrollBar);var Pd=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Fd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Nd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Pd(A,e,i),i};f.XScrollBar=class extends f.ScrollBar{constructor(A,e=[]){super(),this.setProperties(A).append(e)}},f.XScrollBar=Fd([ae("XScrollBar",{direction:"horizontal"})],f.XScrollBar);var Td=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,Gd=(r,A,e,t)=>{for(var i=t>1?void 0:t?Ld(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Td(A,e,i),i};f.YScrollBar=class extends f.ScrollBar{constructor(A,e=[]){super(),this.setProperties(A).append(e)}},f.YScrollBar=Gd([ae("YScrollBar",{direction:"vertical"})],f.YScrollBar);var Od=(()=>{var r=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:st&&st.tagName.toUpperCase()==="SCRIPT"&&st.src||new URL("index.js",document.baseURI).href;return function(A){A=A||{};var e;e||(e=typeof A<"u"?A:{});var t,i;e.ready=new Promise(function(E,p){t=E,i=p});var s=Object.assign({},e),n="";typeof document<"u"&&document.currentScript&&(n=document.currentScript.src),r&&(n=r),n.indexOf("blob:")!==0?n=n.substr(0,n.replace(/[?#].*/,"").lastIndexOf("/")+1):n="";var o=e.print||console.log.bind(console),a=e.printErr||console.warn.bind(console);Object.assign(e,s),s=null;var l;e.wasmBinary&&(l=e.wasmBinary),e.noExitRuntime,typeof WebAssembly!="object"&&N("no native wasm support detected");var h,c=!1;function u(E,p,y){y=p+y;for(var w="";!(p>=y);){var S=E[p++];if(!S)break;if(S&128){var P=E[p++]&63;if((S&224)==192)w+=String.fromCharCode((S&31)<<6|P);else{var F=E[p++]&63;S=(S&240)==224?(S&15)<<12|P<<6|F:(S&7)<<18|P<<12|F<<6|E[p++]&63,65536>S?w+=String.fromCharCode(S):(S-=65536,w+=String.fromCharCode(55296|S>>10,56320|S&1023))}}else w+=String.fromCharCode(S)}return w}var d,I,C,B,U,M,D,R,b;function Q(){var E=h.buffer;d=E,e.HEAP8=I=new Int8Array(E),e.HEAP16=B=new Int16Array(E),e.HEAP32=M=new Int32Array(E),e.HEAPU8=C=new Uint8Array(E),e.HEAPU16=U=new Uint16Array(E),e.HEAPU32=D=new Uint32Array(E),e.HEAPF32=R=new Float32Array(E),e.HEAPF64=b=new Float64Array(E)}var v,x=[],k=[],Z=[];function Y(){var E=e.preRun.shift();x.unshift(E)}var L=0,te=null;function N(E){throw e.onAbort&&e.onAbort(E),E="Aborted("+E+")",a(E),c=!0,E=new WebAssembly.RuntimeError(E+". Build with -sASSERTIONS for more info."),i(E),E}function $(E){return E.startsWith("data:application/octet-stream;base64,")}var Ae;if(Ae="data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9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iABQgA3AoABIAFB/ABqIgNBADsBACABQgA3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jAEEQayIDJAAgA0EIaiAAIAFBAnRB7CVqKAIAIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC1QAAkACQAJAAkACQCACDgQEAAECAwsgACABIAFBwgBqEEMPCyAAIAEgAUHCAGogAxBEDwsgACABIAFBwgBqEEIPCxAkAAsgACABIAFBwgBqIAMQRQsvACAAIAJFQQF0IgIgASADEGAgACACIAEQS5IgACACIAEgAxB/IAAgAiABEFKSkgvOAQIDfwJ9IwBBEGsiAyQAQQEhBCADQQhqIABB/ABqIgUgACABQQF0akH2AGoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQI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gC5AMiAA0ACwsgA0EQaiQAC0ABAX8CQEGsOy0AAEEBcQRAQag7KAIAIQIMAQtBAUGAJxAMIQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////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AQOAgMAAQtBAyEDDAILECQACyABKgKUAyACKgKUA5MhB0EAIQMLIAIgA0ECdGogByAGkzgCnAMMAQsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQ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////////w+DIgNCgYCAgICAgIAIWgRAIARCgYCAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNAiAMKAIsIQlBBiADIANBA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AEEQEB4iACACKQMINwMIIAAgAikDADcDACACQRBqJAAgAAtjAQJ/IwBBEGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACADIAEgAiAEQQFxBH8gASgCACAAaigCAAUgAAsRAwBBEBAeIgAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiQAIAALNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEEAAs5AQF/IAEgACgCBCIEQQF1aiEBIAAoAgAhACABIAIgAyAEQQFxBH8gASgCACAAaigCAAUgAAsRCAALCQAgASAAEQIACwUAQcM7Cw8AIAEgACgCAGogAjYCAAsNACABIAAoAgBqKAIACxgBAX9BEBAeIgBCADcDCCAAQQA2AgAgAAsYAQF/QRAQHiIAQgA3AwAgAEIANwMIIAALDABBMBAeQQBBMBAqCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRHgALBQBBvjsLIQAgACABKAIAIAEgASwAC0EASBtBuzsgAigCABAQNgIACyoBAX9BDBAeIgFBADoABCABIAAoAgA2AgggAEEANgIAIAFB2Cc2AgAgAQsFAEG7OwsFAEG4OwshACAAIAEoAgAgASABLAALQQBIG0GkOyACKAIAEBA2AgAL2AEBBH8jAEEgayIDJAAgASgCACIEQfD///8HSQRAAkACQCAEQQtPBEAgBEEPckEBaiIFEB4hBiADIAVBgICAgHhyNgIQIAMgBjYCCCADIAQ2AgwgBCAGaiEFDAELIAMgBDoAEyADQQhqIgYgBGohBSAERQ0BCyAGIAFBBGogBBArGgsgBUEAOgAAIAMgAjYCACADQRhqIANBCGogAyAAEQMAIAMoAhgQHSADKAIYIgAQBiADKAIAEAYgAywAE0EASARAIAMoAggQIwsgA0EgaiQAIAAPCxACAAsqAQF/QQwQHiIBQQA6AAQgASAAKAIANgIIIABBADYCACABQeAmNgIAIAELBQBBpDsLaQECfyMAQRBrIgYkACABIAAoAgQiB0EBdWohASAAKAIAIQA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HcUUNAQsgAkEIaiAIIAYQHyACIAcgAC8AABAfQQEhAyACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAoAhQLGQAgAUH/AXEEQBACAAsgACgCACgCEEEBcQsYACAAKAIAIgAgAC0ACEH+AXEgAXI6AAgLJgAgASAAKAIAIgAoAhRHBEAgACAB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kACg0ZGRkADQAAAgAJDgAAAAkADgAADgBByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT",!$(Ae)){var J=Ae;Ae=e.locateFile?e.locateFile(J,n):n+J}function H(){var E=Ae;try{if(E==Ae&&l)return new Uint8Array(l);if($(E))try{var p=zI(E.slice(37)),y=new Uint8Array(p.length);for(E=0;E<p.length;++E)y[E]=p.charCodeAt(E);var w=y}catch{throw Error("Converting base64 string to bytes failed.")}else w=void 0;var S=w;if(S)return S;throw"both async and sync fetching of the wasm failed"}catch(P){N(P)}}function oe(){return l||typeof fetch!="function"?Promise.resolve().then(function(){return H()}):fetch(Ae,{credentials:"same-origin"}).then(function(E){if(!E.ok)throw"failed to load wasm binary file at '"+Ae+"'";return E.arrayBuffer()}).catch(function(){return H()})}function z(E){for(;0<E.length;)E.shift()(e)}function X(E){if(E===void 0)return"_unknown";E=E.replace(/[^a-zA-Z0-9_]/g,"$");var p=E.charCodeAt(0);return 48<=p&&57>=p?"_"+E:E}function ge(E,p){return E=X(E),function(){return p.apply(this,arguments)}}var ie=[{},{value:void 0},{value:null},{value:!0},{value:!1}],le=[];function re(E){var p=Error,y=ge(E,function(w){this.name=E,this.message=w,w=Error(w).stack,w!==void 0&&(this.stack=this.toString()+`
753
+ `+w.replace(/^Error(:[^\n]*)?\n/,""))});return y.prototype=Object.create(p.prototype),y.prototype.constructor=y,y.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},y}var he=void 0;function V(E){throw new he(E)}var Ee=E=>(E||V("Cannot use deleted val. handle = "+E),ie[E].value),ht=E=>{switch(E){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var p=le.length?le.pop():ie.length;return ie[p]={ga:1,value:E},p}},gt=void 0,Ye=void 0;function ce(E){for(var p="";C[E];)p+=Ye[C[E++]];return p}var _e=[];function We(){for(;_e.length;){var E=_e.pop();E.M.$=!1,E.delete()}}var je=void 0,Se={};function rt(E,p){for(p===void 0&&V("ptr should not be undefined");E.R;)p=E.ba(p),E=E.R;return p}var Ht={};function Hr(E){E=Ol(E);var p=ce(E);return $t(E),p}function wn(E,p){var y=Ht[E];return y===void 0&&V(p+" has unknown type "+Hr(E)),y}function Jr(){}var _n=!1;function Ul(E){--E.count.value,E.count.value===0&&(E.T?E.U.W(E.T):E.P.N.W(E.O))}function kl(E,p,y){return p===y?E:y.R===void 0?null:(E=kl(E,p,y.R),E===null?null:y.na(E))}var Pl={};function SI(E,p){return p=rt(E,p),Se[p]}var Nl=void 0;function Kr(E){throw new Nl(E)}function Yr(E,p){return p.P&&p.O||Kr("makeClassHandle requires ptr and ptrType"),!!p.U!=!!p.T&&Kr("Both smartPtrType and smartPtr must be specified"),p.count={value:1},ri(Object.create(E,{M:{value:p}}))}function ri(E){return typeof FinalizationRegistry>"u"?(ri=p=>p,E):(_n=new FinalizationRegistry(p=>{Ul(p.M)}),ri=p=>{var y=p.M;return y.T&&_n.register(p,{M:y},p),p},Jr=p=>{_n.unregister(p)},ri(E))}var Wr={};function vn(E){for(;E.length;){var p=E.pop();E.pop()(p)}}function Hi(E){return this.fromWireType(M[E>>2])}var si={},Vr={};function fA(E,p,y){function w(T){T=y(T),T.length!==E.length&&Kr("Mismatched type converter count");for(var K=0;K<E.length;++K)jt(E[K],T[K])}E.forEach(function(T){Vr[T]=p});var S=Array(p.length),P=[],F=0;p.forEach((T,K)=>{Ht.hasOwnProperty(T)?S[K]=Ht[T]:(P.push(T),si.hasOwnProperty(T)||(si[T]=[]),si[T].push(()=>{S[K]=Ht[T],++F,F===P.length&&w(S)}))}),P.length===0&&w(S)}function bn(E){switch(E){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+E)}}function jt(E,p,y={}){if(!("argPackAdvance"in p))throw new TypeError("registerType registeredInstance requires argPackAdvance");var w=p.name;if(E||V('type "'+w+'" must have a positive integer typeid pointer'),Ht.hasOwnProperty(E)){if(y.ua)return;V("Cannot register type '"+w+"' twice")}Ht[E]=p,delete Vr[E],si.hasOwnProperty(E)&&(p=si[E],delete si[E],p.forEach(S=>S()))}function Dn(E){V(E.M.P.N.name+" instance already deleted")}function dA(){}function xn(E,p,y){if(E[p].S===void 0){var w=E[p];E[p]=function(){return E[p].S.hasOwnProperty(arguments.length)||V("Function '"+y+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+E[p].S+")!"),E[p].S[arguments.length].apply(this,arguments)},E[p].S=[],E[p].S[w.Z]=w}}function MI(E,p){e.hasOwnProperty(E)?(V("Cannot register public name '"+E+"' twice"),xn(e,E,E),e.hasOwnProperty(void 0)&&V("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),e[E].S[void 0]=p):e[E]=p}function RI(E,p,y,w,S,P,F,T){this.name=E,this.constructor=p,this.X=y,this.W=w,this.R=S,this.pa=P,this.ba=F,this.na=T,this.ja=[]}function Sn(E,p,y){for(;p!==y;)p.ba||V("Expected null or instance of "+y.name+", got an instance of "+p.name),E=p.ba(E),p=p.R;return E}function UI(E,p){return p===null?(this.ea&&V("null is not a valid "+this.name),0):(p.M||V('Cannot pass "'+kn(p)+'" as a '+this.name),p.M.O||V("Cannot pass deleted object as a pointer of type "+this.name),Sn(p.M.O,p.M.P.N,this.N))}function kI(E,p){if(p===null){if(this.ea&&V("null is not a valid "+this.name),this.da){var y=this.fa();return E!==null&&E.push(this.W,y),y}return 0}if(p.M||V('Cannot pass "'+kn(p)+'" as a '+this.name),p.M.O||V("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&p.M.P.ca&&V("Cannot convert argument of type "+(p.M.U?p.M.U.name:p.M.P.name)+" to parameter type "+this.name),y=Sn(p.M.O,p.M.P.N,this.N),this.da)switch(p.M.T===void 0&&V("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:p.M.U===this?y=p.M.T:V("Cannot convert argument of type "+(p.M.U?p.M.U.name:p.M.P.name)+" to parameter type "+this.name);break;case 1:y=p.M.T;break;case 2:if(p.M.U===this)y=p.M.T;else{var w=p.clone();y=this.xa(y,ht(function(){w.delete()})),E!==null&&E.push(this.W,y)}break;default:V("Unsupporting sharing policy")}return y}function PI(E,p){return p===null?(this.ea&&V("null is not a valid "+this.name),0):(p.M||V('Cannot pass "'+kn(p)+'" as a '+this.name),p.M.O||V("Cannot pass deleted object as a pointer of type "+this.name),p.M.P.ca&&V("Cannot convert argument of type "+p.M.P.name+" to parameter type "+this.name),Sn(p.M.O,p.M.P.N,this.N))}function Zt(E,p,y,w){this.name=E,this.N=p,this.ea=y,this.ca=w,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,p.R!==void 0?this.toWireType=kI:(this.toWireType=w?UI:PI,this.V=null)}function NI(E,p){e.hasOwnProperty(E)||Kr("Replacing nonexistant public symbol"),e[E]=p,e[E].Z=void 0}function FI(E,p){var y=[];return function(){if(y.length=0,Object.assign(y,arguments),E.includes("j")){var w=e["dynCall_"+E];w=y.length?w.apply(null,[p].concat(y)):w.call(null,p)}else w=v.get(p).apply(null,y);return w}}function Dt(E,p){E=ce(E);var y=E.includes("j")?FI(E,p):v.get(p);return typeof y!="function"&&V("unknown function pointer with signature "+E+": "+p),y}var Fl=void 0;function Xr(E,p){function y(P){S[P]||Ht[P]||(Vr[P]?Vr[P].forEach(y):(w.push(P),S[P]=!0))}var w=[],S={};throw p.forEach(y),new Fl(E+": "+w.map(Hr).join([", "]))}function Mn(E,p,y,w,S){var P=p.length;2>P&&V("argTypes array size mismatch! Must at least get return value and 'this' types!");var F=p[1]!==null&&y!==null,T=!1;for(y=1;y<p.length;++y)if(p[y]!==null&&p[y].V===void 0){T=!0;break}var K=p[0].name!=="void",O=P-2,W=Array(O),ee=[],ue=[];return function(){if(arguments.length!==O&&V("function "+E+" called with "+arguments.length+" arguments, expected "+O+" args!"),ue.length=0,ee.length=F?2:1,ee[0]=S,F){var Pe=p[1].toWireType(ue,this);ee[1]=Pe}for(var de=0;de<O;++de)W[de]=p[de+2].toWireType(ue,arguments[de]),ee.push(W[de]);if(de=w.apply(null,ee),T)vn(ue);else for(var Et=F?1:2;Et<p.length;Et++){var xt=Et===1?Pe:W[Et-2];p[Et].V!==null&&p[Et].V(xt)}return Pe=K?p[0].fromWireType(de):void 0,Pe}}function Rn(E,p){for(var y=[],w=0;w<E;w++)y.push(D[p+4*w>>2]);return y}function Un(E){4<E&&--ie[E].ga===0&&(ie[E]=void 0,le.push(E))}function kn(E){if(E===null)return"null";var p=typeof E;return p==="object"||p==="array"||p==="function"?E.toString():""+E}function TI(E,p){switch(p){case 2:return function(y){return this.fromWireType(R[y>>2])};case 3:return function(y){return this.fromWireType(b[y>>3])};default:throw new TypeError("Unknown float type: "+E)}}function LI(E,p,y){switch(p){case 0:return y?function(w){return I[w]}:function(w){return C[w]};case 1:return y?function(w){return B[w>>1]}:function(w){return U[w>>1]};case 2:return y?function(w){return M[w>>2]}:function(w){return D[w>>2]};default:throw new TypeError("Unknown integer type: "+E)}}function GI(E,p){for(var y="",w=0;!(w>=p/2);++w){var S=B[E+2*w>>1];if(S==0)break;y+=String.fromCharCode(S)}return y}function OI(E,p,y){if(y===void 0&&(y=2147483647),2>y)return 0;y-=2;var w=p;y=y<2*E.length?y/2:E.length;for(var S=0;S<y;++S)B[p>>1]=E.charCodeAt(S),p+=2;return B[p>>1]=0,p-w}function HI(E){return 2*E.length}function JI(E,p){for(var y=0,w="";!(y>=p/4);){var S=M[E+4*y>>2];if(S==0)break;++y,65536<=S?(S-=65536,w+=String.fromCharCode(55296|S>>10,56320|S&1023)):w+=String.fromCharCode(S)}return w}function KI(E,p,y){if(y===void 0&&(y=2147483647),4>y)return 0;var w=p;y=w+y-4;for(var S=0;S<E.length;++S){var P=E.charCodeAt(S);if(55296<=P&&57343>=P){var F=E.charCodeAt(++S);P=65536+((P&1023)<<10)|F&1023}if(M[p>>2]=P,p+=4,p+4>y)break}return M[p>>2]=0,p-w}function YI(E){for(var p=0,y=0;y<E.length;++y){var w=E.charCodeAt(y);55296<=w&&57343>=w&&++y,p+=4}return p}var WI={};function Tl(E){var p=WI[E];return p===void 0?ce(E):p}var qr=[];function VI(E){var p=qr.length;return qr.push(E),p}function XI(E,p){for(var y=Array(E),w=0;w<E;++w)y[w]=wn(D[p+4*w>>2],"parameter "+w);return y}var Ll=[],qI=[null,[],[]];he=e.BindingError=re("BindingError"),e.count_emval_handles=function(){for(var E=0,p=5;p<ie.length;++p)ie[p]!==void 0&&++E;return E},e.get_first_emval=function(){for(var E=5;E<ie.length;++E)if(ie[E]!==void 0)return ie[E];return null},gt=e.PureVirtualError=re("PureVirtualError");for(var Gl=Array(256),zr=0;256>zr;++zr)Gl[zr]=String.fromCharCode(zr);Ye=Gl,e.getInheritedInstanceCount=function(){return Object.keys(Se).length},e.getLiveInheritedInstances=function(){var E=[],p;for(p in Se)Se.hasOwnProperty(p)&&E.push(Se[p]);return E},e.flushPendingDeletes=We,e.setDelayFunction=function(E){je=E,_e.length&&je&&je(We)},Nl=e.InternalError=re("InternalError"),dA.prototype.isAliasOf=function(E){if(!(this instanceof dA&&E instanceof dA))return!1;var p=this.M.P.N,y=this.M.O,w=E.M.P.N;for(E=E.M.O;p.R;)y=p.ba(y),p=p.R;for(;w.R;)E=w.ba(E),w=w.R;return p===w&&y===E},dA.prototype.clone=function(){if(this.M.O||Dn(this),this.M.aa)return this.M.count.value+=1,this;var E=ri,p=Object,y=p.create,w=Object.getPrototypeOf(this),S=this.M;return E=E(y.call(p,w,{M:{value:{count:S.count,$:S.$,aa:S.aa,O:S.O,P:S.P,T:S.T,U:S.U}}})),E.M.count.value+=1,E.M.$=!1,E},dA.prototype.delete=function(){this.M.O||Dn(this),this.M.$&&!this.M.aa&&V("Object already scheduled for deletion"),Jr(this),Ul(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},dA.prototype.isDeleted=function(){return!this.M.O},dA.prototype.deleteLater=function(){return this.M.O||Dn(this),this.M.$&&!this.M.aa&&V("Object already scheduled for deletion"),_e.push(this),_e.length===1&&je&&je(We),this.M.$=!0,this},Zt.prototype.qa=function(E){return this.ka&&(E=this.ka(E)),E},Zt.prototype.ha=function(E){this.W&&this.W(E)},Zt.prototype.argPackAdvance=8,Zt.prototype.readValueFromPointer=Hi,Zt.prototype.deleteObject=function(E){E!==null&&E.delete()},Zt.prototype.fromWireType=function(E){function p(){return this.da?Yr(this.N.X,{P:this.wa,O:y,U:this,T:E}):Yr(this.N.X,{P:this,O:E})}var y=this.qa(E);if(!y)return this.ha(E),null;var w=SI(this.N,y);if(w!==void 0)return w.M.count.value===0?(w.M.O=y,w.M.T=E,w.clone()):(w=w.clone(),this.ha(E),w);if(w=this.N.pa(y),w=Pl[w],!w)return p.call(this);w=this.ca?w.la:w.pointerType;var S=kl(y,this.N,w.N);return S===null?p.call(this):this.da?Yr(w.N.X,{P:w,O:S,U:this,T:E}):Yr(w.N.X,{P:w,O:S})},Fl=e.UnboundTypeError=re("UnboundTypeError");var zI=typeof atob=="function"?atob:function(E){var p="",y=0;E=E.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(E.charAt(y++)),S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(E.charAt(y++)),P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(E.charAt(y++)),F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(E.charAt(y++));w=w<<2|S>>4,S=(S&15)<<4|P>>2;var T=(P&3)<<6|F;p+=String.fromCharCode(w),P!==64&&(p+=String.fromCharCode(S)),F!==64&&(p+=String.fromCharCode(T))}while(y<E.length);return p},jI={l:function(E,p,y,w){N("Assertion failed: "+(E?u(C,E):"")+", at: "+[p?p?u(C,p):"":"unknown filename",y,w?w?u(C,w):"":"unknown function"])},q:function(E,p,y){E=ce(E),p=wn(p,"wrapper"),y=Ee(y);var w=[].slice,S=p.N,P=S.X,F=S.R.X,T=S.R.constructor;E=ge(E,function(){S.R.ja.forEach((function(O){if(this[O]===F[O])throw new gt("Pure virtual function "+O+" must be implemented in JavaScript")}).bind(this)),Object.defineProperty(this,"__parent",{value:P}),this.__construct.apply(this,w.call(arguments))}),P.__construct=function(){this===P&&V("Pass correct 'this' to __construct");var O=T.implement.apply(void 0,[this].concat(w.call(arguments)));Jr(O);var W=O.M;O.notifyOnDestruction(),W.aa=!0,Object.defineProperties(this,{M:{value:W}}),ri(this),O=W.O,O=rt(S,O),Se.hasOwnProperty(O)?V("Tried to register registered instance: "+O):Se[O]=this},P.__destruct=function(){this===P&&V("Pass correct 'this' to __destruct"),Jr(this);var O=this.M.O;O=rt(S,O),Se.hasOwnProperty(O)?delete Se[O]:V("Tried to unregister unregistered instance: "+O)},E.prototype=Object.create(P);for(var K in y)E.prototype[K]=y[K];return ht(E)},j:function(E){var p=Wr[E];delete Wr[E];var y=p.fa,w=p.W,S=p.ia,P=S.map(F=>F.ta).concat(S.map(F=>F.za));fA([E],P,F=>{var T={};return S.forEach((K,O)=>{var W=F[O],ee=K.ra,ue=K.sa,Pe=F[O+S.length],de=K.ya,Et=K.Aa;T[K.oa]={read:xt=>W.fromWireType(ee(ue,xt)),write:(xt,Ji)=>{var eA=[];de(Et,xt,Pe.toWireType(eA,Ji)),vn(eA)}}}),[{name:p.name,fromWireType:function(K){var O={},W;for(W in T)O[W]=T[W].read(K);return w(K),O},toWireType:function(K,O){for(var W in T)if(!(W in O))throw new TypeError('Missing field: "'+W+'"');var ee=y();for(W in T)T[W].write(ee,O[W]);return K!==null&&K.push(w,ee),ee},argPackAdvance:8,readValueFromPointer:Hi,V:w}]})},v:function(){},B:function(E,p,y,w,S){var P=bn(y);p=ce(p),jt(E,{name:p,fromWireType:function(F){return!!F},toWireType:function(F,T){return T?w:S},argPackAdvance:8,readValueFromPointer:function(F){if(y===1)var T=I;else if(y===2)T=B;else if(y===4)T=M;else throw new TypeError("Unknown boolean type size: "+p);return this.fromWireType(T[F>>P])},V:null})},f:function(E,p,y,w,S,P,F,T,K,O,W,ee,ue){W=ce(W),P=Dt(S,P),T&&(T=Dt(F,T)),O&&(O=Dt(K,O)),ue=Dt(ee,ue);var Pe=X(W);MI(Pe,function(){Xr("Cannot construct "+W+" due to unbound types",[w])}),fA([E,p,y],w?[w]:[],function(de){if(de=de[0],w)var Et=de.N,xt=Et.X;else xt=dA.prototype;de=ge(Pe,function(){if(Object.getPrototypeOf(this)!==Ji)throw new he("Use 'new' to construct "+W);if(eA.Y===void 0)throw new he(W+" has no accessible constructor");var Kl=eA.Y[arguments.length];if(Kl===void 0)throw new he("Tried to invoke ctor of "+W+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(eA.Y).toString()+") parameters instead!");return Kl.apply(this,arguments)});var Ji=Object.create(xt,{constructor:{value:de}});de.prototype=Ji;var eA=new RI(W,de,Ji,ue,Et,P,T,O);Et=new Zt(W,eA,!0,!1),xt=new Zt(W+"*",eA,!1,!1);var Jl=new Zt(W+" const*",eA,!1,!0);return Pl[E]={pointerType:xt,la:Jl},NI(Pe,de),[Et,xt,Jl]})},d:function(E,p,y,w,S,P,F){var T=Rn(y,w);p=ce(p),P=Dt(S,P),fA([],[E],function(K){function O(){Xr("Cannot call "+W+" due to unbound types",T)}K=K[0];var W=K.name+"."+p;p.startsWith("@@")&&(p=Symbol[p.substring(2)]);var ee=K.N.constructor;return ee[p]===void 0?(O.Z=y-1,ee[p]=O):(xn(ee,p,W),ee[p].S[y-1]=O),fA([],T,function(ue){return ue=Mn(W,[ue[0],null].concat(ue.slice(1)),null,P,F),ee[p].S===void 0?(ue.Z=y-1,ee[p]=ue):ee[p].S[y-1]=ue,[]}),[]})},p:function(E,p,y,w,S,P){0<p||N();var F=Rn(p,y);S=Dt(w,S),fA([],[E],function(T){T=T[0];var K="constructor "+T.name;if(T.N.Y===void 0&&(T.N.Y=[]),T.N.Y[p-1]!==void 0)throw new he("Cannot register multiple constructors with identical number of parameters ("+(p-1)+") for class '"+T.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return T.N.Y[p-1]=()=>{Xr("Cannot construct "+T.name+" due to unbound types",F)},fA([],F,function(O){return O.splice(1,0,null),T.N.Y[p-1]=Mn(K,O,null,S,P),[]}),[]})},a:function(E,p,y,w,S,P,F,T){var K=Rn(y,w);p=ce(p),P=Dt(S,P),fA([],[E],function(O){function W(){Xr("Cannot call "+ee+" due to unbound types",K)}O=O[0];var ee=O.name+"."+p;p.startsWith("@@")&&(p=Symbol[p.substring(2)]),T&&O.N.ja.push(p);var ue=O.N.X,Pe=ue[p];return Pe===void 0||Pe.S===void 0&&Pe.className!==O.name&&Pe.Z===y-2?(W.Z=y-2,W.className=O.name,ue[p]=W):(xn(ue,p,ee),ue[p].S[y-2]=W),fA([],K,function(de){return de=Mn(ee,de,O,P,F),ue[p].S===void 0?(de.Z=y-2,ue[p]=de):ue[p].S[y-2]=de,[]}),[]})},A:function(E,p){p=ce(p),jt(E,{name:p,fromWireType:function(y){var w=Ee(y);return Un(y),w},toWireType:function(y,w){return ht(w)},argPackAdvance:8,readValueFromPointer:Hi,V:null})},n:function(E,p,y){y=bn(y),p=ce(p),jt(E,{name:p,fromWireType:function(w){return w},toWireType:function(w,S){return S},argPackAdvance:8,readValueFromPointer:TI(p,y),V:null})},e:function(E,p,y,w,S){p=ce(p),S===-1&&(S=4294967295),S=bn(y);var P=T=>T;if(w===0){var F=32-8*y;P=T=>T<<F>>>F}y=p.includes("unsigned")?function(T,K){return K>>>0}:function(T,K){return K},jt(E,{name:p,fromWireType:P,toWireType:y,argPackAdvance:8,readValueFromPointer:LI(p,S,w!==0),V:null})},b:function(E,p,y){function w(P){P>>=2;var F=D;return new S(d,F[P+1],F[P])}var S=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][p];y=ce(y),jt(E,{name:y,fromWireType:w,argPackAdvance:8,readValueFromPointer:w},{ua:!0})},o:function(E,p){p=ce(p);var y=p==="std::string";jt(E,{name:p,fromWireType:function(w){var S=D[w>>2],P=w+4;if(y)for(var F=P,T=0;T<=S;++T){var K=P+T;if(T==S||C[K]==0){if(F=F?u(C,F,K-F):"",O===void 0)var O=F;else O+="\0",O+=F;F=K+1}}else{for(O=Array(S),T=0;T<S;++T)O[T]=String.fromCharCode(C[P+T]);O=O.join("")}return $t(w),O},toWireType:function(w,S){S instanceof ArrayBuffer&&(S=new Uint8Array(S));var P,F=typeof S=="string";if(F||S instanceof Uint8Array||S instanceof Uint8ClampedArray||S instanceof Int8Array||V("Cannot pass non-string to std::string"),y&&F){var T=0;for(P=0;P<S.length;++P){var K=S.charCodeAt(P);127>=K?T++:2047>=K?T+=2:55296<=K&&57343>=K?(T+=4,++P):T+=3}P=T}else P=S.length;if(T=Pn(4+P+1),K=T+4,D[T>>2]=P,y&&F){if(F=K,K=P+1,P=C,0<K){K=F+K-1;for(var O=0;O<S.length;++O){var W=S.charCodeAt(O);if(55296<=W&&57343>=W){var ee=S.charCodeAt(++O);W=65536+((W&1023)<<10)|ee&1023}if(127>=W){if(F>=K)break;P[F++]=W}else{if(2047>=W){if(F+1>=K)break;P[F++]=192|W>>6}else{if(65535>=W){if(F+2>=K)break;P[F++]=224|W>>12}else{if(F+3>=K)break;P[F++]=240|W>>18,P[F++]=128|W>>12&63}P[F++]=128|W>>6&63}P[F++]=128|W&63}}P[F]=0}}else if(F)for(F=0;F<P;++F)O=S.charCodeAt(F),255<O&&($t(K),V("String has UTF-16 code units that do not fit in 8 bits")),C[K+F]=O;else for(F=0;F<P;++F)C[K+F]=S[F];return w!==null&&w.push($t,T),T},argPackAdvance:8,readValueFromPointer:Hi,V:function(w){$t(w)}})},i:function(E,p,y){if(y=ce(y),p===2)var w=GI,S=OI,P=HI,F=()=>U,T=1;else p===4&&(w=JI,S=KI,P=YI,F=()=>D,T=2);jt(E,{name:y,fromWireType:function(K){for(var O=D[K>>2],W=F(),ee,ue=K+4,Pe=0;Pe<=O;++Pe){var de=K+4+Pe*p;(Pe==O||W[de>>T]==0)&&(ue=w(ue,de-ue),ee===void 0?ee=ue:(ee+="\0",ee+=ue),ue=de+p)}return $t(K),ee},toWireType:function(K,O){typeof O!="string"&&V("Cannot pass non-string to C++ string type "+y);var W=P(O),ee=Pn(4+W+p);return D[ee>>2]=W>>T,S(O,ee+4,W+p),K!==null&&K.push($t,ee),ee},argPackAdvance:8,readValueFromPointer:Hi,V:function(K){$t(K)}})},k:function(E,p,y,w,S,P){Wr[E]={name:ce(p),fa:Dt(y,w),W:Dt(S,P),ia:[]}},h:function(E,p,y,w,S,P,F,T,K,O){Wr[E].ia.push({oa:ce(p),ta:y,ra:Dt(w,S),sa:P,za:F,ya:Dt(T,K),Aa:O})},C:function(E,p){p=ce(p),jt(E,{va:!0,name:p,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(E,p,y,w,S){E=qr[E],p=Ee(p),y=Tl(y);var P=[];return D[w>>2]=ht(P),E(p,y,P,S)},t:function(E,p,y,w){E=qr[E],p=Ee(p),y=Tl(y),E(p,y,null,w)},g:Un,m:function(E,p){var y=XI(E,p),w=y[0];p=w.name+"_$"+y.slice(1).map(function(F){return F.name}).join("_")+"$";var S=Ll[p];if(S!==void 0)return S;var P=Array(E-1);return S=VI((F,T,K,O)=>{for(var W=0,ee=0;ee<E-1;++ee)P[ee]=y[ee+1].readValueFromPointer(O+W),W+=y[ee+1].argPackAdvance;for(F=F[T].apply(F,P),ee=0;ee<E-1;++ee)y[ee+1].ma&&y[ee+1].ma(P[ee]);if(!w.va)return w.toWireType(K,F)}),Ll[p]=S},D:function(E){4<E&&(ie[E].ga+=1)},r:function(E){var p=Ee(E);vn(p),Un(E)},c:function(){N("")},x:function(E,p,y){C.copyWithin(E,p,p+y)},w:function(E){var p=C.length;if(E>>>=0,2147483648<E)return!1;for(var y=1;4>=y;y*=2){var w=p*(1+.2/y);w=Math.min(w,E+100663296);var S=Math;w=Math.max(E,w),S=S.min.call(S,2147483648,w+(65536-w%65536)%65536);e:{try{h.grow(S-d.byteLength+65535>>>16),Q();var P=1;break e}catch{}P=void 0}if(P)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(E,p,y,w){for(var S=0,P=0;P<y;P++){var F=D[p>>2],T=D[p+4>>2];p+=8;for(var K=0;K<T;K++){var O=C[F+K],W=qI[E];O===0||O===10?((E===1?o:a)(u(W,0)),W.length=0):W.push(O)}S+=T}return D[w>>2]=S,0}};(function(){function E(S){e.asm=S.exports,h=e.asm.E,Q(),v=e.asm.J,k.unshift(e.asm.F),L--,e.monitorRunDependencies&&e.monitorRunDependencies(L),L==0&&te&&(S=te,te=null,S())}function p(S){E(S.instance)}function y(S){return oe().then(function(P){return WebAssembly.instantiate(P,w)}).then(function(P){return P}).then(S,function(P){a("failed to asynchronously prepare wasm: "+P),N(P)})}var w={a:jI};if(L++,e.monitorRunDependencies&&e.monitorRunDependencies(L),e.instantiateWasm)try{return e.instantiateWasm(w,E)}catch(S){a("Module.instantiateWasm callback failed with error: "+S),i(S)}return function(){return l||typeof WebAssembly.instantiateStreaming!="function"||$(Ae)||typeof fetch!="function"?y(p):fetch(Ae,{credentials:"same-origin"}).then(function(S){return WebAssembly.instantiateStreaming(S,w).then(p,function(P){return a("wasm streaming compile failed: "+P),a("falling back to ArrayBuffer instantiation"),y(p)})})}().catch(i),{}})(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.F).apply(null,arguments)};var Ol=e.___getTypeName=function(){return(Ol=e.___getTypeName=e.asm.G).apply(null,arguments)};e.__embind_initialize_bindings=function(){return(e.__embind_initialize_bindings=e.asm.H).apply(null,arguments)};var Pn=e._malloc=function(){return(Pn=e._malloc=e.asm.I).apply(null,arguments)},$t=e._free=function(){return($t=e._free=e.asm.K).apply(null,arguments)};e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.L).apply(null,arguments)};var jr;te=function E(){jr||Hl(),jr||(te=E)};function Hl(){function E(){if(!jr&&(jr=!0,e.calledRun=!0,!c)){if(z(k),t(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;){var p=e.postRun.shift();Z.unshift(p)}z(Z)}}if(!(0<L)){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)Y();z(x),0<L||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),E()},1)):E())}}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Hl(),A.ready}})();let Ke=function(r){return r[r.Auto=0]="Auto",r[r.FlexStart=1]="FlexStart",r[r.Center=2]="Center",r[r.FlexEnd=3]="FlexEnd",r[r.Stretch=4]="Stretch",r[r.Baseline=5]="Baseline",r[r.SpaceBetween=6]="SpaceBetween",r[r.SpaceAround=7]="SpaceAround",r[r.SpaceEvenly=8]="SpaceEvenly",r}({}),Ur=function(r){return r[r.BorderBox=0]="BorderBox",r[r.ContentBox=1]="ContentBox",r}({}),fl=function(r){return r[r.Width=0]="Width",r[r.Height=1]="Height",r}({}),gA=function(r){return r[r.Inherit=0]="Inherit",r[r.LTR=1]="LTR",r[r.RTL=2]="RTL",r}({}),jA=function(r){return r[r.Flex=0]="Flex",r[r.None=1]="None",r[r.Contents=2]="Contents",r}({}),Be=function(r){return r[r.Left=0]="Left",r[r.Top=1]="Top",r[r.Right=2]="Right",r[r.Bottom=3]="Bottom",r[r.Start=4]="Start",r[r.End=5]="End",r[r.Horizontal=6]="Horizontal",r[r.Vertical=7]="Vertical",r[r.All=8]="All",r}({}),ZA=function(r){return r[r.None=0]="None",r[r.StretchFlexBasis=1]="StretchFlexBasis",r[r.AbsolutePositionWithoutInsetsExcludesPadding=2]="AbsolutePositionWithoutInsetsExcludesPadding",r[r.AbsolutePercentAgainstInnerSize=4]="AbsolutePercentAgainstInnerSize",r[r.All=2147483647]="All",r[r.Classic=2147483646]="Classic",r}({}),Hd=function(r){return r[r.WebFlexBasis=0]="WebFlexBasis",r}({}),cA=function(r){return r[r.Column=0]="Column",r[r.ColumnReverse=1]="ColumnReverse",r[r.Row=2]="Row",r[r.RowReverse=3]="RowReverse",r}({}),kr=function(r){return r[r.Column=0]="Column",r[r.Row=1]="Row",r[r.All=2]="All",r}({}),mt=function(r){return r[r.FlexStart=0]="FlexStart",r[r.Center=1]="Center",r[r.FlexEnd=2]="FlexEnd",r[r.SpaceBetween=3]="SpaceBetween",r[r.SpaceAround=4]="SpaceAround",r[r.SpaceEvenly=5]="SpaceEvenly",r}({}),$A=function(r){return r[r.Error=0]="Error",r[r.Warn=1]="Warn",r[r.Info=2]="Info",r[r.Debug=3]="Debug",r[r.Verbose=4]="Verbose",r[r.Fatal=5]="Fatal",r}({}),Qn=function(r){return r[r.Undefined=0]="Undefined",r[r.Exactly=1]="Exactly",r[r.AtMost=2]="AtMost",r}({}),dl=function(r){return r[r.Default=0]="Default",r[r.Text=1]="Text",r}({}),ei=function(r){return r[r.Visible=0]="Visible",r[r.Hidden=1]="Hidden",r[r.Scroll=2]="Scroll",r}({}),ti=function(r){return r[r.Static=0]="Static",r[r.Relative=1]="Relative",r[r.Absolute=2]="Absolute",r}({}),Gt=function(r){return r[r.Undefined=0]="Undefined",r[r.Point=1]="Point",r[r.Percent=2]="Percent",r[r.Auto=3]="Auto",r}({}),Ai=function(r){return r[r.NoWrap=0]="NoWrap",r[r.Wrap=1]="Wrap",r[r.WrapReverse=2]="WrapReverse",r}({});const Jd={ALIGN_AUTO:Ke.Auto,ALIGN_FLEX_START:Ke.FlexStart,ALIGN_CENTER:Ke.Center,ALIGN_FLEX_END:Ke.FlexEnd,ALIGN_STRETCH:Ke.Stretch,ALIGN_BASELINE:Ke.Baseline,ALIGN_SPACE_BETWEEN:Ke.SpaceBetween,ALIGN_SPACE_AROUND:Ke.SpaceAround,ALIGN_SPACE_EVENLY:Ke.SpaceEvenly,BOX_SIZING_BORDER_BOX:Ur.BorderBox,BOX_SIZING_CONTENT_BOX:Ur.ContentBox,DIMENSION_WIDTH:fl.Width,DIMENSION_HEIGHT:fl.Height,DIRECTION_INHERIT:gA.Inherit,DIRECTION_LTR:gA.LTR,DIRECTION_RTL:gA.RTL,DISPLAY_FLEX:jA.Flex,DISPLAY_NONE:jA.None,DISPLAY_CONTENTS:jA.Contents,EDGE_LEFT:Be.Left,EDGE_TOP:Be.Top,EDGE_RIGHT:Be.Right,EDGE_BOTTOM:Be.Bottom,EDGE_START:Be.Start,EDGE_END:Be.End,EDGE_HORIZONTAL:Be.Horizontal,EDGE_VERTICAL:Be.Vertical,EDGE_ALL:Be.All,ERRATA_NONE:ZA.None,ERRATA_STRETCH_FLEX_BASIS:ZA.StretchFlexBasis,ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:ZA.AbsolutePositionWithoutInsetsExcludesPadding,ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE:ZA.AbsolutePercentAgainstInnerSize,ERRATA_ALL:ZA.All,ERRATA_CLASSIC:ZA.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:Hd.WebFlexBasis,FLEX_DIRECTION_COLUMN:cA.Column,FLEX_DIRECTION_COLUMN_REVERSE:cA.ColumnReverse,FLEX_DIRECTION_ROW:cA.Row,FLEX_DIRECTION_ROW_REVERSE:cA.RowReverse,GUTTER_COLUMN:kr.Column,GUTTER_ROW:kr.Row,GUTTER_ALL:kr.All,JUSTIFY_FLEX_START:mt.FlexStart,JUSTIFY_CENTER:mt.Center,JUSTIFY_FLEX_END:mt.FlexEnd,JUSTIFY_SPACE_BETWEEN:mt.SpaceBetween,JUSTIFY_SPACE_AROUND:mt.SpaceAround,JUSTIFY_SPACE_EVENLY:mt.SpaceEvenly,LOG_LEVEL_ERROR:$A.Error,LOG_LEVEL_WARN:$A.Warn,LOG_LEVEL_INFO:$A.Info,LOG_LEVEL_DEBUG:$A.Debug,LOG_LEVEL_VERBOSE:$A.Verbose,LOG_LEVEL_FATAL:$A.Fatal,MEASURE_MODE_UNDEFINED:Qn.Undefined,MEASURE_MODE_EXACTLY:Qn.Exactly,MEASURE_MODE_AT_MOST:Qn.AtMost,NODE_TYPE_DEFAULT:dl.Default,NODE_TYPE_TEXT:dl.Text,OVERFLOW_VISIBLE:ei.Visible,OVERFLOW_HIDDEN:ei.Hidden,OVERFLOW_SCROLL:ei.Scroll,POSITION_TYPE_STATIC:ti.Static,POSITION_TYPE_RELATIVE:ti.Relative,POSITION_TYPE_ABSOLUTE:ti.Absolute,UNIT_UNDEFINED:Gt.Undefined,UNIT_POINT:Gt.Point,UNIT_PERCENT:Gt.Percent,UNIT_AUTO:Gt.Auto,WRAP_NO_WRAP:Ai.NoWrap,WRAP_WRAP:Ai.Wrap,WRAP_WRAP_REVERSE:Ai.WrapReverse};function Kd(r){function A(i,s,n){const o=i[s];i[s]=function(){for(var a=arguments.length,l=new Array(a),h=0;h<a;h++)l[h]=arguments[h];return n.call(this,o,...l)}}for(const i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding","setGap"]){const s={[Gt.Point]:r.Node.prototype[i],[Gt.Percent]:r.Node.prototype[`${i}Percent`],[Gt.Auto]:r.Node.prototype[`${i}Auto`]};A(r.Node.prototype,i,function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];const h=a.pop();let c,u;if(h==="auto")c=Gt.Auto,u=void 0;else if(typeof h=="object")c=h.unit,u=h.valueOf();else if(c=typeof h=="string"&&h.endsWith("%")?Gt.Percent:Gt.Point,u=parseFloat(h),h!==void 0&&!Number.isNaN(h)&&Number.isNaN(u))throw new Error(`Invalid value ${h} for ${i}`);if(!s[c])throw new Error(`Failed to execute "${i}": Unsupported unit '${h}'`);return u!==void 0?s[c].call(this,...a,u):s[c].call(this,...a)})}function e(i){return r.MeasureCallback.implement({measure:function(){const{width:s,height:n}=i(...arguments);return{width:s??NaN,height:n??NaN}}})}A(r.Node.prototype,"setMeasureFunc",function(i,s){return s?i.call(this,e(s)):this.unsetMeasureFunc()});function t(i){return r.DirtiedCallback.implement({dirtied:i})}return A(r.Node.prototype,"setDirtiedFunc",function(i,s){i.call(this,t(s))}),A(r.Config.prototype,"free",function(){r.Config.destroy(this)}),A(r.Node,"create",(i,s)=>s?r.Node.createWithConfig(s):r.Node.createDefault()),A(r.Node.prototype,"free",function(){r.Node.destroy(this)}),A(r.Node.prototype,"freeRecursive",function(){for(let i=0,s=this.getChildCount();i<s;++i)this.getChild(0).freeRecursive();this.free()}),A(r.Node.prototype,"calculateLayout",function(i){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:gA.LTR;return i.call(this,s,n,o)}),{Config:r.Config,Node:r.Node,...Jd}}async function Yd(){return Kd(await Od())}var Wd=Object.defineProperty,j=(r,A,e,t)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(A,e,i)||i);return i&&Wd(A,e,i),i};class q extends St{constructor(e){super();g(this,"_backgroundColor",new Rt);g(this,"_defaultFilter",{brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0});this.setProperties(e)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"backgroundColor":this._backgroundColor.value=this.backgroundColor==="none"?void 0:this.backgroundColor;break}}canPointeEvents(){return this.pointerEvents!=="none"}getComputedOpacity(){return _t(0,this.opacity,1)}getComputedBackgroundColor(){return this._backgroundColor}async loadBackgroundImage(){if(this.backgroundImage!=="none")return await Ot.texture.load(this.backgroundImage)}getComputedTransformOrigin(){const[e,t=e]=this.transformOrigin.split(" ");return[e,t].map(i=>{switch(i=i.trim(),i){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(i)}})}getComputedFilter(){let e={};return this.filter==="none"||(e=IA(this.filter).reduce((t,{name:i,args:s})=>(t[i]=s[0].normalizedIntValue,t),e),Object.keys(this._defaultFilter).forEach(t=>{e[t]=e[t]??this._defaultFilter[t]})),e}getComputedFilterColorMatrix(){const e=new qi,t=this.getComputedFilter();for(const i in t){const s=t[i];switch(i){case"hue-rotate":e.hueRotate(s*Ce);break;case"saturate":e.saturate(s);break;case"brightness":e.brightness(s);break;case"contrast":e.contrast(s);break;case"invert":e.invert(s);break;case"sepia":e.sepia(s);break;case"opacity":e.opacity(s);break;case"grayscale":e.grayscale(s);break}}return e}}j([_({default:"none"})],q.prototype,"backgroundColor"),j([_({default:"none"})],q.prototype,"backgroundImage"),j([_({default:"none"})],q.prototype,"filter"),j([_({default:"none"})],q.prototype,"boxShadow"),j([_({default:"none"})],q.prototype,"maskImage"),j([_({default:1})],q.prototype,"opacity"),j([_({default:0})],q.prototype,"borderRadius"),j([_({default:"#000000"})],q.prototype,"borderColor"),j([_({default:"none"})],q.prototype,"borderStyle"),j([_({default:0})],q.prototype,"outlineWidth"),j([_({default:0})],q.prototype,"outlineOffset"),j([_({default:"#000000"})],q.prototype,"outlineColor"),j([_({default:"none"})],q.prototype,"outlineStyle"),j([_({default:"visible"})],q.prototype,"visibility"),j([_({default:"visible"})],q.prototype,"overflow"),j([_({default:"auto"})],q.prototype,"pointerEvents"),j([_()],q.prototype,"alignContent"),j([_()],q.prototype,"alignItems"),j([_()],q.prototype,"alignSelf"),j([_()],q.prototype,"borderTop"),j([_()],q.prototype,"borderLeft"),j([_()],q.prototype,"borderRight"),j([_()],q.prototype,"borderBottom"),j([_()],q.prototype,"borderWidth"),j([_()],q.prototype,"border"),j([_()],q.prototype,"direction"),j([_()],q.prototype,"display"),j([_()],q.prototype,"flex"),j([_()],q.prototype,"flexBasis"),j([_()],q.prototype,"flexDirection"),j([_()],q.prototype,"flexGrow"),j([_()],q.prototype,"flexShrink"),j([_()],q.prototype,"flexWrap"),j([_()],q.prototype,"height"),j([_()],q.prototype,"justifyContent"),j([_()],q.prototype,"gap"),j([_()],q.prototype,"marginTop"),j([_()],q.prototype,"marginLeft"),j([_()],q.prototype,"marginRight"),j([_()],q.prototype,"marginBottom"),j([_()],q.prototype,"margin"),j([_()],q.prototype,"maxHeight"),j([_()],q.prototype,"maxWidth"),j([_()],q.prototype,"minHeight"),j([_()],q.prototype,"minWidth"),j([_()],q.prototype,"paddingTop"),j([_()],q.prototype,"paddingLeft"),j([_()],q.prototype,"paddingRight"),j([_()],q.prototype,"paddingBottom"),j([_()],q.prototype,"padding"),j([_()],q.prototype,"top"),j([_()],q.prototype,"bottom"),j([_()],q.prototype,"left"),j([_()],q.prototype,"right"),j([_()],q.prototype,"position"),j([_()],q.prototype,"boxSizing"),j([_()],q.prototype,"width");const Il=xs();for(const r in Il)BA(q,r,{default:Il[r]});const Bl=Ss();for(const r in Bl)BA(q,r,{default:Bl[r]});var El=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,Xd=(r,A,e)=>A in r?El(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,yn=(r,A,e,t)=>{for(var i=t>1?void 0:t?Vd(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&El(A,e,i),i},qd=(r,A,e)=>Xd(r,A+"",e);const mn={auto:Ke.Auto,"flex-start":Ke.FlexStart,center:Ke.Center,"flex-end":Ke.FlexEnd,stretch:Ke.Stretch,baseline:Ke.Baseline,"space-between":Ke.SpaceBetween,"space-around":Ke.SpaceAround,"space-evenly":Ke.SpaceEvenly},zd={none:jA.None,flex:jA.Flex,contents:jA.Contents},jd={inherit:gA.Inherit,ltr:gA.LTR,rtl:gA.RTL},Zd={column:cA.Column,"column-reverse":cA.ColumnReverse,row:cA.Row,"row-reverse":cA.RowReverse},$d={"no-wrap":Ai.NoWrap,wrap:Ai.Wrap,"Wrap-reverse":Ai.WrapReverse},eI={"flex-start":mt.FlexStart,center:mt.Center,"flex-end":mt.FlexEnd,"space-between":mt.SpaceBetween,"space-around":mt.SpaceAround,"space-evenly":mt.SpaceEvenly},tI={visible:ei.Visible,hidden:ei.Hidden,scroll:ei.Scroll},AI={static:ti.Static,relative:ti.Relative,absolute:ti.Absolute},iI={"border-box":Ur.BorderBox,"content-box":Ur.ContentBox};f.Element=class extends f.Node{constructor(e,t=[]){super();g(this,"_layout",f.Element.layoutEngine.Node.create());g(this,"transform",new Ze);g(this,"_parentTransformDirtyId");g(this,"opacity",1);g(this,"visible",!0);g(this,"_parentOpacity");g(this,"_parentVisible");g(this,"_modulate",new Rt(4294967295));g(this,"_backgroundImage");g(this,"context",new Ps);g(this,"_resetContext",!0);g(this,"_redrawing",!1);g(this,"_reflowing",!1);g(this,"_repainting",!1);g(this,"_originalBatchables",[]);g(this,"_layoutedBatchables",[]);g(this,"_batchables",[]);this._updateStyleProperty=this._updateStyleProperty.bind(this),this.style=new q,this.setProperties(e).append(t)}static async loadLayoutEngine(){this.layoutEngine=await Yd()}get style(){return this._style}set style(e){var i;const t=(...s)=>{this.emit("updateStyleProperty",...s),this._updateStyleProperty(s[0],s[1],s[2],s[3])};e.on("updateProperty",t),(i=this._style)==null||i.off("updateProperty",t),this._style=e}setProperties(e){if(e){const{style:t,...i}=e;t&&this.style.setProperties(t),super.setProperties(i)}return this}_parented(e){super._parented(e),e._layout&&this._layout&&e._layout.insertChild(this._layout,e._layout.getChildCount())}_unparented(e){super._unparented(e),e._layout&&this._layout&&e._layout.removeChild(this._layout)}_updateProperty(e,t,i,s){switch(super._updateProperty(e,t,i,s),e){case"modulate":this._modulate.value=t,this.requestRepaint();break;case"blendMode":return this.requestRepaint()}}_updateStyleProperty(e,t,i,s){switch(e){case"alignContent":this._layout.setAlignContent(mn[this.style.alignContent]);break;case"alignItems":this._layout.setAlignItems(mn[this.style.alignItems]);break;case"alignSelf":this._layout.setAlignSelf(mn[this.style.alignSelf]);break;case"aspectRatio":this._layout.setAspectRatio(t);break;case"borderTop":this._layout.setBorder(Be.Top,this.style.borderWidth);break;case"borderBottom":this._layout.setBorder(Be.Bottom,this.style.borderWidth);break;case"borderLeft":this._layout.setBorder(Be.Left,this.style.borderWidth);break;case"borderRight":this._layout.setBorder(Be.Right,this.style.borderWidth);break;case"border":this._layout.setBorder(Be.All,this.style.borderWidth);break;case"direction":this._layout.setDirection(jd[this.style.direction]);break;case"display":this._layout.setDisplay(zd[this.style.display]);break;case"flex":this._layout.setFlex(this.style.flex);break;case"flexBasis":this._layout.setFlexBasis(this.style.flexBasis);break;case"flexDirection":this._layout.setFlexDirection(Zd[this.style.flexDirection]);break;case"flexGrow":this._layout.setFlexGrow(this.style.flexGrow);break;case"flexShrink":this._layout.setFlexShrink(this.style.flexShrink);break;case"flexWrap":this._layout.setFlexWrap($d[this.style.flexWrap]);break;case"height":this._layout.setHeight(this.style.height);break;case"justifyContent":this._layout.setJustifyContent(eI[this.style.justifyContent]);break;case"gap":this._layout.setGap(kr.All,this.style.gap);break;case"marginTop":this._layout.setMargin(Be.Top,this.style.marginTop);break;case"marginBottom":this._layout.setMargin(Be.Top,this.style.marginBottom);break;case"marginLeft":this._layout.setMargin(Be.Left,this.style.marginLeft);break;case"marginRight":this._layout.setMargin(Be.Top,this.style.marginRight);break;case"margin":this._layout.setMargin(Be.All,this.style.margin);break;case"maxHeight":this._layout.setMaxHeight(this.style.maxHeight);break;case"maxWidth":this._layout.setMaxWidth(this.style.maxWidth);break;case"minHeight":this._layout.setMinHeight(this.style.minHeight);break;case"minWidth":this._layout.setMinWidth(this.style.minWidth);break;case"overflow":this._layout.setOverflow(tI[this.style.overflow]);break;case"paddingTop":this._layout.setPadding(Be.Top,this.style.paddingTop);break;case"paddingBottom":this._layout.setPadding(Be.Bottom,this.style.paddingBottom);break;case"paddingLeft":this._layout.setPadding(Be.Left,this.style.paddingLeft);break;case"paddingRight":this._layout.setPadding(Be.Right,this.style.paddingRight);break;case"padding":this._layout.setPadding(Be.All,this.style.padding);break;case"top":this._layout.setPosition(Be.Top,this.style.top);break;case"bottom":this._layout.setPosition(Be.Bottom,this.style.bottom);break;case"left":this._layout.setPosition(Be.Left,this.style.left);break;case"right":this._layout.setPosition(Be.Right,this.style.right);break;case"position":this._layout.setPositionType(AI[this.style.position]);break;case"boxSizing":this._layout.setBoxSizing(iI[this.style.boxSizing]);break;case"width":this._layout.setWidth(this.style.width);break;case"scaleX":case"scaleY":case"rotate":case"transform":case"transformOrigin":this._updateTransform();break;case"backgroundColor":this._updateBackgroundColor();break;case"backgroundImage":this._updateBackgroundImage();break;case"opacity":this._updateOpacity();break;case"visibility":this._updateVisible();break;case"filter":this.requestRepaint();break;case"boxShadow":this._updateBoxShadow();break;case"maskImage":this._updateMaskImage();break;case"borderRadius":this.requestRedraw();break}}_updateBoxShadow(){const e="__$style.shadow";if(this.style.boxShadow!=="none")this.getNode(e)||this.appendChild(new f.ShadowEffect,"back");else{const t=this.getNode(e);t&&this.removeChild(t)}}_updateMaskImage(){const e="__$style.maskImage",t=this.style.maskImage;if(t&&t!=="none"){const i=this.getNode(e);i?i.src=t:this.appendChild(new f.MaskEffect({src:t}),"back")}else{const i=this.getNode(e);i&&this.removeChild(i)}}_updateBackgroundColor(){const e=this.style.getComputedBackgroundColor();this._originalBatchables.length?this.requestRepaint():e.a>0&&this.requestRedraw()}async _updateBackgroundImage(){this._backgroundImage=await this.style.loadBackgroundImage(),this.requestRedraw()}_updateOpacity(){var t;const e=this.style.getComputedOpacity()*(((t=this.getParent())==null?void 0:t.opacity)??1);this.opacity!==e&&(this.opacity=e,this.requestRepaint())}_updateVisible(){var e;this.visible=this.style.visibility==="visible"&&(((e=this.getParent())==null?void 0:e.visible)??!0)}_updateTransform(){this.calculateLayout(void 0,void 0,gA.LTR);const e=this._layout.getComputedLayout(),{left:t,top:i,width:s,height:n}=e,{scaleX:o,scaleY:a,rotate:l}=this.style,h=new Ze(!1),c=new Ze(!1).scale(o,a).translate(t,i).rotate(l*fs),u=new Ze;IA(!this.style.transform||this.style.transform==="none"?"":this.style.transform,{width:s,height:n}).forEach(({name:v,args:x})=>{const k=x.map(Z=>Z.normalizedIntValue);switch(u.identity(),v){case"translate":u.translate(k[0]*s,(k[1]??k[0])*n);break;case"translateX":u.translateX(k[0]*s);break;case"translateY":u.translateY(k[0]*n);break;case"translateZ":u.translateZ(k[0]);break;case"translate3d":u.translate3d(k[0]*s,(k[1]??k[0])*n,k[2]??k[1]??k[0]);break;case"scale":u.scale(k[0],k[1]??k[0]);break;case"scaleX":u.scaleX(k[0]);break;case"scaleY":u.scaleY(k[0]);break;case"scale3d":u.scale3d(k[0],k[1]??k[0],k[2]??k[1]??k[0]);break;case"rotate":u.rotate(k[0]*Ce);break;case"rotateX":u.rotateX(k[0]*Ce);break;case"rotateY":u.rotateY(k[0]*Ce);break;case"rotateZ":u.rotateZ(k[0]*Ce);break;case"rotate3d":u.rotate3d(k[0]*Ce,(k[1]??k[0])*Ce,(k[2]??k[1]??k[0])*Ce,(k[3]??k[2]??k[1]??k[0])*Ce);break;case"skew":u.skew(k[0],k[0]??k[1]);break;case"skewX":u.skewX(k[0]);break;case"skewY":u.skewY(k[0]);break;case"matrix":u.set(k);break}h.multiply(u)}),c.update(),h.update();const d=c.toArray(),I=h.toArray(),C=[I[0]*d[0]+I[3]*d[1],I[1]*d[0]+I[4]*d[1],I[2]*d[0]+I[5]*d[1]+d[2],I[0]*d[3]+I[3]*d[4],I[1]*d[3]+I[4]*d[4],I[2]*d[3]+I[5]*d[4]+d[5],0,0,1],[B,U]=this.style.getComputedTransformOrigin(),M=B*s,D=U*n;C[2]+=C[0]*-M+C[1]*-D+M,C[5]+=C[3]*-M+C[4]*-D+D;const R=this.getParent(),b=R==null?void 0:R.transform;this._parentTransformDirtyId=b==null?void 0:b.dirtyId;let Q;if(b){const v=b.toArray();Q=[C[0]*v[0]+C[3]*v[1],C[1]*v[0]+C[4]*v[1],C[2]*v[0]+C[5]*v[1]+v[2],C[0]*v[3]+C[3]*v[4],C[1]*v[3]+C[4]*v[4],C[2]*v[3]+C[5]*v[4]+v[5],0,0,1]}else Q=C;this.transform.set(Q),this._updateOverflow(),this.requestRedraw()}getRect(){const[e,t,i,s,n,o]=this.transform.toArray(),a=this._layout.getComputedWidth()??0,l=this._layout.getComputedHeight()??0;return new hi(i,o,e*a+t*l,s*a+n*l)}_updateOverflow(){if(this.style.overflow==="hidden"){const e=this.getRect();this.mask={x:e.x,y:e.y,width:e.width,height:e.height}}else this.mask=void 0}show(){this.style.visibility="visible"}hide(){this.style.visibility="hidden"}isVisibleInTree(){return this.opacity>0&&this.visible}canRender(){return super.canRender()&&this.isVisibleInTree()}requestRedraw(){this._redrawing=!0}requestReflow(){this._reflowing=!0}requestRepaint(){this._repainting=!0}_process(e){var i;const t=this.getParent();this._parentVisible!==(t==null?void 0:t.visible)&&(this._parentVisible=t==null?void 0:t.visible,this._updateVisible()),this._parentOpacity!==(t==null?void 0:t.opacity)&&(this._parentOpacity=t==null?void 0:t.opacity,this._updateOpacity()),(this._layout.hasNewLayout()||((i=t==null?void 0:t.transform)==null?void 0:i.dirtyId)!==this._parentTransformDirtyId)&&(this._layout.markLayoutSeen(),this._updateTransform()),super._process(e)}_transformVertices(e){const[t,i,s,n,o,a]=this.transform.toArray(),l=e.slice();for(let h=e.length,c=0;c<h;c+=2){const u=e[c],d=e[c+1];l[c]=t*u+i*d+s,l[c+1]=n*u+o*d+a}return l}_draw(){this._drawBackground(),this._drawContent(),this._drawBorder(),this._drawOutline()}_drawBackground(){const e=this._backgroundImage;e!=null&&e.valid&&(this.context.fillStyle=e,this.context.textureTransform=new Ze().scale(this._layout.getComputedWidth()/e.width,this._layout.getComputedHeight()/e.height),this._fillBoundingRect())}_drawContent(){this._fillBoundingRect()}_drawBorder(){this.style.borderWidth&&this.style.borderStyle!=="none"&&(this.context.lineWidth=this.style.borderWidth,this.context.strokeStyle=this.style.borderColor,this._strokeBoundingRect())}_drawOutline(){this.style.outlineWidth&&this.style.outlineColor!=="none"&&(this.context.lineWidth=this.style.outlineWidth,this.context.strokeStyle=this.style.outlineColor,this._strokeBoundingRect())}_drawBoundingRect(){const{borderRadius:e}=this.style,t=this._layout.getComputedWidth(),i=this._layout.getComputedHeight();t&&i&&(e?this.context.roundRect(0,0,t,i,e):this.context.rect(0,0,t,i))}_fillBoundingRect(){this._drawBoundingRect(),this.context.fill()}_strokeBoundingRect(){this._drawBoundingRect(),this.context.stroke()}_relayout(e){return this._reflow(e)}_reflow(e){return this._repaint(e.map(t=>({...t,vertices:this._transformVertices(t.vertices)})))}_repaint(e){const t=this.style.getComputedFilterColorMatrix();return e.map(i=>({...i,backgroundColor:this.style.getComputedBackgroundColor().abgr,modulate:this._modulate.toArgb(this.opacity,!0),colorMatrix:t.toMatrix4().toArray(!0),colorMatrixOffset:t.toVector4().toArray(),blendMode:this.blendMode}))}calculateLayout(e,t,i){const s=this.getParent();s!=null&&s.calculateLayout?s.calculateLayout(e,t,i):this._layout.calculateLayout(e,t,i)}_render(e){let t;this._redrawing?(this.emit("draw"),this._draw(),this._originalBatchables=this.context.toBatchables(),this._layoutedBatchables=this._relayout(this._originalBatchables),t=this._layoutedBatchables,this._resetContext&&this.context.reset()):this._reflowing?(this._layoutedBatchables=this._reflow(this._originalBatchables),t=this._layoutedBatchables):this._repainting&&(t=this._repaint(this._layoutedBatchables)),t&&(this._batchables=t,this._redrawing=!1,this._reflowing=!1,this._repainting=!1),this._batchables.forEach(i=>{var s,n;(s=i.texture)==null||s.upload(e),e.batch2D.render({...i,texture:(n=i.texture)==null?void 0:n._glTexture(e)})}),super._render(e)}toJSON(){const e=super.toJSON();return{...e,props:{style:this.style.toJSON(),...e.props}}}},qd(f.Element,"layoutEngine"),yn([_()],f.Element.prototype,"modulate",2),yn([_()],f.Element.prototype,"blendMode",2),f.Element=yn([ae("Element")],f.Element);var rI=Object.defineProperty,sI=Object.getOwnPropertyDescriptor,Pr=(r,A,e,t)=>{for(var i=t>1?void 0:t?sI(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&rI(A,e,i),i};f.Scaler=class extends f.Node{get target(){var A;if((A=this.parent)!=null&&A.style)return this.parent}constructor(A,e=[]){super(),this.setProperties(A),this.append(e)}_updateProperty(A,e,t,i){switch(super._updateProperty(A,e,t,i),A){case"value":case"min":case"max":{this.value=_t(this.minValue,this.value,this.maxValue),this._updateScale();break}}}_updateScale(){const A=this.target;A&&(A.style.scaleX=this.value,A.style.scaleY=this.value,this.emit("updateScale",this.value))}_onWheel(A){if(!this.target)return;if(A.preventDefault(),!(A.wheelDeltaY?Math.abs(Math.abs(A.wheelDeltaY)-Math.abs(3*A.deltaY))<3:A.deltaMode===0)&&A.ctrlKey){A.preventDefault();let i=A.deltaY/(A.ctrlKey?1:100);i*=-.015,this.value+=i}}_input(A,e){switch(super._input(A,e),e){case"wheel":this._onWheel(A);break}}},Pr([_({default:1})],f.Scaler.prototype,"value",2),Pr([_({default:.05})],f.Scaler.prototype,"minValue",2),Pr([_({default:10})],f.Scaler.prototype,"maxValue",2),f.Scaler=Pr([ae("Scaler",{processMode:"disabled",renderMode:"disabled"})],f.Scaler);var pl=Object.defineProperty,nI=Object.getOwnPropertyDescriptor,oI=(r,A,e)=>A in r?pl(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,aI=(r,A,e,t)=>{for(var i=t>1?void 0:t?nI(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&pl(A,e,i),i},lI=(r,A,e)=>oI(r,A+"",e);f.KawaseTransition=class extends f.Transition{constructor(){super(...arguments);g(this,"blur",10);g(this,"quality",10)}apply(e,t){const i=this.currentTimeProgress;let s,n;i<.5?(s=0,n=(.5-i)/.5):(s=1,n=(i-.5)/.5);const o=this.blur,a=this.quality,l=t.width,h=t.height,c=[],u=[o];if(o>0){let M=o;const D=o/a;for(let R=1;R<a;R++)M-=D,u.push(M)}const d=1/l,I=1/h,C=[];let B;const U=a-1;for(let M=0;M<U;M++)B=u[M]+.5,C[0]=B*d,C[1]=B*I,c.push({offset:C});B=u[U]+.5,C[0]=B*d,C[1]=B*I,c.push({offset:C}),c.forEach(M=>{Ie.draw(e,f.KawaseTransition.material,{sampler:s,progress:n,...M})})}},lI(f.KawaseTransition,"material",new we({vert:`attribute vec2 position;
753
754
  attribute vec2 uv;
754
755
  varying vec2 vUv;
755
756
  void main() {
@@ -770,7 +771,7 @@ void main(void) {
770
771
  color += texture2D(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));
771
772
  color *= 0.25;
772
773
  gl_FragColor = color;
773
- }`})),d.KawaseTransition=cp([j("KawaseTransition")],d.KawaseTransition);var Ka=Object.defineProperty,fp=Object.getOwnPropertyDescriptor,dp=(n,r,e)=>r in n?Ka(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,pp=(n,r,e,t)=>{for(var i=t>1?void 0:t?fp(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ka(r,e,i),i},gp=(n,r,e)=>dp(n,r+"",e);d.LeftEraseTransition=class extends d.Transition{apply(r){J.draw(r,d.LeftEraseTransition.material,{previous:0,next:1,progress:this.currentTimeProgress})}},gp(d.LeftEraseTransition,"material",new se({vert:`attribute vec2 position;
774
+ }`})),f.KawaseTransition=aI([ae("KawaseTransition")],f.KawaseTransition);var Cl=Object.defineProperty,hI=Object.getOwnPropertyDescriptor,gI=(r,A,e)=>A in r?Cl(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,cI=(r,A,e,t)=>{for(var i=t>1?void 0:t?hI(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Cl(A,e,i),i},uI=(r,A,e)=>gI(r,A+"",e);f.LeftEraseTransition=class extends f.Transition{apply(A){Ie.draw(A,f.LeftEraseTransition.material,{previous:0,next:1,progress:this.currentTimeProgress})}},uI(f.LeftEraseTransition,"material",new we({vert:`attribute vec2 position;
774
775
  attribute vec2 uv;
775
776
  varying vec2 vUv;
776
777
  void main() {
@@ -795,7 +796,7 @@ void main() {
795
796
  mixPercent = 1.0;
796
797
  }
797
798
  gl_FragColor = mix(src2Color, src1Color, mixPercent);
798
- }`})),d.LeftEraseTransition=pp([j("LeftEraseTransition")],d.LeftEraseTransition);var Ja=Object.defineProperty,mp=Object.getOwnPropertyDescriptor,yp=(n,r,e)=>r in n?Ja(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,_p=(n,r,e,t)=>{for(var i=t>1?void 0:t?mp(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Ja(r,e,i),i},vp=(n,r,e)=>yp(n,r+"",e);d.TiltShiftTransition=class extends d.Transition{constructor(){super(...arguments);u(this,"blur",100);u(this,"gradientBlur",600)}apply(e,t){const i=this.currentTimeProgress;let s,o;i<.5?(s=0,o=(.5-i)/.5):(s=1,o=(i-.5)/.5);const a=t.width,l=t.height,h=[0,l/2],c=[600,l/2],f=[a,l],p=c[0]-h[0],m=c[1]-h[1],g=Math.sqrt(p*p+m*m);J.draw(e,d.TiltShiftTransition.material,{sampler:s,progress:o,blur:this.blur,gradientBlur:this.gradientBlur,start:h,end:c,delta:[p/g,m/g],texSize:f}),J.draw(e,d.TiltShiftTransition.material,{sampler:s,progress:o,blur:this.blur,gradientBlur:this.gradientBlur,start:h,end:c,delta:[-m/g,p/g],texSize:f})}},vp(d.TiltShiftTransition,"material",new se({vert:`attribute vec2 position;
799
+ }`})),f.LeftEraseTransition=cI([ae("LeftEraseTransition")],f.LeftEraseTransition);var Ql=Object.defineProperty,fI=Object.getOwnPropertyDescriptor,dI=(r,A,e)=>A in r?Ql(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,II=(r,A,e,t)=>{for(var i=t>1?void 0:t?fI(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&Ql(A,e,i),i},BI=(r,A,e)=>dI(r,A+"",e);f.TiltShiftTransition=class extends f.Transition{constructor(){super(...arguments);g(this,"blur",100);g(this,"gradientBlur",600)}apply(e,t){const i=this.currentTimeProgress;let s,n;i<.5?(s=0,n=(.5-i)/.5):(s=1,n=(i-.5)/.5);const o=t.width,a=t.height,l=[0,a/2],h=[600,a/2],c=[o,a],u=h[0]-l[0],d=h[1]-l[1],I=Math.sqrt(u*u+d*d);Ie.draw(e,f.TiltShiftTransition.material,{sampler:s,progress:n,blur:this.blur,gradientBlur:this.gradientBlur,start:l,end:h,delta:[u/I,d/I],texSize:c}),Ie.draw(e,f.TiltShiftTransition.material,{sampler:s,progress:n,blur:this.blur,gradientBlur:this.gradientBlur,start:l,end:h,delta:[-d/I,u/I],texSize:c})}},BI(f.TiltShiftTransition,"material",new we({vert:`attribute vec2 position;
799
800
  attribute vec2 uv;
800
801
  varying vec2 vUv;
801
802
  void main() {
@@ -839,7 +840,7 @@ void main(void) {
839
840
  color.rgb /= color.a + 0.00001;
840
841
 
841
842
  gl_FragColor = color;
842
- }`})),d.TiltShiftTransition=_p([j("TiltShiftTransition")],d.TiltShiftTransition);var Qa=Object.defineProperty,bp=Object.getOwnPropertyDescriptor,wp=(n,r,e)=>r in n?Qa(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e,xp=(n,r,e,t)=>{for(var i=t>1?void 0:t?bp(r,e):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&Qa(r,e,i),i},Pp=(n,r,e)=>wp(n,r+"",e);d.TwistTransition=class extends d.Transition{constructor(){super(...arguments);u(this,"radius");u(this,"angle",4);u(this,"padding",20);u(this,"offset")}apply(e,t){const i=this.currentTimeProgress;let s,o;i<.5?(s=0,o=(.5-i)/.5):(s=1,o=(i-.5)/.5);const a=t.width,l=t.height;J.draw(e,d.TwistTransition.material,{sampler:s,progress:o,filterArea:[a,l,0,0],radius:this.radius??a,angle:this.angle,padding:this.padding,offset:this.offset??[a/2,l/2]})}},Pp(d.TwistTransition,"material",new se({vert:`attribute vec2 position;
843
+ }`})),f.TiltShiftTransition=II([ae("TiltShiftTransition")],f.TiltShiftTransition);var yl=Object.defineProperty,EI=Object.getOwnPropertyDescriptor,pI=(r,A,e)=>A in r?yl(r,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[A]=e,CI=(r,A,e,t)=>{for(var i=t>1?void 0:t?EI(A,e):A,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(t?n(A,e,i):n(i))||i);return t&&i&&yl(A,e,i),i},QI=(r,A,e)=>pI(r,A+"",e);f.TwistTransition=class extends f.Transition{constructor(){super(...arguments);g(this,"radius");g(this,"angle",4);g(this,"padding",20);g(this,"offset")}apply(e,t){const i=this.currentTimeProgress;let s,n;i<.5?(s=0,n=(.5-i)/.5):(s=1,n=(i-.5)/.5);const o=t.width,a=t.height;Ie.draw(e,f.TwistTransition.material,{sampler:s,progress:n,filterArea:[o,a,0,0],radius:this.radius??o,angle:this.angle,padding:this.padding,offset:this.offset??[o/2,a/2]})}},QI(f.TwistTransition,"material",new we({vert:`attribute vec2 position;
843
844
  attribute vec2 uv;
844
845
  varying vec2 vUv;
845
846
  void main() {
@@ -885,4 +886,4 @@ void main(void) {
885
886
  coord = twist(coord, radius - (progress * radius));
886
887
  coord = unmapCoord(coord);
887
888
  gl_FragColor = texture2D(sampler, coord);
888
- }`})),d.TwistTransition=xp([j("TwistTransition")],d.TwistTransition);class el extends Tt{install(r){const e=async t=>{const{decodeFrames:i}=await import("modern-gif");return await r.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s)).then(s=>new mi(s.map(o=>({duration:o.delay,texture:new Es(o.data,o.width,o.height)}))))};return this.load=t=>r.loadBy(t,()=>e(t)),["image/gif"].forEach(t=>{r.register(t,e)}),r.gif=this,this}}class tl extends Tt{install(r){const e=t=>r.fetch(t).then(i=>i.json());return this.load=t=>r.loadBy(t,()=>e(t)),["json"].forEach(t=>{r.register(t,e)}),r.json=this,this}}class rl extends Tt{install(r){const e=async(t,i)=>(await import("lottie-web").then(o=>o.default)).loadAnimation({container:null,renderer:"canvas",rendererSettings:{context:i.getContext("2d")},loop:!1,autoplay:!1,animationData:await r.fetch(t).then(o=>o.json())});return this.load=(t,i)=>r.loadBy(t,()=>e(t,i)),["lottie"].forEach(t=>{r.register(t,e)}),r.lottie=this,this}}class il extends Tt{install(r){const e=async t=>await r.fetch(t).then(i=>i.text());return this.load=t=>r.loadBy(t,()=>e(t)),r.text=this,this}}class sl extends Tt{install(r){const e=t=>r.fetchImageBitmap(t,{premultiplyAlpha:"premultiply"}).then(i=>new ge(i));return this.load=t=>r.loadBy(t,()=>e(t)),["image/gif","image/jpeg","image/png","image/tiff","image/vnd.wap.wbmp","image/x-icon","image/x-jng","image/x-ms-bmp","image/svg+xml","image/webp"].forEach(t=>{r.register(t,e)}),r.texture=this,this}}class nl extends Tt{install(r){const e=t=>new Wo(t).load();return this.load=t=>r.loadBy(t,()=>e(t)),["video/3gpp","video/mpeg","video/quicktime","video/x-flv","video/x-mng","video/x-ms-asf","video/x-ms-wmv","video/x-msvideo","video/mp4"].forEach(t=>{r.register(t,e)}),r.video=this,this}}const Cp=Object.entries({"text/html":["html","htm","shtml"],"text/css":["css"],"text/xml":["xml"],"image/gif":["gif"],"image/jpeg":["jpeg","jpg"],"application/x-javascript":["js"],"application/atom+xml":["atom"],"application/rss+xml":["rss"],"text/mathml":["mml"],"text/plain":["txt"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/x-component":["htc"],"image/png":["png"],"image/tiff":["tif","tiff"],"image/vnd.wap.wbmp":["wbmp"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-ms-bmp":["bmp"],"image/svg+xml":["svg"],"image/webp":["webp"],"application/java-archive":["jar","war","ear"],"application/mac-binhex40":["hqx"],"application/msword":["doc"],"application/pdf":["pdf"],"application/postscript":["ps","eps","ai"],"application/rtf":["rtf"],"application/vnd.ms-excel":["xls"],"application/vnd.ms-powerpoint":["ppt"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/x-7z-compressed":["7z"],"application/x-cocoa":["cco"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-makeself":["run"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-sea":["sea"],"application/x-shockwave-flash":["swf"],"application/x-stuffit":["sit"],"application/x-tcl":["tcl","tk"],"application/x-x509-ca-cert":["der","pem","crt"],"application/x-xpinstall":["xpi"],"application/xhtml+xml":["xhtml"],"application/zip":["zip"],"application/octet-stream":["bin","exe","dll","deb","dmg","eot","iso","img","msi","msp","msm"],"audio/midi":["mid","midi","kar"],"audio/mpeg":["mp3"],"audio/ogg":["ogg"],"audio/x-realaudio":["ra"],"video/3gpp":["3gpp","3gp"],"video/mpeg":["mpeg","mpg"],"video/quicktime":["mov"],"video/x-flv":["flv"],"video/x-mng":["mng"],"video/x-ms-asf":["asx","asf"],"video/x-ms-wmv":["wmv"],"video/x-msvideo":["avi"],"video/mp4":["m4v","mp4"]});function Tp(n){for(const[r,e]of Cp)if(e.includes(n))return r}async function Sp(n){var e,t;let r;if(n.startsWith("data:"))r=(e=n.match(/^data:(.+?);/))==null?void 0:e[1];else if(n.startsWith("http")){const i=(t=n.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim();i&&(r=Tp(i))}return r??await fetch(n).then(i=>i.headers.get("Content-Type"))??""}const ji="WeakRef"in globalThis;class ol{constructor(){u(this,"defaultHandler",r=>this.fetch(r));u(this,"_handlers",new Map);u(this,"_handleing",new Map);u(this,"_handled",new Map);u(this,"_gc",ji?new FinalizationRegistry(r=>{const e=this.get(r);e&&"destroy"in e&&e.destroy(),this._handled.delete(r)}):void 0);ji||fe.on(this.gc.bind(this),{sort:2})}use(r){return r.install(this),this}register(r,e){return this._handlers.set(r,e),this}fetch(r){return fetch(r)}_fixSVG(r){const e=new DOMParser().parseFromString(decodeURIComponent(r.split(",")[1]),"image/svg+xml").documentElement;return e.setAttribute("width","512"),e.setAttribute("height","512"),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.outerHTML)}`}async fetchImageBitmap(r,e){return r.startsWith("http")?await this.fetch(r).then(t=>t.blob()).then(t=>t.type==="image/svg+xml"?t.text().then(i=>this.fetchImageBitmap(this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),e)):createImageBitmap(t,e)):(r.startsWith("data:image/svg+xml;charset=utf-8,")&&(r=this._fixSVG(r)),new Promise(t=>{const i=new Image;i.src=r,i.onload=()=>{i.decode().finally(()=>{t(i)})}}).then(t=>createImageBitmap(t,e)))}get(r){let e=this._handled.get(r);return ji&&e instanceof WeakRef&&(e=e.deref(),e||this._handleing.delete(r)),e}set(r,e){let t=e;ji&&typeof e=="object"&&(this._gc.register(e,r),t=new WeakRef(e)),this._handled.set(r,t)}async loadBy(r,e){const t=this.get(r)??this._handleing.get(r);if(t)return t;const i=e().then(s=>(this.set(r,s),s)).finally(()=>{this._handleing.delete(r)});return this._handleing.set(r,i),i}async load(r,e){return this.loadBy(r,async()=>{const t=await Sp(r);return(this._handlers.get(t)??this.defaultHandler)(r,e)})}async waitUntilLoad(){await Promise.all(Array.from(this._handleing.values()))}gc(){this._handled.forEach((r,e)=>{const t=this.get(e);t&&"destroy"in t&&t.destroy()}),this._handled.clear()}}const Pt=new ol().use(new ho).use(new el).use(new tl).use(new rl).use(new il).use(new sl).use(new nl);class Ep extends d.Control{constructor(){super();u(this,"name","CanvasEditor");u(this,"hover",new d.Node2D({name:"hover",internalMode:"back",style:{visibility:"hidden",outlineStyle:"solid",outlineColor:16711935,outlineWidth:2,pointerEvents:"none"}}));u(this,"selectionRect",new d.Node2D({name:"selectionRect",internalMode:"back",style:{visibility:"hidden",width:1,height:1,backgroundColor:16711695,outlineStyle:"solid",outlineColor:16711935,outlineWidth:2,pointerEvents:"none"}}));u(this,"selector",new d.Node2D({name:"selector"}));u(this,"scaler",new d.Scaler({internalMode:"back"}).on("updateScale",e=>{this.ruler.scale=e;const t=this.drawboard.style.height*e,i=this.drawboard.style.width*e;t>this.style.height?(this.yScrollBar.style.visibility="visible",this.yScrollBar.maxValue=t,this.yScrollBar.page=this.style.height):this.yScrollBar.style.visibility="hidden",i>this.style.width?(this.xScrollBar.style.visibility="visible",this.xScrollBar.maxValue=i,this.xScrollBar.page=this.style.width):this.xScrollBar.style.visibility="hidden"}));u(this,"xScrollBar",new d.XScrollBar({internalMode:"back",style:{visibility:"hidden"}}));u(this,"yScrollBar",new d.YScrollBar({internalMode:"back",style:{visibility:"hidden"}}));u(this,"drawboard",new d.Node2D({name:"drawboard",style:{width:500,height:500,backgroundColor:4294967295,overflow:"hidden",pointerEvents:"none",boxShadow:"2px 2px 2px 1px rgba(0, 0, 0, 0.2)"}}).append(this.scaler));u(this,"ruler",new d.Ruler({name:"ruler",offsetX:100,offsetY:100}).append(this.drawboard,this.hover,this.selectionRect,this.xScrollBar,this.yScrollBar));u(this,"_pointerStart");u(this,"_pointerOffset");u(this,"selected");this._onPointerdown=this._onPointerdown.bind(this),this._onPointermove=this._onPointermove.bind(this),this._onPointerup=this._onPointerup.bind(this),this.append(this.ruler)}_updateStyleProperty(e,t,i,s){switch(super._updateStyleProperty(e,t,i,s),e){case"width":this.drawboard.style.left=(this.style.width-this.drawboard.style.width)/2,this.ruler.offsetX=this.drawboard.style.left;break;case"height":this.drawboard.style.top=(this.style.height-this.drawboard.style.height)/2,this.ruler.offsetY=this.drawboard.style.top;break}}_guiInput(e,t){switch(super._guiInput(e,t),t){case"pointerdown":this._onPointerdown(e);break;case"pointermove":this._onPointermove(e);break;case"pointerup":this._onPointerup();break}}_onPointerdown(e){const t=e.target;this._pointerOffset={x:e.offsetX,y:e.offsetY},t instanceof d.Node2D?(this.selected=t,this._pointerStart=t.style.clone()):(this.selected=void 0,this._pointerStart=void 0,this.selectionRect.style.visibility="visible",this.selectionRect.style.left=e.screen.x,this.selectionRect.style.top=e.screen.y,this.selectionRect.style.width=1,this.selectionRect.style.height=1),this._onHover()}_onPointermove(e){const{selected:t,_pointerStart:i,_pointerOffset:s}=this,o=s?{x:e.offsetX-s.x,y:e.offsetY-s.y}:{x:0,y:0};t&&i?(t.style.left=i.left+o.x,t.style.top=i.top+o.y):this.selectionRect.isVisibleInTree()&&(this.selectionRect.style.width=o.x,this.selectionRect.style.height=o.y),this._onHover()}_onPointerup(){this.selected=void 0,this.selectionRect.style.visibility="hidden",this._onHover()}_onHover(){const e=this.selected;e instanceof d.Node2D?(this.hover.style.visibility="visible",this.hover.style.width=e.style.width,this.hover.style.height=e.style.height,this.hover.transform.set(e.transform),this.hover.requestRedraw()):this.hover.style.visibility="hidden"}}const al={alpha:!0,stencil:!0,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"};class ll extends gi{constructor(e={}){var p,m;const{view:t,width:i,height:s,pixelRatio:o=rs,backgroundColor:a=0,autoResize:l,autoStart:h,timeline:c,...f}=e;super(c);u(this,"input",new Dn);u(this,"renderer");u(this,"_resizeObserver",vn?new ResizeObserver(e=>{const t=e[0];if(t.target===this.view){const{inlineSize:i,blockSize:s}=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize;this.resize(i,s)}}):void 0);this.renderer=new lo(t,{...al,...f}),this._setupInput(),this.pixelRatio=o,this.backgroundColor=a,l?(!t&&this.renderer.view&&(this.renderer.view.style.width="100%",this.renderer.view.style.height="100%"),this.enableAutoResize(l)):this.resize(i||this.gl.drawingBufferWidth||((p=this.view)==null?void 0:p.clientWidth)||200,s||this.gl.drawingBufferHeight||((m=this.view)==null?void 0:m.clientHeight)||200,!t),h&&this.start()}get view(){return this.renderer.view}get gl(){return this.renderer.gl}get screen(){return this.renderer.screen}get width(){return this.screen.width}get height(){return this.screen.height}get pixelRatio(){return this.renderer.pixelRatio}set pixelRatio(e){this.renderer.pixelRatio=e,this.resize(this.width,this.height),this.view&&(this.view.dataset.pixelRatio=String(e))}_setupInput(){return this.view&&(this.input.setTarget(this.view),["pointerdown","pointerover","pointermove","pointerup","wheel"].forEach(e=>{this.input.on(e,t=>{this.root.input(t,e),this.emit(e,t)})})),this}enableAutoResize(e=!0){var t,i;return this.view&&(e?(t=this._resizeObserver)==null||t.observe(this.view):(i=this._resizeObserver)==null||i.unobserve(this.view)),this}resize(e,t,i=!1){return this.renderer.resize(e,t,i),this.root.width=e,this.root.height=t,this.renderer.program.uniforms.projectionMatrix=this.root.toProjectionArray(!0),this}nextTick(){return ss()}waitUntilLoad(){return Pt.waitUntilLoad()}render(e=0){return this._render(this.renderer,e)}start(){return this.render(),super.start(e=>{this.render(e)})}destroy(){this.stop(),this.root.getChildren(!0).forEach(e=>this.root.removeChild(e)),this.input.removeEventListeners(),this.enableAutoResize(!1),this.renderer.destroy()}toPixels(){return this.render(),this.renderer.toPixels()}toImageData(){return new ImageData(this.toPixels(),this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}toCanvas2D(){var s,o;const e=this.toImageData(),t=document.createElement("canvas");t.width=e.width,t.height=e.height,(s=t.getContext("2d"))==null||s.putImageData(e,0,0);const i=document.createElement("canvas");return i.width=this.width,i.height=this.height,(o=i.getContext("2d"))==null||o.drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),i}}let Zr,Mp;const hl=[];async function Ap(n=100){for(;;){const r=hl.shift();if(r)try{await r()}catch(e){console.error(e)}else await new Promise(e=>setTimeout(e,n))}}async function Op(n){Zr??(Zr=new ll({width:1,height:1}));const r=Zr.root;r.removeChildren();const{data:e,width:t,height:i}=n;return Zr.resize(t,i),(Array.isArray(e)?e:[e]).forEach(s=>{s instanceof d.Node?r.addChild(s):r.addChild(d.Node.parse(s))}),await Zr.waitUntilLoad(),Zr.toCanvas2D()}async function Up(n){return Mp??(Mp=Ap()),new Promise(r=>{hl.push(async()=>r(await Op(n)))})}d.Assets=ol,d.AudioPipeline=pn,d.AudioProcessor=Bd,d.AudioSpectrum=Vd,d.CanvasContext=Xo,d.CanvasEditor=Ep,d.CanvasItemStyle=ne,d.CanvasTexture=Er,d.Color=Ct,d.ColorMatrix=us,d.ColorTexture=Ss,d.CoreObject=ti,d.DEG_TO_RAD=qn,d.DEVICE_PIXEL_RATIO=rs,d.EffectMaterial=di,d.Engine=ll,d.EventEmitter=mt,d.FontLoader=ho,d.Geometry=fi,d.GifLoader=el,d.HTMLAudio=qa,d.HTMLAudioContext=Fi,d.HTMLSound=$i,d.IN_BROWSER=_r,d.Image2DResource=mi,d.ImageTexture=yc,d.IndexBuffer=rr,d.Input=Dn,d.InputEvent=ri,d.JsonLoader=tl,d.Loader=Tt,d.LottieLoader=rl,d.MainLoop=oi,d.Material=se,d.Matrix=ot,d.Matrix2=kl,d.Matrix3=fs,d.Matrix4=Gn,d.MouseInputEvent=ns,d.PI=Me,d.PI_2=le,d.PixelsTexture=Es,d.PointerInputEvent=In,d.Projection2D=Xn,d.QuadGeometry=sc,d.QuadUvGeometry=J,d.RAD_TO_DEG=Rl,d.RawWeakMap=Zt,d.Rect2=ni,d.RefCounted=Un,d.Renderer=Yn,d.Resource=yt,d.SUPPORTS_AUDIO_CONTEXT=Qi,d.SUPPORTS_CLICK_EVENTS=wn,d.SUPPORTS_CREATE_IMAGE_BITMAP=Ji,d.SUPPORTS_IMAGE_BITMAP=_n,d.SUPPORTS_MOUSE_EVENTS=bl,d.SUPPORTS_OFFLINE_AUDIO_CONTEXT=ts,d.SUPPORTS_POINTER_EVENTS=Yt,d.SUPPORTS_RESIZE_OBSERVER=vn,d.SUPPORTS_TOUCH_EVENTS=gt,d.SUPPORTS_WEBGL2=yn,d.SUPPORTS_WEBKIT_AUDIO_CONTEXT=es,d.SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT=xn,d.SUPPORTS_WEB_AUDIO=Pn,d.SUPPORTS_WHEEL_EVENTS=bn,d.SceneTree=gi,d.TextLoader=il,d.Texture2D=ge,d.TextureLoader=sl,d.TextureRect2D=_i,d.Ticker=fe,d.Transform2D=et,d.UvGeometry=lc,d.UvMaterial=ir,d.Vector=Qe,d.Vector2=si,d.Vector3=Ll,d.Vector4=Wn,d.VertexAttribute=je,d.VertexBuffer=vt,d.VideoLoader=nl,d.VideoTexture=Wo,d.ViewportTexture=As,d.WebAudio=Xa,d.WebAudioContext=Dt,d.WebGLBatch2DModule=Jn,d.WebGLBlendMode=Kt,d.WebGLBufferModule=Qn,d.WebGLFramebufferModule=eo,d.WebGLMaskModule=to,d.WebGLModule=He,d.WebGLProgramModule=ro,d.WebGLRenderer=lo,d.WebGLScissorModule=io,d.WebGLState=kt,d.WebGLStateModule=Kn,d.WebGLStencilModule=so,d.WebGLTextureModule=no,d.WebGLVertexArrayModule=oo,d.WebGLViewportModule=ao,d.WebSound=Wa,d.WheelInputEvent=br,d.assets=Pt,d.clamp=at,d.createHTMLCanvas=En,d.createNode=xl,d.crossOrigin=An,d.cubicBezier=pr,d.curves=Bl,d.customNode=j,d.customNodes=ei,d.defaultOptions=al,d.defineProperty=vr,d.determineCrossOrigin=Mn,d.ease=za,d.easeIn=Va,d.easeInOut=Ga,d.easeOut=ja,d.getDeclarations=Qr,d.getDefaultCssPropertyValue=Ki,d.isCanvasElement=Tn,d.isElementNode=is,d.isImageElement=wl,d.isPow2=Zi,d.isVideoElement=Cn,d.isWebgl2=Sn,d.lerp=de,d.linear=$a,d.log2=ps,d.mapWebGLBlendModes=Zn,d.nextPow2=ds,d.nextTick=ss,d.parseCssFunctions=yr,d.parseCssProperty=mr,d.property=M,d.protectedProperty=ue,d.render=Up,d.timingFunctions=Ni,d.uid=gn,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
889
+ }`})),f.TwistTransition=CI([ae("TwistTransition")],f.TwistTransition);class ml extends tA{install(A){const e=async t=>{const{decodeFrames:i}=await import("modern-gif");return await A.fetch(t).then(s=>s.arrayBuffer()).then(s=>i(s)).then(s=>new or(s.map(n=>({duration:n.delay,texture:new Rs(n.data,n.width,n.height)}))))};return this.load=t=>A.loadBy(t,()=>e(t)),["image/gif"].forEach(t=>{A.register(t,e)}),A.gif=this,this}}class wl extends tA{install(A){const e=t=>A.fetch(t).then(i=>i.json());return this.load=t=>A.loadBy(t,()=>e(t)),["json"].forEach(t=>{A.register(t,e)}),A.json=this,this}}class _l extends tA{install(A){const e=async(t,i)=>(await import("lottie-web").then(n=>n.default)).loadAnimation({container:null,renderer:"canvas",rendererSettings:{context:i.getContext("2d")},loop:!1,autoplay:!1,animationData:await A.fetch(t).then(n=>n.json())});return this.load=(t,i)=>A.loadBy(t,()=>e(t,i)),["lottie"].forEach(t=>{A.register(t,e)}),A.lottie=this,this}}class vl extends tA{install(A){const e=async t=>await A.fetch(t).then(i=>i.text());return this.load=t=>A.loadBy(t,()=>e(t)),A.text=this,this}}class bl extends tA{install(A){const e=t=>A.fetchImageBitmap(t,{premultiplyAlpha:"premultiply"}).then(i=>new Ne(i));return this.load=t=>A.loadBy(t,()=>e(t)),["image/gif","image/jpeg","image/png","image/tiff","image/vnd.wap.wbmp","image/x-icon","image/x-jng","image/x-ms-bmp","image/svg+xml","image/webp"].forEach(t=>{A.register(t,e)}),A.texture=this,this}}class Dl extends tA{install(A){const e=t=>new ha(t).load();return this.load=t=>A.loadBy(t,()=>e(t)),["video/3gpp","video/mpeg","video/quicktime","video/x-flv","video/x-mng","video/x-ms-asf","video/x-ms-wmv","video/x-msvideo","video/mp4"].forEach(t=>{A.register(t,e)}),A.video=this,this}}const yI=Object.entries({"text/html":["html","htm","shtml"],"text/css":["css"],"text/xml":["xml"],"image/gif":["gif"],"image/jpeg":["jpeg","jpg"],"application/x-javascript":["js"],"application/atom+xml":["atom"],"application/rss+xml":["rss"],"text/mathml":["mml"],"text/plain":["txt"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/x-component":["htc"],"image/png":["png"],"image/tiff":["tif","tiff"],"image/vnd.wap.wbmp":["wbmp"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-ms-bmp":["bmp"],"image/svg+xml":["svg"],"image/webp":["webp"],"application/java-archive":["jar","war","ear"],"application/mac-binhex40":["hqx"],"application/msword":["doc"],"application/pdf":["pdf"],"application/postscript":["ps","eps","ai"],"application/rtf":["rtf"],"application/vnd.ms-excel":["xls"],"application/vnd.ms-powerpoint":["ppt"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/x-7z-compressed":["7z"],"application/x-cocoa":["cco"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-makeself":["run"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-sea":["sea"],"application/x-shockwave-flash":["swf"],"application/x-stuffit":["sit"],"application/x-tcl":["tcl","tk"],"application/x-x509-ca-cert":["der","pem","crt"],"application/x-xpinstall":["xpi"],"application/xhtml+xml":["xhtml"],"application/zip":["zip"],"application/octet-stream":["bin","exe","dll","deb","dmg","eot","iso","img","msi","msp","msm"],"audio/midi":["mid","midi","kar"],"audio/mpeg":["mp3"],"audio/ogg":["ogg"],"audio/x-realaudio":["ra"],"video/3gpp":["3gpp","3gp"],"video/mpeg":["mpeg","mpg"],"video/quicktime":["mov"],"video/x-flv":["flv"],"video/x-mng":["mng"],"video/x-ms-asf":["asx","asf"],"video/x-ms-wmv":["wmv"],"video/x-msvideo":["avi"],"video/mp4":["m4v","mp4"]});function mI(r){for(const[A,e]of yI)if(e.includes(r))return A}async function wI(r){var e,t;let A;if(r.startsWith("data:"))A=(e=r.match(/^data:(.+?);/))==null?void 0:e[1];else if(r.startsWith("http")){const i=(t=r.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim();i&&(A=mI(i))}return A??await fetch(r).then(i=>i.headers.get("Content-Type"))??""}const Nr="WeakRef"in globalThis;class xl{constructor(){g(this,"defaultHandler",A=>this.fetch(A));g(this,"_handlers",new Map);g(this,"_handleing",new Map);g(this,"_handled",new Map);g(this,"_gc",Nr?new FinalizationRegistry(A=>{const e=this.get(A);e&&"destroy"in e&&e.destroy(),this._handled.delete(A)}):void 0);Nr||Re.on(this.gc.bind(this),{sort:2})}use(A){return A.install(this),this}register(A,e){return this._handlers.set(A,e),this}fetch(A){return fetch(A)}_fixSVG(A){const e=new DOMParser().parseFromString(decodeURIComponent(A.split(",")[1]),"image/svg+xml").documentElement;return e.setAttribute("width","512"),e.setAttribute("height","512"),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.outerHTML)}`}async fetchImageBitmap(A,e){return A.startsWith("http")?await this.fetch(A).then(t=>t.blob()).then(t=>t.type==="image/svg+xml"?t.text().then(i=>this.fetchImageBitmap(this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),e)):createImageBitmap(t,e)):(A.startsWith("data:image/svg+xml;charset=utf-8,")&&(A=this._fixSVG(A)),new Promise(t=>{const i=new Image;i.src=A,i.onload=()=>{i.decode().finally(()=>{t(i)})}}).then(t=>createImageBitmap(t,e)))}get(A){let e=this._handled.get(A);return Nr&&e instanceof WeakRef&&(e=e.deref(),e||this._handleing.delete(A)),e}set(A,e){let t=e;Nr&&typeof e=="object"&&(this._gc.register(e,A),t=new WeakRef(e)),this._handled.set(A,t)}async loadBy(A,e){const t=this.get(A)??this._handleing.get(A);if(t)return t;const i=e().then(s=>(this.set(A,s),s)).finally(()=>{this._handleing.delete(A)});return this._handleing.set(A,i),i}async load(A,e){return this.loadBy(A,async()=>{const t=await wI(A);return(this._handlers.get(t)??this.defaultHandler)(A,e)})}async waitUntilLoad(){await Promise.all(Array.from(this._handleing.values()))}gc(){this._handled.forEach((A,e)=>{const t=this.get(e);t&&"destroy"in t&&t.destroy()}),this._handled.clear()}}const Ot=new xl().use(new So).use(new ml).use(new wl).use(new _l).use(new vl).use(new bl).use(new Dl);class _I extends f.Control{constructor(){super();g(this,"hover",new f.Node2D({name:"hover",internalMode:"back",style:{visibility:"hidden",outlineStyle:"solid",outlineColor:16711935,outlineWidth:2,pointerEvents:"none"}}));g(this,"selectionRect",new f.Node2D({name:"selectionRect",internalMode:"back",style:{visibility:"hidden",width:1,height:1,backgroundColor:16711695,outlineStyle:"solid",outlineColor:16711935,outlineWidth:2,pointerEvents:"none"}}));g(this,"selector",new f.Node2D({name:"selector"}));g(this,"scaler",new f.Scaler({internalMode:"back"}).on("updateScale",e=>{this.ruler.scale=e,this._updateScrollbars()}));g(this,"xScrollBar",new f.XScrollBar({internalMode:"back",style:{visibility:"hidden"}}));g(this,"yScrollBar",new f.YScrollBar({internalMode:"back",style:{visibility:"hidden"}}));g(this,"drawboard",new f.Node2D({name:"drawboard",style:{width:500,height:500,backgroundColor:4294967295,overflow:"hidden",pointerEvents:"none",boxShadow:"2px 2px 2px 1px rgba(0, 0, 0, 0.2)"}},[this.scaler]));g(this,"ruler",new f.Ruler({name:"ruler",offsetX:100,offsetY:100},[this.drawboard,this.hover,this.selectionRect,this.xScrollBar,this.yScrollBar]));g(this,"_pointerStart");g(this,"_pointerOffset");g(this,"selected");this._onPointerdown=this._onPointerdown.bind(this),this._onPointermove=this._onPointermove.bind(this),this._onPointerup=this._onPointerup.bind(this),this.append(this.ruler)}_updateStyleProperty(e,t,i,s){switch(super._updateStyleProperty(e,t,i,s),e){case"width":this.drawboard.style.left=(this.style.width-this.drawboard.style.width)/2,this.ruler.offsetX=this.drawboard.style.left;break;case"height":this.drawboard.style.top=(this.style.height-this.drawboard.style.height)/2,this.ruler.offsetY=this.drawboard.style.top;break}}_guiInput(e,t){switch(super._guiInput(e,t),t){case"pointerdown":this._onPointerdown(e);break;case"pointermove":this._onPointermove(e);break;case"pointerup":this._onPointerup();break}}_onPointerdown(e){const t=e.target;this._pointerOffset={x:e.offsetX,y:e.offsetY},t instanceof f.Node2D?(this.selected=t,this._pointerStart=t.style.clone()):(this.selected=void 0,this._pointerStart=void 0,this.selectionRect.style.visibility="visible",this.selectionRect.style.left=e.screen.x,this.selectionRect.style.top=e.screen.y,this.selectionRect.style.width=1,this.selectionRect.style.height=1),this._onHover()}_onPointermove(e){const{selected:t,_pointerStart:i,_pointerOffset:s}=this,n=s?{x:e.offsetX-s.x,y:e.offsetY-s.y}:{x:0,y:0};t&&i?(t.style.left=i.left+n.x,t.style.top=i.top+n.y):this.selectionRect.isVisibleInTree()&&(this.selectionRect.style.width=n.x,this.selectionRect.style.height=n.y),this._onHover()}_onPointerup(){this.selected=void 0,this.selectionRect.style.visibility="hidden",this._onHover()}_onHover(){const e=this.selected;e instanceof f.Node2D?(this.hover.style.visibility="visible",this.hover.style.width=e.style.width,this.hover.style.height=e.style.height,this.hover.transform.set(e.transform),this.hover.requestRedraw()):this.hover.style.visibility="hidden"}_updateScrollbars(){const e=this.ruler.scale,t=this.drawboard.style.height*e,i=this.drawboard.style.width*e;t>this.style.height?(this.yScrollBar.style.visibility="visible",this.yScrollBar.maxValue=t,this.yScrollBar.page=this.style.height):this.yScrollBar.style.visibility="hidden",i>this.style.width?(this.xScrollBar.style.visibility="visible",this.xScrollBar.maxValue=i,this.xScrollBar.page=this.style.width):this.xScrollBar.style.visibility="hidden"}}const Sl={alpha:!0,stencil:!0,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"};class Ml extends nr{constructor(e={}){var u,d;const{view:t,width:i,height:s,pixelRatio:n=ss,backgroundColor:o=0,autoResize:a,autoStart:l,timeline:h,...c}=e;super(h);g(this,"input",new eo);g(this,"renderer");g(this,"_resizeObserver",Gn?new ResizeObserver(e=>{const t=e[0];if(t.target===this.view){const{inlineSize:i,blockSize:s}=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize;this.resize(i,s)}}):void 0);this.renderer=new xo(t,{...Sl,...c}),this._setupInput(),this.pixelRatio=n,this.backgroundColor=o,a?(!t&&this.renderer.view&&(this.renderer.view.style.width="100%",this.renderer.view.style.height="100%"),this.enableAutoResize(a)):this.resize(i||this.gl.drawingBufferWidth||((u=this.view)==null?void 0:u.clientWidth)||200,s||this.gl.drawingBufferHeight||((d=this.view)==null?void 0:d.clientHeight)||200,!t),l&&this.start()}get view(){return this.renderer.view}get gl(){return this.renderer.gl}get screen(){return this.renderer.screen}get width(){return this.screen.width}get height(){return this.screen.height}get pixelRatio(){return this.renderer.pixelRatio}set pixelRatio(e){this.renderer.pixelRatio=e,this.resize(this.width,this.height),this.view&&(this.view.dataset.pixelRatio=String(e))}_setupInput(){return this.view&&(this.input.setTarget(this.view),["pointerdown","pointerover","pointermove","pointerup","wheel"].forEach(e=>{this.input.on(e,t=>{this.root.input(t,e),this.emit(e,t)})})),this}enableAutoResize(e=!0){var t,i;return this.view&&(e?(t=this._resizeObserver)==null||t.observe(this.view):(i=this._resizeObserver)==null||i.unobserve(this.view)),this}resize(e,t,i=!1){return this.renderer.resize(e,t,i),this.root.width=e,this.root.height=t,this.renderer.program.uniforms.projectionMatrix=this.root.toProjectionArray(!0),this}nextTick(){return os()}waitUntilLoad(){return Ot.waitUntilLoad()}render(e=0){return this._render(this.renderer,e)}start(){return this.render(),super.start(e=>{this.render(e)})}destroy(){this.stop(),this.root.getChildren(!0).forEach(e=>this.root.removeChild(e)),this.input.removeEventListeners(),this.enableAutoResize(!1),this.renderer.destroy()}toPixels(){return this.render(),this.renderer.toPixels()}toImageData(){return new ImageData(this.toPixels(),this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}toCanvas2D(){var s,n;const e=this.toImageData(),t=document.createElement("canvas");t.width=e.width,t.height=e.height,(s=t.getContext("2d"))==null||s.putImageData(e,0,0);const i=document.createElement("canvas");return i.width=this.width,i.height=this.height,(n=i.getContext("2d"))==null||n.drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),i}}let Li,vI;const Rl=[];async function bI(r=100){for(;;){const A=Rl.shift();if(A)try{await A()}catch(e){console.error(e)}else await new Promise(e=>setTimeout(e,r))}}async function DI(r){Li??(Li=new Ml({width:1,height:1}));const A=Li.root;A.removeChildren();const{data:e,width:t,height:i}=r;return Li.resize(t,i),(Array.isArray(e)?e:[e]).forEach(s=>{s instanceof f.Node?A.appendChild(s):A.appendChild(f.Node.parse(s))}),await Li.waitUntilLoad(),Li.toCanvas2D()}async function xI(r){return vI??(vI=bI()),new Promise(A=>{Rl.push(async()=>A(await DI(r)))})}f.Assets=xl,f.AudioPipeline=Cn,f.AudioProcessor=Id,f.AudioSpectrum=md,f.CanvasContext=Ps,f.CanvasItemEditor=_I,f.CanvasItemStyle=ve,f.CanvasTexture=Ii,f.Color=Rt,f.ColorMatrix=qi,f.ColorTexture=Ms,f.CoreObject=Wi,f.DEG_TO_RAD=fs,f.DEVICE_PIXEL_RATIO=ss,f.EffectMaterial=rr,f.ElementStyle=q,f.Engine=Ml,f.EventEmitter=Yt,f.FontLoader=So,f.Geometry=ir,f.GifLoader=ml,f.HTMLAudio=ll,f.HTMLAudioContext=Sr,f.HTMLSound=Mr,f.IN_BROWSER=oi,f.Image2DResource=or,f.ImageTexture=jg,f.IndexBuffer=TA,f.Input=eo,f.InputEvent=Vi,f.JsonLoader=wl,f.Loader=tA,f.LottieLoader=_l,f.MainLoop=ji,f.Material=we,f.Matrix=Ut,f.Matrix2=Ih,f.Matrix3=ds,f.Matrix4=go,f.MouseInputEvent=as,f.PI=Jt,f.PI_2=Ce,f.PixelsTexture=Rs,f.PointerInputEvent=$n,f.Projection2D=uo,f.QuadGeometry=Tg,f.QuadUvGeometry=Ie,f.RAD_TO_DEG=fh,f.RawWeakMap=RA,f.Rect2=hi,f.RefCounted=Zn,f.Renderer=Io,f.Resource=St,f.SUPPORTS_AUDIO_CONTEXT=As,f.SUPPORTS_CLICK_EVENTS=Hn,f.SUPPORTS_CREATE_IMAGE_BITMAP=ts,f.SUPPORTS_IMAGE_BITMAP=Ln,f.SUPPORTS_MOUSE_EVENTS=eh,f.SUPPORTS_OFFLINE_AUDIO_CONTEXT=rs,f.SUPPORTS_POINTER_EVENTS=MA,f.SUPPORTS_RESIZE_OBSERVER=Gn,f.SUPPORTS_TOUCH_EVENTS=Kt,f.SUPPORTS_WEBGL2=Tn,f.SUPPORTS_WEBKIT_AUDIO_CONTEXT=is,f.SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT=Jn,f.SUPPORTS_WEB_AUDIO=Kn,f.SUPPORTS_WHEEL_EVENTS=On,f.SceneTree=nr,f.TextLoader=vl,f.Texture2D=Ne,f.TextureLoader=bl,f.TextureRect2D=lr,f.Ticker=Re,f.Transform2D=Ze,f.UvGeometry=Hg,f.UvMaterial=LA,f.Vector=wt,f.Vector2=zi,f.Vector3=Bh,f.Vector4=co,f.VertexAttribute=ft,f.VertexBuffer=Vt,f.VideoLoader=Dl,f.VideoTexture=ha,f.ViewportTexture=ks,f.WebAudio=gl,f.WebAudioContext=lA,f.WebGLBatch2DModule=po,f.WebGLBlendMode=UA,f.WebGLBufferModule=Co,f.WebGLFramebufferModule=Qo,f.WebGLMaskModule=yo,f.WebGLModule=Ct,f.WebGLProgramModule=mo,f.WebGLRenderer=xo,f.WebGLScissorModule=wo,f.WebGLState=EA,f.WebGLStateModule=Eo,f.WebGLStencilModule=_o,f.WebGLTextureModule=vo,f.WebGLVertexArrayModule=bo,f.WebGLViewportModule=Do,f.WebSound=hl,f.WheelInputEvent=ai,f.assets=Ot,f.clamp=_t,f.createHTMLCanvas=Xn,f.createNode=Ah,f.crossOrigin=zn,f.cubicBezier=zA,f.curves=dh,f.customNode=ae,f.customNodes=Yi,f.defaultOptions=Sl,f.defineProperty=BA,f.determineCrossOrigin=qn,f.ease=sl,f.easeIn=nl,f.easeInOut=al,f.easeOut=ol,f.getDeclarations=Ki,f.getDefaultCssPropertyValue=es,f.isCanvasElement=Wn,f.isElementNode=ns,f.isImageElement=th,f.isPow2=$r,f.isVideoElement=Yn,f.isWebgl2=Vn,f.lerp=Ue,f.linear=rl,f.log2=Bs,f.mapWebGLBlendModes=Bo,f.nextPow2=Is,f.nextTick=os,f.parseCssFunctions=IA,f.parseCssProperty=ni,f.property=_,f.protectedProperty=Me,f.render=xI,f.timingFunctions=xr,f.uid=Nn,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});