reacthub-pixitweenjs 0.3.2-alpha.0 → 0.3.2
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/hocs/AbstractContainer.d.ts +9 -0
- package/dist/index.es.js +1213 -1203
- package/dist/index.umd.js +36 -36
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(_,Ir){typeof exports=="object"&&typeof module<"u"?Ir(exports,require("pixi.js/gif"),require("@pixi/react"),require("pixi.js"),require("react"),require("gsap"),require("gsap/CustomEase"),require("gsap/PixiPlugin"),require("pixi-filters"),require("audiomotion-analyzer"),require("@react-three/fiber"),require("three"),require("three/examples/jsm/loaders/GLTFLoader.js"),require("gl-transitions"),require("lottie-web"),require("three/examples/jsm/environments/RoomEnvironment.js"),require("@react-three/postprocessing"),require("@react-three/drei")):typeof define=="function"&&define.amd?define(["exports","pixi.js/gif","@pixi/react","pixi.js","react","gsap","gsap/CustomEase","gsap/PixiPlugin","pixi-filters","audiomotion-analyzer","@react-three/fiber","three","three/examples/jsm/loaders/GLTFLoader.js","gl-transitions","lottie-web","three/examples/jsm/environments/RoomEnvironment.js","@react-three/postprocessing","@react-three/drei"],Ir):(_=typeof globalThis<"u"?globalThis:_||self,Ir(_["reacthub-pixitweenjs"]={},_.PIXI.gif,_.PIXIReact,_.PIXI,_.React,_.gsap,_.CustomEase,_.PixiPlugin,_.PIXI.filters,_.AudioMotionAnalyzer,_.ReactThreeFiber,_.THREE,_.GLTFLoader,_.glTransitions,_.lottie,_.RoomEnvironment,_.ReactThreePostprocessing,_.Drei))})(this,(function(_,Ir,at,B,S,E,wn,Kn,Zn,eE,is,qd,Vd,os,tE,nE,$n,Kd){"use strict";function Mi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const W=Mi(B),I=Mi(S),
|
|
1
|
+
(function(_,Ir){typeof exports=="object"&&typeof module<"u"?Ir(exports,require("pixi.js/gif"),require("@pixi/react"),require("pixi.js"),require("react"),require("gsap"),require("gsap/CustomEase"),require("gsap/PixiPlugin"),require("pixi-filters"),require("audiomotion-analyzer"),require("@react-three/fiber"),require("three"),require("three/examples/jsm/loaders/GLTFLoader.js"),require("gl-transitions"),require("lottie-web"),require("three/examples/jsm/environments/RoomEnvironment.js"),require("@react-three/postprocessing"),require("@react-three/drei")):typeof define=="function"&&define.amd?define(["exports","pixi.js/gif","@pixi/react","pixi.js","react","gsap","gsap/CustomEase","gsap/PixiPlugin","pixi-filters","audiomotion-analyzer","@react-three/fiber","three","three/examples/jsm/loaders/GLTFLoader.js","gl-transitions","lottie-web","three/examples/jsm/environments/RoomEnvironment.js","@react-three/postprocessing","@react-three/drei"],Ir):(_=typeof globalThis<"u"?globalThis:_||self,Ir(_["reacthub-pixitweenjs"]={},_.PIXI.gif,_.PIXIReact,_.PIXI,_.React,_.gsap,_.CustomEase,_.PixiPlugin,_.PIXI.filters,_.AudioMotionAnalyzer,_.ReactThreeFiber,_.THREE,_.GLTFLoader,_.glTransitions,_.lottie,_.RoomEnvironment,_.ReactThreePostprocessing,_.Drei))})(this,(function(_,Ir,at,B,S,E,wn,Kn,Zn,eE,is,qd,Vd,os,tE,nE,$n,Kd){"use strict";function Mi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const W=Mi(B),I=Mi(S),ne=Mi(Zn),V=Mi(qd);var He=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGLLoader="webgl-loader",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.WebGPULoader="webgpu-loader",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.CanvasLoader="canvas-loader",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.TextureUploaderWebGL="texture-uploader-webgl",t.TextureUploaderWebGPU="texture-uploader-webgpu",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(He||{});const ss=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Li=(t,e)=>ss(t).priority??e,rE={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(ss).forEach(e=>{e.type.forEach(n=>this._removeHandlers[n]?.(e))}),this},add(...t){return t.map(ss).forEach(e=>{e.type.forEach(n=>{const r=this._addHandlers,i=this._queue;r[n]?r[n]?.(e):(i[n]=i[n]||[],i[n]?.push(e))})}),this},handle(t,e,n){const r=this._addHandlers,i=this._removeHandlers;if(r[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);r[t]=e,i[t]=n;const o=this._queue;return o[t]&&(o[t]?.forEach(s=>e(s)),delete o[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,r=>{e.findIndex(o=>o.name===r.name)>=0||(e.push({name:r.name,value:r.ref}),e.sort((o,s)=>Li(s.value,n)-Li(o.value,n)))},r=>{const i=e.findIndex(o=>o.name===r.name);i!==-1&&e.splice(i,1)})},handleByList(t,e,n=-1){return this.handle(t,r=>{e.includes(r.ref)||(e.push(r.ref),e.sort((i,o)=>Li(o,n)-Li(i,n)))},r=>{const i=e.indexOf(r.ref);i!==-1&&e.splice(i,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},as=Object.create(null),Zd=Object.create(null);function Pi(t,e){let n=Zd[t];return n===void 0&&(as[e]===void 0&&(as[e]=1),Zd[t]=n=as[e]++),n}let $d={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};const iE={get(){return $d},set(t){$d=t}};let Ni;function oE(){return(!Ni||Ni?.isContextLost())&&(Ni=iE.get().createCanvas().getContext("webgl",{})),Ni}let ki;function sE(){if(!ki){ki="mediump";const t=oE();t&&t.getShaderPrecisionFormat&&(ki=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return ki}function aE(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
|
|
2
2
|
|
|
3
3
|
#ifdef GL_ES // This checks if it is WebGL1
|
|
4
4
|
#define in varying
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
${t}`}else r!=="highp"&&t.substring(0,15)==="precision highp"&&(t=t.replace("precision highp","precision mediump"));const i=e.maxSupportedFragmentPrecision==="highp"?"highp":"mediump";return dE(t,i)}function dE(t,e){const n=new Set;let r="";for(const[,i]of t.matchAll(lE))n.add(i);for(const[,i]of t.matchAll(cE))n.has(i)||(n.add(i),r+=`precision ${uE[i]??e} ${i};
|
|
18
18
|
`);return r+t}function hE(t,e){return e?`#version 300 es
|
|
19
19
|
${t}`:t}const pE={},mE={};function gE(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const r=n?pE:mE;return r[e]?(r[e]++,e+=`-${r[e]}`):r[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
|
|
20
|
-
${t}`}function yE(t,e){return e?t.replace("#version 300 es",""):t}const cs={stripVersion:yE,ensurePrecision:fE,addProgramDefines:aE,setProgramName:gE,insertVersion:hE},Mr=Object.create(null),Jd=class Wd{constructor(e){e={...Wd.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:sE()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let i=e.fragment,o=e.vertex;Object.keys(cs).forEach(s=>{const a=r[s];i=cs[s](i,a,!0),o=cs[s](o,a,!1)}),this.fragment=i,this.vertex=o,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Pi(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Mr[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Mr[n]||(Mr[n]=new Wd(e),Mr[n]._cacheKey=n),Mr[n]}};Jd.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let ls=Jd;const Qd={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function _E(t){return Qd[t]??Qd.float32}const bE={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},eh=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function th(t,e){let n;for(;(n=eh.exec(t))!==null;){const r=bE[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:r,stride:_E(r).stride,offset:0,instance:!1,start:0}}eh.lastIndex=0}function xE(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function vE({source:t,entryPoint:e}){const n={},r=xE(t),i=r.indexOf(`fn ${e}(`);if(i===-1)return n;const o=r.indexOf("->",i);if(o===-1)return n;const s=r.substring(i,o);if(th(s,n),Object.keys(n).length===0){const a=s.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const l=a[1],c=new RegExp(`struct\\s+${l}\\s*\\{([^}]+)\\}`,"s"),u=r.match(c);u&&th(u[1],n)}}return n}function us(t){const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,o=/:\s*([\w<>]+)/,s=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,c=t.match(e)?.map(f=>{const d=f.match(i),h=d?.[1]??"";let p;return h==="<uniform>"?p="uniform":h.startsWith("<storage")&&(p="storage"),{group:parseInt(f.match(n)[1],10),binding:parseInt(f.match(r)[1],10),name:d[2],accessMode:p,type:f.match(o)[1]}});if(!c)return{groups:[],structs:[]};const u=t.match(s)?.map(f=>{const d=f.match(l)[1],h=f.match(a).reduce((p,m)=>{const[g,y]=m.split(":");return p[g.trim()]=y.trim(),p},{});return h?{name:d,members:h}:null}).filter(({name:f})=>c.some(d=>d.type===f||d.type.includes(`<${f}>`)))??[];return{groups:c,structs:u}}var Ke=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Ke||{});function Di(t){return t.endsWith("<u32>")?"uint":t.endsWith("<i32>")?"sint":"float"}function TE({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]=[]),r.accessMode==="uniform"?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,buffer:{type:"uniform"}}):r.accessMode==="storage"?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,buffer:{type:"read-only-storage"}}):r.type==="sampler"?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,sampler:{type:"filtering"}}):r.type==="sampler_comparison"?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,sampler:{type:"comparison"}}):r.type==="texture_2d"||r.type.startsWith("texture_2d<")?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d"?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d_array"?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_2d_array"||r.type.startsWith("texture_2d_array<")?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_3d"||r.type.startsWith("texture_3d<")?e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"3d",multisampled:!1}}):(r.type==="texture_cube"||r.type.startsWith("texture_cube<"))&&e[r.group].push({binding:r.binding,visibility:Ke.VERTEX|Ke.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function EE({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]={}),e[r.group][r.name]=r.binding}return e}function SE(t,e){const n=new Set,r=new Set,i=[...t.structs,...e.structs].filter(s=>n.has(s.name)?!1:(n.add(s.name),!0)),o=[...t.groups,...e.groups].filter(s=>{const a=`${s.name}-${s.binding}`;return r.has(a)?!1:(r.add(a),!0)});return{structs:i,groups:o}}const Lr=Object.create(null);class Pr{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:r,layout:i,gpuLayout:o,name:s}=e;if(this.name=s,this.fragment=n,this.vertex=r,n.source===r.source){const a=us(n.source);this.structsAndGroups=a}else{const a=us(r.source),l=us(n.source);this.structsAndGroups=SE(a,l)}this.layout=i??EE(this.structsAndGroups),this.gpuLayout=o??TE(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,r=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=Pi(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=vE(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Lr[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Lr[n]||(Lr[n]=new Pr(e),Lr[n]._cacheKey=n),Lr[n]}}var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fs={exports:{}},nh;function wE(){return nh||(nh=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},a.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(c,u,f,d,h,p){var m=n?n+c:c;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,b,x;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];g.fn.apply(g.context,b)}else{var v=g.length,T;for(x=0;x<v;x++)switch(g[x].once&&this.removeListener(c,g[x].fn,void 0,!0),y){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!b)for(T=1,b=new Array(y-1);T<y;T++)b[T-1]=arguments[T];g[x].fn.apply(g[x].context,b)}}return!0},a.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},a.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},a.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&s(this,h);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==u||d&&!p[m].once||f&&p[m].context!==f)&&g.push(p[m]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(fs)),fs.exports}var AE=wE();const Nr=Jn(AE),ds={default:-1};function Nt(t="default"){return ds[t]===void 0&&(ds[t]=-1),++ds[t]}const rh=["f32","i32","u32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>","vec2<u32>","vec3<u32>","vec4<u32>"],OE=rh.reduce((t,e)=>(t[e]=!0,t),{});function CE(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const ih=class ZT extends Nr{constructor(e,n){super(),this.uid=Nt("uniform"),this._resourceType="uniformGroup",this._resourceId=Nt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...ZT.defaultOptions,...n},this.uniformStructures=e;const r={};for(const i in e){const o=e[i];if(o.name=i,o.size=o.size??1,!OE[o.type]){const s=o.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(s){const[,a,l]=s;throw new Error(`Uniform type ${o.type} is not supported. Use type: '${a}', size: ${l} instead.`)}throw new Error(`Uniform type ${o.type} is not supported. Supported uniform types are: ${rh.join(", ")}`)}o.value??(o.value=CE(o.type,o.size)),r[i]=o.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Pi(Object.keys(r).map(i=>`${i}-${e[i].type}`).join("-"),"uniform-group")}get buffer(){return this._buffer}set buffer(e){this._buffer!==e&&(this._buffer?.off("change",this.onBufferChange,this),this._buffer=e,e?.on("change",this.onBufferChange,this))}get _gcLastUsed(){return this._buffer?._gcLastUsed??-1}set _gcLastUsed(e){this._buffer&&(this._buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=Nt("resource"),this.emit("change",this)}update(){this._dirtyId++}};ih.defaultOptions={ubo:!1,isStatic:!1};let oh=ih;const RE=Math.PI*2;class qt{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new qt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return hs.x=0,hs.y=0,hs}}const hs=new qt;class An{constructor(e=1,n=0,r=0,i=1,o=0,s=0){this.array=null,this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,r,i,o,s){return this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const r=n||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(e,n){n=n||new qt;const r=e.x,i=e.y;return n.x=this.a*r+this.c*i+this.tx,n.y=this.b*r+this.d*i+this.ty,n}applyInverse(e,n){n=n||new qt;const r=this.a,i=this.b,o=this.c,s=this.d,a=this.tx,l=this.ty,c=1/(r*s+o*-i),u=e.x,f=e.y;return n.x=s*c*u+-o*c*f+(l*o-a*s)*c,n.y=r*c*f+-i*c*u+(-l*r+a*i)*c,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.a,o=this.c,s=this.tx;return this.a=i*n-this.b*r,this.b=i*r+this.b*n,this.c=o*n-this.d*r,this.d=o*r+this.d*n,this.tx=s*n-this.ty*r,this.ty=s*r+this.ty*n,this}append(e){const n=this.a,r=this.b,i=this.c,o=this.d;return this.a=e.a*n+e.b*i,this.b=e.a*r+e.b*o,this.c=e.c*n+e.d*i,this.d=e.c*r+e.d*o,this.tx=e.tx*n+e.ty*i+this.tx,this.ty=e.tx*r+e.ty*o+this.ty,this}appendFrom(e,n){const r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,c=n.a,u=n.b,f=n.c,d=n.d;return this.a=r*c+i*f,this.b=r*u+i*d,this.c=o*c+s*f,this.d=o*u+s*d,this.tx=a*c+l*f+n.tx,this.ty=a*u+l*d+n.ty,this}setTransform(e,n,r,i,o,s,a,l,c){return this.a=Math.cos(a+c)*o,this.b=Math.sin(a+c)*o,this.c=-Math.sin(a-l)*s,this.d=Math.cos(a-l)*s,this.tx=e-(r*this.a+i*this.c),this.ty=n-(r*this.b+i*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const r=this.a,i=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,r=this.b,i=this.c,o=this.d,s=e.pivot,a=-Math.atan2(-i,o),l=Math.atan2(r,n),c=Math.abs(a+l);let u=Math.sqrt(n*n+r*r);return c<1e-5||Math.abs(RE-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):Math.abs(Math.PI-c)<1e-5?(e.rotation=l-Math.PI,e.skew.x=e.skew.y=0,u=-u):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=u,e.scale.y=Math.sqrt(i*i+o*o),e.position.x=this.tx+(s.x*n+s.y*i),e.position.y=this.ty+(s.x*r+s.y*o),e}invert(){const e=this.a,n=this.b,r=this.c,i=this.d,o=this.tx,s=e*i-n*r;return this.a=i/s,this.b=-n/s,this.c=-r/s,this.d=e/s,this.tx=(r*this.ty-i*o)/s,this.ty=-(e*this.ty-n*o)/s,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new An;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return ME.identity()}static get shared(){return IE.identity()}}const IE=new An,ME=new An,On=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Cn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Rn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],In=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ps=[],sh=[],Bi=Math.sign;function LE(){for(let t=0;t<16;t++){const e=[];ps.push(e);for(let n=0;n<16;n++){const r=Bi(On[t]*On[n]+Rn[t]*Cn[n]),i=Bi(Cn[t]*On[n]+In[t]*Cn[n]),o=Bi(On[t]*Rn[n]+Rn[t]*In[n]),s=Bi(Cn[t]*Rn[n]+In[t]*In[n]);for(let a=0;a<16;a++)if(On[a]===r&&Cn[a]===i&&Rn[a]===o&&In[a]===s){e.push(a);break}}}for(let t=0;t<16;t++){const e=new An;e.set(On[t],Cn[t],Rn[t],In[t],0,0),sh.push(e)}}LE();const Ne={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>On[t],uY:t=>Cn[t],vX:t=>Rn[t],vY:t=>In[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>ps[t][e],sub:(t,e)=>ps[t][Ne.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?Ne.S:Ne.N:Math.abs(e)*2<=Math.abs(t)?t>0?Ne.E:Ne.W:e>0?t>0?Ne.SE:Ne.SW:t>0?Ne.NE:Ne.NW,matrixAppendRotationInv:(t,e,n=0,r=0,i=0,o=0)=>{const s=sh[Ne.inv(e)],a=s.a,l=s.b,c=s.c,u=s.d,f=n-Math.min(0,a*i,c*o,a*i+c*o),d=r-Math.min(0,l*i,u*o,l*i+u*o),h=t.a,p=t.b,m=t.c,g=t.d;t.a=a*h+l*m,t.b=a*p+l*g,t.c=c*h+u*m,t.d=c*p+u*g,t.tx=f*h+d*m+t.tx,t.ty=f*p+d*g+t.ty},transformRectCoords:(t,e,n,r)=>{const{x:i,y:o,width:s,height:a}=t,{x:l,y:c,width:u,height:f}=e;return n===Ne.E?(r.set(i+l,o+c,s,a),r):n===Ne.S?r.set(u-o-a+l,i+c,a,s):n===Ne.W?r.set(u-i-s+l,f-o-a+c,s,a):n===Ne.N?r.set(o+l,f-i-s+c,a,s):r.set(i+l,o+c,s,a)}},Ui=[new qt,new qt,new qt,new qt];class kr{constructor(e=0,n=0,r=0,i=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(r),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new kr(0,0,0,0)}clone(){return new kr(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,r,i=.5){const{width:o,height:s}=this;if(o<=0||s<=0)return!1;const a=this.x,l=this.y,c=r*(1-i),u=r-c,f=a-c,d=a+o+c,h=l-c,p=l+s+c,m=a+u,g=a+o-u,y=l+u,b=l+s-u;return e>=f&&e<=d&&n>=h&&n<=p&&!(e>m&&e<g&&n>y&&n<b)}intersects(e,n){if(!n){const C=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=C)return!1;const P=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>P}const r=this.left,i=this.right,o=this.top,s=this.bottom;if(i<=r||s<=o)return!1;const a=Ui[0].set(e.left,e.top),l=Ui[1].set(e.left,e.bottom),c=Ui[2].set(e.right,e.top),u=Ui[3].set(e.right,e.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const f=Math.sign(n.a*n.d-n.b*n.c);if(f===0||(n.apply(a,a),n.apply(l,l),n.apply(c,c),n.apply(u,u),Math.max(a.x,l.x,c.x,u.x)<=r||Math.min(a.x,l.x,c.x,u.x)>=i||Math.max(a.y,l.y,c.y,u.y)<=o||Math.min(a.y,l.y,c.y,u.y)>=s))return!1;const d=f*(l.y-a.y),h=f*(a.x-l.x),p=d*r+h*o,m=d*i+h*o,g=d*r+h*s,y=d*i+h*s;if(Math.max(p,m,g,y)<=d*a.x+h*a.y||Math.min(p,m,g,y)>=d*u.x+h*u.y)return!1;const b=f*(a.y-c.y),x=f*(c.x-a.x),v=b*r+x*o,T=b*i+x*o,w=b*r+x*s,O=b*i+x*s;return!(Math.max(v,T,w,O)<=b*a.x+x*a.y||Math.min(v,T,w,O)>=b*u.x+x*u.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}getBounds(e){return e||(e=new kr),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,r=e.y,i=e.x+e.width,o=e.y+e.height;return n>=this.x&&n<this.x+this.width&&r>=this.y&&r<this.y+this.height&&i>=this.x&&i<=this.x+this.width&&o>=this.y&&o<=this.y+this.height}set(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ah=new Set,ch="8.0.0",PE="8.22.0",Qn={quiet:!1,noColor:!1},Gi=((t,e,n=3)=>{if(Qn.quiet||ah.has(e))return;let r=new Error().stack;const i=`${e}
|
|
20
|
+
${t}`}function yE(t,e){return e?t.replace("#version 300 es",""):t}const cs={stripVersion:yE,ensurePrecision:fE,addProgramDefines:aE,setProgramName:gE,insertVersion:hE},Mr=Object.create(null),Jd=class Wd{constructor(e){e={...Wd.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:sE()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let i=e.fragment,o=e.vertex;Object.keys(cs).forEach(s=>{const a=r[s];i=cs[s](i,a,!0),o=cs[s](o,a,!1)}),this.fragment=i,this.vertex=o,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Pi(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Mr[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Mr[n]||(Mr[n]=new Wd(e),Mr[n]._cacheKey=n),Mr[n]}};Jd.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let ls=Jd;const Qd={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function _E(t){return Qd[t]??Qd.float32}const bE={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},eh=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function th(t,e){let n;for(;(n=eh.exec(t))!==null;){const r=bE[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:r,stride:_E(r).stride,offset:0,instance:!1,start:0}}eh.lastIndex=0}function xE(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function vE({source:t,entryPoint:e}){const n={},r=xE(t),i=r.indexOf(`fn ${e}(`);if(i===-1)return n;const o=r.indexOf("->",i);if(o===-1)return n;const s=r.substring(i,o);if(th(s,n),Object.keys(n).length===0){const a=s.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const l=a[1],c=new RegExp(`struct\\s+${l}\\s*\\{([^}]+)\\}`,"s"),u=r.match(c);u&&th(u[1],n)}}return n}function us(t){const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,o=/:\s*([\w<>]+)/,s=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,c=t.match(e)?.map(f=>{const d=f.match(i),h=d?.[1]??"";let p;return h==="<uniform>"?p="uniform":h.startsWith("<storage")&&(p="storage"),{group:parseInt(f.match(n)[1],10),binding:parseInt(f.match(r)[1],10),name:d[2],accessMode:p,type:f.match(o)[1]}});if(!c)return{groups:[],structs:[]};const u=t.match(s)?.map(f=>{const d=f.match(l)[1],h=f.match(a).reduce((p,m)=>{const[g,y]=m.split(":");return p[g.trim()]=y.trim(),p},{});return h?{name:d,members:h}:null}).filter(({name:f})=>c.some(d=>d.type===f||d.type.includes(`<${f}>`)))??[];return{groups:c,structs:u}}var Ve=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Ve||{});function Di(t){return t.endsWith("<u32>")?"uint":t.endsWith("<i32>")?"sint":"float"}function TE({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]=[]),r.accessMode==="uniform"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,buffer:{type:"uniform"}}):r.accessMode==="storage"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,buffer:{type:"read-only-storage"}}):r.type==="sampler"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,sampler:{type:"filtering"}}):r.type==="sampler_comparison"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,sampler:{type:"comparison"}}):r.type==="texture_2d"||r.type.startsWith("texture_2d<")?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d_array"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_2d_array"||r.type.startsWith("texture_2d_array<")?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_3d"||r.type.startsWith("texture_3d<")?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"3d",multisampled:!1}}):(r.type==="texture_cube"||r.type.startsWith("texture_cube<"))&&e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function EE({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]={}),e[r.group][r.name]=r.binding}return e}function SE(t,e){const n=new Set,r=new Set,i=[...t.structs,...e.structs].filter(s=>n.has(s.name)?!1:(n.add(s.name),!0)),o=[...t.groups,...e.groups].filter(s=>{const a=`${s.name}-${s.binding}`;return r.has(a)?!1:(r.add(a),!0)});return{structs:i,groups:o}}const Lr=Object.create(null);class Pr{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:r,layout:i,gpuLayout:o,name:s}=e;if(this.name=s,this.fragment=n,this.vertex=r,n.source===r.source){const a=us(n.source);this.structsAndGroups=a}else{const a=us(r.source),l=us(n.source);this.structsAndGroups=SE(a,l)}this.layout=i??EE(this.structsAndGroups),this.gpuLayout=o??TE(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,r=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=Pi(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=vE(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Lr[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Lr[n]||(Lr[n]=new Pr(e),Lr[n]._cacheKey=n),Lr[n]}}var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fs={exports:{}},nh;function wE(){return nh||(nh=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},a.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(c,u,f,d,h,p){var m=n?n+c:c;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,b,x;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];g.fn.apply(g.context,b)}else{var v=g.length,T;for(x=0;x<v;x++)switch(g[x].once&&this.removeListener(c,g[x].fn,void 0,!0),y){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!b)for(T=1,b=new Array(y-1);T<y;T++)b[T-1]=arguments[T];g[x].fn.apply(g[x].context,b)}}return!0},a.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},a.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},a.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&s(this,h);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==u||d&&!p[m].once||f&&p[m].context!==f)&&g.push(p[m]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(fs)),fs.exports}var AE=wE();const Nr=Jn(AE),ds={default:-1};function Pt(t="default"){return ds[t]===void 0&&(ds[t]=-1),++ds[t]}const rh=["f32","i32","u32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>","vec2<u32>","vec3<u32>","vec4<u32>"],OE=rh.reduce((t,e)=>(t[e]=!0,t),{});function CE(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const ih=class ZT extends Nr{constructor(e,n){super(),this.uid=Pt("uniform"),this._resourceType="uniformGroup",this._resourceId=Pt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...ZT.defaultOptions,...n},this.uniformStructures=e;const r={};for(const i in e){const o=e[i];if(o.name=i,o.size=o.size??1,!OE[o.type]){const s=o.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(s){const[,a,l]=s;throw new Error(`Uniform type ${o.type} is not supported. Use type: '${a}', size: ${l} instead.`)}throw new Error(`Uniform type ${o.type} is not supported. Supported uniform types are: ${rh.join(", ")}`)}o.value??(o.value=CE(o.type,o.size)),r[i]=o.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Pi(Object.keys(r).map(i=>`${i}-${e[i].type}`).join("-"),"uniform-group")}get buffer(){return this._buffer}set buffer(e){this._buffer!==e&&(this._buffer?.off("change",this.onBufferChange,this),this._buffer=e,e?.on("change",this.onBufferChange,this))}get _gcLastUsed(){return this._buffer?._gcLastUsed??-1}set _gcLastUsed(e){this._buffer&&(this._buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=Pt("resource"),this.emit("change",this)}update(){this._dirtyId++}};ih.defaultOptions={ubo:!1,isStatic:!1};let oh=ih;const RE=Math.PI*2;class qt{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new qt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return hs.x=0,hs.y=0,hs}}const hs=new qt;class An{constructor(e=1,n=0,r=0,i=1,o=0,s=0){this.array=null,this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,r,i,o,s){return this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const r=n||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(e,n){n=n||new qt;const r=e.x,i=e.y;return n.x=this.a*r+this.c*i+this.tx,n.y=this.b*r+this.d*i+this.ty,n}applyInverse(e,n){n=n||new qt;const r=this.a,i=this.b,o=this.c,s=this.d,a=this.tx,l=this.ty,c=1/(r*s+o*-i),u=e.x,f=e.y;return n.x=s*c*u+-o*c*f+(l*o-a*s)*c,n.y=r*c*f+-i*c*u+(-l*r+a*i)*c,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.a,o=this.c,s=this.tx;return this.a=i*n-this.b*r,this.b=i*r+this.b*n,this.c=o*n-this.d*r,this.d=o*r+this.d*n,this.tx=s*n-this.ty*r,this.ty=s*r+this.ty*n,this}append(e){const n=this.a,r=this.b,i=this.c,o=this.d;return this.a=e.a*n+e.b*i,this.b=e.a*r+e.b*o,this.c=e.c*n+e.d*i,this.d=e.c*r+e.d*o,this.tx=e.tx*n+e.ty*i+this.tx,this.ty=e.tx*r+e.ty*o+this.ty,this}appendFrom(e,n){const r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,c=n.a,u=n.b,f=n.c,d=n.d;return this.a=r*c+i*f,this.b=r*u+i*d,this.c=o*c+s*f,this.d=o*u+s*d,this.tx=a*c+l*f+n.tx,this.ty=a*u+l*d+n.ty,this}setTransform(e,n,r,i,o,s,a,l,c){return this.a=Math.cos(a+c)*o,this.b=Math.sin(a+c)*o,this.c=-Math.sin(a-l)*s,this.d=Math.cos(a-l)*s,this.tx=e-(r*this.a+i*this.c),this.ty=n-(r*this.b+i*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const r=this.a,i=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,r=this.b,i=this.c,o=this.d,s=e.pivot,a=-Math.atan2(-i,o),l=Math.atan2(r,n),c=Math.abs(a+l);let u=Math.sqrt(n*n+r*r);return c<1e-5||Math.abs(RE-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):Math.abs(Math.PI-c)<1e-5?(e.rotation=l-Math.PI,e.skew.x=e.skew.y=0,u=-u):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=u,e.scale.y=Math.sqrt(i*i+o*o),e.position.x=this.tx+(s.x*n+s.y*i),e.position.y=this.ty+(s.x*r+s.y*o),e}invert(){const e=this.a,n=this.b,r=this.c,i=this.d,o=this.tx,s=e*i-n*r;return this.a=i/s,this.b=-n/s,this.c=-r/s,this.d=e/s,this.tx=(r*this.ty-i*o)/s,this.ty=-(e*this.ty-n*o)/s,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new An;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return ME.identity()}static get shared(){return IE.identity()}}const IE=new An,ME=new An,On=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Cn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Rn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],In=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ps=[],sh=[],Bi=Math.sign;function LE(){for(let t=0;t<16;t++){const e=[];ps.push(e);for(let n=0;n<16;n++){const r=Bi(On[t]*On[n]+Rn[t]*Cn[n]),i=Bi(Cn[t]*On[n]+In[t]*Cn[n]),o=Bi(On[t]*Rn[n]+Rn[t]*In[n]),s=Bi(Cn[t]*Rn[n]+In[t]*In[n]);for(let a=0;a<16;a++)if(On[a]===r&&Cn[a]===i&&Rn[a]===o&&In[a]===s){e.push(a);break}}}for(let t=0;t<16;t++){const e=new An;e.set(On[t],Cn[t],Rn[t],In[t],0,0),sh.push(e)}}LE();const Ne={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>On[t],uY:t=>Cn[t],vX:t=>Rn[t],vY:t=>In[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>ps[t][e],sub:(t,e)=>ps[t][Ne.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?Ne.S:Ne.N:Math.abs(e)*2<=Math.abs(t)?t>0?Ne.E:Ne.W:e>0?t>0?Ne.SE:Ne.SW:t>0?Ne.NE:Ne.NW,matrixAppendRotationInv:(t,e,n=0,r=0,i=0,o=0)=>{const s=sh[Ne.inv(e)],a=s.a,l=s.b,c=s.c,u=s.d,f=n-Math.min(0,a*i,c*o,a*i+c*o),d=r-Math.min(0,l*i,u*o,l*i+u*o),h=t.a,p=t.b,m=t.c,g=t.d;t.a=a*h+l*m,t.b=a*p+l*g,t.c=c*h+u*m,t.d=c*p+u*g,t.tx=f*h+d*m+t.tx,t.ty=f*p+d*g+t.ty},transformRectCoords:(t,e,n,r)=>{const{x:i,y:o,width:s,height:a}=t,{x:l,y:c,width:u,height:f}=e;return n===Ne.E?(r.set(i+l,o+c,s,a),r):n===Ne.S?r.set(u-o-a+l,i+c,a,s):n===Ne.W?r.set(u-i-s+l,f-o-a+c,s,a):n===Ne.N?r.set(o+l,f-i-s+c,a,s):r.set(i+l,o+c,s,a)}},Ui=[new qt,new qt,new qt,new qt];class kr{constructor(e=0,n=0,r=0,i=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(r),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new kr(0,0,0,0)}clone(){return new kr(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,r,i=.5){const{width:o,height:s}=this;if(o<=0||s<=0)return!1;const a=this.x,l=this.y,c=r*(1-i),u=r-c,f=a-c,d=a+o+c,h=l-c,p=l+s+c,m=a+u,g=a+o-u,y=l+u,b=l+s-u;return e>=f&&e<=d&&n>=h&&n<=p&&!(e>m&&e<g&&n>y&&n<b)}intersects(e,n){if(!n){const C=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=C)return!1;const P=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>P}const r=this.left,i=this.right,o=this.top,s=this.bottom;if(i<=r||s<=o)return!1;const a=Ui[0].set(e.left,e.top),l=Ui[1].set(e.left,e.bottom),c=Ui[2].set(e.right,e.top),u=Ui[3].set(e.right,e.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const f=Math.sign(n.a*n.d-n.b*n.c);if(f===0||(n.apply(a,a),n.apply(l,l),n.apply(c,c),n.apply(u,u),Math.max(a.x,l.x,c.x,u.x)<=r||Math.min(a.x,l.x,c.x,u.x)>=i||Math.max(a.y,l.y,c.y,u.y)<=o||Math.min(a.y,l.y,c.y,u.y)>=s))return!1;const d=f*(l.y-a.y),h=f*(a.x-l.x),p=d*r+h*o,m=d*i+h*o,g=d*r+h*s,y=d*i+h*s;if(Math.max(p,m,g,y)<=d*a.x+h*a.y||Math.min(p,m,g,y)>=d*u.x+h*u.y)return!1;const b=f*(a.y-c.y),x=f*(c.x-a.x),v=b*r+x*o,T=b*i+x*o,w=b*r+x*s,O=b*i+x*s;return!(Math.max(v,T,w,O)<=b*a.x+x*a.y||Math.min(v,T,w,O)>=b*u.x+x*u.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}getBounds(e){return e||(e=new kr),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,r=e.y,i=e.x+e.width,o=e.y+e.height;return n>=this.x&&n<this.x+this.width&&r>=this.y&&r<this.y+this.height&&i>=this.x&&i<=this.x+this.width&&o>=this.y&&o<=this.y+this.height}set(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ah=new Set,ch="8.0.0",PE="8.22.0",Qn={quiet:!1,noColor:!1},Gi=((t,e,n=3)=>{if(Qn.quiet||ah.has(e))return;let r=new Error().stack;const i=`${e}
|
|
21
21
|
Deprecated since v${t}`,o=typeof console.groupCollapsed=="function"&&!Qn.noColor;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",i):(r=r.split(`
|
|
22
22
|
`).splice(n).join(`
|
|
23
|
-
`),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(r))),ah.add(e)});Object.defineProperties(Gi,{quiet:{get:()=>Qn.quiet,set:t=>{Qn.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>Qn.noColor,set:t=>{Qn.noColor=t},enumerable:!0,configurable:!1}});const lh=()=>{};function NE(t){return t.endsWith("int")}function uh(t){return!(t&t-1)&&!!t}function kE(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const fh=Object.create(null);function DE(t){const e=fh[t];return e===void 0&&(fh[t]=Nt("resource")),e}const dh=class $T extends Nr{constructor(e={}){super(),this._resourceType="textureSampler",this._maxAnisotropy=1,this.destroyed=!1,e={...$T.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){Gi(ch,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=DE(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};dh.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let FE=dh;const hh=class JT extends Nr{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Nt("textureSource"),this._resourceType="textureSource",this._resourceId=Nt("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.depth=1,this._ownsStyle=!1,this.antialias=!1,this.transient=!1,this.storage=!1,this._batchTick=-1,this._textureBindLocation=-1;const n=e;e={...JT.defaultOptions,...e};const r=BE(e),i=r==="3d"||r==="1d"?r:"2d";UE(n,r,i),this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=i,this.viewDimension=r,this.arrayLayerCount=e.arrayLayerCount,this.depth=i==="3d"?e.depth??1:1,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=i==="3d"?!1:e.antialias,this.transient=e.transient??!1,this.storage=e.storage??!1,this.alphaMode=e.alphaMode,this.style=new FE(kE(e)),this._ownsStyle=!0,this.destroyed=!1,this._refreshPOT()}get depthOrArrayLayers(){return this.dimension==="3d"?this.depth:this.arrayLayerCount||1}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._ownsStyle=!1,this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._ownsStyle&&this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Nt("resource"),this.emit("change",this),this.emit("unload",this);for(const e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,r){r||(r=this._resolution),e||(e=this.width),n||(n=this.height);const i=Math.round(e*r),o=Math.round(n*r);return this.width=i/r,this.height=o/r,this._resolution=r,this.pixelWidth===i&&this.pixelHeight===o?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=o,this.emit("resize",this),this._resourceId=Nt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=uh(this.pixelWidth)&&uh(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};hh.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let ms=hh;function BE(t){return t.viewDimension?t.viewDimension:t.depth?"3d":t.arrayLayerCount>1?"2d-array":"2d"}function UE(t,e,n){if(t.depth!==void 0&&typeof t.depth!="number")throw new Error(`[TextureSource] depth is a 3D texture's depth in texels, but got ${t.depth}. For a depth buffer, use the depth option of a RenderTarget or the renderer.`);if(t.depth&&t.arrayLayerCount>1)throw new Error("[TextureSource] depth and arrayLayerCount can't be combined: use depth for a 3D texture or arrayLayerCount for a 2D array.");if(t.depth&&e!=="3d")throw new Error(`[TextureSource] depth makes a 3D texture, but viewDimension is '${e}'. Use arrayLayerCount for layered textures.`);if(e==="3d"&&t.arrayLayerCount>1)throw new Error("[TextureSource] a 3D texture takes depth, not arrayLayerCount.");if(t.dimensions&&t.dimensions!==n)throw new Error(`[TextureSource] dimensions '${t.dimensions}' doesn't match viewDimension '${e}'. Leave dimensions out; it is derived from the view.`);if(t.dimensions&&Gi(PE,"TextureSource dimensions is derived from viewDimension and depth; leave it out."),n==="3d"&&t.antialias)throw new Error("[TextureSource] a 3D texture can't be antialiased: WebGPU has no multisampled 3D textures.")}class ph extends ms{constructor(e){const n=e.depth??e.arrayLayerCount??1,r=e.resource||new Float32Array(e.width*e.height*n*4);let i=e.format;i||(r instanceof Float32Array?i="rgba32float":r instanceof Int32Array||r instanceof Uint32Array?i="rgba32uint":r instanceof Int16Array||r instanceof Uint16Array?i="rgba16uint":(r instanceof Int8Array,i="bgra8unorm"));const o=NE(i)||n>1;super({...o&&{alphaMode:"no-premultiply-alpha"},...e,resource:r,format:i}),this.uploadMethodId="buffer",this._updateStart=0,this._updateEnd=1/0}update(e=0,n=1/0){if((e>0||n<1/0)&&this.depthOrArrayLayers>1)throw new Error("[BufferImageSource] a 3D texture or 2D array uploads whole: call update() with no range.");this._updateStart=e,this._updateEnd=n,super.update(),this._updateStart=0,this._updateEnd=1/0}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}ph.extension=He.TextureSource;const mh=new An;class GE{constructor(e,n){this.mapCoord=new An,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this)),this.update()}destroy(){this._texture?.removeListener("update",this.update,this),this._texture=null}multiplyUvs(e,n){n===void 0&&(n=e);const r=this.mapCoord;for(let i=0;i<e.length;i+=2){const o=e[i],s=e[i+1];n[i]=o*r.a+s*r.c+r.tx,n[i+1]=o*r.b+s*r.d+r.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const r=e.orig,i=e.trim;i&&(mh.set(r.width/i.width,0,0,r.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(mh));const o=e.source,s=this.uClampFrame,a=this.clampMargin/o._resolution,l=this.clampOffset/o._resolution;return s[0]=(e.frame.x+a+l)/o.width,s[1]=(e.frame.y+a+l)/o.height,s[2]=(e.frame.x+e.frame.width-a+l)/o.width,s[3]=(e.frame.y+e.frame.height-a+l)/o.height,this.uClampOffset[0]=this.clampOffset/o.pixelWidth,this.uClampOffset[1]=this.clampOffset/o.pixelHeight,this.isSimple=e.frame.width===o.width&&e.frame.height===o.height&&e.rotate===0,!0}}class Mn extends Nr{constructor({source:e,label:n,frame:r,orig:i,trim:o,defaultAnchor:s,defaultBorders:a,rotate:l,dynamic:c}={}){if(super(),this.uid=Nt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new kr,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=e?.source??new ms,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:u,height:f}=this._source;this.frame.width=u,this.frame.height=f}this.orig=i||this.frame,this.trim=o,this.rotate=l??0,this.defaultAnchor=s,this.defaultBorders=a,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new GE(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:r,height:i}=this._source,o=n.x/r,s=n.y/i,a=n.width/r,l=n.height/i;let c=this.rotate;if(c){const u=a/2,f=l/2,d=o+u,h=s+f;c=Ne.add(c,Ne.NW),e.x0=d+u*Ne.uX(c),e.y0=h+f*Ne.uY(c),c=Ne.add(c,2),e.x1=d+u*Ne.uX(c),e.y1=h+f*Ne.uY(c),c=Ne.add(c,2),e.x2=d+u*Ne.uX(c),e.y2=h+f*Ne.uY(c),c=Ne.add(c,2),e.x3=d+u*Ne.uX(c),e.y3=h+f*Ne.uY(c)}else e.x0=o,e.y0=s,e.x1=o+a,e.y1=s,e.x2=o+a,e.y2=s+l,e.x3=o,e.y3=s+l}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return Gi(ch,"Texture.baseTexture is now Texture.source"),this._source}}Mn.EMPTY=new Mn({label:"EMPTY",source:new ms({label:"EMPTY"})}),Mn.EMPTY.destroy=lh,Mn.WHITE=new Mn({source:new ph({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),Mn.WHITE.destroy=lh;let gs=0;const gh=500;function yh(...t){gs!==gh&&(gs++,gs===gh?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}class ys{constructor(e){this.resources=Object.create(null),this._resourceKeysValue=null,this._dirty=!0;let n=0;for(const r in e){const i=e[r];this.setResource(i,n++)}}get _resourceKeys(){return this._resourceKeysValue??(this._resourceKeysValue=Object.keys(this.resources).map(Number)),this._resourceKeysValue}get _key(){if(this._dirty){this._dirty=!1;const e=[];let n=0;for(const r in this.resources)e[n++]=this.resources[r]?this.resources[r]._resourceId:-1;this._keyValue=e.join("|")}return this._keyValue}setResource(e,n){const r=this.resources[n];e!==r&&(r&&r.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),r===void 0&&(this._resourceKeysValue=null),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const n=this.resources,r=this._resourceKeys;for(let i=0;i<r.length;i++){const o=n[r[i]];o&&(o._gcLastUsed=e)}}destroy(){const e=this.resources;for(const n in e)e[n]?.off?.("change",this.onResourceChange,this);this.resources=null,this._resourceKeysValue=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const n=this.resources;for(const r in n)n[r]===e&&(n[r]=null);yh(`[BindGroup] a '${e._resourceType}' was destroyed while still bound to a shader. Remove it from the shader before destroying it.`)}}}var _s=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(_s||{});class ji{constructor(e){this.data={...e};const n=Object.keys(e).sort().map(r=>`${r}:${e[r]}`).join("|");this.id=Pi(n,"shader-overrides")}static from(e){return e instanceof ji?e:new ji(e)}}class bs extends Nr{constructor(e){super(),this.uid=Nt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:r,groups:i,resources:o,compatibleRenderers:s,groupMap:a,overrides:l}=e;this._overrides=l?ji.from(l):null,this.gpuProgram=n,this.glProgram=r,s===void 0&&(s=0,n&&(s|=_s.WEBGPU),r&&(s|=_s.WEBGL)),this.compatibleRenderers=s;const c={};if(a)for(const u in a)for(const f in a[u]){const d=a[u][f];c[d]={group:u,binding:f,name:d}}if(!o&&!i&&(o={}),o&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(n&&i&&!a){const u=n.structsAndGroups.groups;a={},u.forEach(f=>{a[f.group]=a[f.group]||{},a[f.group][f.binding]=f.name,c[f.name]=f})}else if(o){i={},a||(a={}),n&&n.structsAndGroups.groups.forEach(d=>{a[d.group]=a[d.group]||{},a[d.group][d.binding]=d.name,c[d.name]=d});let u=0;for(const f in o)c[f]||(n&&!r&&yh(`[Shader] the resource '${f}' matches no binding in the WGSL source — is the name correct?`),i[99]||(i[99]=new ys,this._ownedBindGroups.push(i[99])),c[f]={group:99,binding:u,name:f},a[99]=a[99]||{},a[99][u]=f,u++);for(const f in o){const d=f;let h=o[f];!h.source&&!h._resourceType&&(h=new oh(h));const p=c[d];p&&(i[p.group]||(i[p.group]=new ys,this._ownedBindGroups.push(i[p.group])),i[p.group].setResource(h,p.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,c)}addResource(e,n,r){var i,o;(i=this._uniformBindMap)[n]||(i[n]={}),(o=this._uniformBindMap[n])[r]||(o[r]=e),this.groups[n]||(this.groups[n]=new ys,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const r={};for(const i in n){const o=n[i];Object.defineProperty(r,o.name,{get(){return e[o.group].getResource(o.binding)},set(s){e[o.group].setResource(s,o.binding)}})}return r}destroy(e=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(n=>{n.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null,this._overrides=null)}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=Pr.from(n)),r&&(s=ls.from(r)),new bs({gpuProgram:o,glProgram:s,...i})}}const jE={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},HE={BLEND:0,OFFSET:1,CULLING:2,DEPTH_TEST:3,WINDING:4,DEPTH_MASK:5},{BLEND:xs,OFFSET:vs,CULLING:Ts,DEPTH_TEST:Es,WINDING:Ss,DEPTH_MASK:ws}=HE,As=class QT{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<xs)}set blend(e){!!(this.data&1<<xs)!==e&&(this.data^=1<<xs)}get offsets(){return!!(this.data&1<<vs)}set offsets(e){!!(this.data&1<<vs)!==e&&(this.data^=1<<vs)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Ts)}set culling(e){!!(this.data&1<<Ts)!==e&&(this.data^=1<<Ts)}get depthTest(){return!!(this.data&1<<Es)}set depthTest(e){!!(this.data&1<<Es)!==e&&(this.data^=1<<Es)}get depthMask(){return!!(this.data&1<<ws)}set depthMask(e){!!(this.data&1<<ws)!==e&&(this.data^=1<<ws)}get clockwiseFrontFace(){return!!(this.data&1<<Ss)}set clockwiseFrontFace(e){!!(this.data&1<<Ss)!==e&&(this.data^=1<<Ss)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=jE[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new QT;return e.depthTest=!1,e.depthMask=!1,e.blend=!0,e}};As.default2d=As.for2d();let YE=As;const _h=class zd extends bs{constructor(e){e={...zd.defaultOptions,...e},super(e),this.enabled=!0,this._state=YE.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,r,i){e.applyFilter(this,n,r,i)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=Pr.from(n)),r&&(s=ls.from(r)),new zd({gpuProgram:o,glProgram:s,...i})}};_h.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let XE=_h;var WE=`
|
|
23
|
+
`),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(r))),ah.add(e)});Object.defineProperties(Gi,{quiet:{get:()=>Qn.quiet,set:t=>{Qn.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>Qn.noColor,set:t=>{Qn.noColor=t},enumerable:!0,configurable:!1}});const lh=()=>{};function NE(t){return t.endsWith("int")}function uh(t){return!(t&t-1)&&!!t}function kE(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const fh=Object.create(null);function DE(t){const e=fh[t];return e===void 0&&(fh[t]=Pt("resource")),e}const dh=class $T extends Nr{constructor(e={}){super(),this._resourceType="textureSampler",this._maxAnisotropy=1,this.destroyed=!1,e={...$T.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){Gi(ch,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=DE(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};dh.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let FE=dh;const hh=class JT extends Nr{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Pt("textureSource"),this._resourceType="textureSource",this._resourceId=Pt("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.depth=1,this._ownsStyle=!1,this.antialias=!1,this.transient=!1,this.storage=!1,this._batchTick=-1,this._textureBindLocation=-1;const n=e;e={...JT.defaultOptions,...e};const r=BE(e),i=r==="3d"||r==="1d"?r:"2d";UE(n,r,i),this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=i,this.viewDimension=r,this.arrayLayerCount=e.arrayLayerCount,this.depth=i==="3d"?e.depth??1:1,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=i==="3d"?!1:e.antialias,this.transient=e.transient??!1,this.storage=e.storage??!1,this.alphaMode=e.alphaMode,this.style=new FE(kE(e)),this._ownsStyle=!0,this.destroyed=!1,this._refreshPOT()}get depthOrArrayLayers(){return this.dimension==="3d"?this.depth:this.arrayLayerCount||1}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._ownsStyle=!1,this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._ownsStyle&&this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Pt("resource"),this.emit("change",this),this.emit("unload",this);for(const e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,r){r||(r=this._resolution),e||(e=this.width),n||(n=this.height);const i=Math.round(e*r),o=Math.round(n*r);return this.width=i/r,this.height=o/r,this._resolution=r,this.pixelWidth===i&&this.pixelHeight===o?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=o,this.emit("resize",this),this._resourceId=Pt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=uh(this.pixelWidth)&&uh(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};hh.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let ms=hh;function BE(t){return t.viewDimension?t.viewDimension:t.depth?"3d":t.arrayLayerCount>1?"2d-array":"2d"}function UE(t,e,n){if(t.depth!==void 0&&typeof t.depth!="number")throw new Error(`[TextureSource] depth is a 3D texture's depth in texels, but got ${t.depth}. For a depth buffer, use the depth option of a RenderTarget or the renderer.`);if(t.depth&&t.arrayLayerCount>1)throw new Error("[TextureSource] depth and arrayLayerCount can't be combined: use depth for a 3D texture or arrayLayerCount for a 2D array.");if(t.depth&&e!=="3d")throw new Error(`[TextureSource] depth makes a 3D texture, but viewDimension is '${e}'. Use arrayLayerCount for layered textures.`);if(e==="3d"&&t.arrayLayerCount>1)throw new Error("[TextureSource] a 3D texture takes depth, not arrayLayerCount.");if(t.dimensions&&t.dimensions!==n)throw new Error(`[TextureSource] dimensions '${t.dimensions}' doesn't match viewDimension '${e}'. Leave dimensions out; it is derived from the view.`);if(t.dimensions&&Gi(PE,"TextureSource dimensions is derived from viewDimension and depth; leave it out."),n==="3d"&&t.antialias)throw new Error("[TextureSource] a 3D texture can't be antialiased: WebGPU has no multisampled 3D textures.")}class ph extends ms{constructor(e){const n=e.depth??e.arrayLayerCount??1,r=e.resource||new Float32Array(e.width*e.height*n*4);let i=e.format;i||(r instanceof Float32Array?i="rgba32float":r instanceof Int32Array||r instanceof Uint32Array?i="rgba32uint":r instanceof Int16Array||r instanceof Uint16Array?i="rgba16uint":(r instanceof Int8Array,i="bgra8unorm"));const o=NE(i)||n>1;super({...o&&{alphaMode:"no-premultiply-alpha"},...e,resource:r,format:i}),this.uploadMethodId="buffer",this._updateStart=0,this._updateEnd=1/0}update(e=0,n=1/0){if((e>0||n<1/0)&&this.depthOrArrayLayers>1)throw new Error("[BufferImageSource] a 3D texture or 2D array uploads whole: call update() with no range.");this._updateStart=e,this._updateEnd=n,super.update(),this._updateStart=0,this._updateEnd=1/0}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}ph.extension=He.TextureSource;const mh=new An;class GE{constructor(e,n){this.mapCoord=new An,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this)),this.update()}destroy(){this._texture?.removeListener("update",this.update,this),this._texture=null}multiplyUvs(e,n){n===void 0&&(n=e);const r=this.mapCoord;for(let i=0;i<e.length;i+=2){const o=e[i],s=e[i+1];n[i]=o*r.a+s*r.c+r.tx,n[i+1]=o*r.b+s*r.d+r.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const r=e.orig,i=e.trim;i&&(mh.set(r.width/i.width,0,0,r.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(mh));const o=e.source,s=this.uClampFrame,a=this.clampMargin/o._resolution,l=this.clampOffset/o._resolution;return s[0]=(e.frame.x+a+l)/o.width,s[1]=(e.frame.y+a+l)/o.height,s[2]=(e.frame.x+e.frame.width-a+l)/o.width,s[3]=(e.frame.y+e.frame.height-a+l)/o.height,this.uClampOffset[0]=this.clampOffset/o.pixelWidth,this.uClampOffset[1]=this.clampOffset/o.pixelHeight,this.isSimple=e.frame.width===o.width&&e.frame.height===o.height&&e.rotate===0,!0}}class Mn extends Nr{constructor({source:e,label:n,frame:r,orig:i,trim:o,defaultAnchor:s,defaultBorders:a,rotate:l,dynamic:c}={}){if(super(),this.uid=Pt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new kr,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=e?.source??new ms,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:u,height:f}=this._source;this.frame.width=u,this.frame.height=f}this.orig=i||this.frame,this.trim=o,this.rotate=l??0,this.defaultAnchor=s,this.defaultBorders=a,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new GE(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:r,height:i}=this._source,o=n.x/r,s=n.y/i,a=n.width/r,l=n.height/i;let c=this.rotate;if(c){const u=a/2,f=l/2,d=o+u,h=s+f;c=Ne.add(c,Ne.NW),e.x0=d+u*Ne.uX(c),e.y0=h+f*Ne.uY(c),c=Ne.add(c,2),e.x1=d+u*Ne.uX(c),e.y1=h+f*Ne.uY(c),c=Ne.add(c,2),e.x2=d+u*Ne.uX(c),e.y2=h+f*Ne.uY(c),c=Ne.add(c,2),e.x3=d+u*Ne.uX(c),e.y3=h+f*Ne.uY(c)}else e.x0=o,e.y0=s,e.x1=o+a,e.y1=s,e.x2=o+a,e.y2=s+l,e.x3=o,e.y3=s+l}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return Gi(ch,"Texture.baseTexture is now Texture.source"),this._source}}Mn.EMPTY=new Mn({label:"EMPTY",source:new ms({label:"EMPTY"})}),Mn.EMPTY.destroy=lh,Mn.WHITE=new Mn({source:new ph({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),Mn.WHITE.destroy=lh;let gs=0;const gh=500;function yh(...t){gs!==gh&&(gs++,gs===gh?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}class ys{constructor(e){this.resources=Object.create(null),this._resourceKeysValue=null,this._dirty=!0;let n=0;for(const r in e){const i=e[r];this.setResource(i,n++)}}get _resourceKeys(){return this._resourceKeysValue??(this._resourceKeysValue=Object.keys(this.resources).map(Number)),this._resourceKeysValue}get _key(){if(this._dirty){this._dirty=!1;const e=[];let n=0;for(const r in this.resources)e[n++]=this.resources[r]?this.resources[r]._resourceId:-1;this._keyValue=e.join("|")}return this._keyValue}setResource(e,n){const r=this.resources[n];e!==r&&(r&&r.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),r===void 0&&(this._resourceKeysValue=null),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const n=this.resources,r=this._resourceKeys;for(let i=0;i<r.length;i++){const o=n[r[i]];o&&(o._gcLastUsed=e)}}destroy(){const e=this.resources;for(const n in e)e[n]?.off?.("change",this.onResourceChange,this);this.resources=null,this._resourceKeysValue=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const n=this.resources;for(const r in n)n[r]===e&&(n[r]=null);yh(`[BindGroup] a '${e._resourceType}' was destroyed while still bound to a shader. Remove it from the shader before destroying it.`)}}}var _s=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(_s||{});class ji{constructor(e){this.data={...e};const n=Object.keys(e).sort().map(r=>`${r}:${e[r]}`).join("|");this.id=Pi(n,"shader-overrides")}static from(e){return e instanceof ji?e:new ji(e)}}class bs extends Nr{constructor(e){super(),this.uid=Pt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:r,groups:i,resources:o,compatibleRenderers:s,groupMap:a,overrides:l}=e;this._overrides=l?ji.from(l):null,this.gpuProgram=n,this.glProgram=r,s===void 0&&(s=0,n&&(s|=_s.WEBGPU),r&&(s|=_s.WEBGL)),this.compatibleRenderers=s;const c={};if(a)for(const u in a)for(const f in a[u]){const d=a[u][f];c[d]={group:u,binding:f,name:d}}if(!o&&!i&&(o={}),o&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(n&&i&&!a){const u=n.structsAndGroups.groups;a={},u.forEach(f=>{a[f.group]=a[f.group]||{},a[f.group][f.binding]=f.name,c[f.name]=f})}else if(o){i={},a||(a={}),n&&n.structsAndGroups.groups.forEach(d=>{a[d.group]=a[d.group]||{},a[d.group][d.binding]=d.name,c[d.name]=d});let u=0;for(const f in o)c[f]||(n&&!r&&yh(`[Shader] the resource '${f}' matches no binding in the WGSL source — is the name correct?`),i[99]||(i[99]=new ys,this._ownedBindGroups.push(i[99])),c[f]={group:99,binding:u,name:f},a[99]=a[99]||{},a[99][u]=f,u++);for(const f in o){const d=f;let h=o[f];!h.source&&!h._resourceType&&(h=new oh(h));const p=c[d];p&&(i[p.group]||(i[p.group]=new ys,this._ownedBindGroups.push(i[p.group])),i[p.group].setResource(h,p.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,c)}addResource(e,n,r){var i,o;(i=this._uniformBindMap)[n]||(i[n]={}),(o=this._uniformBindMap[n])[r]||(o[r]=e),this.groups[n]||(this.groups[n]=new ys,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const r={};for(const i in n){const o=n[i];Object.defineProperty(r,o.name,{get(){return e[o.group].getResource(o.binding)},set(s){e[o.group].setResource(s,o.binding)}})}return r}destroy(e=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(n=>{n.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null,this._overrides=null)}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=Pr.from(n)),r&&(s=ls.from(r)),new bs({gpuProgram:o,glProgram:s,...i})}}const jE={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},HE={BLEND:0,OFFSET:1,CULLING:2,DEPTH_TEST:3,WINDING:4,DEPTH_MASK:5},{BLEND:xs,OFFSET:vs,CULLING:Ts,DEPTH_TEST:Es,WINDING:Ss,DEPTH_MASK:ws}=HE,As=class QT{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<xs)}set blend(e){!!(this.data&1<<xs)!==e&&(this.data^=1<<xs)}get offsets(){return!!(this.data&1<<vs)}set offsets(e){!!(this.data&1<<vs)!==e&&(this.data^=1<<vs)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Ts)}set culling(e){!!(this.data&1<<Ts)!==e&&(this.data^=1<<Ts)}get depthTest(){return!!(this.data&1<<Es)}set depthTest(e){!!(this.data&1<<Es)!==e&&(this.data^=1<<Es)}get depthMask(){return!!(this.data&1<<ws)}set depthMask(e){!!(this.data&1<<ws)!==e&&(this.data^=1<<ws)}get clockwiseFrontFace(){return!!(this.data&1<<Ss)}set clockwiseFrontFace(e){!!(this.data&1<<Ss)!==e&&(this.data^=1<<Ss)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=jE[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new QT;return e.depthTest=!1,e.depthMask=!1,e.blend=!0,e}};As.default2d=As.for2d();let YE=As;const _h=class zd extends bs{constructor(e){e={...zd.defaultOptions,...e},super(e),this.enabled=!0,this._state=YE.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,r,i){e.applyFilter(this,n,r,i)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=Pr.from(n)),r&&(s=ls.from(r)),new zd({gpuProgram:o,glProgram:s,...i})}};_h.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let XE=_h;var WE=`
|
|
24
24
|
in vec2 vTextureCoord;
|
|
25
25
|
in vec4 vColor;
|
|
26
26
|
|
|
@@ -143,7 +143,7 @@ fn mainFragment(
|
|
|
143
143
|
{MAIN}
|
|
144
144
|
|
|
145
145
|
return out;
|
|
146
|
-
}`;class
|
|
146
|
+
}`;class Ke extends XE{constructor(e){const n=e.gpu,r=bh({source:qE,...n}),i=Pr.from({vertex:{source:r,entryPoint:"mainVertex"},fragment:{source:r,entryPoint:"mainFragment"}}),o=e.gl,s=bh({source:WE,...o}),a=ls.from({vertex:zE,fragment:s}),l=new oh({uBlend:{value:1,type:"f32"}});super({gpuProgram:i,glProgram:a,blendRequired:!0,resources:{blendUniforms:l,uBackTexture:Mn.EMPTY}})}}function bh(t){const{source:e,functions:n,main:r}=t;return e.replace("{FUNCTIONS}",n).replace("{MAIN}",r)}const Os=`
|
|
147
147
|
float getLuminosity(vec3 c) {
|
|
148
148
|
return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
|
|
149
149
|
}
|
|
@@ -319,7 +319,7 @@ fn mainFragment(
|
|
|
319
319
|
|
|
320
320
|
return color;
|
|
321
321
|
}
|
|
322
|
-
`;class xh extends
|
|
322
|
+
`;class xh extends Ke{constructor(){super({gl:{functions:`
|
|
323
323
|
${Os}
|
|
324
324
|
|
|
325
325
|
vec3 blendColor(vec3 base, vec3 blend, float opacity)
|
|
@@ -337,7 +337,7 @@ fn mainFragment(
|
|
|
337
337
|
}
|
|
338
338
|
`,main:`
|
|
339
339
|
out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
340
|
-
`}})}}xh.extension={name:"color",type:He.BlendMode};class vh extends
|
|
340
|
+
`}})}}xh.extension={name:"color",type:He.BlendMode};class vh extends Ke{constructor(){super({gl:{functions:`
|
|
341
341
|
float colorBurn(float base, float blend)
|
|
342
342
|
{
|
|
343
343
|
return max((1.0 - ((1.0 - base) / blend)), 0.0);
|
|
@@ -373,7 +373,7 @@ fn mainFragment(
|
|
|
373
373
|
}
|
|
374
374
|
`,main:`
|
|
375
375
|
out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
376
|
-
`}})}}vh.extension={name:"color-burn",type:He.BlendMode};class Th extends
|
|
376
|
+
`}})}}vh.extension={name:"color-burn",type:He.BlendMode};class Th extends Ke{constructor(){super({gl:{functions:`
|
|
377
377
|
float colorDodge(float base, float blend)
|
|
378
378
|
{
|
|
379
379
|
return base / (1.0 - blend);
|
|
@@ -409,7 +409,7 @@ fn mainFragment(
|
|
|
409
409
|
}
|
|
410
410
|
`,main:`
|
|
411
411
|
out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
412
|
-
`}})}}Th.extension={name:"color-dodge",type:He.BlendMode};class Eh extends
|
|
412
|
+
`}})}}Th.extension={name:"color-dodge",type:He.BlendMode};class Eh extends Ke{constructor(){super({gl:{functions:`
|
|
413
413
|
vec3 blendDarken(vec3 base, vec3 blend, float opacity)
|
|
414
414
|
{
|
|
415
415
|
return (min(base, blend) * opacity + base * (1.0 - opacity));
|
|
@@ -423,7 +423,7 @@ fn mainFragment(
|
|
|
423
423
|
}
|
|
424
424
|
`,main:`
|
|
425
425
|
out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
426
|
-
`}})}}Eh.extension={name:"darken",type:He.BlendMode};class Sh extends
|
|
426
|
+
`}})}}Eh.extension={name:"darken",type:He.BlendMode};class Sh extends Ke{constructor(){super({gl:{functions:`
|
|
427
427
|
vec3 blendDifference(vec3 base, vec3 blend, float opacity)
|
|
428
428
|
{
|
|
429
429
|
return (abs(blend - base) * opacity + base * (1.0 - opacity));
|
|
@@ -437,7 +437,7 @@ fn mainFragment(
|
|
|
437
437
|
}
|
|
438
438
|
`,main:`
|
|
439
439
|
out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
440
|
-
`}})}}Sh.extension={name:"difference",type:He.BlendMode};class wh extends
|
|
440
|
+
`}})}}Sh.extension={name:"difference",type:He.BlendMode};class wh extends Ke{constructor(){super({gl:{functions:`
|
|
441
441
|
float divide(float base, float blend)
|
|
442
442
|
{
|
|
443
443
|
return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;
|
|
@@ -472,7 +472,7 @@ fn mainFragment(
|
|
|
472
472
|
}
|
|
473
473
|
`,main:`
|
|
474
474
|
out = vec4<f32>(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
475
|
-
`}})}}wh.extension={name:"divide",type:He.BlendMode};class Ah extends
|
|
475
|
+
`}})}}wh.extension={name:"divide",type:He.BlendMode};class Ah extends Ke{constructor(){super({gl:{functions:`
|
|
476
476
|
vec3 exclusion(vec3 base, vec3 blend)
|
|
477
477
|
{
|
|
478
478
|
return base + blend - 2.0 * base * blend;
|
|
@@ -496,7 +496,7 @@ fn mainFragment(
|
|
|
496
496
|
}
|
|
497
497
|
`,main:`
|
|
498
498
|
out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
499
|
-
`}})}}Ah.extension={name:"exclusion",type:He.BlendMode};class Oh extends
|
|
499
|
+
`}})}}Ah.extension={name:"exclusion",type:He.BlendMode};class Oh extends Ke{constructor(){super({gl:{functions:`
|
|
500
500
|
float hardLight(float base, float blend)
|
|
501
501
|
{
|
|
502
502
|
return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
@@ -531,7 +531,7 @@ fn mainFragment(
|
|
|
531
531
|
}
|
|
532
532
|
`,main:`
|
|
533
533
|
out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
534
|
-
`}})}}Oh.extension={name:"hard-light",type:He.BlendMode};class Ch extends
|
|
534
|
+
`}})}}Oh.extension={name:"hard-light",type:He.BlendMode};class Ch extends Ke{constructor(){super({gl:{functions:`
|
|
535
535
|
float hardMix(float base, float blend)
|
|
536
536
|
{
|
|
537
537
|
return (base + blend >= 1.0) ? 1.0 : 0.0;
|
|
@@ -565,7 +565,7 @@ fn mainFragment(
|
|
|
565
565
|
}
|
|
566
566
|
`,main:`
|
|
567
567
|
out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
568
|
-
`}})}}Ch.extension={name:"hard-mix",type:He.BlendMode};class Rh extends
|
|
568
|
+
`}})}}Ch.extension={name:"hard-mix",type:He.BlendMode};class Rh extends Ke{constructor(){super({gl:{functions:`
|
|
569
569
|
vec3 blendLighten(vec3 base, vec3 blend, float opacity)
|
|
570
570
|
{
|
|
571
571
|
return (max(base, blend) * opacity + base * (1.0 - opacity));
|
|
@@ -579,7 +579,7 @@ fn mainFragment(
|
|
|
579
579
|
}
|
|
580
580
|
`,main:`
|
|
581
581
|
out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
582
|
-
`}})}}Rh.extension={name:"lighten",type:He.BlendMode};class Ih extends
|
|
582
|
+
`}})}}Rh.extension={name:"lighten",type:He.BlendMode};class Ih extends Ke{constructor(){super({gl:{functions:`
|
|
583
583
|
float linearBurn(float base, float blend)
|
|
584
584
|
{
|
|
585
585
|
return max(0.0, base + blend - 1.0);
|
|
@@ -615,7 +615,7 @@ fn mainFragment(
|
|
|
615
615
|
}
|
|
616
616
|
`,main:`
|
|
617
617
|
out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
618
|
-
`}})}}Ih.extension={name:"linear-burn",type:He.BlendMode};class Mh extends
|
|
618
|
+
`}})}}Ih.extension={name:"linear-burn",type:He.BlendMode};class Mh extends Ke{constructor(){super({gl:{functions:`
|
|
619
619
|
float linearDodge(float base, float blend) {
|
|
620
620
|
return min(1.0, base + blend);
|
|
621
621
|
}
|
|
@@ -648,7 +648,7 @@ fn mainFragment(
|
|
|
648
648
|
}
|
|
649
649
|
`,main:`
|
|
650
650
|
out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
651
|
-
`}})}}Mh.extension={name:"linear-dodge",type:He.BlendMode};class Lh extends
|
|
651
|
+
`}})}}Mh.extension={name:"linear-dodge",type:He.BlendMode};class Lh extends Ke{constructor(){super({gl:{functions:`
|
|
652
652
|
float linearBurn(float base, float blend) {
|
|
653
653
|
return max(0.0, base + blend - 1.0);
|
|
654
654
|
}
|
|
@@ -700,7 +700,7 @@ fn mainFragment(
|
|
|
700
700
|
}
|
|
701
701
|
`,main:`
|
|
702
702
|
out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
703
|
-
`}})}}Lh.extension={name:"linear-light",type:He.BlendMode};class Ph extends
|
|
703
|
+
`}})}}Lh.extension={name:"linear-light",type:He.BlendMode};class Ph extends Ke{constructor(){super({gl:{functions:`
|
|
704
704
|
${Os}
|
|
705
705
|
|
|
706
706
|
vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
|
|
@@ -720,7 +720,7 @@ fn mainFragment(
|
|
|
720
720
|
}
|
|
721
721
|
`,main:`
|
|
722
722
|
out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
723
|
-
`}})}}Ph.extension={name:"luminosity",type:He.BlendMode};class Nh extends
|
|
723
|
+
`}})}}Ph.extension={name:"luminosity",type:He.BlendMode};class Nh extends Ke{constructor(){super({gl:{functions:`
|
|
724
724
|
vec3 negation(vec3 base, vec3 blend)
|
|
725
725
|
{
|
|
726
726
|
return 1.0-abs(1.0-base-blend);
|
|
@@ -744,7 +744,7 @@ fn mainFragment(
|
|
|
744
744
|
}
|
|
745
745
|
`,main:`
|
|
746
746
|
out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
747
|
-
`}})}}Nh.extension={name:"negation",type:He.BlendMode};class kh extends
|
|
747
|
+
`}})}}Nh.extension={name:"negation",type:He.BlendMode};class kh extends Ke{constructor(){super({gl:{functions:`
|
|
748
748
|
float overlay(float base, float blend)
|
|
749
749
|
{
|
|
750
750
|
return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));
|
|
@@ -780,7 +780,7 @@ fn mainFragment(
|
|
|
780
780
|
}
|
|
781
781
|
`,main:`
|
|
782
782
|
out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
783
|
-
`}})}}kh.extension={name:"overlay",type:He.BlendMode};class Dh extends
|
|
783
|
+
`}})}}kh.extension={name:"overlay",type:He.BlendMode};class Dh extends Ke{constructor(){super({gl:{functions:`
|
|
784
784
|
float pinLight(float base, float blend)
|
|
785
785
|
{
|
|
786
786
|
return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));
|
|
@@ -816,7 +816,7 @@ fn mainFragment(
|
|
|
816
816
|
}
|
|
817
817
|
`,main:`
|
|
818
818
|
out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
819
|
-
`}})}}Dh.extension={name:"pin-light",type:He.BlendMode};class Fh extends
|
|
819
|
+
`}})}}Dh.extension={name:"pin-light",type:He.BlendMode};class Fh extends Ke{constructor(){super({gl:{functions:`
|
|
820
820
|
${Os}
|
|
821
821
|
|
|
822
822
|
vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
|
|
@@ -836,7 +836,7 @@ fn mainFragment(
|
|
|
836
836
|
}
|
|
837
837
|
`,main:`
|
|
838
838
|
out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
839
|
-
`}})}}Fh.extension={name:"saturation",type:He.BlendMode};class Bh extends
|
|
839
|
+
`}})}}Fh.extension={name:"saturation",type:He.BlendMode};class Bh extends Ke{constructor(){super({gl:{functions:`
|
|
840
840
|
float softLight(float base, float blend)
|
|
841
841
|
{
|
|
842
842
|
return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));
|
|
@@ -872,7 +872,7 @@ fn mainFragment(
|
|
|
872
872
|
}
|
|
873
873
|
`,main:`
|
|
874
874
|
out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
875
|
-
`}})}}Bh.extension={name:"soft-light",type:He.BlendMode};class Uh extends
|
|
875
|
+
`}})}}Bh.extension={name:"soft-light",type:He.BlendMode};class Uh extends Ke{constructor(){super({gl:{functions:`
|
|
876
876
|
float subtract(float base, float blend)
|
|
877
877
|
{
|
|
878
878
|
return max(0.0, base - blend);
|
|
@@ -908,7 +908,7 @@ fn mainFragment(
|
|
|
908
908
|
}
|
|
909
909
|
`,main:`
|
|
910
910
|
out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
911
|
-
`}})}}Uh.extension={name:"subtract",type:He.BlendMode};class Gh extends
|
|
911
|
+
`}})}}Uh.extension={name:"subtract",type:He.BlendMode};class Gh extends Ke{constructor(){super({gl:{functions:`
|
|
912
912
|
float colorBurn(float base, float blend)
|
|
913
913
|
{
|
|
914
914
|
return max((1.0-((1.0-base)/blend)),0.0);
|
|
@@ -964,7 +964,7 @@ fn mainFragment(
|
|
|
964
964
|
}
|
|
965
965
|
`,main:`
|
|
966
966
|
out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
967
|
-
`}})}}Gh.extension={name:"vivid-light",type:He.BlendMode},rE.add(xh,vh,Th,Eh,Sh,wh,Ah,Oh,Ch,Rh,Ih,Lh,Mh,Ph,Nh,kh,Dh,Fh,Bh,Uh,Gh),at.extend({AnimatedSprite:B.AnimatedSprite,Container:B.Container,Graphics:B.Graphics,Mesh:B.Mesh,Sprite:B.Sprite,Text:B.Text,TilingSprite:B.TilingSprite,GifSprite:Ir.GifSprite});var Rs={exports:{}},Dr={};var jh;function VE(){if(jh)return Dr;jh=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:o}}return Dr.Fragment=e,Dr.jsx=n,Dr.jsxs=n,Dr}var Hh;function KE(){return Hh||(Hh=1,Rs.exports=VE()),Rs.exports}var M=KE();const ue={Normal:"Normal",None:"None",Warm:"Warm",Cool:"Cool",BlackAndWhite:"BlackAndWhite",Vivid:"Vivid",Fade:"Fade",RetroVintage:"RetroVintage",Sepia:"Sepia",OldFilm:"OldFilm",Polaroid:"Polaroid",Seventies:"70s",Cinematic:"Cinematic",Dramatic:"Dramatic",Moody:"Moody",FilmNoir:"FilmNoir",SoftFocus:"SoftFocus",Dreamy:"Dreamy",DreamyVintage:"DreamyVintage",DarkMood:"DarkMood",HDR:"HDR",Pop:"Pop",Pastel:"Pastel",Neon:"Neon",Pixelize:"Pixelize",RadialPixel:"RadialPixel",CrossCut:"CrossCut",Liquid:"Liquid",Outliner:"Outliner",DotPattern:"DotPattern",CRT:"CRT",Posterize:"Posterize",TVGlitch:"TVGlitch",HalfTone:"HalfTone",Linocut:"Linocut",Shifter:"Shifter",Mirror:"Mirror",ASCII:"ASCII",Emboss:"Emboss",Glow:"Glow",TiltShift:"TiltShift",ExtrudeBlur:"ExtrudeBlur",Sharpie:"Sharpie",Recolor:"Recolor",GreenScreen:"GreenScreen",Godray:"Godray",MotionBlur:"MotionBlur",AdvancedBloom:"AdvancedBloom",RetroHalfTone:"RetroHalfTone",NightVision:"NightVision",Vignette:"Vignette",CYAN:"CYAN"};var kt=(t=>(t.NONE="none",t.EQUALIZER="equalizer",t.ROUNDBARS="roundbars",t.LED="led",t.RADIAL_SPECTRUM="radial_spectrum",t.LUMI_BARS="lumi_bars",t))(kt||{});let Yh;function Xh(){return Yh=document.body,Yh}function $e(t,e,n){let r;return S.useEffect(()=>{r=r||Xh();const i=o=>{const s=o.detail;e(s)};return r.addEventListener(t,i,!1),()=>{r?.removeEventListener(t,i,!1)}},n),i=>{r=i}}function Ln(t,e){const n=Xh(),r=new CustomEvent(t,{detail:e});n.dispatchEvent(r)}function ZE(){let t;function e(n){t=n}return e.emit=function(n,r){const i=new CustomEvent(n,{bubbles:!0,detail:r});t?.dispatchEvent(i)},e}const Ye=I.createContext({}),ke={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END",FONTS_LOADED:"FONTS_LOADED"},$E=({children:t})=>{const[e,n]=S.useState(0),r=S.useRef(void 0),i=S.useRef(void 0),o=S.useRef(0),s=S.useRef(!1),a=S.useRef(!1),[l,c]=S.useState(!1),u=S.useRef(new Set),f=S.useRef(!1),d=S.useRef(!1);S.useLayoutEffect(()=>(i.current=E.context(()=>{r.current&&r.current.progress(0).kill(),r.current&&r.current.clear(),r.current&&E.killTweensOf(r.current),r.current=E.timeline({paused:!0,defaults:{duration:0}})}),()=>{r.current&&r.current.revert(),i.current.revert()}),[]);const h=S.useCallback(()=>{if(r.current){const R=r.current.time();R<o.current?s.current=!0:s.current=!1,o.current=R,u.current.forEach(P=>{try{P(R)}catch(A){typeof console<"u"&&console.warn&&console.warn("[GsapPixi] timeUpdate listener error:",A)}})}},[]);S.useEffect(()=>{if(r.current){const C=r.current;C.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){C.pause(),h()}).eventCallback("onUpdate",function(){h()}).eventCallback("onRepeat",function(){console.log("onrepeat",C.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",C.progress())}).eventCallback("onComplete",function(){C.seek(.01),C.pause(),f.current=!1,Ln(ke.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),h()})}},[]),S.useEffect(()=>{r.current&&e>0&&o.current===0&&(r.current.seek(.01),o.current=.01)},[e]);const p=S.useCallback(()=>{r.current&&r.current.revert()},[]),m=S.useCallback(()=>{r.current&&(r.current.restart(),f.current=!0,Ln(ke.RESUME))},[]),g=S.useCallback(()=>{if(!r.current)return;const C=r.current;C.repeat(1),C.restart(),f.current=!0,Ln(ke.RESUME)},[]),y=S.useCallback(C=>{r.current&&(r.current.seek(C),h())},[h]),b=S.useCallback(()=>{r.current&&r.current.seek(4)},[]),x=S.useCallback(()=>{const C=r.current;return C?C.totalDuration():0},[]),v=S.useCallback(C=>{u.current.add(C)},[]),T=S.useCallback(C=>{u.current.delete(C)},[]),w=()=>{r.current&&(r.current.pause(),f.current=!1,Ln(ke.PAUSE))},O=()=>{r.current&&(r.current.resume(),f.current=!0,Ln(ke.RESUME))};return $e(ke.SEEK_START,()=>{a.current=!0,d.current=!0}),$e(ke.SCRUBBER_PLAY,()=>{O()}),$e(ke.SCRUBBER_PAUSE,()=>{w()}),$e(ke.SCRUBBER_SEEK,C=>{y(C)}),$e(ke.SEEK_END,()=>{a.current=!1,d.current=!1}),$e(ke.REVERSE_MODE_START,()=>{s.current=!0}),$e(ke.REVERSE_MODE_END,()=>{s.current=!1}),$e(ke.SCRUBBER_PROGRESS_UPDATE,C=>{}),M.jsx(Ye,{value:{gsapCtx:i,tl:r,handlePlay:O,handlePause:w,handleReset:p,handleSeek:y,handleSeekTest:b,handleRestart:m,handleRepeat:g,playerTimeRef:o,getTimelineDuration:x,totalDuration:e,setTotalDuration:n,reverseModeRef:s,dragModeRef:a,isRemotion:l,setIsRemotion:c,registerTimeUpdateListener:v,unregisterTimeUpdateListener:T,playStateRef:f,isSeekingRef:d},children:t})};var Is,Wh;function Hi(){if(Wh)return Is;Wh=1;var t=Object.prototype;function e(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||t;return n===i}return Is=e,Is}var Ms,zh;function qh(){if(zh)return Ms;zh=1;function t(e,n){return function(r){return e(n(r))}}return Ms=t,Ms}var Ls,Vh;function JE(){if(Vh)return Ls;Vh=1;var t=qh(),e=t(Object.keys,Object);return Ls=e,Ls}var Ps,Kh;function Zh(){if(Kh)return Ps;Kh=1;var t=Hi(),e=JE(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!t(o))return e(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return Ps=i,Ps}var Ns,$h;function Jh(){if($h)return Ns;$h=1;var t=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi;return Ns=t,Ns}var ks,Qh;function St(){if(Qh)return ks;Qh=1;var t=Jh(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return ks=n,ks}var Ds,ep;function er(){if(ep)return Ds;ep=1;var t=St(),e=t.Symbol;return Ds=e,Ds}var Fs,tp;function QE(){if(tp)return Fs;tp=1;var t=er(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[i]=l:delete s[i]),u}return Fs=o,Fs}var Bs,np;function eS(){if(np)return Bs;np=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Bs=n,Bs}var Us,rp;function tr(){if(rp)return Us;rp=1;var t=er(),e=QE(),n=eS(),r="[object Null]",i="[object Undefined]",o=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?e(a):n(a)}return Us=s,Us}var Gs,ip;function Pn(){if(ip)return Gs;ip=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Gs=t,Gs}var js,op;function sp(){if(op)return js;op=1;var t=tr(),e=Pn(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!e(a))return!1;var l=t(a);return l==r||l==i||l==n||l==o}return js=s,js}var Hs,ap;function tS(){if(ap)return Hs;ap=1;var t=St(),e=t["__core-js_shared__"];return Hs=e,Hs}var Ys,cp;function nS(){if(cp)return Ys;cp=1;var t=tS(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return Ys=n,Ys}var Xs,lp;function up(){if(lp)return Xs;lp=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return Xs=n,Xs}var Ws,fp;function rS(){if(fp)return Ws;fp=1;var t=sp(),e=nS(),n=Pn(),r=up(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||e(d))return!1;var h=t(d)?u:o;return h.test(r(d))}return Ws=f,Ws}var zs,dp;function iS(){if(dp)return zs;dp=1;function t(e,n){return e?.[n]}return zs=t,zs}var qs,hp;function Nn(){if(hp)return qs;hp=1;var t=rS(),e=iS();function n(r,i){var o=e(r,i);return t(o)?o:void 0}return qs=n,qs}var Vs,pp;function oS(){if(pp)return Vs;pp=1;var t=Nn(),e=St(),n=t(e,"DataView");return Vs=n,Vs}var Ks,mp;function Zs(){if(mp)return Ks;mp=1;var t=Nn(),e=St(),n=t(e,"Map");return Ks=n,Ks}var $s,gp;function sS(){if(gp)return $s;gp=1;var t=Nn(),e=St(),n=t(e,"Promise");return $s=n,$s}var Js,yp;function aS(){if(yp)return Js;yp=1;var t=Nn(),e=St(),n=t(e,"Set");return Js=n,Js}var Qs,_p;function cS(){if(_p)return Qs;_p=1;var t=Nn(),e=St(),n=t(e,"WeakMap");return Qs=n,Qs}var ea,bp;function Fr(){if(bp)return ea;bp=1;var t=oS(),e=Zs(),n=sS(),r=aS(),i=cS(),o=tr(),s=up(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",f="[object WeakMap]",d="[object DataView]",h=s(t),p=s(e),m=s(n),g=s(r),y=s(i),b=o;return(t&&b(new t(new ArrayBuffer(1)))!=d||e&&b(new e)!=a||n&&b(n.resolve())!=c||r&&b(new r)!=u||i&&b(new i)!=f)&&(b=function(x){var v=o(x),T=v==l?x.constructor:void 0,w=T?s(T):"";if(w)switch(w){case h:return d;case p:return a;case m:return c;case g:return u;case y:return f}return v}),ea=b,ea}var ta,xp;function dn(){if(xp)return ta;xp=1;function t(e){return e!=null&&typeof e=="object"}return ta=t,ta}var na,vp;function lS(){if(vp)return na;vp=1;var t=tr(),e=dn(),n="[object Arguments]";function r(i){return e(i)&&t(i)==n}return na=r,na}var ra,Tp;function ia(){if(Tp)return ra;Tp=1;var t=lS(),e=dn(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=t((function(){return arguments})())?t:function(s){return e(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return ra=o,ra}var oa,Ep;function Vt(){if(Ep)return oa;Ep=1;var t=Array.isArray;return oa=t,oa}var sa,Sp;function wp(){if(Sp)return sa;Sp=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return sa=e,sa}var aa,Ap;function ca(){if(Ap)return aa;Ap=1;var t=sp(),e=wp();function n(r){return r!=null&&e(r.length)&&!t(r)}return aa=n,aa}var Br={exports:{}},la,Op;function uS(){if(Op)return la;Op=1;function t(){return!1}return la=t,la}Br.exports;var Cp;function Yi(){return Cp||(Cp=1,(function(t,e){var n=St(),r=uS(),i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;t.exports=c})(Br,Br.exports)),Br.exports}var ua,Rp;function fS(){if(Rp)return ua;Rp=1;var t=tr(),e=wp(),n=dn(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",x="[object Float64Array]",v="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",O="[object Uint8Array]",C="[object Uint8ClampedArray]",R="[object Uint16Array]",P="[object Uint32Array]",A={};A[b]=A[x]=A[v]=A[T]=A[w]=A[O]=A[C]=A[R]=A[P]=!0,A[r]=A[i]=A[g]=A[o]=A[y]=A[s]=A[a]=A[l]=A[c]=A[u]=A[f]=A[d]=A[h]=A[p]=A[m]=!1;function L(N){return n(N)&&e(N.length)&&!!A[t(N)]}return ua=L,ua}var fa,Ip;function da(){if(Ip)return fa;Ip=1;function t(e){return function(n){return e(n)}}return fa=t,fa}var Ur={exports:{}};Ur.exports;var Mp;function ha(){return Mp||(Mp=1,(function(t,e){var n=Jh(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();t.exports=a})(Ur,Ur.exports)),Ur.exports}var pa,Lp;function ma(){if(Lp)return pa;Lp=1;var t=fS(),e=da(),n=ha(),r=n&&n.isTypedArray,i=r?e(r):t;return pa=i,pa}var ga,Pp;function dS(){if(Pp)return ga;Pp=1;var t=Zh(),e=Fr(),n=ia(),r=Vt(),i=ca(),o=Yi(),s=Hi(),a=ma(),l="[object Map]",c="[object Set]",u=Object.prototype,f=u.hasOwnProperty;function d(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var p=e(h);if(p==l||p==c)return!h.size;if(s(h))return!t(h).length;for(var m in h)if(f.call(h,m))return!1;return!0}return ga=d,ga}var hS=dS();const ya=Jn(hS);var Np=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Np||{});const _a={normal:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:0},lensflare:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},filmstrip:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},grunge:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},bricks:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"MULTIPLY",alpha:1}},kp=t=>{const{overlay:e,width:n,height:r,x:i,y:o}=t,{src:s}=_a[e]||_a.normal,[a,l]=I.useState(null);return I.useEffect(()=>{let c=!1;return W.Assets.load(s).then(u=>{c||l(u)}).catch(()=>{}),()=>{c=!0}},[s]),a?M.jsx("pixiTilingSprite",{texture:a,width:n,height:r,x:i,y:o,tilePosition:{x:0,y:0},tileScale:{x:.5,y:.5},alpha:.5,anchor:.5}):null};var Gr=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Gr||{});var pS=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,mS=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,gS=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,yS=/(^[#\.][a-z]|[a-y][a-z])/i,_S=Math.PI/180,bS=180/Math.PI,Xi=Math.sin,Wi=Math.cos,mt=Math.abs,Kt=Math.sqrt,jr=Math.atan2,ba=1e8,Dp=function(e){return typeof e=="string"},Fp=function(e){return typeof e=="number"},xS=function(e){return typeof e>"u"},vS={},TS={},zi=1e5,Bp=function(e){return Math.round((e+ba)%1*zi)/zi||(e<0?0:1)},Ce=function(e){return Math.round(e*zi)/zi||0},Up=function(e){return Math.round(e*1e10)/1e10||0},Gp=function(e){return e.closed=Math.abs(e[0]-e[e.length-2])<.001&&Math.abs(e[1]-e[e.length-1])<.001},jp=function(e,n,r,i){var o=e[n],s=i===1?6:Ta(o,r,i);if((s||!i)&&s+r+2<o.length)return e.splice(n,0,o.slice(0,r+s+2)),o.splice(0,r+s),1},xa=function(e,n,r){var i=e.length,o=~~(r*i);if(e[o]>n){for(;--o&&e[o]>n;);o<0&&(o=0)}else for(;e[++o]<n&&o<i;);return o<i?o:i-1},ES=function(e,n){var r=e.length;for(e.reverse();r--;)e[r].reversed||nr(e[r])},Hp=function(e,n){return n.totalLength=e.totalLength,e.samples?(n.samples=e.samples.slice(0),n.lookup=e.lookup.slice(0),n.minLength=e.minLength,n.resolution=e.resolution):e.totalPoints&&(n.totalPoints=e.totalPoints),n},SS=function(e,n){var r=e.length,i=e[r-1]||[],o=i.length;r&&n[0]===i[o-2]&&n[1]===i[o-1]&&(n=i.concat(n.slice(2)),r--),e[r]=n};function Hr(t){t=Dp(t)&&yS.test(t)&&document.querySelector(t)||t;var e=t.getAttribute?t:0,n;return e&&(t=t.getAttribute("d"))?(e._gsPath||(e._gsPath={}),n=e._gsPath[t],n&&!n._dirty?n:e._gsPath[t]=Dt(t)):t?Dp(t)?Dt(t):Fp(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function wS(t){for(var e=[],n=0;n<t.length;n++)e[n]=Hp(t[n],t[n].slice(0));return Hp(t,e)}function nr(t){var e=0,n;for(t.reverse();e<t.length;e+=2)n=t[e],t[e]=t[e+1],t[e+1]=n;t.reversed=!t.reversed}var AS=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(e.attributes),o=i.length,s;for(n=","+n+",";--o>-1;)s=i[o].nodeName.toLowerCase(),n.indexOf(","+s+",")<0&&r.setAttributeNS(null,s,i[o].nodeValue);return r},OS={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"},CS=function(e,n){for(var r=n?n.split(","):[],i={},o=r.length;--o>-1;)i[r[o]]=+e.getAttribute(r[o])||0;return i};function va(t,e){var n=t.tagName.toLowerCase(),r=.552284749831,i,o,s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R;return n==="path"||!t.getBBox?t:(c=AS(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),R=CS(t,OS[n]),n==="rect"?(a=R.rx,l=R.ry||a,o=R.x,s=R.y,h=R.width-a*2,p=R.height-l*2,a||l?(m=o+a*(1-r),g=o+a,y=g+h,b=y+a*r,x=y+a,v=s+l*(1-r),T=s+l,w=T+p,O=w+l*r,C=w+l,i="M"+x+","+T+" V"+w+" C"+[x,O,b,C,y,C,y-(y-g)/3,C,g+(y-g)/3,C,g,C,m,C,o,O,o,w,o,w-(w-T)/3,o,T+(w-T)/3,o,T,o,v,m,s,g,s,g+(y-g)/3,s,y-(y-g)/3,s,y,s,b,s,x,v,x,T].join(",")+"z"):i="M"+(o+h)+","+s+" v"+p+" h"+-h+" v"+-p+" h"+h+"z"):n==="circle"||n==="ellipse"?(n==="circle"?(a=l=R.r,f=a*r):(a=R.rx,l=R.ry,f=l*r),o=R.cx,s=R.cy,u=a*r,i="M"+(o+a)+","+s+" C"+[o+a,s+f,o+u,s+l,o,s+l,o-u,s+l,o-a,s+f,o-a,s,o-a,s-f,o-u,s-l,o,s-l,o+u,s-l,o+a,s-f,o+a,s].join(",")+"z"):n==="line"?i="M"+R.x1+","+R.y1+" L"+R.x2+","+R.y2:(n==="polyline"||n==="polygon")&&(d=(t.getAttribute("points")+"").match(mS)||[],o=d.shift(),s=d.shift(),i="M"+o+","+s+" L"+d.join(","),n==="polygon"&&(i+=","+o+","+s+"z")),c.setAttribute("d",hn(c._gsRawPath=Dt(i))),e&&t.parentNode&&(t.parentNode.insertBefore(c,t),t.parentNode.removeChild(t)),c)}function Yp(t,e,n){var r=t[e],i=t[e+2],o=t[e+4],s;return r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,s=i+(o+(t[e+6]-o)*n-i)*n-r,r=t[e+1],i=t[e+3],o=t[e+5],r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,Ce(jr(i+(o+(t[e+7]-o)*n-i)*n-r,s)*bS)}function Xp(t,e,n){n=xS(n)?1:Up(n)||0,e=Up(e)||0;var r=Math.max(0,~~(mt(n-e)-1e-8)),i=wS(t);if(e>n&&(e=1-e,n=1-n,ES(i),i.totalLength=0),e<0||n<0){var o=Math.abs(~~Math.min(e,n))+1;e+=o,n+=o}i.totalLength||Zt(i);var s=n>1,a=zp(i,e,vS,!0),l=zp(i,n,TS),c=l.segment,u=a.segment,f=l.segIndex,d=a.segIndex,h=l.i,p=a.i,m=d===f,g=h===p&&m,y,b,x,v,T,w,O,C;if(s||r){for(y=f<d||m&&h<p||g&&l.t<a.t,jp(i,d,p,a.t)&&(d++,y||(f++,g?(l.t=(l.t-a.t)/(1-a.t),h=0):m&&(h-=p))),Math.abs(1-(n-e))<1e-5?f=d-1:!l.t&&f?f--:jp(i,f,h,l.t)&&y&&d++,a.t===1&&(d=(d+1)%i.length),T=[],w=i.length,O=1+w*r,C=d,O+=(w-d+f)%w,v=0;v<O;v++)SS(T,i[C++%w]);i=T}else if(x=l.t===1?6:Ta(c,h,l.t),e!==n)for(b=Ta(u,p,g?a.t/l.t:a.t),m&&(x+=b),c.splice(h+x+2),(b||p)&&u.splice(0,p+b),v=i.length;v--;)(v<d||v>f)&&i.splice(v,1);else c.angle=Yp(c,h+x,0),h+=x,a=c[h],l=c[h+1],c.length=c.totalLength=0,c.totalPoints=i.totalPoints=8,c.push(a,l,a,l,a,l,a,l);return i.totalLength=0,i}function Wp(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var r=~~t.resolution||12,i=1/r,o=t.length,s=t[e],a=t[e+1],l=e?e/6*r:0,c=t.samples,u=t.lookup,f=(e?t.minLength:ba)||ba,d=c[l+n*r-1],h=e?c[l-1]:0,p,m,g,y,b,x,v,T,w,O,C,R,P,A,L,N,D;for(c.length=u.length=0,m=e+2;m<o;m+=6){if(g=t[m+4]-s,y=t[m+2]-s,b=t[m]-s,T=t[m+5]-a,w=t[m+3]-a,O=t[m+1]-a,x=v=C=R=0,mt(g)<.01&&mt(T)<.01&&mt(b)+mt(O)<.01)t.length>8&&(t.splice(m,6),m-=6,o-=6);else for(p=1;p<=r;p++)A=i*p,P=1-A,x=v-(v=(A*A*g+3*P*(A*y+P*b))*A),C=R-(R=(A*A*T+3*P*(A*w+P*O))*A),N=Kt(C*C+x*x),N<f&&(f=N),h+=N,c[l++]=h;s+=g,a+=T}if(d)for(d-=h;l<c.length;l++)c[l]+=d;if(c.length&&f){if(t.totalLength=D=c[c.length-1]||0,t.minLength=f,D/f<9999)for(N=L=0,p=0;p<D;p+=f)u[N++]=c[L]<p?++L:L}else t.totalLength=c[0]=0;return e?h-c[e/2-1]:h}function Zt(t,e){var n,r,i;for(i=n=r=0;i<t.length;i++)t[i].resolution=~~e||12,n+=Wp(t[i]),r+=t[i].length;return t.totalPoints=r,t.totalLength=n,t}function Ta(t,e,n){if(n<=0||n>=1)return 0;var r=t[e],i=t[e+1],o=t[e+2],s=t[e+3],a=t[e+4],l=t[e+5],c=t[e+6],u=t[e+7],f=r+(o-r)*n,d=o+(a-o)*n,h=i+(s-i)*n,p=s+(l-s)*n,m=f+(d-f)*n,g=h+(p-h)*n,y=a+(c-a)*n,b=l+(u-l)*n;return d+=(y-d)*n,p+=(b-p)*n,t.splice(e+2,4,Ce(f),Ce(h),Ce(m),Ce(g),Ce(m+(d-m)*n),Ce(g+(p-g)*n),Ce(d),Ce(p),Ce(y),Ce(b)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}function zp(t,e,n,r){n=n||{},t.totalLength||Zt(t),(e<0||e>1)&&(e=Bp(e));var i=0,o=t[0],s,a,l,c,u,f,d;if(!e)d=f=i=0,o=t[0];else if(e===1)d=1,i=t.length-1,o=t[i],f=o.length-8;else{if(t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=f;o=t[i],c=u-o.totalLength,e=(l-c)/(u-c)||0}s=o.samples,a=o.resolution,l=o.totalLength*e,f=o.lookup.length?o.lookup[~~(l/o.minLength)]||0:xa(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a),f=~~(f/a)*6,r&&d===1&&(f+6<o.length?(f+=6,d=0):i+1<t.length&&(f=d=0,o=t[++i]))}return n.t=d,n.i=f,n.path=t,n.segment=o,n.segIndex=i,n}function qp(t,e,n,r){var i=t[0],o=r||{},s,a,l,c,u,f,d,h,p;if((e<0||e>1)&&(e=Bp(e)),i.lookup||Zt(t),t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=t[f];c=u-i.totalLength,e=(l-c)/(u-c)||0}return s=i.samples,a=i.resolution,l=i.totalLength*e,f=i.lookup.length?i.lookup[e<1?~~(l/i.minLength):i.lookup.length-1]||0:xa(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a)||0,p=1-d,f=~~(f/a)*6,h=i[f],o.x=Ce((d*d*(i[f+6]-h)+3*p*(d*(i[f+4]-h)+p*(i[f+2]-h)))*d+h),o.y=Ce((d*d*(i[f+7]-(h=i[f+1]))+3*p*(d*(i[f+5]-h)+p*(i[f+3]-h)))*d+h),n&&(o.angle=i.totalLength?Yp(i,f,d>=1?1-1e-9:d||1e-9):i.angle||0),o}function Yr(t,e,n,r,i,o,s){for(var a=t.length,l,c,u,f,d;--a>-1;)for(l=t[a],c=l.length,u=0;u<c;u+=2)f=l[u],d=l[u+1],l[u]=f*e+d*r+o,l[u+1]=f*n+d*i+s;return t._dirty=1,t}function RS(t,e,n,r,i,o,s,a,l){if(!(t===a&&e===l)){n=mt(n),r=mt(r);var c=i%360*_S,u=Wi(c),f=Xi(c),d=Math.PI,h=d*2,p=(t-a)/2,m=(e-l)/2,g=u*p+f*m,y=-f*p+u*m,b=g*g,x=y*y,v=b/(n*n)+x/(r*r);v>1&&(n=Kt(v)*n,r=Kt(v)*r);var T=n*n,w=r*r,O=(T*w-T*x-w*b)/(T*x+w*b);O<0&&(O=0);var C=(o===s?-1:1)*Kt(O),R=C*(n*y/r),P=C*-(r*g/n),A=(t+a)/2,L=(e+l)/2,N=A+(u*R-f*P),D=L+(f*R+u*P),F=(g-R)/n,G=(y-P)/r,z=(-g-R)/n,K=(-y-P)/r,ae=F*F+G*G,pe=(G<0?-1:1)*Math.acos(F/Kt(ae)),X=(F*K-G*z<0?-1:1)*Math.acos((F*z+G*K)/Kt(ae*(z*z+K*K)));isNaN(X)&&(X=d),!s&&X>0?X-=h:s&&X<0&&(X+=h),pe%=h,X%=h;var he=Math.ceil(mt(X)/(h/4)),j=[],$=X/he,H=4/3*Xi($/2)/(1+Wi($/2)),ce=u*n,Z=f*n,se=f*-r,J=u*r,ie;for(ie=0;ie<he;ie++)i=pe+ie*$,g=Wi(i),y=Xi(i),F=Wi(i+=$),G=Xi(i),j.push(g-H*y,y+H*g,F+H*G,G-H*F,F,G);for(ie=0;ie<j.length;ie+=2)g=j[ie],y=j[ie+1],j[ie]=g*ce+y*se+N,j[ie+1]=g*Z+y*J+D;return j[ie-2]=a,j[ie-1]=l,j}}function Dt(t){var e=(t+"").replace(gS,function(R){var P=+R;return P<1e-4&&P>-1e-4?0:P}).match(pS)||[],n=[],r=0,i=0,o=2/3,s=e.length,a=0,l="ERROR: malformed path: "+t,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C=function(P,A,L,N){b=(L-P)/3,x=(N-A)/3,m.push(P+b,A+x,L-b,N-x,L,N)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(l),n;for(c=0;c<s;c++)if(T=h,isNaN(e[c])?(h=e[c].toUpperCase(),p=h!==e[c]):c--,f=+e[c+1],d=+e[c+2],p&&(f+=r,d+=i),c||(g=f,y=d),h==="M")m&&(m.length<8?n.length-=1:a+=m.length,Gp(m)),r=g=f,i=y=d,m=[f,d],n.push(m),c+=2,h="L";else if(h==="C")m||(m=[0,0]),p||(r=i=0),m.push(f,d,r+e[c+3]*1,i+e[c+4]*1,r+=e[c+5]*1,i+=e[c+6]*1),c+=6;else if(h==="S")b=r,x=i,(T==="C"||T==="S")&&(b+=r-m[m.length-4],x+=i-m[m.length-3]),p||(r=i=0),m.push(b,x,f,d,r+=e[c+3]*1,i+=e[c+4]*1),c+=4;else if(h==="Q")b=r+(f-r)*o,x=i+(d-i)*o,p||(r=i=0),r+=e[c+3]*1,i+=e[c+4]*1,m.push(b,x,r+(f-r)*o,i+(d-i)*o,r,i),c+=4;else if(h==="T")b=r-m[m.length-4],x=i-m[m.length-3],m.push(r+b,i+x,f+(r+b*1.5-f)*o,d+(i+x*1.5-d)*o,r=f,i=d),c+=2;else if(h==="H")C(r,i,r=f,i),c+=1;else if(h==="V")C(r,i,r,i=f+(p?i-r:0)),c+=1;else if(h==="L"||h==="Z")h==="Z"&&(f=g,d=y,m.closed=!0),(h==="L"||mt(r-f)>.5||mt(i-d)>.5)&&(C(r,i,f,d),h==="L"&&(c+=2)),r=f,i=d;else if(h==="A"){if(w=e[c+4],O=e[c+5],b=e[c+6],x=e[c+7],u=7,w.length>1&&(w.length<3?(x=b,b=O,u--):(x=O,b=w.substr(2),u-=2),O=w.charAt(1),w=w.charAt(0)),v=RS(r,i,+e[c+1],+e[c+2],+e[c+3],+w,+O,(p?r:0)+b*1,(p?i:0)+x*1),c+=u,v)for(u=0;u<v.length;u++)m.push(v[u]);r=m[m.length-2],i=m[m.length-1]}else console.log(l);return c=m.length,c<6?(n.pop(),c=0):Gp(m),n.totalPoints=a+c,n}function IS(t,e){e===void 0&&(e=1);for(var n=t[0],r=0,i=[n,r],o=2;o<t.length;o+=2)i.push(n,r,t[o],r=(t[o]-n)*e/2,n=t[o],-r);return i}function MS(t,e){t.samples||Wp(t);for(var n=t.samples,r=t.lookup,i=t.resolution,o=t.totalLength,s=t.slice(0,2),a=[],l=t.length-4,c=6,u=.2,f=0,d=0,h,p,m,g,y,b,x,v,T,w,O,C,R,P;c<l;c+=6)Math.abs(jr(t[c+1]-t[c-1],t[c]-t[c-2])-jr(t[c+3]-t[c+1],t[c+2]-t[c]))>u&&a.push(c);if(a.push(t.length-2),l=a.length,s.nonSmooth=C=[1],e>l)for(e-=l,y=0;y<l;y++){for(R=a[y],P=Math.round(R/6*i),T=n[P-1]-f,p=Math.round(n[P-1]/o*e)-d,d+=p,b=1/(p+1),x=1;x<=p;x++)w=f+T*x*b,c=r.length?r[w<o?~~(w/t.minLength):r.length-1]||0:xa(n,w,w/o),m=c?n[c-1]:0,g=n[c],g<w&&(m=g,g=n[++c]),h=1/i*((w-m)/(g-m)+c%i)||0,v=1-h,c=~~(c/i)*6,O=t[c],s.push(Ce((h*h*(t[c+6]-O)+3*v*(h*(t[c+4]-O)+v*(t[c+2]-O)))*h+O),Ce((h*h*(t[c+7]-(O=t[c+1]))+3*v*(h*(t[c+5]-O)+v*(t[c+3]-O)))*h+O));C[s.length]=1,s.push(t[R],t[R+1]),f+=T}return c=t.length-2,t.closed&&Math.abs(jr(t[c+1]-t[c-1],t[c]-t[c-2])-jr(t[3]-t[1],t[2]-t[0]))<=u&&(C[0]=C[C.length-1]=0),s}function qi(t,e){mt(t[0]-t[2])<1e-4&&mt(t[1]-t[3])<1e-4&&(t=t.slice(2));var n=t.length-2,r=+t[0],i=+t[1],o=+t[2],s=+t[3],a=[r,i,r,i],l=o-r,c=s-i,u=t.nonSmooth||[],f=Math.abs(t[n]-r)<.001&&Math.abs(t[n+1]-i)<.001,d,h,p,m,g,y,b,x,v,T,w,O,C,R,P;if(!n)return[r,i,r,i,r,i,r,i];for(f&&(t.push(o,s),o=r,s=i,r=t[n-2],i=t[n-1],t.unshift(r,i),n+=4,u=[0,0].concat(u)),e=e||e===0?+e:1,p=2;p<n;p+=2)if(d=r,h=i,r=o,i=s,o=+t[p+2],s=+t[p+3],!(r===o&&i===s)){if(m=l,g=c,l=o-r,c=s-i,u[p]){a.push(r-(r-d)/4,i-(i-h)/4,r,i,r+(o-r)/4,i+(s-i)/4);continue}y=Kt(m*m+g*g),b=Kt(l*l+c*c),x=Kt(Math.pow(l/b+m/y,2)+Math.pow(c/b+g/y,2)),v=(y+b)*e*.25/x,T=r-(r-d)*(y?v/y:0),w=r+(o-r)*(b?v/b:0),O=r-(T+((w-T)*(y*3/(y+b)+.5)/4||0)),C=i-(i-h)*(y?v/y:0),R=i+(s-i)*(b?v/b:0),P=i-(C+((R-C)*(y*3/(y+b)+.5)/4||0)),a.push(Ce(T+O),Ce(C+P),Ce(r),Ce(i),Ce(w+O),Ce(R+P))}return r!==o||i!==s||a.length<4?a.push(Ce(o),Ce(s),Ce(o),Ce(s)):a.length-=2,a.length===2?a.push(r,i,r,i,r,i):f&&(a.splice(0,6),a.length-=6),a.closed=f,a}function hn(t){Fp(t[0])&&(t=[t]);var e="",n=t.length,r,i,o,s;for(i=0;i<n;i++){for(s=t[i],e+="M"+Ce(s[0])+","+Ce(s[1])+" C",r=s.length,o=2;o<r;o++)e+=Ce(s[o++])+","+Ce(s[o++])+" "+Ce(s[o++])+","+Ce(s[o++])+" "+Ce(s[o++])+","+Ce(s[o])+" ";s.closed&&(e+="z")}return e}var $t,kn,Ea,Vi,Xr,Ki,Zi,Wr,wt="transform",Sa=wt+"Origin",Vp,Kp=function(e){var n=e.ownerDocument||e;for(!(wt in e.style)&&("msTransform"in e.style)&&(wt="msTransform",Sa=wt+"Origin");n.parentNode&&(n=n.parentNode););if(kn=window,Zi=new zr,n){$t=n,Ea=n.documentElement,Vi=n.body,Wr=$t.createElementNS("http://www.w3.org/2000/svg","g"),Wr.style.transform="none";var r=n.createElement("div"),i=n.createElement("div"),o=n&&(n.body||n.firstElementChild);o&&o.appendChild&&(o.appendChild(r),r.appendChild(i),r.style.position="static",r.style.transform="translate3d(0,0,1px)",Vp=i.offsetParent!==r,o.removeChild(r))}return n},LS=function(e){for(var n,r;e&&e!==Vi;)r=e._gsap,r&&r.uncache&&r.get(e,"x"),r&&!r.scaleX&&!r.scaleY&&r.renderTransform&&(r.scaleX=r.scaleY=1e-4,r.renderTransform(1,r),n?n.push(r):n=[r]),e=e.parentNode;return n},Zp=[],$p=[],PS=function(){return kn.pageYOffset||$t.scrollTop||Ea.scrollTop||Vi.scrollTop||0},NS=function(){return kn.pageXOffset||$t.scrollLeft||Ea.scrollLeft||Vi.scrollLeft||0},wa=function(e){return e.ownerSVGElement||((e.tagName+"").toLowerCase()==="svg"?e:null)},kS=function t(e){if(kn.getComputedStyle(e).position==="fixed")return!0;if(e=e.parentNode,e&&e.nodeType===1)return t(e)},Aa=function t(e,n){if(e.parentNode&&($t||Kp(e))){var r=wa(e),i=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o=r?n?"rect":"g":"div",s=n!==2?0:100,a=n===3?100:0,l={position:"absolute",display:"block",pointerEvents:"none",margin:"0",padding:"0"},c=$t.createElementNS?$t.createElementNS(i.replace(/^https/,"http"),o):$t.createElement(o);return n&&(r?(Ki||(Ki=t(e)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+s+","+a+")"),c.setAttribute("fill","transparent"),Ki.appendChild(c)):(Xr||(Xr=t(e),Object.assign(Xr.style,l)),Object.assign(c.style,l,{width:"0.1px",height:"0.1px",top:a+"px",left:s+"px"}),Xr.appendChild(c))),c}throw"Need document and parent."},DS=function(e){for(var n=new zr,r=0;r<e.numberOfItems;r++)n.multiply(e.getItem(r).matrix);return n},FS=function(e){var n=e.getCTM(),r;return n||(r=e.style[wt],e.style[wt]="none",e.appendChild(Wr),n=Wr.getCTM(),e.removeChild(Wr),r?e.style[wt]=r:e.style.removeProperty(wt.replace(/([A-Z])/g,"-$1").toLowerCase())),n||Zi.clone()},BS=function(e,n){var r=wa(e),i=e===r,o=r?Zp:$p,s=e.parentNode,a=s&&!r&&s.shadowRoot&&s.shadowRoot.appendChild?s.shadowRoot:s,l,c,u,f,d,h;if(e===kn)return e;if(o.length||o.push(Aa(e,1),Aa(e,2),Aa(e,3)),l=r?Ki:Xr,r)i?(u=FS(e),f=-u.e/u.a,d=-u.f/u.d,c=Zi):e.getBBox?(u=e.getBBox(),c=e.transform?e.transform.baseVal:{},c=c.numberOfItems?c.numberOfItems>1?DS(c):c.getItem(0).matrix:Zi,f=c.a*u.x+c.c*u.y,d=c.b*u.x+c.d*u.y):(c=new zr,f=d=0),n&&e.tagName.toLowerCase()==="g"&&(f=d=0),(i||!e.getBoundingClientRect().width?r:s).appendChild(l),l.setAttribute("transform","matrix("+c.a+","+c.b+","+c.c+","+c.d+","+(c.e+f)+","+(c.f+d)+")");else{if(f=d=0,Vp)for(c=e.offsetParent,u=e;u&&(u=u.parentNode)&&u!==c&&u.parentNode;)(kn.getComputedStyle(u)[wt]+"").length>4&&(f=u.offsetLeft,d=u.offsetTop,u=0);if(h=kn.getComputedStyle(e),h.position!=="absolute"&&h.position!=="fixed")for(c=e.offsetParent;s&&s!==c;)f+=s.scrollLeft||0,d+=s.scrollTop||0,s=s.parentNode;u=l.style,u.top=e.offsetTop-d+"px",u.left=e.offsetLeft-f+"px",u[wt]=h[wt],u[Sa]=h[Sa],u.position=h.position==="fixed"?"fixed":"absolute",a.appendChild(l)}return l},Oa=function(e,n,r,i,o,s,a){return e.a=n,e.b=r,e.c=i,e.d=o,e.e=s,e.f=a,e},zr=(function(){function t(n,r,i,o,s,a){n===void 0&&(n=1),r===void 0&&(r=0),i===void 0&&(i=0),o===void 0&&(o=1),s===void 0&&(s=0),a===void 0&&(a=0),Oa(this,n,r,i,o,s,a)}var e=t.prototype;return e.inverse=function(){var r=this.a,i=this.b,o=this.c,s=this.d,a=this.e,l=this.f,c=r*s-i*o||1e-10;return Oa(this,s/c,-i/c,-o/c,r/c,(o*l-s*a)/c,-(r*l-i*a)/c)},e.multiply=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f,u=r.a,f=r.c,d=r.b,h=r.d,p=r.e,m=r.f;return Oa(this,u*i+d*s,u*o+d*a,f*i+h*s,f*o+h*a,l+p*i+m*s,c+p*o+m*a)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f;return i===r.a&&o===r.b&&s===r.c&&a===r.d&&l===r.e&&c===r.f},e.apply=function(r,i){i===void 0&&(i={});var o=r.x,s=r.y,a=this.a,l=this.b,c=this.c,u=this.d,f=this.e,d=this.f;return i.x=o*a+s*c+f||0,i.y=o*l+s*u+d||0,i},t})();function rr(t,e,n,r){if(!t||!t.parentNode||($t||Kp(t)).documentElement===t)return new zr;var i=LS(t),o=wa(t),s=o?Zp:$p,a=BS(t,n),l=s[0].getBoundingClientRect(),c=s[1].getBoundingClientRect(),u=s[2].getBoundingClientRect(),f=a.parentNode,d=!r&&kS(t),h=new zr((c.left-l.left)/100,(c.top-l.top)/100,(u.left-l.left)/100,(u.top-l.top)/100,l.left+(d?0:NS()),l.top+(d?0:PS()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return e?h.inverse():h}var US="x,translateX,left,marginLeft,xPercent".split(","),GS="y,translateY,top,marginTop,yPercent".split(","),jS=Math.PI/180,gt,Jp,ir,Ca,Ra,Qp,HS=function(){return gt||typeof window<"u"&&(gt=window.gsap)&>.registerPlugin&>},qr=function(e,n,r,i){for(var o=n.length,s=i===2?0:i,a=0;a<o;a++)e[s]=parseFloat(n[a][r]),i===2&&(e[s+1]=0),s+=2;return e},or=function(e,n,r){return parseFloat(e._gsap.get(e,n,r||"px"))||0},em=function(e){var n=e[0],r=e[1],i;for(i=2;i<e.length;i+=2)n=e[i]+=n,r=e[i+1]+=r},tm=function(e,n,r,i,o,s,a,l,c){if(a.type==="cubic")n=[n];else{a.fromCurrent!==!1&&n.unshift(or(r,i,l),o?or(r,o,c):0),a.relative&&em(n);var u=o?qi:IS;n=[u(n,a.curviness)]}return n=s(rm(n,r,a)),$i(e,r,i,n,"x",l),o&&$i(e,r,o,n,"y",c),Zt(n,a.resolution||(a.curviness===0?20:12))},YS=function(e){return e},XS=/[-+\.]*\d+\.?(?:e-|e\+)?\d*/g,nm=function(e,n,r){var i=rr(e),o=0,s=0,a;return(e.tagName+"").toLowerCase()==="svg"?(a=e.viewBox.baseVal,a.width||(a={width:+e.getAttribute("width"),height:+e.getAttribute("height")})):a=n&&e.getBBox&&e.getBBox(),n&&n!=="auto"&&(o=n.push?n[0]*(a?a.width:e.offsetWidth||0):n.x,s=n.push?n[1]*(a?a.height:e.offsetHeight||0):n.y),r.apply(o||s?i.apply({x:o,y:s}):{x:i.e,y:i.f})},Ia=function(e,n,r,i){var o=rr(e.parentNode,!0,!0),s=o.clone().multiply(rr(n)),a=nm(e,r,o),l=nm(n,i,o),c=l.x,u=l.y,f;return s.e=s.f=0,i==="auto"&&n.getTotalLength&&n.tagName.toLowerCase()==="path"&&(f=n.getAttribute("d").match(XS)||[],f=s.apply({x:+f[0],y:+f[1]}),c+=f.x,u+=f.y),f&&(f=s.apply(n.getBBox()),c-=f.x,u-=f.y),s.e=c-a.x,s.f=u-a.y,s},rm=function(e,n,r){var i=r.align,o=r.matrix,s=r.offsetX,a=r.offsetY,l=r.alignOrigin,c=e[0][0],u=e[0][1],f=or(n,"x"),d=or(n,"y"),h,p,m;return!e||!e.length?Hr("M0,0L0,0"):(i&&(i==="self"||(h=Ca(i)[0]||n)===n?Yr(e,1,0,0,1,f-c,d-u):(l&&l[2]!==!1?gt.set(n,{transformOrigin:l[0]*100+"% "+l[1]*100+"%"}):l=[or(n,"xPercent")/-100,or(n,"yPercent")/-100],p=Ia(n,h,l,"auto"),m=p.apply({x:c,y:u}),Yr(e,p.a,p.b,p.c,p.d,f+p.e-(m.x-p.e),d+p.f-(m.y-p.f)))),o?Yr(e,o.a,o.b,o.c,o.d,o.e,o.f):(s||a)&&Yr(e,1,0,0,1,s||0,a||0),e)},$i=function(e,n,r,i,o,s){var a=n._gsap,l=a.harness,c=l&&l.aliases&&l.aliases[r],u=c&&c.indexOf(",")<0?c:r,f=e._pt=new Jp(e._pt,n,u,0,0,YS,0,a.set(n,u,e));f.u=ir(a.get(n,u,s))||0,f.path=i,f.pp=o,e._props.push(u)},WS=function(e,n){return function(r){return e||n!==1?Xp(r,e,n):r}},im={version:"3.15.0",name:"motionPath",register:function(e,n,r){gt=e,ir=gt.utils.getUnit,Ca=gt.utils.toArray,Ra=gt.core.getStyleSaver,Qp=gt.core.reverting||function(){},Jp=r},init:function(e,n,r){if(!gt)return console.warn("Please gsap.registerPlugin(MotionPathPlugin)"),!1;(!(typeof n=="object"&&!n.style)||!n.path)&&(n={path:n});var i=[],o=n,s=o.path,a=o.autoRotate,l=o.unitX,c=o.unitY,u=o.x,f=o.y,d=s[0],h=WS(n.start,"end"in n?n.end:1),p,m;if(this.rawPaths=i,this.target=e,this.tween=r,this.styles=Ra&&Ra(e,"transform"),(this.rotate=a||a===0)&&(this.rOffset=parseFloat(a)||0,this.radians=!!n.useRadians,this.rProp=n.rotation||"rotation",this.rSet=e._gsap.set(e,this.rProp,this),this.ru=ir(e._gsap.get(e,this.rProp))||0),Array.isArray(s)&&!("closed"in s)&&typeof d!="number"){for(m in d)!u&&~US.indexOf(m)?u=m:!f&&~GS.indexOf(m)&&(f=m);u&&f?i.push(tm(this,qr(qr([],s,u,0),s,f,1),e,u,f,h,n,l||ir(s[0][u]),c||ir(s[0][f]))):u=f=0;for(m in d)m!==u&&m!==f&&i.push(tm(this,qr([],s,m,2),e,m,0,h,n,ir(s[0][m])))}else p=h(rm(Hr(n.path),e,n)),Zt(p,n.resolution),i.push(p),$i(this,e,n.x||"x",p,"x",n.unitX||"px"),$i(this,e,n.y||"y",p,"y",n.unitY||"px");r.vars.immediateRender&&this.render(r.progress(),this)},render:function(e,n){var r=n.rawPaths,i=r.length,o=n._pt;if(n.tween._time||!Qp()){for(e>1?e=1:e<0&&(e=0);i--;)qp(r[i],e,!i&&n.rotate,r[i]);for(;o;)o.set(o.t,o.p,o.path[o.pp]+o.u,o.d,e),o=o._next;n.rotate&&n.rSet(n.target,n.rProp,r[0].angle*(n.radians?jS:1)+n.rOffset+n.ru,n,e)}else n.styles.revert()},getLength:function(e){return Zt(Hr(e)).totalLength},sliceRawPath:Xp,getRawPath:Hr,pointsToSegment:qi,stringToRawPath:Dt,rawPathToString:hn,transformRawPath:Yr,getGlobalMatrix:rr,getPositionOnPath:qp,cacheRawPathMeasurements:Zt,convertToPath:function(e,n){return Ca(e).map(function(r){return va(r,n!==!1)})},convertCoordinates:function(e,n,r){var i=rr(n,!0,!0).multiply(rr(e));return r?i.apply(r):i},getAlignMatrix:Ia,getRelativePosition:function(e,n,r,i){var o=Ia(e,n,r,i);return{x:o.e,y:o.f}},arrayToRawPath:function(e,n){n=n||{};var r=qr(qr([],e,n.x||"x",0),e,n.y||"y",1);return n.relative&&em(r),[n.type==="cubic"?r:qi(r,n.curviness)]}};HS()&>.registerPlugin(im),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerPlugin(wn),wn.create("springBounce","0.32, 1.06, 0.61, 0.93"),E.registerEffect({name:"HEART_BEAT",effect(t,e){try{const{canvasWidth:r,canvasHeight:i,...o}=e;return E.timeline({repeat:e.repeat||0,defaults:{ease:"power2.out",...o}}).to(t,{pixi:{scale:1*1.3},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.14,ease:"power2.in"}).to(t,{pixi:{scale:1*1.2},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.28,ease:"power2.in"})}catch(n){return console.error("[HEART_BEAT] Animation error:",n),E.timeline()}}});const ne={IN:"IN",OUT:"OUT",ATTENTION:"ATTENTION"},ee={NONE:"NONE",FADE:"FADE",SLIDE:"SLIDE",ZOOM:"ZOOM",BOUNCE:"BOUNCE",BACK:"BACK",FLIP:"FLIP",ROTATE:"ROTATE",ROLL:"ROLL",LIGHT_SPEED:"LIGHT_SPEED",WIPE:"WIPE",SHAKE:"SHAKE",SPECIAL:"SPECIAL"},Pe={OFFSET_MEDIUM:2e3}.OFFSET_MEDIUM,Te={NONE:{id:"NONE",category:ee.NONE,direction:null,keyframes:{},gsapEasing:"none",defaultDuration:0},FADE_IN:{id:"FADE_IN",category:ee.FADE,direction:ne.IN,keyframes:{opacity:{from:0,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5},FADE_IN_DOWN:{id:"FADE_IN_DOWN",category:ee.FADE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_UP:{id:"FADE_IN_UP",category:ee.FADE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_LEFT:{id:"FADE_IN_LEFT",category:ee.FADE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_RIGHT:{id:"FADE_IN_RIGHT",category:ee.FADE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_OUT:{id:"FADE_OUT",category:ee.FADE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_DOWN:{id:"FADE_OUT_DOWN",category:ee.FADE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_UP:{id:"FADE_OUT_UP",category:ee.FADE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_LEFT:{id:"FADE_OUT_LEFT",category:ee.FADE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_RIGHT:{id:"FADE_OUT_RIGHT",category:ee.FADE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_DOWN:{id:"SLIDE_IN_DOWN",category:ee.SLIDE,direction:ne.IN,keyframes:{translateY:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_UP:{id:"SLIDE_IN_UP",category:ee.SLIDE,direction:ne.IN,keyframes:{translateY:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_LEFT:{id:"SLIDE_IN_LEFT",category:ee.SLIDE,direction:ne.IN,keyframes:{translateX:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_RIGHT:{id:"SLIDE_IN_RIGHT",category:ee.SLIDE,direction:ne.IN,keyframes:{translateX:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_DOWN:{id:"SLIDE_OUT_DOWN",category:ee.SLIDE,direction:ne.OUT,keyframes:{translateY:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_UP:{id:"SLIDE_OUT_UP",category:ee.SLIDE,direction:ne.OUT,keyframes:{translateY:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_LEFT:{id:"SLIDE_OUT_LEFT",category:ee.SLIDE,direction:ne.OUT,keyframes:{translateX:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_RIGHT:{id:"SLIDE_OUT_RIGHT",category:ee.SLIDE,direction:ne.OUT,keyframes:{translateX:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN:{id:"ZOOM_IN",category:ee.ZOOM,direction:ne.IN,keyframes:{opacity:{from:0,to:1,midPoint:.5},scale:{from:.3,to:1}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN_DOWN:{id:"ZOOM_IN_DOWN",category:ee.ZOOM,direction:ne.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:-1e3,mid:60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_UP:{id:"ZOOM_IN_UP",category:ee.ZOOM,direction:ne.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:1e3,mid:-60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_LEFT:{id:"ZOOM_IN_LEFT",category:ee.ZOOM,direction:ne.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:-1e3,mid:10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_RIGHT:{id:"ZOOM_IN_RIGHT",category:ee.ZOOM,direction:ne.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:1e3,mid:-10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_OUT:{id:"ZOOM_OUT",category:ee.ZOOM,direction:ne.OUT,keyframes:{opacity:{from:1,to:0,midPoint:.5},scale:{from:1,to:.3}},gsapEasing:"power2.in",defaultDuration:.5},ZOOM_OUT_DOWN:{id:"ZOOM_OUT_DOWN",category:ee.ZOOM,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:-60,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_UP:{id:"ZOOM_OUT_UP",category:ee.ZOOM,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:60,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_LEFT:{id:"ZOOM_OUT_LEFT",category:ee.ZOOM,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:42,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_RIGHT:{id:"ZOOM_OUT_RIGHT",category:ee.ZOOM,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:-42,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},BACK_IN_DOWN:{id:"BACK_IN_DOWN",category:ee.BACK,direction:ne.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_UP:{id:"BACK_IN_UP",category:ee.BACK,direction:ne.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_LEFT:{id:"BACK_IN_LEFT",category:ee.BACK,direction:ne.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_RIGHT:{id:"BACK_IN_RIGHT",category:ee.BACK,direction:ne.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_OUT_DOWN:{id:"BACK_OUT_DOWN",category:ee.BACK,direction:ne.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_UP:{id:"BACK_OUT_UP",category:ee.BACK,direction:ne.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_LEFT:{id:"BACK_OUT_LEFT",category:ee.BACK,direction:ne.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_RIGHT:{id:"BACK_OUT_RIGHT",category:ee.BACK,direction:ne.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BOUNCE_IN:{id:"BOUNCE_IN",category:ee.BOUNCE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.3,to:1}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_DOWN:{id:"BOUNCE_IN_DOWN",category:ee.BOUNCE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_UP:{id:"BOUNCE_IN_UP",category:ee.BOUNCE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_LEFT:{id:"BOUNCE_IN_LEFT",category:ee.BOUNCE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_RIGHT:{id:"BOUNCE_IN_RIGHT",category:ee.BOUNCE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_OUT:{id:"BOUNCE_OUT",category:ee.BOUNCE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,to:.3}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_DOWN:{id:"BOUNCE_OUT_DOWN",category:ee.BOUNCE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_UP:{id:"BOUNCE_OUT_UP",category:ee.BOUNCE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_LEFT:{id:"BOUNCE_OUT_LEFT",category:ee.BOUNCE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_RIGHT:{id:"BOUNCE_OUT_RIGHT",category:ee.BOUNCE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},FLIP:{id:"FLIP",category:ee.FLIP,direction:ne.ATTENTION,keyframes:{rotation:{from:-360,mid1:-190,mid2:-170,to:0},scale:{from:1,mid:.95,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_X:{id:"FLIP_IN_X",category:ee.FLIP,direction:ne.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleY:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_Y:{id:"FLIP_IN_Y",category:ee.FLIP,direction:ne.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleX:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_X:{id:"FLIP_OUT_X",category:ee.FLIP,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scaleY:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_Y:{id:"FLIP_OUT_Y",category:ee.FLIP,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},scaleX:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_LEFT:{id:"LIGHT_SPEED_IN_LEFT",category:ee.LIGHT_SPEED,direction:ne.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"-100%",to:0,atPercent:60},skewX:{from:30,mid1:-20,mid2:5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_RIGHT:{id:"LIGHT_SPEED_IN_RIGHT",category:ee.LIGHT_SPEED,direction:ne.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"100%",to:0,atPercent:60},skewX:{from:-30,mid1:20,mid2:-5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_OUT_LEFT:{id:"LIGHT_SPEED_OUT_LEFT",category:ee.LIGHT_SPEED,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"-100%"},skewX:{from:0,to:-30}},gsapEasing:"power2.in",defaultDuration:.5},LIGHT_SPEED_OUT_RIGHT:{id:"LIGHT_SPEED_OUT_RIGHT",category:ee.LIGHT_SPEED,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},skewX:{from:0,to:30}},gsapEasing:"power2.in",defaultDuration:.5},ROTATE_IN:{id:"ROTATE_IN",category:ee.ROTATE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},rotation:{from:-200,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROTATE_OUT:{id:"ROTATE_OUT",category:ee.ROTATE,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},rotation:{from:0,to:200}},gsapEasing:"power1.in",defaultDuration:.5},ROLL_IN:{id:"ROLL_IN",category:ee.ROLL,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:"-100%",to:0},rotation:{from:-120,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROLL_OUT:{id:"ROLL_OUT",category:ee.ROLL,direction:ne.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},rotation:{from:0,to:120}},gsapEasing:"power1.in",defaultDuration:.5},SHAKE:{id:"SHAKE",category:ee.SHAKE,direction:ne.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_X:{id:"SHAKE_X",category:ee.SHAKE,direction:ne.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_Y:{id:"SHAKE_Y",category:ee.SHAKE,direction:ne.ATTENTION,keyframes:{shakeY:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},HEART_BEAT:{id:"HEART_BEAT",category:ee.SPECIAL,direction:ne.ATTENTION,keyframes:{pulseScale:{min:1,max:1.3}},gsapEasing:"power1.inOut",defaultDuration:.5},PULSE:{id:"PULSE",category:ee.SPECIAL,direction:ne.ATTENTION,keyframes:{pulseScale:{min:1,max:1.05}},gsapEasing:"power1.inOut",defaultDuration:.5},WIPE_LEFT:{id:"WIPE_LEFT",category:ee.WIPE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_RIGHT:{id:"WIPE_RIGHT",category:ee.WIPE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_UP:{id:"WIPE_UP",category:ee.WIPE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_DOWN:{id:"WIPE_DOWN",category:ee.WIPE,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},RISE:{id:"RISE",category:ee.SPECIAL,direction:ne.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:30,to:0},scale:{from:.95,to:1}},gsapEasing:"power2.out",defaultDuration:.5},TYPEWRITER:{id:"TYPEWRITER",category:ee.SPECIAL,direction:ne.IN,keyframes:{typewriter:{text:"",duration:2,charactersPerSecond:20}},gsapEasing:"none",defaultDuration:2}};E.registerEffect({name:"FADE_IN",effect(t,e){try{const n=Te.FADE_IN;if(!n)return console.error("[FADE_IN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_DOWN",effect(t,e){try{const n=Te.FADE_IN_DOWN;if(!n)return console.error("[FADE_IN_DOWN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return E.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_UP",effect(t,e){try{const n=Te.FADE_IN_UP;if(!n)return console.error("[FADE_IN_UP] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return E.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_LEFT",effect(t,e){try{const n=Te.FADE_IN_LEFT;if(!n)return console.error("[FADE_IN_LEFT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return E.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){try{const n=Te.FADE_IN_RIGHT;if(!n)return console.error("[FADE_IN_RIGHT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return E.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT",effect(t,e){try{const n=Te.FADE_OUT;if(!n)return console.error("[FADE_OUT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_DOWN",effect(t,e){try{const n=Te.FADE_OUT_DOWN;if(!n)return console.error("[FADE_OUT_DOWN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_UP",effect(t,e){try{const n=Te.FADE_OUT_UP;if(!n)return console.error("[FADE_OUT_UP] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_LEFT",effect(t,e){try{const n=Te.FADE_OUT_LEFT;if(!n)return console.error("[FADE_OUT_LEFT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_RIGHT",effect(t,e){try{const n=Te.FADE_OUT_RIGHT;if(!n)return console.error("[FADE_OUT_RIGHT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_RIGHT] Animation error:",n),E.timeline()}}});function Ma(t){const e=Array.isArray(t)?t[0]:t;return e&&typeof e.addChild=="function"?e:null}const om=200;function zS(t){try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return om}function qS(t){try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return om}function pn(t,e,n,r){E.registerEffect({name:t,effect(i,o){try{const s=Te[t];if(!s)return console.error(`[${t}] Animation config not found`),E.timeline();const{duration:a=s?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=o,u=o.x??0,f=o.y??0,d=o.scaleX??1,h=o.scaleY??1,p=o.alpha??1,m=o.rotation??0,g=Ma(i)??i,y=e==="x"?zS(g):qS(g),b=e==="x"?u+r*y:u,x=e==="y"?f+r*y:f,v=n==="in"?{x:b,y:x,alpha:0}:{x:u,y:f,alpha:p},T=n==="in"?{x:u,y:f,alpha:p}:{x:b,y:x,alpha:0};return E.fromTo(i,{pixi:{x:v.x,y:v.y,scaleX:d,scaleY:h,alpha:v.alpha,rotation:m}},{pixi:{x:T.x,y:T.y,scaleX:d,scaleY:h,alpha:T.alpha,rotation:m},duration:a,ease:o.ease||s?.gsapEasing||"power2.out",immediateRender:l,overwrite:c})}catch(s){return console.error(`[${t}] Animation error:`,s),E.timeline()}}})}pn("SLIDE_IN_DOWN","y","in",-1),pn("SLIDE_IN_UP","y","in",1),pn("SLIDE_IN_LEFT","x","in",-1),pn("SLIDE_IN_RIGHT","x","in",1),pn("SLIDE_OUT_DOWN","y","out",1),pn("SLIDE_OUT_UP","y","out",-1),pn("SLIDE_OUT_LEFT","x","out",-1),pn("SLIDE_OUT_RIGHT","x","out",1),E.registerEffect({name:"ZOOM_IN",effect(t,e){try{const n=Te.ZOOM_IN;if(!n)return console.error("[ZOOM_IN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return E.fromTo(t,{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l}},{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l},duration:i,ease:e.ease||"power2.out",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_DOWN",effect(t,e){try{const n=Te.ZOOM_IN_DOWN;if(!n)return console.error("[ZOOM_IN_DOWN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||-1e3,s=n?.keyframes?.translateY?.mid||60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:m}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_UP",effect(t,e){try{const n=Te.ZOOM_IN_UP;if(!n)return console.error("[ZOOM_IN_UP] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||1e3,s=n?.keyframes?.translateY?.mid||-60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:m}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_LEFT",effect(t,e){try{const n=Te.ZOOM_IN_LEFT;if(!n)return console.error("[ZOOM_IN_LEFT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||-1e3,s=n?.keyframes?.translateX?.mid||10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:m,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_RIGHT",effect(t,e){try{const n=Te.ZOOM_IN_RIGHT;if(!n)return console.error("[ZOOM_IN_RIGHT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||1e3,s=n?.keyframes?.translateX?.mid||-10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:m,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT",effect(t,e){try{const n=Te.ZOOM_OUT;if(!n)return console.error("[ZOOM_OUT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.to||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return E.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l}},{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l},duration:i,ease:e.ease||"power2.in",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_DOWN",effect(t,e){try{const n=Te.ZOOM_OUT_DOWN;if(!n)return console.error("[ZOOM_OUT_DOWN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||-60,s=n?.keyframes?.translateY?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:m},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_UP",effect(t,e){try{const n=Te.ZOOM_OUT_UP;if(!n)return console.error("[ZOOM_OUT_UP] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||60,s=n?.keyframes?.translateY?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:m},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_LEFT",effect(t,e){try{const n=Te.ZOOM_OUT_LEFT;if(!n)return console.error("[ZOOM_OUT_LEFT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||42,s=n?.keyframes?.translateX?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:m,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_RIGHT",effect(t,e){try{const n=Te.ZOOM_OUT_RIGHT;if(!n)return console.error("[ZOOM_OUT_RIGHT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||-42,s=n?.keyframes?.translateX?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:m,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_RIGHT] Animation error:",n),E.timeline()}}});const sr=.7,La=.7,sm={BACK_IN_DOWN:{axis:"y",delta:-1200},BACK_IN_UP:{axis:"y",delta:1200},BACK_IN_LEFT:{axis:"x",delta:-2e3},BACK_IN_RIGHT:{axis:"x",delta:2e3}},am={BACK_OUT_DOWN:{axis:"y",delta:700},BACK_OUT_UP:{axis:"y",delta:-700},BACK_OUT_LEFT:{axis:"x",delta:-2e3},BACK_OUT_RIGHT:{axis:"x",delta:2e3}};function VS(t){const{axis:e,delta:n}=sm[t];E.registerEffect({name:t,effect(r,i){try{const o=Te[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,p=i.rotation??0,m=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.8,b=s*.2,x=E.timeline();return x.fromTo(r,{pixi:{x:m,y:g,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p}},{pixi:{x:c,y:u,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),x.to(r,{pixi:{scaleX:f,scaleY:d,alpha:h},duration:b,ease:"power1.out",immediateRender:!1},y),x}catch(o){return console.error(`[${t}] Animation error:`,o),E.timeline()}}})}function KS(t){const{axis:e,delta:n}=am[t];E.registerEffect({name:t,effect(r,i){try{const o=Te[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,p=i.rotation??0,m=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.2,b=s*.8,x=E.timeline();return x.fromTo(r,{pixi:{x:c,y:u,scaleX:f,scaleY:d,alpha:h,rotation:p}},{pixi:{x:c,y:u,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),x.to(r,{pixi:{x:m,y:g},duration:b,ease:"power1.in",immediateRender:!1},y),x}catch(o){return console.error(`[${t}] Animation error:`,o),E.timeline()}}})}Object.keys(sm).forEach(VS),Object.keys(am).forEach(KS);function ZS(t){const e=Te[t];if(!e){console.error(`[effectGenerator] Animation config not found: ${t}`);return}const{keyframes:n,gsapEasing:r,defaultDuration:i}=e;E.registerEffect({name:t,effect(o,s){try{const a=s.x??0,l=s.y??0,c=s.scaleX??1,u=s.scaleY??1,f=s.alpha??1,d=s.rotation??0,h={pixi:{}},p={pixi:{}};return h.pixi.x=a,h.pixi.y=l,p.pixi.x=a,p.pixi.y=l,n.opacity!==void 0?(h.pixi.alpha=n.opacity.from!==void 0?n.opacity.from:f,p.pixi.alpha=n.opacity.to!==void 0?n.opacity.to:f):(h.pixi.alpha=f,p.pixi.alpha=f),n.scale!==void 0&&(h.pixi.scale=n.scale.from,p.pixi.scale=n.scale.to),n.scaleX!==void 0?(h.pixi.scaleX=(n.scaleX.from??1)*c,p.pixi.scaleX=(n.scaleX.to??1)*c):n.scale||(h.pixi.scaleX=c,p.pixi.scaleX=c),n.scaleY!==void 0?(h.pixi.scaleY=(n.scaleY.from??1)*u,p.pixi.scaleY=(n.scaleY.to??1)*u):n.scale||(h.pixi.scaleY=u,p.pixi.scaleY=u),n.rotation!==void 0?(h.pixi.rotation=n.rotation.from??d,p.pixi.rotation=n.rotation.to??d):(h.pixi.rotation=d,p.pixi.rotation=d),n.skewX!==void 0&&(h.pixi.skewX=n.skewX.from??0,p.pixi.skewX=n.skewX.to??0),n.skewY!==void 0&&(h.pixi.skewY=n.skewY.from??0,p.pixi.skewY=n.skewY.to??0),n.translateX!==void 0&&(h.pixi.x=a+(n.translateX.from??0),p.pixi.x=a+(n.translateX.to??0)),n.translateY!==void 0&&(h.pixi.y=l+(n.translateY.from??0),p.pixi.y=l+(n.translateY.to??0)),E.fromTo(o,h,{...p,duration:s.duration||i,ease:s.ease||r,immediateRender:s.immediateRender??!0,overwrite:s.overwrite??"auto"})}catch(a){return console.error(`[${t}] Animation error:`,a),E.timeline()}}})}function Pa(t){t.forEach(e=>{try{ZS(e)}catch(n){console.error(`[effectGenerator] Failed to register effect: ${e}`,n)}})}Pa(["BOUNCE_IN","BOUNCE_IN_DOWN","BOUNCE_IN_UP","BOUNCE_IN_LEFT","BOUNCE_IN_RIGHT","BOUNCE_OUT","BOUNCE_OUT_DOWN","BOUNCE_OUT_UP","BOUNCE_OUT_LEFT","BOUNCE_OUT_RIGHT"]),E.registerEffect({name:"FLIP",effect(t,e){const n=Te.FLIP,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-360}},{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-190},duration:r*.4,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-170},duration:r*.1,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s*.95,scaleY:a*.95},duration:r*.3,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s,scaleY:a},duration:r*.2,ease:"power1.in"}),u}}),E.registerEffect({name:"FLIP_IN_X",effect(t,e){const n=Te.FLIP_IN_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a},duration:r*.2,ease:"power1.out"}),u}}),E.registerEffect({name:"FLIP_IN_Y",effect(t,e){const n=Te.FLIP_IN_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s},duration:r*.2,ease:"power1.out"}),u}}),E.registerEffect({name:"FLIP_OUT_X",effect(t,e){const n=Te.FLIP_OUT_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0},duration:r*.7,ease:"power1.in"}),u}}),E.registerEffect({name:"FLIP_OUT_Y",effect(t,e){const n=Te.FLIP_OUT_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0},duration:r*.7,ease:"power1.in"}),u}}),E.registerEffect({name:"LIGHT_SPEED_IN_LEFT",effect(t,e){try{const n=Te.LIGHT_SPEED_IN_LEFT;if(!n)return console.error("[LIGHT_SPEED_IN_LEFT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_IN_RIGHT",effect(t,e){try{const n=Te.LIGHT_SPEED_IN_RIGHT;if(!n)return console.error("[LIGHT_SPEED_IN_RIGHT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_OUT_LEFT",effect(t,e){try{const n=Te.LIGHT_SPEED_OUT_LEFT;if(!n)return console.error("[LIGHT_SPEED_OUT_LEFT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_OUT_RIGHT",effect(t,e){try{const n=Te.LIGHT_SPEED_OUT_RIGHT;if(!n)return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation error:",n),E.timeline()}}});const cm=2e3;E.registerEffect({name:"ROLL_IN",effect(t,e){try{const n=Te.ROLL_IN;if(!n)return console.error("[ROLL_IN] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||cm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=E.timeline();return f.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u-120}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u},duration:r,ease:"power1.out"}),f}catch(n){return console.error("[ROLL_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROLL_OUT",effect(t,e){try{const n=Te.ROLL_OUT;if(!n)return console.error("[ROLL_OUT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||cm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=E.timeline();return f.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u+120},duration:r,ease:"power1.in"}),f}catch(n){return console.error("[ROLL_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN",effect(t,e){try{const n=Te.ROTATE_IN;if(!n)return console.error("[ROTATE_IN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u-200}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u},duration:r,ease:"power1.out",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT",effect(t,e){try{const n=Te.ROTATE_OUT;if(!n)return console.error("[ROTATE_OUT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u+200},duration:r,ease:"power1.in",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_IN_DOWN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+45}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_IN_DOWN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_IN_UP_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-90}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_IN_UP_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_OUT_DOWN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:d,pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_OUT_DOWN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_OUT_UP_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+90},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:d,pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_OUT_UP_RIGHT] Animation error:",n),E.timeline()}}});const ar=Te.PULSE,lm=ar?.keyframes?.pulseScale?.min||1,um=ar?.keyframes?.pulseScale?.max||1.05;E.registerEffect({name:"PULSE",effect(t,e){try{const n=e.scaleX??1,r=e.scaleY??1;return E.timeline().fromTo(t,{pixi:{scaleX:n*lm,scaleY:r*lm}},{pixi:{scaleX:n*um,scaleY:r*um},duration:e.duration||ar?.defaultDuration||.5,repeat:e.repeat||2,yoyo:!0,ease:e.ease||ar?.gsapEasing||"power1.inOut",yoyoEase:e.yoyoEase||"power3"}).to(t,{pixi:{scaleX:n,scaleY:r},duration:e.resetDuration||.3,ease:e.resetEase||"power1.out"})}catch(n){return console.error("[PULSE] Animation error:",n),E.timeline()}},defaults:{duration:ar?.defaultDuration||.5,repeat:2,resetDuration:.3,ease:ar?.gsapEasing||"power1.inOut",resetEase:"power1.out"},extendTimeline:!0}),E.registerEffect({name:"SHAKE_X",effect(t,e){try{const n=Te.SHAKE_X;if(!n)return console.error("[SHAKE_X] Animation config not found"),E.timeline();const r=n?.keyframes?.shakeX?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.x??0,a=i/10,l=E.timeline();return l.fromTo(t,{pixi:{x:s}},{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_X] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"SHAKE_Y",effect(t,e){try{const n=Te.SHAKE_Y;if(!n)return console.error("[SHAKE_Y] Animation config not found"),E.timeline();const r=n?.keyframes?.shakeY?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.y??0,a=i/10,l=E.timeline();return l.fromTo(t,{pixi:{y:s}},{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_Y] Animation error:",n),E.timeline()}}}),Pa(["WIPE_LEFT","WIPE_RIGHT","WIPE_UP","WIPE_DOWN"]),Pa(["RISE"]),E.registerEffect({name:"TYPEWRITER",effect(t,e){try{const{text:n="",onTextChange:r}=e;if(!n||!t)return E.timeline();const i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();u.set(t,{pixi:{x:i,y:o,scaleX:s,scaleY:a,alpha:l,rotation:c}},0);const f=n.length;return u.to(t,{duration:e.duration||2,ease:"none",onStart(){t&&(t.text="",t.updateText&&t.updateText()),r&&r("","START")},onUpdate(){const d=this.progress(),h=Math.min(Math.round(d*f),f),p=n.substring(0,h);r&&r(p,"UPDATE"),t&&(t.text=p,t.updateText&&t.updateText())},onComplete(){r&&r(n,"COMPLETE"),t&&(t.text=n,t.updateText&&t.updateText())},onInterrupt(){r&&r("","INTERRUPT")},onReverseComplete(){r&&r("","REVERSE_COMPLETE")}},0),u}catch(n){return console.error("[TYPEWRITER] Animation error:",n),E.timeline()}},defaults:{duration:2,text:""},extendTimeline:!0});const Ji="__logoRevealMask";function $S(t,e){const n=typeof e.width=="number"&&e.width>0?e.width:0,r=typeof e.height=="number"&&e.height>0?e.height:0;if(n&&r)return{w:n,h:r};try{const i=t.getLocalBounds();if(i.width>1&&i.height>1)return{w:i.width,h:i.height}}catch{}return{w:Math.max(1,t.width||240),h:Math.max(1,t.height||240)}}function JS(t){const e=t[Ji];if(e&&!e.destroyed)return t.mask=e,e;const n=new W.Graphics;return t[Ji]=n,t.addChild(n),t.mask=n,n}function QS(t){const e=t[Ji];t.mask=null,e&&!e.destroyed&&(e.parent&&e.parent.removeChild(e),e.destroy()),t[Ji]=void 0}const ew={draw:(t,e,n)=>{t.rect(0,-n/2,e,n).fill(16777215)},origin:(t,e,n)=>({x:t-n/2,y:e}),axes:"x"},tw={draw:(t,e,n)=>{t.circle(0,0,Math.hypot(e,n)*.55).fill(16777215)},origin:(t,e)=>({x:t,y:e}),axes:"both"},nw={draw:(t,e,n)=>{const r=Math.max(e,n)*.2,i=e+n+r*2,o=-n/2-r,s=n/2+r;t.moveTo(0,o).lineTo(i,o).lineTo(i-n,s).lineTo(-n,s).closePath().fill(16777215)},origin:(t,e,n,r)=>({x:t-n/2-Math.max(n,r)*.2,y:e}),axes:"x"};function Na(t,e,n,r){try{const i=Ma(t);if(!i)throw new Error("LOGO_REVEAL target is not a PIXI.Container");const o=e.duration??.9,s=e.ease||r,a=e.x??0,l=e.y??0,c=e.alpha??1,{w:u,h:f}=$S(i,e);E.set(i,{pixi:{alpha:c,x:a,y:l,scaleX:e.scaleX??1,scaleY:e.scaleY??1}});const d=JS(i),{x:h,y:p}=n.origin(a,l,u,f);d.clear(),n.draw(d,u,f),d.position.set(h,p),d.pivot.set(0,0);const m=n.axes==="both";return E.fromTo(d.scale,{x:0,y:m?0:1},{x:1,y:1,duration:o,ease:s,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto",onReverseComplete:()=>{QS(i)}})}catch(i){return console.error("[LOGO_REVEAL] mask effect error:",i),E.timeline()}}E.registerEffect({name:"SCALE_POP",effect(t,e){try{const n=e.duration??.65,r=e.x??0,i=e.y??0,o=e.scaleX??1,s=e.scaleY??1,a=e.alpha??1,l=e.ease||"back.out(1.7)";return E.fromTo(t,{pixi:{scaleX:.28*o,scaleY:.28*s,alpha:0,x:r,y:i}},{pixi:{scaleX:o,scaleY:s,alpha:a,x:r,y:i},duration:n,ease:l,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(n){return console.error("[SCALE_POP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"WIPE_LEFT_RIGHT",effect(t,e){return Na(t,e,ew,"power2.inOut")}}),E.registerEffect({name:"WIPE_RADIAL",effect(t,e){return Na(t,e,tw,"power2.out")}}),E.registerEffect({name:"MASK_PAINT_ON",effect(t,e){return Na(t,e,nw,"power3.out")}});const fm="__staggerSplitText",Qi="__staggerBaseX",eo="__staggerBaseY";function ka(t){const e=[t];for(;e.length;){const n=e.shift();for(const r of n.children??[]){if(r instanceof W.Text)return r;r instanceof W.Container&&e.push(r)}}return null}const Da=t=>t==null?"-":typeof t=="number"?String(t):`${t.x},${t.y}`;function rw(t,e,n){const r=t.style;return[e,t.text,r.fontFamily,r.fontSize,r.fontWeight,r.letterSpacing,r.wordWrap?r.wordWrapWidth:"nowrap",Da(n.charAnchor),Da(n.wordAnchor),Da(n.lineAnchor)].join("|")}function iw(t,e,n){const r=ka(t);if(!r)return null;const i=t,o=i[fm],s=rw(r,e,n);if(o&&!o.split.destroyed&&o.signature===s)return o.split;o&&!o.split.destroyed&&(o.split.parent?.removeChild(o.split),o.split.destroy({children:!0}));const a=W.SplitText.from(r,n);return a.position.copyFrom(r.position),a.rotation=r.rotation,a.scale.copyFrom(r.scale),(r.parent??t).addChild(a),r.alpha=0,i[fm]={signature:s,split:a},a}function Fa(t,e){const n=Ma(t);return n||(console.error(`[${e}] target is not a PIXI.Container`),null)}function dm(t,e){E.set(t,{pixi:{alpha:e.alpha??1,x:e.x??0,y:e.y??0,scaleX:e.scaleX??1,scaleY:e.scaleY??1}})}function hm(t,e,n={}){const r=iw(t,e,n),i=r?e==="letter"?r.chars:r.words:[];if(i.length===0)return null;for(const s of i){const a=s;typeof a[Qi]!="number"&&(a[Qi]=s.x),typeof a[eo]!="number"&&(a[eo]=s.y)}const o=s=>a=>a[s]??0;return{node:t,units:i,baseX:o(Qi),baseY:o(eo),fontSize:Number(ka(t)?.style?.fontSize)||48}}function pm(t,e,n){const i=(typeof t.stagger=="number"&&t.stagger>=0?t.stagger:Math.min(.12,n/Math.max(e,1)/2))*Math.max(e-1,0);return{amount:i,unitDuration:Math.max(.12,n-i)}}function mm(t,e,n="start"){return{amount:e,from:t.staggerFrom??n,...t.staggerEase?{ease:t.staggerEase}:{}}}const gm="__textUnitMask";function ow(t,e){const n=t.parent;if(!n)return null;const r=t,i=r[gm];if(i&&!i.mask.destroyed)if(i.signature!==e)i.mask.parent?.removeChild(i.mask),i.mask.destroy();else return i.mask.parent||n.addChild(i.mask),t.mask=i.mask,i.mask;let o=0,s=0,a=0,l=0;try{const h=t.getLocalBounds();h.width>0&&h.height>0&&(o=h.x,s=h.y,a=h.width,l=h.height)}catch{}if(!(a>0&&l>0))return null;const c=ym(r,Qi,t.x),u=ym(r,eo,t.y),f=Math.max(6,l*.12),d=new W.Graphics;return d.rect(c+o-f,u+s-f,a+f*2,l+f*2).fill(16777215),n.addChild(d),t.mask=d,r[gm]={signature:e,mask:d},d}function ym(t,e,n){const r=t[e];return typeof r=="number"?r:n}const sw={};function At(t){sw[t.name]={from:t.from??"start",unit:t.unit??"word"},E.registerEffect({name:t.name,effect(e,n){const r=Fa(e,t.name);if(!r)return E.timeline();try{const i=n.duration??.75,o=n.ease||t.ease,s=n.revealUnit==="letter"||n.revealUnit==="word"?n.revealUnit:t.unit??"word";dm(r,n);const a=hm(r,s,t.anchors);if(!a)return Ba(r,n,!1,o);const{units:l,baseX:c,baseY:u,fontSize:f}=a,d=new Map;if(t.masked){for(const g of l){let y=f;try{const b=g.getLocalBounds();b.height>0&&(y=b.height)}catch{}d.set(g,y)}for(const g of l)ow(g,t.name)}const h={baseX:c,baseY:u,unitH:g=>d.get(g)??f,fontSize:f},{amount:p,unitDuration:m}=pm(n,l.length,i);return E.fromTo(l,t.from_(h),{...t.to(h),duration:m,ease:o,stagger:mm(n,p,t.from??"start"),immediateRender:n.immediateRender??!0,overwrite:n.overwrite??"auto"})}catch(i){return console.error(`[${t.name}] Animation error:`,i),E.timeline()}}})}function Ba(t,e,n,r){const i=e.duration??.75,o=e.ease||r,s=e.alpha??1,a=e.y??0,l=n?e.yOffset??24:0;return E.fromTo(t,{pixi:{alpha:0,y:a+l}},{pixi:{alpha:s,y:a},duration:i,ease:o,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}function Ua(t,e,n,r){const i=Fa(t,"STAGGER_TEXT");if(!i)return E.timeline();try{const o=e.duration??.75,s=e.ease||r,a=e.revealUnit==="letter"?"letter":"word";dm(i,e);const l=hm(i,a);if(!l)return Ba(i,e,n,s);const{units:c,baseY:u,fontSize:f}=l,d=n?e.yOffset??Math.max(12,f*.35):0,{amount:h,unitDuration:p}=pm(e,c.length,o);return E.fromTo(c,{alpha:0,y:(m,g)=>u(g)+d},{alpha:1,y:(m,g)=>u(g),duration:p,ease:s,stagger:mm(e,h),immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(o){return console.error("[STAGGER_TEXT] Animation error:",o),E.timeline()}}E.registerEffect({name:"STAGGER_FADE_UP_TEXT",effect(t,e){return Ua(t,e,!0,"power2.out")}}),E.registerEffect({name:"STAGGER_FADE_TEXT",effect(t,e){return Ua(t,e,!1,"power1.out")}});function _m(t,e,n,r){const i=Fa(t,"STAGGER_FADE");return i?ka(i)?Ua(t,e,n,r):Ba(i,e,n,e.ease||r):E.timeline()}E.registerEffect({name:"STAGGER_FADE_UP",effect(t,e){return _m(t,e,!0,"power2.out")}}),E.registerEffect({name:"STAGGER_FADE",effect(t,e){return _m(t,e,!1,"power1.out")}});const Vr=Math.PI/180;function aw(t,e){let n=Math.imul(t+1,374761393)+Math.imul(e+1,668265263);return n=Math.imul(n^n>>>13,1274126177),((n^n>>>16)>>>0)/4294967296}const Kr=(t,e,n,r)=>n+aw(t,e)*(r-n);At({name:"TEXT_CASCADE",ease:"back.out(1.4)",from:"start",unit:"word",from_:({baseY:t,fontSize:e})=>({alpha:0,rotation:-15*Vr,y:(n,r)=>t(r)-e*1.2}),to:({baseY:t})=>({alpha:1,rotation:0,y:(e,n)=>t(n)})}),At({name:"TEXT_SPOTLIGHT",ease:"power2.out",from:"center",unit:"word",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:.1,pixi:{scaleX:.8,scaleY:.8}}),to:()=>({alpha:1,pixi:{scaleX:1,scaleY:1}})}),At({name:"TEXT_BLINDS",ease:"power2.out",from:"edges",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:0,pixi:{scaleX:0}}),to:()=>({alpha:1,pixi:{scaleX:1}})}),At({name:"TEXT_POPCORN",ease:"back.out(2)",from:"random",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:({baseY:t,fontSize:e})=>({alpha:0,pixi:{scaleX:0,scaleY:0},rotation:n=>Kr(n,1,-20,20)*Vr,y:(n,r)=>t(r)+Kr(n,2,.2,.8)*e}),to:({baseY:t})=>({alpha:1,pixi:{scaleX:1,scaleY:1},rotation:0,y:(e,n)=>t(n)})}),At({name:"TEXT_RIPPLE",ease:"elastic.out(1, 0.6)",from:"start",unit:"letter",from_:({baseY:t,fontSize:e})=>({alpha:0,y:(n,r)=>t(r)+Math.sin(n*.8)*e*.9}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_SHUFFLE",ease:"power3.out",from:"random",unit:"word",anchors:{wordAnchor:.5,charAnchor:.5},from_:({baseX:t,baseY:e,fontSize:n})=>({alpha:0,rotation:r=>Kr(r,3,-15,15)*Vr,x:(r,i)=>t(i)+Kr(r,4,-1.6,1.6)*n,y:(r,i)=>e(i)+Kr(r,5,-.9,.9)*n}),to:({baseX:t,baseY:e})=>({alpha:1,rotation:0,x:(n,r)=>t(r),y:(n,r)=>e(r)})}),At({name:"TEXT_DOMINO",ease:"power3.out",from:"start",unit:"letter",anchors:{charAnchor:{x:0,y:1},wordAnchor:{x:0,y:1}},from_:()=>({alpha:0,rotation:-90*Vr}),to:()=>({alpha:1,rotation:0})}),At({name:"TEXT_PENDULUM",ease:"elastic.out(1, 0.5)",from:"start",unit:"letter",anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,rotation:90*Vr}),to:()=>({alpha:1,rotation:0})}),At({name:"TEXT_SLIDE_REVEAL",ease:"power3.out",from:"start",unit:"word",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)+e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_SLOT",ease:"back.out(1.3)",from:"start",unit:"letter",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)-e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_CURTAIN",ease:"power2.inOut",from:"start",unit:"word",masked:!0,anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,pixi:{scaleY:0}}),to:()=>({alpha:1,pixi:{scaleY:1}})}),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerEffect({name:"SWING",effect(t,e){return E.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),E.registerEffect({name:"JELLO",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),E.registerEffect({name:"WOOBLE",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),E.registerEffect({name:"NONE",effect(t){return E.timeline().to(t,{duration:0})}}),E.registerEffect({name:"FLASH",effect(t,e){return E.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerPlugin(wn),E.registerPlugin(im);const Xe=t=>{E.effects[t.name]||E.registerEffect(t)};wn.create("springBounce","0.32, 1.06, 0.61, 0.93"),wn.create("springStiff","M0,0 C0.18,0 0.28,1.2 0.5,1 C0.66,0.88 0.78,1.05 1,1"),Xe({name:"PULSE",effect(t,e){return E.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),Xe({name:"SHAKE",effect(t,e){return E.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),Xe({name:"SWING",effect(t,e){return E.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Xe({name:"JELLO",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Xe({name:"WOOBLE",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),Xe({name:"NONE",effect(t,e){return E.timeline().to(t,{duration:0})}}),Xe({name:"FLASH",effect(t,e){return E.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),Xe({name:"BOUNCE_IN",effect(t,e){return E.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e?.x,y:e?.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),Xe({name:"BOUNCE_IN_DOWN",effect(t,e){return E.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e?.x,y:-2500,alpha:0}})}}),Xe({name:"BOUNCE_IN_LEFT",effect(t,e){return E.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),Xe({name:"BOUNCE_IN_RIGHT",effect(t,e){const n=Math.max(1e3,e?.maxX+500);return E.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:n}})}}),Xe({name:"BOUNCE_IN_UP",effect(t,e){return E.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),Xe({name:"BOUNCE_OUT",effect(t,e){return E.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),Xe({name:"FADE_IN",effect(t){return E.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),Xe({name:"FADE_IN_DOWN",effect(t,e){return E.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Xe({name:"FADE_IN_LEFT",effect(t,e){return E.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),Xe({name:"FADE_IN_RIGHT",effect(t,e){return E.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),Xe({name:"FADE_IN_UP",effect(t,e){return E.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Xe({name:"MOTION_PATH_SPRING",effect(t,e){const{path:n,duration:r=2,autoRotate:i=!1,alignOrigin:o=[.5,.5],ease:s="springStiff",repeat:a=0,yoyo:l=!1,start:c=0,end:u=1}=e||{};return E.to(t,{duration:r,ease:s,repeat:a,yoyo:l,motionPath:{path:n,autoRotate:i,alignOrigin:o,start:c,end:u}})}}),Xe({name:"SPIN",effect(t){return E.to(t,{rotation:(e,n)=>E.utils.snap(360,Number(E.getProperty(n,"rotation"))+360)})}});const bm=200,cw=t=>{try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return bm},lw=t=>{try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return bm},mn=(t,e,n,r)=>{Xe({name:t,effect(i,o){const s=o?.x??0,a=o?.y??0,l=o?.scaleX??1,c=o?.scaleY??1,u=o?.alpha??1,f=o?.rotation??0,d=o?.duration??.5,h=e==="x"?cw(i):lw(i),p=e==="x"?s+r*h:s,m=e==="y"?a+r*h:a,g=n==="in"?{x:p,y:m,alpha:0}:{x:s,y:a,alpha:u},y=n==="in"?{x:s,y:a,alpha:u}:{x:p,y:m,alpha:0};return E.fromTo(i,{pixi:{x:g.x,y:g.y,scaleX:l,scaleY:c,alpha:g.alpha,rotation:f}},{pixi:{x:y.x,y:y.y,scaleX:l,scaleY:c,alpha:y.alpha,rotation:f},duration:d,ease:o?.ease||"power2.out",immediateRender:o?.immediateRender??!0,overwrite:o?.overwrite})}})};mn("SLIDE_IN_LEFT","x","in",-1),mn("SLIDE_IN_RIGHT","x","in",1),mn("SLIDE_IN_TOP","y","in",-1),mn("SLIDE_IN_BOTTOM","y","in",1),mn("SLIDE_OUT_LEFT","x","out",-1),mn("SLIDE_OUT_RIGHT","x","out",1),mn("SLIDE_OUT_TOP","y","out",-1),mn("SLIDE_OUT_BOTTOM","y","out",1);const cr=.7,Ga=.7,uw=-1200,fw=700;Xe({name:"BACK_IN",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+uw,u=l*.8,f=l*.2,d=E.timeline();return d.fromTo(t,{pixi:{x:n,y:c,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a}},{pixi:{x:n,y:r,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{scaleX:i,scaleY:o,alpha:s},duration:f,ease:"power1.out",immediateRender:!1},u),d}}),Xe({name:"BACK_OUT",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+fw,u=l*.2,f=l*.8,d=E.timeline();return d.fromTo(t,{pixi:{x:n,y:r,scaleX:i,scaleY:o,alpha:s,rotation:a}},{pixi:{x:n,y:r,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{x:n,y:c},duration:f,ease:"power1.in",immediateRender:!1},u),d}});function xm(){return{updateEffect:S.useCallback((e,n,r)=>{if(!e)return console.warn("useGsapEffect: Target container is null or undefined"),E.to({},{duration:0});if(!n||typeof n!="string")return console.warn("useGsapEffect: Invalid effect name provided"),E.to(e,{duration:0});const i={immediateRender:!1,overwrite:!0,...r};try{return E.effects[n]?E.effects[n](e,i):E.effects.NONE?(console.warn(`useGsapEffect: Effect "${n}" not found, falling back to NONE`),E.effects.NONE(e,i)):(console.warn("useGsapEffect: NONE effect not found, returning empty tween"),E.to(e,{duration:0}))}catch(o){return console.error("useGsapEffect: Error applying effect:",o),E.to(e,{duration:0})}},[])}}const Ft={DEFAULT_DURATION_MS:1e3,DEFAULT_DURATION_SEC:1,MIN_DURATION_SEC:.1,MAX_DURATION_SEC:5,ENTRANCE_OVERLAP_SEC:.25,DEFAULT_LOOP_ROTATIONS_PER_SEC:.25,MIN_LOOP_ROTATIONS_PER_SEC:.05,MAX_LOOP_ROTATIONS_PER_SEC:1},Zr={WIDTH:1920,HEIGHT:1080},ja=new Set(["NONE","HEART_BEAT","PULSE","SHAKE","SHAKE_X","SHAKE_Y","HEAD_SHAKE","SWING","TADA","WOBBLE","JELLO","RUBBER_BAND","TYPEWRITER","RISE","TEXT_CASCADE","TEXT_SPOTLIGHT","TEXT_BLINDS","TEXT_POPCORN","TEXT_RIPPLE","TEXT_SHUFFLE","TEXT_DOMINO","TEXT_PENDULUM","TEXT_SLIDE_REVEAL","TEXT_SLOT","TEXT_CURTAIN"]),$r=new Set(["TYPEWRITER","RISE"]),vm=new Set(["SPIN_360"]);function Tm(t){return vm.has(t)}const Em={NONE:"NONE",BOUNCE:"BOUNCE",FLASH:"FLASH",PULSE:"PULSE",RUBBER_BAND:"RUBBER_BAND",SHAKE_X:"SHAKE_X",SHAKE_Y:"SHAKE_Y",HEAD_SHAKE:"HEAD_SHAKE",SWING:"SWING",TADA:"TADA",WOBBLE:"WOBBLE",JELLO:"JELLO",HEART_BEAT:"HEART_BEAT",BACK_IN_DOWN:"BACK_IN_DOWN",BACK_IN_LEFT:"BACK_IN_LEFT",BACK_IN_RIGHT:"BACK_IN_RIGHT",BACK_IN_UP:"BACK_IN_UP",BACK_OUT_DOWN:"BACK_OUT_DOWN",BACK_OUT_LEFT:"BACK_OUT_LEFT",BACK_OUT_RIGHT:"BACK_OUT_RIGHT",BACK_OUT_UP:"BACK_OUT_UP",BOUNCE_IN:"BOUNCE_IN",BOUNCE_IN_DOWN:"BOUNCE_IN_DOWN",BOUNCE_IN_LEFT:"BOUNCE_IN_LEFT",BOUNCE_IN_RIGHT:"BOUNCE_IN_RIGHT",BOUNCE_IN_UP:"BOUNCE_IN_UP",BOUNCE_OUT:"BOUNCE_OUT",BOUNCE_OUT_DOWN:"BOUNCE_OUT_DOWN",BOUNCE_OUT_LEFT:"BOUNCE_OUT_LEFT",BOUNCE_OUT_RIGHT:"BOUNCE_OUT_RIGHT",BOUNCE_OUT_UP:"BOUNCE_OUT_UP",FADE_IN:"FADE_IN",FADE_IN_DOWN:"FADE_IN_DOWN",FADE_IN_DOWN_BIG:"FADE_IN_DOWN_BIG",FADE_IN_LEFT:"FADE_IN_LEFT",FADE_IN_LEFT_BIG:"FADE_IN_LEFT_BIG",FADE_IN_RIGHT:"FADE_IN_RIGHT",FADE_IN_RIGHT_BIG:"FADE_IN_RIGHT_BIG",FADE_IN_UP:"FADE_IN_UP",FADE_IN_UP_BIG:"FADE_IN_UP_BIG",FADE_IN_TOP_LEFT:"FADE_IN_TOP_LEFT",FADE_IN_TOP_RIGHT:"FADE_IN_TOP_RIGHT",FADE_IN_BOTTOM_LEFT:"FADE_IN_BOTTOM_LEFT",FADE_IN_BOTTOM_RIGHT:"FADE_IN_BOTTOM_RIGHT",FADE_OUT:"FADE_OUT",FADE_OUT_DOWN:"FADE_OUT_DOWN",FADE_OUT_DOWN_BIG:"FADE_OUT_DOWN_BIG",FADE_OUT_LEFT:"FADE_OUT_LEFT",FADE_OUT_LEFT_BIG:"FADE_OUT_LEFT_BIG",FADE_OUT_RIGHT:"FADE_OUT_RIGHT",FADE_OUT_RIGHT_BIG:"FADE_OUT_RIGHT_BIG",FADE_OUT_UP:"FADE_OUT_UP",FADE_OUT_UP_BIG:"FADE_OUT_UP_BIG",FADE_OUT_TOP_LEFT:"FADE_OUT_TOP_LEFT",FADE_OUT_TOP_RIGHT:"FADE_OUT_TOP_RIGHT",FADE_OUT_BOTTOM_RIGHT:"FADE_OUT_BOTTOM_RIGHT",FADE_OUT_BOTTOM_LEFT:"FADE_OUT_BOTTOM_LEFT",FLIP:"FLIP",FLIP_IN_X:"FLIP_IN_X",FLIP_IN_Y:"FLIP_IN_Y",FLIP_OUT_X:"FLIP_OUT_X",FLIP_OUT_Y:"FLIP_OUT_Y",LIGHT_SPEED_IN_RIGHT:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_IN_LEFT:"LIGHT_SPEED_IN_LEFT",LIGHT_SPEED_OUT_RIGHT:"LIGHT_SPEED_OUT_RIGHT",LIGHT_SPEED_OUT_LEFT:"LIGHT_SPEED_OUT_LEFT",ROTATE_IN:"ROTATE_IN",ROTATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROTATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROTATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROTATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT",ROTATE_OUT:"ROTATE_OUT",ROTATE_OUT_DOWN_LEFT:"ROTATE_OUT_DOWN_LEFT",ROTATE_OUT_DOWN_RIGHT:"ROTATE_OUT_DOWN_RIGHT",ROTATE_OUT_UP_LEFT:"ROTATE_OUT_UP_LEFT",ROTATE_OUT_UP_RIGHT:"ROTATE_OUT_UP_RIGHT",HINGE:"HINGE",JACK_IN_THE_BOX:"JACK_IN_THE_BOX",ROLL_IN:"ROLL_IN",ROLL_OUT:"ROLL_OUT",ZOOM_IN:"ZOOM_IN",ZOOM_IN_DOWN:"ZOOM_IN_DOWN",ZOOM_IN_LEFT:"ZOOM_IN_LEFT",ZOOM_IN_RIGHT:"ZOOM_IN_RIGHT",ZOOM_IN_UP:"ZOOM_IN_UP",ZOOM_OUT:"ZOOM_OUT",ZOOM_OUT_DOWN:"ZOOM_OUT_DOWN",ZOOM_OUT_LEFT:"ZOOM_OUT_LEFT",ZOOM_OUT_RIGHT:"ZOOM_OUT_RIGHT",ZOOM_OUT_UP:"ZOOM_OUT_UP",SLIDE_IN_DOWN:"SLIDE_IN_DOWN",SLIDE_IN_LEFT:"SLIDE_IN_LEFT",SLIDE_IN_RIGHT:"SLIDE_IN_RIGHT",SLIDE_IN_UP:"SLIDE_IN_UP",SLIDE_OUT_DOWN:"SLIDE_OUT_DOWN",SLIDE_OUT_LEFT:"SLIDE_OUT_LEFT",SLIDE_OUT_RIGHT:"SLIDE_OUT_RIGHT",SLIDE_OUT_UP:"SLIDE_OUT_UP",SPIN_360:"SPIN_360",SCALE_POP:"SCALE_POP",WIPE_LEFT_RIGHT:"WIPE_LEFT_RIGHT",WIPE_RADIAL:"WIPE_RADIAL",MASK_PAINT_ON:"MASK_PAINT_ON",TYPEWRITER:"TYPEWRITER",RISE:"RISE",STAGGER_FADE_UP_TEXT:"STAGGER_FADE_UP_TEXT",STAGGER_FADE_TEXT:"STAGGER_FADE_TEXT",STAGGER_FADE_UP:"STAGGER_FADE_UP",STAGGER_FADE:"STAGGER_FADE",TEXT_CASCADE:"TEXT_CASCADE",TEXT_SPOTLIGHT:"TEXT_SPOTLIGHT",TEXT_BLINDS:"TEXT_BLINDS",TEXT_POPCORN:"TEXT_POPCORN",TEXT_RIPPLE:"TEXT_RIPPLE",TEXT_SHUFFLE:"TEXT_SHUFFLE",TEXT_DOMINO:"TEXT_DOMINO",TEXT_PENDULUM:"TEXT_PENDULUM",TEXT_SLIDE_REVEAL:"TEXT_SLIDE_REVEAL",TEXT_SLOT:"TEXT_SLOT",TEXT_CURTAIN:"TEXT_CURTAIN",LIGHT_SPEED_IN:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_OUT:"LIGHT_SPEED_OUT_RIGHT",ROATATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROATATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROATATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROATATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT"},Sm={bounce:"BOUNCE",flash:"FLASH",pulse:"PULSE",rubberBand:"RUBBER_BAND",shakeX:"SHAKE_X",shakeY:"SHAKE_Y",headShake:"HEAD_SHAKE",swing:"SWING",tada:"TADA",wobble:"WOBBLE",jello:"JELLO",heartBeat:"HEART_BEAT",backInDown:"BACK_IN_DOWN",backInLeft:"BACK_IN_LEFT",backInRight:"BACK_IN_RIGHT",backInUp:"BACK_IN_UP",backOutDown:"BACK_OUT_DOWN",backOutLeft:"BACK_OUT_LEFT",backOutRight:"BACK_OUT_RIGHT",backOutUp:"BACK_OUT_UP",bounceIn:"BOUNCE_IN",bounceInDown:"BOUNCE_IN_DOWN",bounceInLeft:"BOUNCE_IN_LEFT",bounceInRight:"BOUNCE_IN_RIGHT",bounceInUp:"BOUNCE_IN_UP",bounceOut:"BOUNCE_OUT",bounceOutDown:"BOUNCE_OUT_DOWN",bounceOutLeft:"BOUNCE_OUT_LEFT",bounceOutRight:"BOUNCE_OUT_RIGHT",bounceOutUp:"BOUNCE_OUT_UP",fadeIn:"FADE_IN",fadeInDown:"FADE_IN_DOWN",fadeInDownBig:"FADE_IN_DOWN_BIG",fadeInLeft:"FADE_IN_LEFT",fadeInLeftBig:"FADE_IN_LEFT_BIG",fadeInRight:"FADE_IN_RIGHT",fadeInRightBig:"FADE_IN_RIGHT_BIG",fadeInUp:"FADE_IN_UP",fadeInUpBig:"FADE_IN_UP_BIG",fadeInTopLeft:"FADE_IN_TOP_LEFT",fadeInTopRight:"FADE_IN_TOP_RIGHT",fadeInBottomLeft:"FADE_IN_BOTTOM_LEFT",fadeInBottomRight:"FADE_IN_BOTTOM_RIGHT",fadeOut:"FADE_OUT",fadeOutDown:"FADE_OUT_DOWN",fadeOutDownBig:"FADE_OUT_DOWN_BIG",fadeOutLeft:"FADE_OUT_LEFT",fadeOutLeftBig:"FADE_OUT_LEFT_BIG",fadeOutRight:"FADE_OUT_RIGHT",fadeOutRightBig:"FADE_OUT_RIGHT_BIG",fadeOutUp:"FADE_OUT_UP",fadeOutUpBig:"FADE_OUT_UP_BIG",fadeOutTopLeft:"FADE_OUT_TOP_LEFT",fadeOutTopRight:"FADE_OUT_TOP_RIGHT",fadeOutBottomRight:"FADE_OUT_BOTTOM_RIGHT",fadeOutBottomLeft:"FADE_OUT_BOTTOM_LEFT",flip:"FLIP",flipInX:"FLIP_IN_X",flipInY:"FLIP_IN_Y",flipOutX:"FLIP_OUT_X",flipOutY:"FLIP_OUT_Y",lightSpeedInRight:"LIGHT_SPEED_IN_RIGHT",lightSpeedInLeft:"LIGHT_SPEED_IN_LEFT",lightSpeedOutRight:"LIGHT_SPEED_OUT_RIGHT",lightSpeedOutLeft:"LIGHT_SPEED_OUT_LEFT",rotateIn:"ROTATE_IN",rotateInDownLeft:"ROTATE_IN_DOWN_LEFT",rotateInDownRight:"ROTATE_IN_DOWN_RIGHT",rotateInUpLeft:"ROTATE_IN_UP_LEFT",rotateInUpRight:"ROTATE_IN_UP_RIGHT",rotateOut:"ROTATE_OUT",rotateOutDownLeft:"ROTATE_OUT_DOWN_LEFT",rotateOutDownRight:"ROTATE_OUT_DOWN_RIGHT",rotateOutUpLeft:"ROTATE_OUT_UP_LEFT",rotateOutUpRight:"ROTATE_OUT_UP_RIGHT",hinge:"HINGE",jackInTheBox:"JACK_IN_THE_BOX",rollIn:"ROLL_IN",rollOut:"ROLL_OUT",zoomIn:"ZOOM_IN",zoomInDown:"ZOOM_IN_DOWN",zoomInLeft:"ZOOM_IN_LEFT",zoomInRight:"ZOOM_IN_RIGHT",zoomInUp:"ZOOM_IN_UP",scalePop:"SCALE_POP",wipeLeftRight:"WIPE_LEFT_RIGHT",wipeRadial:"WIPE_RADIAL",maskPaintOn:"MASK_PAINT_ON",typewriter:"TYPEWRITER",rise:"RISE",textCascade:"TEXT_CASCADE",textSpotlight:"TEXT_SPOTLIGHT",textBlinds:"TEXT_BLINDS",textPopcorn:"TEXT_POPCORN",textRipple:"TEXT_RIPPLE",textShuffle:"TEXT_SHUFFLE",textDomino:"TEXT_DOMINO",textPendulum:"TEXT_PENDULUM",textSlideReveal:"TEXT_SLIDE_REVEAL",textSlot:"TEXT_SLOT",textCurtain:"TEXT_CURTAIN",staggerFadeUpText:"STAGGER_FADE_UP_TEXT",staggerFadeText:"STAGGER_FADE_TEXT",staggerFadeUp:"STAGGER_FADE_UP",staggerFade:"STAGGER_FADE",zoomOut:"ZOOM_OUT",zoomOutDown:"ZOOM_OUT_DOWN",zoomOutLeft:"ZOOM_OUT_LEFT",zoomOutRight:"ZOOM_OUT_RIGHT",zoomOutUp:"ZOOM_OUT_UP",slideInDown:"SLIDE_IN_DOWN",slideInLeft:"SLIDE_IN_LEFT",slideInRight:"SLIDE_IN_RIGHT",slideInUp:"SLIDE_IN_UP",slideOutDown:"SLIDE_OUT_DOWN",slideOutLeft:"SLIDE_OUT_LEFT",slideOutRight:"SLIDE_OUT_RIGHT",slideOutUp:"SLIDE_OUT_UP"};function lr(t){return t?t===t.toUpperCase()?t:Sm[t]?Sm[t]:t.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,""):"NONE"}function Ha(t){const e={name:"NONE",durationSec:Ft.DEFAULT_DURATION_SEC};if(t==null)return e;if(typeof t=="string")return{name:lr(t)||"NONE",durationSec:Ft.DEFAULT_DURATION_SEC};if(typeof t=="object"){const n=lr(t.name??"NONE"),r=t.duration??Ft.DEFAULT_DURATION_MS;return{name:n,durationSec:r/1e3}}return e}function wm(t){const e={name:"NONE",rotationsPerSecond:Ft.DEFAULT_LOOP_ROTATIONS_PER_SEC,direction:1};if(t==null)return e;if(typeof t=="string")return{...e,name:lr(t)||"NONE"};if(typeof t=="object"){const n=lr(t.name??"NONE"),r=typeof t.rotationsPerSecond=="number"&&t.rotationsPerSecond>0?Math.min(Math.max(t.rotationsPerSecond,Ft.MIN_LOOP_ROTATIONS_PER_SEC),Ft.MAX_LOOP_ROTATIONS_PER_SEC):Ft.DEFAULT_LOOP_ROTATIONS_PER_SEC,i=t.direction===-1?-1:1;return{name:n,rotationsPerSecond:r,direction:i}}return e}function dw(t){return!ja.has(t)}function hw(t){return $r.has(t)}function pw(t){if(!t||t==="NONE")return!1;if(typeof window<"u"&&window.gsap){const e=window.gsap;if(e.effects)return typeof e.effects[t]=="function"}return Object.values(Em).includes(t)}const Am=({targetRef:t,transformation:e,start:n,end:r,effectOptions:i={}})=>{const{tl:o}=S.useContext(Ye),s=S.useRef(null),{x:a=0,y:l=0,maxX:c=Zr.WIDTH,maxY:u=Zr.HEIGHT,scale:f=1,rotation:d=0,opacity:h=1,animationIn:p,animationOut:m,animationLoop:g,keyframes:y}=e||{},b=d*(180/Math.PI),x=S.useMemo(()=>Ha(p),[p]),v=S.useMemo(()=>Ha(m),[m]),T=S.useMemo(()=>wm(g),[g]),w=T.name!=="NONE"&&Tm(T.name),O=S.useMemo(()=>!Array.isArray(y)||y.length===0?[]:[...y].sort((N,D)=>N.time-D.time),[y]),C=S.useMemo(()=>{if(Array.isArray(f))return f;const N=typeof f=="number"?f:1;return[N,N]},[f]),R=Number(n)||0,P=Number(r)||R,A=Math.max(P-R,0),L=Math.min(Math.max(Number(e?.entranceOverlapSec)||0,0),A);return S.useLayoutEffect(()=>{const N=t?.current,D=o?.current,F=D;if(!N||!D||A<=0)return;s.current&&(D.remove(s.current),s.current.kill(),s.current=null);const G=C[0]??1,z=C[1]??1,K={x:a,y:l,rotation:b,scaleX:G,scaleY:z,alpha:h},ae=x.name&&x.name!=="NONE"&&!$r.has(x.name)&&E.effects[x.name],pe=v.name&&v.name!=="NONE"&&!$r.has(v.name)&&E.effects[v.name];ae&&ja.has(x.name);const X=x.durationSec,he=v.durationSec,j=ae?X:0,$=pe?Math.max(A-he,j):A,H=c||Zr.WIDTH,ce=u||Zr.HEIGHT,Z={x:K.x,y:K.y,rotation:K.rotation,scaleX:K.scaleX,scaleY:K.scaleY,alpha:K.alpha,maxX:c,maxY:u,canvasWidth:H,canvasHeight:ce,...i,immediateRender:!0,overwrite:!1},se=p&&typeof p=="object"&&typeof p.ease=="string"?p.ease:void 0,J=m&&typeof m=="object"&&typeof m.ease=="string"?m.ease:void 0,ie=p&&typeof p=="object"?{revealUnit:p.revealUnit,stagger:p.stagger,staggerFrom:p.staggerFrom,staggerEase:p.staggerEase,text:typeof p.text=="string"?p.text:void 0,yOffset:p.yOffset}:{},xe=E.timeline();if(ae){const ge=N.x,re=N.y,we=N.alpha,me=N.rotation,Ue=N.scale?.x??1,qe=N.scale?.y??1,pt=N.skew?.x??0,Mt=N.skew?.y??0,ve=E.effects[x.name](N,{duration:X,...Z,...ie,...se?{ease:se}:{}});N.x=ge,N.y=re,N.alpha=we,N.rotation=me,N.scale&&N.scale.set(Ue,qe),N.skew&&N.skew.set(pt,Mt),xe.add(ve,0)}else xe.set(N,{pixi:K},0);const Y=ge=>{const re={};return ge.x!==void 0&&(re.x=ge.x),ge.y!==void 0&&(re.y=ge.y),ge.scaleX!==void 0&&(re.scaleX=ge.scaleX),ge.scaleY!==void 0&&(re.scaleY=ge.scaleY),ge.rotation!==void 0&&(re.rotation=ge.rotation),ge.alpha!==void 0&&(re.alpha=ge.alpha),re};if(O.length>0){const ge=O[0],re=O[O.length-1],we=Math.max(ge.time,j);we>j&&xe.to(N,{pixi:K,duration:we-j,immediateRender:!1},j),xe.set(N,{pixi:Y(ge.properties)},we);for(let me=1;me<O.length;me++){const Ue=O[me-1],qe=O[me],pt=qe.time-Ue.time;pt<=0?xe.set(N,{pixi:Y(qe.properties)},qe.time):xe.to(N,{pixi:Y(qe.properties),duration:pt,ease:qe.easing||"none",immediateRender:!1},Ue.time)}$>re.time&&xe.to(N,{pixi:Y(re.properties),duration:$-re.time,immediateRender:!1},re.time)}else if(w&&$>j){const ge=$-j,re=360*T.rotationsPerSecond*T.direction*ge;xe.set(N,{pixi:{rotation:K.rotation}},j),xe.to(N,{pixi:{rotation:K.rotation+re},duration:ge,ease:"none",immediateRender:!1},j)}else $>j&&xe.to(N,{duration:$-j,pixi:K,immediateRender:!1},j);if(pe){const ge=E.effects[v.name](N,{duration:he,...Z,immediateRender:!1,...J?{ease:J}:{}});xe.add(ge,$)}s.current=xe,D.add(xe,R-L);const Oe=D.time();return D.time(Oe,!1),()=>{s.current&&(F&&F.remove(s.current),s.current.kill(),s.current=null)}},[t,o,a,l,d,b,C,h,c,u,x,v,T,w,O,R,P,A,L,i,p,m]),{childTimelineRef:s}};var to=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t.SPIN="SPIN",t))(to||{});const Ya=0,Om=1,mw=2,Cm=3,gw=new Set([2,4,5,6,7,8,9,10]),yw=t=>t==null||t===Ya?"none":t===Om||t===Cm||gw.has(t)?"native":"none",_w={[Ya]:"normal",[Om]:"add",[mw]:"multiply",[Cm]:"screen",4:"overlay",5:"darken",6:"lighten",7:"color-dodge",8:"color-burn",9:"hard-light",10:"soft-light"},Xa=t=>t==null?"normal":_w[t]??"normal",Rm=(t=Ya)=>S.useMemo(()=>Xa(t),[t]),no=`in vec2 aPosition;
|
|
967
|
+
`}})}}Gh.extension={name:"vivid-light",type:He.BlendMode},rE.add(xh,vh,Th,Eh,Sh,wh,Ah,Oh,Ch,Rh,Ih,Lh,Mh,Ph,Nh,kh,Dh,Fh,Bh,Uh,Gh),at.extend({AnimatedSprite:B.AnimatedSprite,Container:B.Container,Graphics:B.Graphics,Mesh:B.Mesh,Sprite:B.Sprite,Text:B.Text,TilingSprite:B.TilingSprite,GifSprite:Ir.GifSprite});var Rs={exports:{}},Dr={};var jh;function VE(){if(jh)return Dr;jh=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:o}}return Dr.Fragment=e,Dr.jsx=n,Dr.jsxs=n,Dr}var Hh;function KE(){return Hh||(Hh=1,Rs.exports=VE()),Rs.exports}var M=KE();const ue={Normal:"Normal",None:"None",Warm:"Warm",Cool:"Cool",BlackAndWhite:"BlackAndWhite",Vivid:"Vivid",Fade:"Fade",RetroVintage:"RetroVintage",Sepia:"Sepia",OldFilm:"OldFilm",Polaroid:"Polaroid",Seventies:"70s",Cinematic:"Cinematic",Dramatic:"Dramatic",Moody:"Moody",FilmNoir:"FilmNoir",SoftFocus:"SoftFocus",Dreamy:"Dreamy",DreamyVintage:"DreamyVintage",DarkMood:"DarkMood",HDR:"HDR",Pop:"Pop",Pastel:"Pastel",Neon:"Neon",Pixelize:"Pixelize",RadialPixel:"RadialPixel",CrossCut:"CrossCut",Liquid:"Liquid",Outliner:"Outliner",DotPattern:"DotPattern",CRT:"CRT",Posterize:"Posterize",TVGlitch:"TVGlitch",HalfTone:"HalfTone",Linocut:"Linocut",Shifter:"Shifter",Mirror:"Mirror",ASCII:"ASCII",Emboss:"Emboss",Glow:"Glow",TiltShift:"TiltShift",ExtrudeBlur:"ExtrudeBlur",Sharpie:"Sharpie",Recolor:"Recolor",GreenScreen:"GreenScreen",Godray:"Godray",MotionBlur:"MotionBlur",AdvancedBloom:"AdvancedBloom",RetroHalfTone:"RetroHalfTone",NightVision:"NightVision",Vignette:"Vignette",CYAN:"CYAN"};var Nt=(t=>(t.NONE="none",t.EQUALIZER="equalizer",t.ROUNDBARS="roundbars",t.LED="led",t.RADIAL_SPECTRUM="radial_spectrum",t.LUMI_BARS="lumi_bars",t))(Nt||{});let Yh;function Xh(){return Yh=document.body,Yh}function Ze(t,e,n){let r;return S.useEffect(()=>{r=r||Xh();const i=o=>{const s=o.detail;e(s)};return r.addEventListener(t,i,!1),()=>{r?.removeEventListener(t,i,!1)}},n),i=>{r=i}}function Ln(t,e){const n=Xh(),r=new CustomEvent(t,{detail:e});n.dispatchEvent(r)}function ZE(){let t;function e(n){t=n}return e.emit=function(n,r){const i=new CustomEvent(n,{bubbles:!0,detail:r});t?.dispatchEvent(i)},e}const Ye=I.createContext({}),ke={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END",FONTS_LOADED:"FONTS_LOADED"},$E=({children:t})=>{const[e,n]=S.useState(0),r=S.useRef(void 0),i=S.useRef(void 0),o=S.useRef(0),s=S.useRef(!1),a=S.useRef(!1),[l,c]=S.useState(!1),u=S.useRef(new Set),f=S.useRef(!1),d=S.useRef(!1);S.useLayoutEffect(()=>(i.current=E.context(()=>{r.current&&r.current.progress(0).kill(),r.current&&r.current.clear(),r.current&&E.killTweensOf(r.current),r.current=E.timeline({paused:!0,defaults:{duration:0}})}),()=>{r.current&&r.current.revert(),i.current.revert()}),[]);const h=S.useCallback(()=>{if(r.current){const R=r.current.time();R<o.current?s.current=!0:s.current=!1,o.current=R,u.current.forEach(P=>{try{P(R)}catch(A){typeof console<"u"&&console.warn&&console.warn("[GsapPixi] timeUpdate listener error:",A)}})}},[]);S.useEffect(()=>{if(r.current){const C=r.current;C.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){C.pause(),h()}).eventCallback("onUpdate",function(){h()}).eventCallback("onRepeat",function(){console.log("onrepeat",C.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",C.progress())}).eventCallback("onComplete",function(){C.seek(.01),C.pause(),f.current=!1,Ln(ke.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),h()})}},[]),S.useEffect(()=>{r.current&&e>0&&o.current===0&&(r.current.seek(.01),o.current=.01)},[e]);const p=S.useCallback(()=>{r.current&&r.current.revert()},[]),m=S.useCallback(()=>{r.current&&(r.current.restart(),f.current=!0,Ln(ke.RESUME))},[]),g=S.useCallback(()=>{if(!r.current)return;const C=r.current;C.repeat(1),C.restart(),f.current=!0,Ln(ke.RESUME)},[]),y=S.useCallback(C=>{r.current&&(r.current.seek(C),h())},[h]),b=S.useCallback(()=>{r.current&&r.current.seek(4)},[]),x=S.useCallback(()=>{const C=r.current;return C?C.totalDuration():0},[]),v=S.useCallback(C=>{u.current.add(C)},[]),T=S.useCallback(C=>{u.current.delete(C)},[]),w=()=>{r.current&&(r.current.pause(),f.current=!1,Ln(ke.PAUSE))},O=()=>{r.current&&(r.current.resume(),f.current=!0,Ln(ke.RESUME))};return Ze(ke.SEEK_START,()=>{a.current=!0,d.current=!0}),Ze(ke.SCRUBBER_PLAY,()=>{O()}),Ze(ke.SCRUBBER_PAUSE,()=>{w()}),Ze(ke.SCRUBBER_SEEK,C=>{y(C)}),Ze(ke.SEEK_END,()=>{a.current=!1,d.current=!1}),Ze(ke.REVERSE_MODE_START,()=>{s.current=!0}),Ze(ke.REVERSE_MODE_END,()=>{s.current=!1}),Ze(ke.SCRUBBER_PROGRESS_UPDATE,C=>{}),M.jsx(Ye,{value:{gsapCtx:i,tl:r,handlePlay:O,handlePause:w,handleReset:p,handleSeek:y,handleSeekTest:b,handleRestart:m,handleRepeat:g,playerTimeRef:o,getTimelineDuration:x,totalDuration:e,setTotalDuration:n,reverseModeRef:s,dragModeRef:a,isRemotion:l,setIsRemotion:c,registerTimeUpdateListener:v,unregisterTimeUpdateListener:T,playStateRef:f,isSeekingRef:d},children:t})};var Is,Wh;function Hi(){if(Wh)return Is;Wh=1;var t=Object.prototype;function e(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||t;return n===i}return Is=e,Is}var Ms,zh;function qh(){if(zh)return Ms;zh=1;function t(e,n){return function(r){return e(n(r))}}return Ms=t,Ms}var Ls,Vh;function JE(){if(Vh)return Ls;Vh=1;var t=qh(),e=t(Object.keys,Object);return Ls=e,Ls}var Ps,Kh;function Zh(){if(Kh)return Ps;Kh=1;var t=Hi(),e=JE(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!t(o))return e(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return Ps=i,Ps}var Ns,$h;function Jh(){if($h)return Ns;$h=1;var t=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi;return Ns=t,Ns}var ks,Qh;function St(){if(Qh)return ks;Qh=1;var t=Jh(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return ks=n,ks}var Ds,ep;function er(){if(ep)return Ds;ep=1;var t=St(),e=t.Symbol;return Ds=e,Ds}var Fs,tp;function QE(){if(tp)return Fs;tp=1;var t=er(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[i]=l:delete s[i]),u}return Fs=o,Fs}var Bs,np;function eS(){if(np)return Bs;np=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Bs=n,Bs}var Us,rp;function tr(){if(rp)return Us;rp=1;var t=er(),e=QE(),n=eS(),r="[object Null]",i="[object Undefined]",o=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?e(a):n(a)}return Us=s,Us}var Gs,ip;function Pn(){if(ip)return Gs;ip=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Gs=t,Gs}var js,op;function sp(){if(op)return js;op=1;var t=tr(),e=Pn(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!e(a))return!1;var l=t(a);return l==r||l==i||l==n||l==o}return js=s,js}var Hs,ap;function tS(){if(ap)return Hs;ap=1;var t=St(),e=t["__core-js_shared__"];return Hs=e,Hs}var Ys,cp;function nS(){if(cp)return Ys;cp=1;var t=tS(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return Ys=n,Ys}var Xs,lp;function up(){if(lp)return Xs;lp=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return Xs=n,Xs}var Ws,fp;function rS(){if(fp)return Ws;fp=1;var t=sp(),e=nS(),n=Pn(),r=up(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||e(d))return!1;var h=t(d)?u:o;return h.test(r(d))}return Ws=f,Ws}var zs,dp;function iS(){if(dp)return zs;dp=1;function t(e,n){return e?.[n]}return zs=t,zs}var qs,hp;function Nn(){if(hp)return qs;hp=1;var t=rS(),e=iS();function n(r,i){var o=e(r,i);return t(o)?o:void 0}return qs=n,qs}var Vs,pp;function oS(){if(pp)return Vs;pp=1;var t=Nn(),e=St(),n=t(e,"DataView");return Vs=n,Vs}var Ks,mp;function Zs(){if(mp)return Ks;mp=1;var t=Nn(),e=St(),n=t(e,"Map");return Ks=n,Ks}var $s,gp;function sS(){if(gp)return $s;gp=1;var t=Nn(),e=St(),n=t(e,"Promise");return $s=n,$s}var Js,yp;function aS(){if(yp)return Js;yp=1;var t=Nn(),e=St(),n=t(e,"Set");return Js=n,Js}var Qs,_p;function cS(){if(_p)return Qs;_p=1;var t=Nn(),e=St(),n=t(e,"WeakMap");return Qs=n,Qs}var ea,bp;function Fr(){if(bp)return ea;bp=1;var t=oS(),e=Zs(),n=sS(),r=aS(),i=cS(),o=tr(),s=up(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",f="[object WeakMap]",d="[object DataView]",h=s(t),p=s(e),m=s(n),g=s(r),y=s(i),b=o;return(t&&b(new t(new ArrayBuffer(1)))!=d||e&&b(new e)!=a||n&&b(n.resolve())!=c||r&&b(new r)!=u||i&&b(new i)!=f)&&(b=function(x){var v=o(x),T=v==l?x.constructor:void 0,w=T?s(T):"";if(w)switch(w){case h:return d;case p:return a;case m:return c;case g:return u;case y:return f}return v}),ea=b,ea}var ta,xp;function dn(){if(xp)return ta;xp=1;function t(e){return e!=null&&typeof e=="object"}return ta=t,ta}var na,vp;function lS(){if(vp)return na;vp=1;var t=tr(),e=dn(),n="[object Arguments]";function r(i){return e(i)&&t(i)==n}return na=r,na}var ra,Tp;function ia(){if(Tp)return ra;Tp=1;var t=lS(),e=dn(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=t((function(){return arguments})())?t:function(s){return e(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return ra=o,ra}var oa,Ep;function Vt(){if(Ep)return oa;Ep=1;var t=Array.isArray;return oa=t,oa}var sa,Sp;function wp(){if(Sp)return sa;Sp=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return sa=e,sa}var aa,Ap;function ca(){if(Ap)return aa;Ap=1;var t=sp(),e=wp();function n(r){return r!=null&&e(r.length)&&!t(r)}return aa=n,aa}var Br={exports:{}},la,Op;function uS(){if(Op)return la;Op=1;function t(){return!1}return la=t,la}Br.exports;var Cp;function Yi(){return Cp||(Cp=1,(function(t,e){var n=St(),r=uS(),i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;t.exports=c})(Br,Br.exports)),Br.exports}var ua,Rp;function fS(){if(Rp)return ua;Rp=1;var t=tr(),e=wp(),n=dn(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",x="[object Float64Array]",v="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",O="[object Uint8Array]",C="[object Uint8ClampedArray]",R="[object Uint16Array]",P="[object Uint32Array]",A={};A[b]=A[x]=A[v]=A[T]=A[w]=A[O]=A[C]=A[R]=A[P]=!0,A[r]=A[i]=A[g]=A[o]=A[y]=A[s]=A[a]=A[l]=A[c]=A[u]=A[f]=A[d]=A[h]=A[p]=A[m]=!1;function L(N){return n(N)&&e(N.length)&&!!A[t(N)]}return ua=L,ua}var fa,Ip;function da(){if(Ip)return fa;Ip=1;function t(e){return function(n){return e(n)}}return fa=t,fa}var Ur={exports:{}};Ur.exports;var Mp;function ha(){return Mp||(Mp=1,(function(t,e){var n=Jh(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();t.exports=a})(Ur,Ur.exports)),Ur.exports}var pa,Lp;function ma(){if(Lp)return pa;Lp=1;var t=fS(),e=da(),n=ha(),r=n&&n.isTypedArray,i=r?e(r):t;return pa=i,pa}var ga,Pp;function dS(){if(Pp)return ga;Pp=1;var t=Zh(),e=Fr(),n=ia(),r=Vt(),i=ca(),o=Yi(),s=Hi(),a=ma(),l="[object Map]",c="[object Set]",u=Object.prototype,f=u.hasOwnProperty;function d(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var p=e(h);if(p==l||p==c)return!h.size;if(s(h))return!t(h).length;for(var m in h)if(f.call(h,m))return!1;return!0}return ga=d,ga}var hS=dS();const ya=Jn(hS);var Np=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Np||{});const _a={normal:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:0},lensflare:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},filmstrip:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},grunge:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},bricks:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"MULTIPLY",alpha:1}},kp=t=>{const{overlay:e,width:n,height:r,x:i,y:o}=t,{src:s}=_a[e]||_a.normal,[a,l]=I.useState(null);return I.useEffect(()=>{let c=!1;return W.Assets.load(s).then(u=>{c||l(u)}).catch(()=>{}),()=>{c=!0}},[s]),a?M.jsx("pixiTilingSprite",{texture:a,width:n,height:r,x:i,y:o,tilePosition:{x:0,y:0},tileScale:{x:.5,y:.5},alpha:.5,anchor:.5}):null};var Gr=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Gr||{});var pS=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,mS=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,gS=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,yS=/(^[#\.][a-z]|[a-y][a-z])/i,_S=Math.PI/180,bS=180/Math.PI,Xi=Math.sin,Wi=Math.cos,mt=Math.abs,Kt=Math.sqrt,jr=Math.atan2,ba=1e8,Dp=function(e){return typeof e=="string"},Fp=function(e){return typeof e=="number"},xS=function(e){return typeof e>"u"},vS={},TS={},zi=1e5,Bp=function(e){return Math.round((e+ba)%1*zi)/zi||(e<0?0:1)},Oe=function(e){return Math.round(e*zi)/zi||0},Up=function(e){return Math.round(e*1e10)/1e10||0},Gp=function(e){return e.closed=Math.abs(e[0]-e[e.length-2])<.001&&Math.abs(e[1]-e[e.length-1])<.001},jp=function(e,n,r,i){var o=e[n],s=i===1?6:Ta(o,r,i);if((s||!i)&&s+r+2<o.length)return e.splice(n,0,o.slice(0,r+s+2)),o.splice(0,r+s),1},xa=function(e,n,r){var i=e.length,o=~~(r*i);if(e[o]>n){for(;--o&&e[o]>n;);o<0&&(o=0)}else for(;e[++o]<n&&o<i;);return o<i?o:i-1},ES=function(e,n){var r=e.length;for(e.reverse();r--;)e[r].reversed||nr(e[r])},Hp=function(e,n){return n.totalLength=e.totalLength,e.samples?(n.samples=e.samples.slice(0),n.lookup=e.lookup.slice(0),n.minLength=e.minLength,n.resolution=e.resolution):e.totalPoints&&(n.totalPoints=e.totalPoints),n},SS=function(e,n){var r=e.length,i=e[r-1]||[],o=i.length;r&&n[0]===i[o-2]&&n[1]===i[o-1]&&(n=i.concat(n.slice(2)),r--),e[r]=n};function Hr(t){t=Dp(t)&&yS.test(t)&&document.querySelector(t)||t;var e=t.getAttribute?t:0,n;return e&&(t=t.getAttribute("d"))?(e._gsPath||(e._gsPath={}),n=e._gsPath[t],n&&!n._dirty?n:e._gsPath[t]=kt(t)):t?Dp(t)?kt(t):Fp(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function wS(t){for(var e=[],n=0;n<t.length;n++)e[n]=Hp(t[n],t[n].slice(0));return Hp(t,e)}function nr(t){var e=0,n;for(t.reverse();e<t.length;e+=2)n=t[e],t[e]=t[e+1],t[e+1]=n;t.reversed=!t.reversed}var AS=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(e.attributes),o=i.length,s;for(n=","+n+",";--o>-1;)s=i[o].nodeName.toLowerCase(),n.indexOf(","+s+",")<0&&r.setAttributeNS(null,s,i[o].nodeValue);return r},OS={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"},CS=function(e,n){for(var r=n?n.split(","):[],i={},o=r.length;--o>-1;)i[r[o]]=+e.getAttribute(r[o])||0;return i};function va(t,e){var n=t.tagName.toLowerCase(),r=.552284749831,i,o,s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R;return n==="path"||!t.getBBox?t:(c=AS(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),R=CS(t,OS[n]),n==="rect"?(a=R.rx,l=R.ry||a,o=R.x,s=R.y,h=R.width-a*2,p=R.height-l*2,a||l?(m=o+a*(1-r),g=o+a,y=g+h,b=y+a*r,x=y+a,v=s+l*(1-r),T=s+l,w=T+p,O=w+l*r,C=w+l,i="M"+x+","+T+" V"+w+" C"+[x,O,b,C,y,C,y-(y-g)/3,C,g+(y-g)/3,C,g,C,m,C,o,O,o,w,o,w-(w-T)/3,o,T+(w-T)/3,o,T,o,v,m,s,g,s,g+(y-g)/3,s,y-(y-g)/3,s,y,s,b,s,x,v,x,T].join(",")+"z"):i="M"+(o+h)+","+s+" v"+p+" h"+-h+" v"+-p+" h"+h+"z"):n==="circle"||n==="ellipse"?(n==="circle"?(a=l=R.r,f=a*r):(a=R.rx,l=R.ry,f=l*r),o=R.cx,s=R.cy,u=a*r,i="M"+(o+a)+","+s+" C"+[o+a,s+f,o+u,s+l,o,s+l,o-u,s+l,o-a,s+f,o-a,s,o-a,s-f,o-u,s-l,o,s-l,o+u,s-l,o+a,s-f,o+a,s].join(",")+"z"):n==="line"?i="M"+R.x1+","+R.y1+" L"+R.x2+","+R.y2:(n==="polyline"||n==="polygon")&&(d=(t.getAttribute("points")+"").match(mS)||[],o=d.shift(),s=d.shift(),i="M"+o+","+s+" L"+d.join(","),n==="polygon"&&(i+=","+o+","+s+"z")),c.setAttribute("d",hn(c._gsRawPath=kt(i))),e&&t.parentNode&&(t.parentNode.insertBefore(c,t),t.parentNode.removeChild(t)),c)}function Yp(t,e,n){var r=t[e],i=t[e+2],o=t[e+4],s;return r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,s=i+(o+(t[e+6]-o)*n-i)*n-r,r=t[e+1],i=t[e+3],o=t[e+5],r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,Oe(jr(i+(o+(t[e+7]-o)*n-i)*n-r,s)*bS)}function Xp(t,e,n){n=xS(n)?1:Up(n)||0,e=Up(e)||0;var r=Math.max(0,~~(mt(n-e)-1e-8)),i=wS(t);if(e>n&&(e=1-e,n=1-n,ES(i),i.totalLength=0),e<0||n<0){var o=Math.abs(~~Math.min(e,n))+1;e+=o,n+=o}i.totalLength||Zt(i);var s=n>1,a=zp(i,e,vS,!0),l=zp(i,n,TS),c=l.segment,u=a.segment,f=l.segIndex,d=a.segIndex,h=l.i,p=a.i,m=d===f,g=h===p&&m,y,b,x,v,T,w,O,C;if(s||r){for(y=f<d||m&&h<p||g&&l.t<a.t,jp(i,d,p,a.t)&&(d++,y||(f++,g?(l.t=(l.t-a.t)/(1-a.t),h=0):m&&(h-=p))),Math.abs(1-(n-e))<1e-5?f=d-1:!l.t&&f?f--:jp(i,f,h,l.t)&&y&&d++,a.t===1&&(d=(d+1)%i.length),T=[],w=i.length,O=1+w*r,C=d,O+=(w-d+f)%w,v=0;v<O;v++)SS(T,i[C++%w]);i=T}else if(x=l.t===1?6:Ta(c,h,l.t),e!==n)for(b=Ta(u,p,g?a.t/l.t:a.t),m&&(x+=b),c.splice(h+x+2),(b||p)&&u.splice(0,p+b),v=i.length;v--;)(v<d||v>f)&&i.splice(v,1);else c.angle=Yp(c,h+x,0),h+=x,a=c[h],l=c[h+1],c.length=c.totalLength=0,c.totalPoints=i.totalPoints=8,c.push(a,l,a,l,a,l,a,l);return i.totalLength=0,i}function Wp(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var r=~~t.resolution||12,i=1/r,o=t.length,s=t[e],a=t[e+1],l=e?e/6*r:0,c=t.samples,u=t.lookup,f=(e?t.minLength:ba)||ba,d=c[l+n*r-1],h=e?c[l-1]:0,p,m,g,y,b,x,v,T,w,O,C,R,P,A,L,N,D;for(c.length=u.length=0,m=e+2;m<o;m+=6){if(g=t[m+4]-s,y=t[m+2]-s,b=t[m]-s,T=t[m+5]-a,w=t[m+3]-a,O=t[m+1]-a,x=v=C=R=0,mt(g)<.01&&mt(T)<.01&&mt(b)+mt(O)<.01)t.length>8&&(t.splice(m,6),m-=6,o-=6);else for(p=1;p<=r;p++)A=i*p,P=1-A,x=v-(v=(A*A*g+3*P*(A*y+P*b))*A),C=R-(R=(A*A*T+3*P*(A*w+P*O))*A),N=Kt(C*C+x*x),N<f&&(f=N),h+=N,c[l++]=h;s+=g,a+=T}if(d)for(d-=h;l<c.length;l++)c[l]+=d;if(c.length&&f){if(t.totalLength=D=c[c.length-1]||0,t.minLength=f,D/f<9999)for(N=L=0,p=0;p<D;p+=f)u[N++]=c[L]<p?++L:L}else t.totalLength=c[0]=0;return e?h-c[e/2-1]:h}function Zt(t,e){var n,r,i;for(i=n=r=0;i<t.length;i++)t[i].resolution=~~e||12,n+=Wp(t[i]),r+=t[i].length;return t.totalPoints=r,t.totalLength=n,t}function Ta(t,e,n){if(n<=0||n>=1)return 0;var r=t[e],i=t[e+1],o=t[e+2],s=t[e+3],a=t[e+4],l=t[e+5],c=t[e+6],u=t[e+7],f=r+(o-r)*n,d=o+(a-o)*n,h=i+(s-i)*n,p=s+(l-s)*n,m=f+(d-f)*n,g=h+(p-h)*n,y=a+(c-a)*n,b=l+(u-l)*n;return d+=(y-d)*n,p+=(b-p)*n,t.splice(e+2,4,Oe(f),Oe(h),Oe(m),Oe(g),Oe(m+(d-m)*n),Oe(g+(p-g)*n),Oe(d),Oe(p),Oe(y),Oe(b)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}function zp(t,e,n,r){n=n||{},t.totalLength||Zt(t),(e<0||e>1)&&(e=Bp(e));var i=0,o=t[0],s,a,l,c,u,f,d;if(!e)d=f=i=0,o=t[0];else if(e===1)d=1,i=t.length-1,o=t[i],f=o.length-8;else{if(t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=f;o=t[i],c=u-o.totalLength,e=(l-c)/(u-c)||0}s=o.samples,a=o.resolution,l=o.totalLength*e,f=o.lookup.length?o.lookup[~~(l/o.minLength)]||0:xa(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a),f=~~(f/a)*6,r&&d===1&&(f+6<o.length?(f+=6,d=0):i+1<t.length&&(f=d=0,o=t[++i]))}return n.t=d,n.i=f,n.path=t,n.segment=o,n.segIndex=i,n}function qp(t,e,n,r){var i=t[0],o=r||{},s,a,l,c,u,f,d,h,p;if((e<0||e>1)&&(e=Bp(e)),i.lookup||Zt(t),t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=t[f];c=u-i.totalLength,e=(l-c)/(u-c)||0}return s=i.samples,a=i.resolution,l=i.totalLength*e,f=i.lookup.length?i.lookup[e<1?~~(l/i.minLength):i.lookup.length-1]||0:xa(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a)||0,p=1-d,f=~~(f/a)*6,h=i[f],o.x=Oe((d*d*(i[f+6]-h)+3*p*(d*(i[f+4]-h)+p*(i[f+2]-h)))*d+h),o.y=Oe((d*d*(i[f+7]-(h=i[f+1]))+3*p*(d*(i[f+5]-h)+p*(i[f+3]-h)))*d+h),n&&(o.angle=i.totalLength?Yp(i,f,d>=1?1-1e-9:d||1e-9):i.angle||0),o}function Yr(t,e,n,r,i,o,s){for(var a=t.length,l,c,u,f,d;--a>-1;)for(l=t[a],c=l.length,u=0;u<c;u+=2)f=l[u],d=l[u+1],l[u]=f*e+d*r+o,l[u+1]=f*n+d*i+s;return t._dirty=1,t}function RS(t,e,n,r,i,o,s,a,l){if(!(t===a&&e===l)){n=mt(n),r=mt(r);var c=i%360*_S,u=Wi(c),f=Xi(c),d=Math.PI,h=d*2,p=(t-a)/2,m=(e-l)/2,g=u*p+f*m,y=-f*p+u*m,b=g*g,x=y*y,v=b/(n*n)+x/(r*r);v>1&&(n=Kt(v)*n,r=Kt(v)*r);var T=n*n,w=r*r,O=(T*w-T*x-w*b)/(T*x+w*b);O<0&&(O=0);var C=(o===s?-1:1)*Kt(O),R=C*(n*y/r),P=C*-(r*g/n),A=(t+a)/2,L=(e+l)/2,N=A+(u*R-f*P),D=L+(f*R+u*P),F=(g-R)/n,G=(y-P)/r,z=(-g-R)/n,K=(-y-P)/r,se=F*F+G*G,pe=(G<0?-1:1)*Math.acos(F/Kt(se)),X=(F*K-G*z<0?-1:1)*Math.acos((F*z+G*K)/Kt(se*(z*z+K*K)));isNaN(X)&&(X=d),!s&&X>0?X-=h:s&&X<0&&(X+=h),pe%=h,X%=h;var he=Math.ceil(mt(X)/(h/4)),j=[],te=X/he,H=4/3*Xi(te/2)/(1+Wi(te/2)),ae=u*n,Z=f*n,ce=f*-r,J=u*r,ie;for(ie=0;ie<he;ie++)i=pe+ie*te,g=Wi(i),y=Xi(i),F=Wi(i+=te),G=Xi(i),j.push(g-H*y,y+H*g,F+H*G,G-H*F,F,G);for(ie=0;ie<j.length;ie+=2)g=j[ie],y=j[ie+1],j[ie]=g*ae+y*ce+N,j[ie+1]=g*Z+y*J+D;return j[ie-2]=a,j[ie-1]=l,j}}function kt(t){var e=(t+"").replace(gS,function(R){var P=+R;return P<1e-4&&P>-1e-4?0:P}).match(pS)||[],n=[],r=0,i=0,o=2/3,s=e.length,a=0,l="ERROR: malformed path: "+t,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C=function(P,A,L,N){b=(L-P)/3,x=(N-A)/3,m.push(P+b,A+x,L-b,N-x,L,N)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(l),n;for(c=0;c<s;c++)if(T=h,isNaN(e[c])?(h=e[c].toUpperCase(),p=h!==e[c]):c--,f=+e[c+1],d=+e[c+2],p&&(f+=r,d+=i),c||(g=f,y=d),h==="M")m&&(m.length<8?n.length-=1:a+=m.length,Gp(m)),r=g=f,i=y=d,m=[f,d],n.push(m),c+=2,h="L";else if(h==="C")m||(m=[0,0]),p||(r=i=0),m.push(f,d,r+e[c+3]*1,i+e[c+4]*1,r+=e[c+5]*1,i+=e[c+6]*1),c+=6;else if(h==="S")b=r,x=i,(T==="C"||T==="S")&&(b+=r-m[m.length-4],x+=i-m[m.length-3]),p||(r=i=0),m.push(b,x,f,d,r+=e[c+3]*1,i+=e[c+4]*1),c+=4;else if(h==="Q")b=r+(f-r)*o,x=i+(d-i)*o,p||(r=i=0),r+=e[c+3]*1,i+=e[c+4]*1,m.push(b,x,r+(f-r)*o,i+(d-i)*o,r,i),c+=4;else if(h==="T")b=r-m[m.length-4],x=i-m[m.length-3],m.push(r+b,i+x,f+(r+b*1.5-f)*o,d+(i+x*1.5-d)*o,r=f,i=d),c+=2;else if(h==="H")C(r,i,r=f,i),c+=1;else if(h==="V")C(r,i,r,i=f+(p?i-r:0)),c+=1;else if(h==="L"||h==="Z")h==="Z"&&(f=g,d=y,m.closed=!0),(h==="L"||mt(r-f)>.5||mt(i-d)>.5)&&(C(r,i,f,d),h==="L"&&(c+=2)),r=f,i=d;else if(h==="A"){if(w=e[c+4],O=e[c+5],b=e[c+6],x=e[c+7],u=7,w.length>1&&(w.length<3?(x=b,b=O,u--):(x=O,b=w.substr(2),u-=2),O=w.charAt(1),w=w.charAt(0)),v=RS(r,i,+e[c+1],+e[c+2],+e[c+3],+w,+O,(p?r:0)+b*1,(p?i:0)+x*1),c+=u,v)for(u=0;u<v.length;u++)m.push(v[u]);r=m[m.length-2],i=m[m.length-1]}else console.log(l);return c=m.length,c<6?(n.pop(),c=0):Gp(m),n.totalPoints=a+c,n}function IS(t,e){e===void 0&&(e=1);for(var n=t[0],r=0,i=[n,r],o=2;o<t.length;o+=2)i.push(n,r,t[o],r=(t[o]-n)*e/2,n=t[o],-r);return i}function MS(t,e){t.samples||Wp(t);for(var n=t.samples,r=t.lookup,i=t.resolution,o=t.totalLength,s=t.slice(0,2),a=[],l=t.length-4,c=6,u=.2,f=0,d=0,h,p,m,g,y,b,x,v,T,w,O,C,R,P;c<l;c+=6)Math.abs(jr(t[c+1]-t[c-1],t[c]-t[c-2])-jr(t[c+3]-t[c+1],t[c+2]-t[c]))>u&&a.push(c);if(a.push(t.length-2),l=a.length,s.nonSmooth=C=[1],e>l)for(e-=l,y=0;y<l;y++){for(R=a[y],P=Math.round(R/6*i),T=n[P-1]-f,p=Math.round(n[P-1]/o*e)-d,d+=p,b=1/(p+1),x=1;x<=p;x++)w=f+T*x*b,c=r.length?r[w<o?~~(w/t.minLength):r.length-1]||0:xa(n,w,w/o),m=c?n[c-1]:0,g=n[c],g<w&&(m=g,g=n[++c]),h=1/i*((w-m)/(g-m)+c%i)||0,v=1-h,c=~~(c/i)*6,O=t[c],s.push(Oe((h*h*(t[c+6]-O)+3*v*(h*(t[c+4]-O)+v*(t[c+2]-O)))*h+O),Oe((h*h*(t[c+7]-(O=t[c+1]))+3*v*(h*(t[c+5]-O)+v*(t[c+3]-O)))*h+O));C[s.length]=1,s.push(t[R],t[R+1]),f+=T}return c=t.length-2,t.closed&&Math.abs(jr(t[c+1]-t[c-1],t[c]-t[c-2])-jr(t[3]-t[1],t[2]-t[0]))<=u&&(C[0]=C[C.length-1]=0),s}function qi(t,e){mt(t[0]-t[2])<1e-4&&mt(t[1]-t[3])<1e-4&&(t=t.slice(2));var n=t.length-2,r=+t[0],i=+t[1],o=+t[2],s=+t[3],a=[r,i,r,i],l=o-r,c=s-i,u=t.nonSmooth||[],f=Math.abs(t[n]-r)<.001&&Math.abs(t[n+1]-i)<.001,d,h,p,m,g,y,b,x,v,T,w,O,C,R,P;if(!n)return[r,i,r,i,r,i,r,i];for(f&&(t.push(o,s),o=r,s=i,r=t[n-2],i=t[n-1],t.unshift(r,i),n+=4,u=[0,0].concat(u)),e=e||e===0?+e:1,p=2;p<n;p+=2)if(d=r,h=i,r=o,i=s,o=+t[p+2],s=+t[p+3],!(r===o&&i===s)){if(m=l,g=c,l=o-r,c=s-i,u[p]){a.push(r-(r-d)/4,i-(i-h)/4,r,i,r+(o-r)/4,i+(s-i)/4);continue}y=Kt(m*m+g*g),b=Kt(l*l+c*c),x=Kt(Math.pow(l/b+m/y,2)+Math.pow(c/b+g/y,2)),v=(y+b)*e*.25/x,T=r-(r-d)*(y?v/y:0),w=r+(o-r)*(b?v/b:0),O=r-(T+((w-T)*(y*3/(y+b)+.5)/4||0)),C=i-(i-h)*(y?v/y:0),R=i+(s-i)*(b?v/b:0),P=i-(C+((R-C)*(y*3/(y+b)+.5)/4||0)),a.push(Oe(T+O),Oe(C+P),Oe(r),Oe(i),Oe(w+O),Oe(R+P))}return r!==o||i!==s||a.length<4?a.push(Oe(o),Oe(s),Oe(o),Oe(s)):a.length-=2,a.length===2?a.push(r,i,r,i,r,i):f&&(a.splice(0,6),a.length-=6),a.closed=f,a}function hn(t){Fp(t[0])&&(t=[t]);var e="",n=t.length,r,i,o,s;for(i=0;i<n;i++){for(s=t[i],e+="M"+Oe(s[0])+","+Oe(s[1])+" C",r=s.length,o=2;o<r;o++)e+=Oe(s[o++])+","+Oe(s[o++])+" "+Oe(s[o++])+","+Oe(s[o++])+" "+Oe(s[o++])+","+Oe(s[o])+" ";s.closed&&(e+="z")}return e}var $t,kn,Ea,Vi,Xr,Ki,Zi,Wr,wt="transform",Sa=wt+"Origin",Vp,Kp=function(e){var n=e.ownerDocument||e;for(!(wt in e.style)&&("msTransform"in e.style)&&(wt="msTransform",Sa=wt+"Origin");n.parentNode&&(n=n.parentNode););if(kn=window,Zi=new zr,n){$t=n,Ea=n.documentElement,Vi=n.body,Wr=$t.createElementNS("http://www.w3.org/2000/svg","g"),Wr.style.transform="none";var r=n.createElement("div"),i=n.createElement("div"),o=n&&(n.body||n.firstElementChild);o&&o.appendChild&&(o.appendChild(r),r.appendChild(i),r.style.position="static",r.style.transform="translate3d(0,0,1px)",Vp=i.offsetParent!==r,o.removeChild(r))}return n},LS=function(e){for(var n,r;e&&e!==Vi;)r=e._gsap,r&&r.uncache&&r.get(e,"x"),r&&!r.scaleX&&!r.scaleY&&r.renderTransform&&(r.scaleX=r.scaleY=1e-4,r.renderTransform(1,r),n?n.push(r):n=[r]),e=e.parentNode;return n},Zp=[],$p=[],PS=function(){return kn.pageYOffset||$t.scrollTop||Ea.scrollTop||Vi.scrollTop||0},NS=function(){return kn.pageXOffset||$t.scrollLeft||Ea.scrollLeft||Vi.scrollLeft||0},wa=function(e){return e.ownerSVGElement||((e.tagName+"").toLowerCase()==="svg"?e:null)},kS=function t(e){if(kn.getComputedStyle(e).position==="fixed")return!0;if(e=e.parentNode,e&&e.nodeType===1)return t(e)},Aa=function t(e,n){if(e.parentNode&&($t||Kp(e))){var r=wa(e),i=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o=r?n?"rect":"g":"div",s=n!==2?0:100,a=n===3?100:0,l={position:"absolute",display:"block",pointerEvents:"none",margin:"0",padding:"0"},c=$t.createElementNS?$t.createElementNS(i.replace(/^https/,"http"),o):$t.createElement(o);return n&&(r?(Ki||(Ki=t(e)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+s+","+a+")"),c.setAttribute("fill","transparent"),Ki.appendChild(c)):(Xr||(Xr=t(e),Object.assign(Xr.style,l)),Object.assign(c.style,l,{width:"0.1px",height:"0.1px",top:a+"px",left:s+"px"}),Xr.appendChild(c))),c}throw"Need document and parent."},DS=function(e){for(var n=new zr,r=0;r<e.numberOfItems;r++)n.multiply(e.getItem(r).matrix);return n},FS=function(e){var n=e.getCTM(),r;return n||(r=e.style[wt],e.style[wt]="none",e.appendChild(Wr),n=Wr.getCTM(),e.removeChild(Wr),r?e.style[wt]=r:e.style.removeProperty(wt.replace(/([A-Z])/g,"-$1").toLowerCase())),n||Zi.clone()},BS=function(e,n){var r=wa(e),i=e===r,o=r?Zp:$p,s=e.parentNode,a=s&&!r&&s.shadowRoot&&s.shadowRoot.appendChild?s.shadowRoot:s,l,c,u,f,d,h;if(e===kn)return e;if(o.length||o.push(Aa(e,1),Aa(e,2),Aa(e,3)),l=r?Ki:Xr,r)i?(u=FS(e),f=-u.e/u.a,d=-u.f/u.d,c=Zi):e.getBBox?(u=e.getBBox(),c=e.transform?e.transform.baseVal:{},c=c.numberOfItems?c.numberOfItems>1?DS(c):c.getItem(0).matrix:Zi,f=c.a*u.x+c.c*u.y,d=c.b*u.x+c.d*u.y):(c=new zr,f=d=0),n&&e.tagName.toLowerCase()==="g"&&(f=d=0),(i||!e.getBoundingClientRect().width?r:s).appendChild(l),l.setAttribute("transform","matrix("+c.a+","+c.b+","+c.c+","+c.d+","+(c.e+f)+","+(c.f+d)+")");else{if(f=d=0,Vp)for(c=e.offsetParent,u=e;u&&(u=u.parentNode)&&u!==c&&u.parentNode;)(kn.getComputedStyle(u)[wt]+"").length>4&&(f=u.offsetLeft,d=u.offsetTop,u=0);if(h=kn.getComputedStyle(e),h.position!=="absolute"&&h.position!=="fixed")for(c=e.offsetParent;s&&s!==c;)f+=s.scrollLeft||0,d+=s.scrollTop||0,s=s.parentNode;u=l.style,u.top=e.offsetTop-d+"px",u.left=e.offsetLeft-f+"px",u[wt]=h[wt],u[Sa]=h[Sa],u.position=h.position==="fixed"?"fixed":"absolute",a.appendChild(l)}return l},Oa=function(e,n,r,i,o,s,a){return e.a=n,e.b=r,e.c=i,e.d=o,e.e=s,e.f=a,e},zr=(function(){function t(n,r,i,o,s,a){n===void 0&&(n=1),r===void 0&&(r=0),i===void 0&&(i=0),o===void 0&&(o=1),s===void 0&&(s=0),a===void 0&&(a=0),Oa(this,n,r,i,o,s,a)}var e=t.prototype;return e.inverse=function(){var r=this.a,i=this.b,o=this.c,s=this.d,a=this.e,l=this.f,c=r*s-i*o||1e-10;return Oa(this,s/c,-i/c,-o/c,r/c,(o*l-s*a)/c,-(r*l-i*a)/c)},e.multiply=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f,u=r.a,f=r.c,d=r.b,h=r.d,p=r.e,m=r.f;return Oa(this,u*i+d*s,u*o+d*a,f*i+h*s,f*o+h*a,l+p*i+m*s,c+p*o+m*a)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f;return i===r.a&&o===r.b&&s===r.c&&a===r.d&&l===r.e&&c===r.f},e.apply=function(r,i){i===void 0&&(i={});var o=r.x,s=r.y,a=this.a,l=this.b,c=this.c,u=this.d,f=this.e,d=this.f;return i.x=o*a+s*c+f||0,i.y=o*l+s*u+d||0,i},t})();function rr(t,e,n,r){if(!t||!t.parentNode||($t||Kp(t)).documentElement===t)return new zr;var i=LS(t),o=wa(t),s=o?Zp:$p,a=BS(t,n),l=s[0].getBoundingClientRect(),c=s[1].getBoundingClientRect(),u=s[2].getBoundingClientRect(),f=a.parentNode,d=!r&&kS(t),h=new zr((c.left-l.left)/100,(c.top-l.top)/100,(u.left-l.left)/100,(u.top-l.top)/100,l.left+(d?0:NS()),l.top+(d?0:PS()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return e?h.inverse():h}var US="x,translateX,left,marginLeft,xPercent".split(","),GS="y,translateY,top,marginTop,yPercent".split(","),jS=Math.PI/180,gt,Jp,ir,Ca,Ra,Qp,HS=function(){return gt||typeof window<"u"&&(gt=window.gsap)&>.registerPlugin&>},qr=function(e,n,r,i){for(var o=n.length,s=i===2?0:i,a=0;a<o;a++)e[s]=parseFloat(n[a][r]),i===2&&(e[s+1]=0),s+=2;return e},or=function(e,n,r){return parseFloat(e._gsap.get(e,n,r||"px"))||0},em=function(e){var n=e[0],r=e[1],i;for(i=2;i<e.length;i+=2)n=e[i]+=n,r=e[i+1]+=r},tm=function(e,n,r,i,o,s,a,l,c){if(a.type==="cubic")n=[n];else{a.fromCurrent!==!1&&n.unshift(or(r,i,l),o?or(r,o,c):0),a.relative&&em(n);var u=o?qi:IS;n=[u(n,a.curviness)]}return n=s(rm(n,r,a)),$i(e,r,i,n,"x",l),o&&$i(e,r,o,n,"y",c),Zt(n,a.resolution||(a.curviness===0?20:12))},YS=function(e){return e},XS=/[-+\.]*\d+\.?(?:e-|e\+)?\d*/g,nm=function(e,n,r){var i=rr(e),o=0,s=0,a;return(e.tagName+"").toLowerCase()==="svg"?(a=e.viewBox.baseVal,a.width||(a={width:+e.getAttribute("width"),height:+e.getAttribute("height")})):a=n&&e.getBBox&&e.getBBox(),n&&n!=="auto"&&(o=n.push?n[0]*(a?a.width:e.offsetWidth||0):n.x,s=n.push?n[1]*(a?a.height:e.offsetHeight||0):n.y),r.apply(o||s?i.apply({x:o,y:s}):{x:i.e,y:i.f})},Ia=function(e,n,r,i){var o=rr(e.parentNode,!0,!0),s=o.clone().multiply(rr(n)),a=nm(e,r,o),l=nm(n,i,o),c=l.x,u=l.y,f;return s.e=s.f=0,i==="auto"&&n.getTotalLength&&n.tagName.toLowerCase()==="path"&&(f=n.getAttribute("d").match(XS)||[],f=s.apply({x:+f[0],y:+f[1]}),c+=f.x,u+=f.y),f&&(f=s.apply(n.getBBox()),c-=f.x,u-=f.y),s.e=c-a.x,s.f=u-a.y,s},rm=function(e,n,r){var i=r.align,o=r.matrix,s=r.offsetX,a=r.offsetY,l=r.alignOrigin,c=e[0][0],u=e[0][1],f=or(n,"x"),d=or(n,"y"),h,p,m;return!e||!e.length?Hr("M0,0L0,0"):(i&&(i==="self"||(h=Ca(i)[0]||n)===n?Yr(e,1,0,0,1,f-c,d-u):(l&&l[2]!==!1?gt.set(n,{transformOrigin:l[0]*100+"% "+l[1]*100+"%"}):l=[or(n,"xPercent")/-100,or(n,"yPercent")/-100],p=Ia(n,h,l,"auto"),m=p.apply({x:c,y:u}),Yr(e,p.a,p.b,p.c,p.d,f+p.e-(m.x-p.e),d+p.f-(m.y-p.f)))),o?Yr(e,o.a,o.b,o.c,o.d,o.e,o.f):(s||a)&&Yr(e,1,0,0,1,s||0,a||0),e)},$i=function(e,n,r,i,o,s){var a=n._gsap,l=a.harness,c=l&&l.aliases&&l.aliases[r],u=c&&c.indexOf(",")<0?c:r,f=e._pt=new Jp(e._pt,n,u,0,0,YS,0,a.set(n,u,e));f.u=ir(a.get(n,u,s))||0,f.path=i,f.pp=o,e._props.push(u)},WS=function(e,n){return function(r){return e||n!==1?Xp(r,e,n):r}},im={version:"3.15.0",name:"motionPath",register:function(e,n,r){gt=e,ir=gt.utils.getUnit,Ca=gt.utils.toArray,Ra=gt.core.getStyleSaver,Qp=gt.core.reverting||function(){},Jp=r},init:function(e,n,r){if(!gt)return console.warn("Please gsap.registerPlugin(MotionPathPlugin)"),!1;(!(typeof n=="object"&&!n.style)||!n.path)&&(n={path:n});var i=[],o=n,s=o.path,a=o.autoRotate,l=o.unitX,c=o.unitY,u=o.x,f=o.y,d=s[0],h=WS(n.start,"end"in n?n.end:1),p,m;if(this.rawPaths=i,this.target=e,this.tween=r,this.styles=Ra&&Ra(e,"transform"),(this.rotate=a||a===0)&&(this.rOffset=parseFloat(a)||0,this.radians=!!n.useRadians,this.rProp=n.rotation||"rotation",this.rSet=e._gsap.set(e,this.rProp,this),this.ru=ir(e._gsap.get(e,this.rProp))||0),Array.isArray(s)&&!("closed"in s)&&typeof d!="number"){for(m in d)!u&&~US.indexOf(m)?u=m:!f&&~GS.indexOf(m)&&(f=m);u&&f?i.push(tm(this,qr(qr([],s,u,0),s,f,1),e,u,f,h,n,l||ir(s[0][u]),c||ir(s[0][f]))):u=f=0;for(m in d)m!==u&&m!==f&&i.push(tm(this,qr([],s,m,2),e,m,0,h,n,ir(s[0][m])))}else p=h(rm(Hr(n.path),e,n)),Zt(p,n.resolution),i.push(p),$i(this,e,n.x||"x",p,"x",n.unitX||"px"),$i(this,e,n.y||"y",p,"y",n.unitY||"px");r.vars.immediateRender&&this.render(r.progress(),this)},render:function(e,n){var r=n.rawPaths,i=r.length,o=n._pt;if(n.tween._time||!Qp()){for(e>1?e=1:e<0&&(e=0);i--;)qp(r[i],e,!i&&n.rotate,r[i]);for(;o;)o.set(o.t,o.p,o.path[o.pp]+o.u,o.d,e),o=o._next;n.rotate&&n.rSet(n.target,n.rProp,r[0].angle*(n.radians?jS:1)+n.rOffset+n.ru,n,e)}else n.styles.revert()},getLength:function(e){return Zt(Hr(e)).totalLength},sliceRawPath:Xp,getRawPath:Hr,pointsToSegment:qi,stringToRawPath:kt,rawPathToString:hn,transformRawPath:Yr,getGlobalMatrix:rr,getPositionOnPath:qp,cacheRawPathMeasurements:Zt,convertToPath:function(e,n){return Ca(e).map(function(r){return va(r,n!==!1)})},convertCoordinates:function(e,n,r){var i=rr(n,!0,!0).multiply(rr(e));return r?i.apply(r):i},getAlignMatrix:Ia,getRelativePosition:function(e,n,r,i){var o=Ia(e,n,r,i);return{x:o.e,y:o.f}},arrayToRawPath:function(e,n){n=n||{};var r=qr(qr([],e,n.x||"x",0),e,n.y||"y",1);return n.relative&&em(r),[n.type==="cubic"?r:qi(r,n.curviness)]}};HS()&>.registerPlugin(im),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerPlugin(wn),wn.create("springBounce","0.32, 1.06, 0.61, 0.93"),E.registerEffect({name:"HEART_BEAT",effect(t,e){try{const{canvasWidth:r,canvasHeight:i,...o}=e;return E.timeline({repeat:e.repeat||0,defaults:{ease:"power2.out",...o}}).to(t,{pixi:{scale:1*1.3},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.14,ease:"power2.in"}).to(t,{pixi:{scale:1*1.2},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.28,ease:"power2.in"})}catch(n){return console.error("[HEART_BEAT] Animation error:",n),E.timeline()}}});const re={IN:"IN",OUT:"OUT",ATTENTION:"ATTENTION"},ee={NONE:"NONE",FADE:"FADE",SLIDE:"SLIDE",ZOOM:"ZOOM",BOUNCE:"BOUNCE",BACK:"BACK",FLIP:"FLIP",ROTATE:"ROTATE",ROLL:"ROLL",LIGHT_SPEED:"LIGHT_SPEED",WIPE:"WIPE",SHAKE:"SHAKE",SPECIAL:"SPECIAL"},Pe={OFFSET_MEDIUM:2e3}.OFFSET_MEDIUM,Te={NONE:{id:"NONE",category:ee.NONE,direction:null,keyframes:{},gsapEasing:"none",defaultDuration:0},FADE_IN:{id:"FADE_IN",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5},FADE_IN_DOWN:{id:"FADE_IN_DOWN",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_UP:{id:"FADE_IN_UP",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_LEFT:{id:"FADE_IN_LEFT",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_RIGHT:{id:"FADE_IN_RIGHT",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_OUT:{id:"FADE_OUT",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_DOWN:{id:"FADE_OUT_DOWN",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_UP:{id:"FADE_OUT_UP",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_LEFT:{id:"FADE_OUT_LEFT",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_RIGHT:{id:"FADE_OUT_RIGHT",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_DOWN:{id:"SLIDE_IN_DOWN",category:ee.SLIDE,direction:re.IN,keyframes:{translateY:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_UP:{id:"SLIDE_IN_UP",category:ee.SLIDE,direction:re.IN,keyframes:{translateY:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_LEFT:{id:"SLIDE_IN_LEFT",category:ee.SLIDE,direction:re.IN,keyframes:{translateX:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_RIGHT:{id:"SLIDE_IN_RIGHT",category:ee.SLIDE,direction:re.IN,keyframes:{translateX:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_DOWN:{id:"SLIDE_OUT_DOWN",category:ee.SLIDE,direction:re.OUT,keyframes:{translateY:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_UP:{id:"SLIDE_OUT_UP",category:ee.SLIDE,direction:re.OUT,keyframes:{translateY:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_LEFT:{id:"SLIDE_OUT_LEFT",category:ee.SLIDE,direction:re.OUT,keyframes:{translateX:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_RIGHT:{id:"SLIDE_OUT_RIGHT",category:ee.SLIDE,direction:re.OUT,keyframes:{translateX:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN:{id:"ZOOM_IN",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1,midPoint:.5},scale:{from:.3,to:1}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN_DOWN:{id:"ZOOM_IN_DOWN",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:-1e3,mid:60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_UP:{id:"ZOOM_IN_UP",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:1e3,mid:-60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_LEFT:{id:"ZOOM_IN_LEFT",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:-1e3,mid:10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_RIGHT:{id:"ZOOM_IN_RIGHT",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:1e3,mid:-10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_OUT:{id:"ZOOM_OUT",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0,midPoint:.5},scale:{from:1,to:.3}},gsapEasing:"power2.in",defaultDuration:.5},ZOOM_OUT_DOWN:{id:"ZOOM_OUT_DOWN",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:-60,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_UP:{id:"ZOOM_OUT_UP",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:60,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_LEFT:{id:"ZOOM_OUT_LEFT",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:42,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_RIGHT:{id:"ZOOM_OUT_RIGHT",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:-42,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},BACK_IN_DOWN:{id:"BACK_IN_DOWN",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_UP:{id:"BACK_IN_UP",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_LEFT:{id:"BACK_IN_LEFT",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_RIGHT:{id:"BACK_IN_RIGHT",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_OUT_DOWN:{id:"BACK_OUT_DOWN",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_UP:{id:"BACK_OUT_UP",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_LEFT:{id:"BACK_OUT_LEFT",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_RIGHT:{id:"BACK_OUT_RIGHT",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BOUNCE_IN:{id:"BOUNCE_IN",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.3,to:1}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_DOWN:{id:"BOUNCE_IN_DOWN",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_UP:{id:"BOUNCE_IN_UP",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_LEFT:{id:"BOUNCE_IN_LEFT",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_RIGHT:{id:"BOUNCE_IN_RIGHT",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_OUT:{id:"BOUNCE_OUT",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,to:.3}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_DOWN:{id:"BOUNCE_OUT_DOWN",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_UP:{id:"BOUNCE_OUT_UP",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_LEFT:{id:"BOUNCE_OUT_LEFT",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_RIGHT:{id:"BOUNCE_OUT_RIGHT",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},FLIP:{id:"FLIP",category:ee.FLIP,direction:re.ATTENTION,keyframes:{rotation:{from:-360,mid1:-190,mid2:-170,to:0},scale:{from:1,mid:.95,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_X:{id:"FLIP_IN_X",category:ee.FLIP,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleY:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_Y:{id:"FLIP_IN_Y",category:ee.FLIP,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleX:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_X:{id:"FLIP_OUT_X",category:ee.FLIP,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scaleY:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_Y:{id:"FLIP_OUT_Y",category:ee.FLIP,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scaleX:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_LEFT:{id:"LIGHT_SPEED_IN_LEFT",category:ee.LIGHT_SPEED,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"-100%",to:0,atPercent:60},skewX:{from:30,mid1:-20,mid2:5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_RIGHT:{id:"LIGHT_SPEED_IN_RIGHT",category:ee.LIGHT_SPEED,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"100%",to:0,atPercent:60},skewX:{from:-30,mid1:20,mid2:-5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_OUT_LEFT:{id:"LIGHT_SPEED_OUT_LEFT",category:ee.LIGHT_SPEED,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"-100%"},skewX:{from:0,to:-30}},gsapEasing:"power2.in",defaultDuration:.5},LIGHT_SPEED_OUT_RIGHT:{id:"LIGHT_SPEED_OUT_RIGHT",category:ee.LIGHT_SPEED,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},skewX:{from:0,to:30}},gsapEasing:"power2.in",defaultDuration:.5},ROTATE_IN:{id:"ROTATE_IN",category:ee.ROTATE,direction:re.IN,keyframes:{opacity:{from:0,to:1},rotation:{from:-200,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROTATE_OUT:{id:"ROTATE_OUT",category:ee.ROTATE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},rotation:{from:0,to:200}},gsapEasing:"power1.in",defaultDuration:.5},ROLL_IN:{id:"ROLL_IN",category:ee.ROLL,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:"-100%",to:0},rotation:{from:-120,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROLL_OUT:{id:"ROLL_OUT",category:ee.ROLL,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},rotation:{from:0,to:120}},gsapEasing:"power1.in",defaultDuration:.5},SHAKE:{id:"SHAKE",category:ee.SHAKE,direction:re.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_X:{id:"SHAKE_X",category:ee.SHAKE,direction:re.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_Y:{id:"SHAKE_Y",category:ee.SHAKE,direction:re.ATTENTION,keyframes:{shakeY:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},HEART_BEAT:{id:"HEART_BEAT",category:ee.SPECIAL,direction:re.ATTENTION,keyframes:{pulseScale:{min:1,max:1.3}},gsapEasing:"power1.inOut",defaultDuration:.5},PULSE:{id:"PULSE",category:ee.SPECIAL,direction:re.ATTENTION,keyframes:{pulseScale:{min:1,max:1.05}},gsapEasing:"power1.inOut",defaultDuration:.5},WIPE_LEFT:{id:"WIPE_LEFT",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_RIGHT:{id:"WIPE_RIGHT",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_UP:{id:"WIPE_UP",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_DOWN:{id:"WIPE_DOWN",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},RISE:{id:"RISE",category:ee.SPECIAL,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:30,to:0},scale:{from:.95,to:1}},gsapEasing:"power2.out",defaultDuration:.5},TYPEWRITER:{id:"TYPEWRITER",category:ee.SPECIAL,direction:re.IN,keyframes:{typewriter:{text:"",duration:2,charactersPerSecond:20}},gsapEasing:"none",defaultDuration:2}};E.registerEffect({name:"FADE_IN",effect(t,e){try{const n=Te.FADE_IN;if(!n)return console.error("[FADE_IN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_DOWN",effect(t,e){try{const n=Te.FADE_IN_DOWN;if(!n)return console.error("[FADE_IN_DOWN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return E.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_UP",effect(t,e){try{const n=Te.FADE_IN_UP;if(!n)return console.error("[FADE_IN_UP] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return E.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_LEFT",effect(t,e){try{const n=Te.FADE_IN_LEFT;if(!n)return console.error("[FADE_IN_LEFT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return E.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){try{const n=Te.FADE_IN_RIGHT;if(!n)return console.error("[FADE_IN_RIGHT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return E.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT",effect(t,e){try{const n=Te.FADE_OUT;if(!n)return console.error("[FADE_OUT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_DOWN",effect(t,e){try{const n=Te.FADE_OUT_DOWN;if(!n)return console.error("[FADE_OUT_DOWN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_UP",effect(t,e){try{const n=Te.FADE_OUT_UP;if(!n)return console.error("[FADE_OUT_UP] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_LEFT",effect(t,e){try{const n=Te.FADE_OUT_LEFT;if(!n)return console.error("[FADE_OUT_LEFT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_RIGHT",effect(t,e){try{const n=Te.FADE_OUT_RIGHT;if(!n)return console.error("[FADE_OUT_RIGHT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_RIGHT] Animation error:",n),E.timeline()}}});function Ma(t){const e=Array.isArray(t)?t[0]:t;return e&&typeof e.addChild=="function"?e:null}const om=200;function zS(t){try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return om}function qS(t){try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return om}function pn(t,e,n,r){E.registerEffect({name:t,effect(i,o){try{const s=Te[t];if(!s)return console.error(`[${t}] Animation config not found`),E.timeline();const{duration:a=s?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=o,u=o.x??0,f=o.y??0,d=o.scaleX??1,h=o.scaleY??1,p=o.alpha??1,m=o.rotation??0,g=Ma(i)??i,y=e==="x"?zS(g):qS(g),b=e==="x"?u+r*y:u,x=e==="y"?f+r*y:f,v=n==="in"?{x:b,y:x,alpha:0}:{x:u,y:f,alpha:p},T=n==="in"?{x:u,y:f,alpha:p}:{x:b,y:x,alpha:0};return E.fromTo(i,{pixi:{x:v.x,y:v.y,scaleX:d,scaleY:h,alpha:v.alpha,rotation:m}},{pixi:{x:T.x,y:T.y,scaleX:d,scaleY:h,alpha:T.alpha,rotation:m},duration:a,ease:o.ease||s?.gsapEasing||"power2.out",immediateRender:l,overwrite:c})}catch(s){return console.error(`[${t}] Animation error:`,s),E.timeline()}}})}pn("SLIDE_IN_DOWN","y","in",-1),pn("SLIDE_IN_UP","y","in",1),pn("SLIDE_IN_LEFT","x","in",-1),pn("SLIDE_IN_RIGHT","x","in",1),pn("SLIDE_OUT_DOWN","y","out",1),pn("SLIDE_OUT_UP","y","out",-1),pn("SLIDE_OUT_LEFT","x","out",-1),pn("SLIDE_OUT_RIGHT","x","out",1),E.registerEffect({name:"ZOOM_IN",effect(t,e){try{const n=Te.ZOOM_IN;if(!n)return console.error("[ZOOM_IN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return E.fromTo(t,{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l}},{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l},duration:i,ease:e.ease||"power2.out",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_DOWN",effect(t,e){try{const n=Te.ZOOM_IN_DOWN;if(!n)return console.error("[ZOOM_IN_DOWN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||-1e3,s=n?.keyframes?.translateY?.mid||60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:m}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_UP",effect(t,e){try{const n=Te.ZOOM_IN_UP;if(!n)return console.error("[ZOOM_IN_UP] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||1e3,s=n?.keyframes?.translateY?.mid||-60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:m}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_LEFT",effect(t,e){try{const n=Te.ZOOM_IN_LEFT;if(!n)return console.error("[ZOOM_IN_LEFT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||-1e3,s=n?.keyframes?.translateX?.mid||10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:m,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_RIGHT",effect(t,e){try{const n=Te.ZOOM_IN_RIGHT;if(!n)return console.error("[ZOOM_IN_RIGHT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||1e3,s=n?.keyframes?.translateX?.mid||-10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:m,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT",effect(t,e){try{const n=Te.ZOOM_OUT;if(!n)return console.error("[ZOOM_OUT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.to||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return E.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l}},{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l},duration:i,ease:e.ease||"power2.in",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_DOWN",effect(t,e){try{const n=Te.ZOOM_OUT_DOWN;if(!n)return console.error("[ZOOM_OUT_DOWN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||-60,s=n?.keyframes?.translateY?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:m},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_UP",effect(t,e){try{const n=Te.ZOOM_OUT_UP;if(!n)return console.error("[ZOOM_OUT_UP] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||60,s=n?.keyframes?.translateY?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:m},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_LEFT",effect(t,e){try{const n=Te.ZOOM_OUT_LEFT;if(!n)return console.error("[ZOOM_OUT_LEFT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||42,s=n?.keyframes?.translateX?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:m,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_RIGHT",effect(t,e){try{const n=Te.ZOOM_OUT_RIGHT;if(!n)return console.error("[ZOOM_OUT_RIGHT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||-42,s=n?.keyframes?.translateX?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:m,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_RIGHT] Animation error:",n),E.timeline()}}});const sr=.7,La=.7,sm={BACK_IN_DOWN:{axis:"y",delta:-1200},BACK_IN_UP:{axis:"y",delta:1200},BACK_IN_LEFT:{axis:"x",delta:-2e3},BACK_IN_RIGHT:{axis:"x",delta:2e3}},am={BACK_OUT_DOWN:{axis:"y",delta:700},BACK_OUT_UP:{axis:"y",delta:-700},BACK_OUT_LEFT:{axis:"x",delta:-2e3},BACK_OUT_RIGHT:{axis:"x",delta:2e3}};function VS(t){const{axis:e,delta:n}=sm[t];E.registerEffect({name:t,effect(r,i){try{const o=Te[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,p=i.rotation??0,m=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.8,b=s*.2,x=E.timeline();return x.fromTo(r,{pixi:{x:m,y:g,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p}},{pixi:{x:c,y:u,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),x.to(r,{pixi:{scaleX:f,scaleY:d,alpha:h},duration:b,ease:"power1.out",immediateRender:!1},y),x}catch(o){return console.error(`[${t}] Animation error:`,o),E.timeline()}}})}function KS(t){const{axis:e,delta:n}=am[t];E.registerEffect({name:t,effect(r,i){try{const o=Te[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,p=i.rotation??0,m=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.2,b=s*.8,x=E.timeline();return x.fromTo(r,{pixi:{x:c,y:u,scaleX:f,scaleY:d,alpha:h,rotation:p}},{pixi:{x:c,y:u,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),x.to(r,{pixi:{x:m,y:g},duration:b,ease:"power1.in",immediateRender:!1},y),x}catch(o){return console.error(`[${t}] Animation error:`,o),E.timeline()}}})}Object.keys(sm).forEach(VS),Object.keys(am).forEach(KS);function ZS(t){const e=Te[t];if(!e){console.error(`[effectGenerator] Animation config not found: ${t}`);return}const{keyframes:n,gsapEasing:r,defaultDuration:i}=e;E.registerEffect({name:t,effect(o,s){try{const a=s.x??0,l=s.y??0,c=s.scaleX??1,u=s.scaleY??1,f=s.alpha??1,d=s.rotation??0,h={pixi:{}},p={pixi:{}};return h.pixi.x=a,h.pixi.y=l,p.pixi.x=a,p.pixi.y=l,n.opacity!==void 0?(h.pixi.alpha=n.opacity.from!==void 0?n.opacity.from:f,p.pixi.alpha=n.opacity.to!==void 0?n.opacity.to:f):(h.pixi.alpha=f,p.pixi.alpha=f),n.scale!==void 0&&(h.pixi.scale=n.scale.from,p.pixi.scale=n.scale.to),n.scaleX!==void 0?(h.pixi.scaleX=(n.scaleX.from??1)*c,p.pixi.scaleX=(n.scaleX.to??1)*c):n.scale||(h.pixi.scaleX=c,p.pixi.scaleX=c),n.scaleY!==void 0?(h.pixi.scaleY=(n.scaleY.from??1)*u,p.pixi.scaleY=(n.scaleY.to??1)*u):n.scale||(h.pixi.scaleY=u,p.pixi.scaleY=u),n.rotation!==void 0?(h.pixi.rotation=n.rotation.from??d,p.pixi.rotation=n.rotation.to??d):(h.pixi.rotation=d,p.pixi.rotation=d),n.skewX!==void 0&&(h.pixi.skewX=n.skewX.from??0,p.pixi.skewX=n.skewX.to??0),n.skewY!==void 0&&(h.pixi.skewY=n.skewY.from??0,p.pixi.skewY=n.skewY.to??0),n.translateX!==void 0&&(h.pixi.x=a+(n.translateX.from??0),p.pixi.x=a+(n.translateX.to??0)),n.translateY!==void 0&&(h.pixi.y=l+(n.translateY.from??0),p.pixi.y=l+(n.translateY.to??0)),E.fromTo(o,h,{...p,duration:s.duration||i,ease:s.ease||r,immediateRender:s.immediateRender??!0,overwrite:s.overwrite??"auto"})}catch(a){return console.error(`[${t}] Animation error:`,a),E.timeline()}}})}function Pa(t){t.forEach(e=>{try{ZS(e)}catch(n){console.error(`[effectGenerator] Failed to register effect: ${e}`,n)}})}Pa(["BOUNCE_IN","BOUNCE_IN_DOWN","BOUNCE_IN_UP","BOUNCE_IN_LEFT","BOUNCE_IN_RIGHT","BOUNCE_OUT","BOUNCE_OUT_DOWN","BOUNCE_OUT_UP","BOUNCE_OUT_LEFT","BOUNCE_OUT_RIGHT"]),E.registerEffect({name:"FLIP",effect(t,e){const n=Te.FLIP,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-360}},{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-190},duration:r*.4,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-170},duration:r*.1,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s*.95,scaleY:a*.95},duration:r*.3,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s,scaleY:a},duration:r*.2,ease:"power1.in"}),u}}),E.registerEffect({name:"FLIP_IN_X",effect(t,e){const n=Te.FLIP_IN_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a},duration:r*.2,ease:"power1.out"}),u}}),E.registerEffect({name:"FLIP_IN_Y",effect(t,e){const n=Te.FLIP_IN_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s},duration:r*.2,ease:"power1.out"}),u}}),E.registerEffect({name:"FLIP_OUT_X",effect(t,e){const n=Te.FLIP_OUT_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0},duration:r*.7,ease:"power1.in"}),u}}),E.registerEffect({name:"FLIP_OUT_Y",effect(t,e){const n=Te.FLIP_OUT_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0},duration:r*.7,ease:"power1.in"}),u}}),E.registerEffect({name:"LIGHT_SPEED_IN_LEFT",effect(t,e){try{const n=Te.LIGHT_SPEED_IN_LEFT;if(!n)return console.error("[LIGHT_SPEED_IN_LEFT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_IN_RIGHT",effect(t,e){try{const n=Te.LIGHT_SPEED_IN_RIGHT;if(!n)return console.error("[LIGHT_SPEED_IN_RIGHT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_OUT_LEFT",effect(t,e){try{const n=Te.LIGHT_SPEED_OUT_LEFT;if(!n)return console.error("[LIGHT_SPEED_OUT_LEFT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_OUT_RIGHT",effect(t,e){try{const n=Te.LIGHT_SPEED_OUT_RIGHT;if(!n)return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation error:",n),E.timeline()}}});const cm=2e3;E.registerEffect({name:"ROLL_IN",effect(t,e){try{const n=Te.ROLL_IN;if(!n)return console.error("[ROLL_IN] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||cm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=E.timeline();return f.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u-120}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u},duration:r,ease:"power1.out"}),f}catch(n){return console.error("[ROLL_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROLL_OUT",effect(t,e){try{const n=Te.ROLL_OUT;if(!n)return console.error("[ROLL_OUT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||cm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=E.timeline();return f.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u+120},duration:r,ease:"power1.in"}),f}catch(n){return console.error("[ROLL_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN",effect(t,e){try{const n=Te.ROTATE_IN;if(!n)return console.error("[ROTATE_IN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u-200}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u},duration:r,ease:"power1.out",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT",effect(t,e){try{const n=Te.ROTATE_OUT;if(!n)return console.error("[ROTATE_OUT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u+200},duration:r,ease:"power1.in",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_IN_DOWN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+45}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_IN_DOWN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_IN_UP_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-90}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_IN_UP_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_OUT_DOWN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:d,pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_OUT_DOWN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_OUT_UP_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+90},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:d,pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_OUT_UP_RIGHT] Animation error:",n),E.timeline()}}});const ar=Te.PULSE,lm=ar?.keyframes?.pulseScale?.min||1,um=ar?.keyframes?.pulseScale?.max||1.05;E.registerEffect({name:"PULSE",effect(t,e){try{const n=e.scaleX??1,r=e.scaleY??1;return E.timeline().fromTo(t,{pixi:{scaleX:n*lm,scaleY:r*lm}},{pixi:{scaleX:n*um,scaleY:r*um},duration:e.duration||ar?.defaultDuration||.5,repeat:e.repeat||2,yoyo:!0,ease:e.ease||ar?.gsapEasing||"power1.inOut",yoyoEase:e.yoyoEase||"power3"}).to(t,{pixi:{scaleX:n,scaleY:r},duration:e.resetDuration||.3,ease:e.resetEase||"power1.out"})}catch(n){return console.error("[PULSE] Animation error:",n),E.timeline()}},defaults:{duration:ar?.defaultDuration||.5,repeat:2,resetDuration:.3,ease:ar?.gsapEasing||"power1.inOut",resetEase:"power1.out"},extendTimeline:!0}),E.registerEffect({name:"SHAKE_X",effect(t,e){try{const n=Te.SHAKE_X;if(!n)return console.error("[SHAKE_X] Animation config not found"),E.timeline();const r=n?.keyframes?.shakeX?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.x??0,a=i/10,l=E.timeline();return l.fromTo(t,{pixi:{x:s}},{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_X] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"SHAKE_Y",effect(t,e){try{const n=Te.SHAKE_Y;if(!n)return console.error("[SHAKE_Y] Animation config not found"),E.timeline();const r=n?.keyframes?.shakeY?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.y??0,a=i/10,l=E.timeline();return l.fromTo(t,{pixi:{y:s}},{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_Y] Animation error:",n),E.timeline()}}}),Pa(["WIPE_LEFT","WIPE_RIGHT","WIPE_UP","WIPE_DOWN"]),Pa(["RISE"]),E.registerEffect({name:"TYPEWRITER",effect(t,e){try{const{text:n="",onTextChange:r}=e;if(!n||!t)return E.timeline();const i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();u.set(t,{pixi:{x:i,y:o,scaleX:s,scaleY:a,alpha:l,rotation:c}},0);const f=n.length;return u.to(t,{duration:e.duration||2,ease:"none",onStart(){t&&(t.text="",t.updateText&&t.updateText()),r&&r("","START")},onUpdate(){const d=this.progress(),h=Math.min(Math.round(d*f),f),p=n.substring(0,h);r&&r(p,"UPDATE"),t&&(t.text=p,t.updateText&&t.updateText())},onComplete(){r&&r(n,"COMPLETE"),t&&(t.text=n,t.updateText&&t.updateText())},onInterrupt(){r&&r("","INTERRUPT")},onReverseComplete(){r&&r("","REVERSE_COMPLETE")}},0),u}catch(n){return console.error("[TYPEWRITER] Animation error:",n),E.timeline()}},defaults:{duration:2,text:""},extendTimeline:!0});const Ji="__logoRevealMask";function $S(t,e){const n=typeof e.width=="number"&&e.width>0?e.width:0,r=typeof e.height=="number"&&e.height>0?e.height:0;if(n&&r)return{w:n,h:r};try{const i=t.getLocalBounds();if(i.width>1&&i.height>1)return{w:i.width,h:i.height}}catch{}return{w:Math.max(1,t.width||240),h:Math.max(1,t.height||240)}}function JS(t){const e=t[Ji];if(e&&!e.destroyed)return t.mask=e,e;const n=new W.Graphics;return t[Ji]=n,t.addChild(n),t.mask=n,n}function QS(t){const e=t[Ji];t.mask=null,e&&!e.destroyed&&(e.parent&&e.parent.removeChild(e),e.destroy()),t[Ji]=void 0}const ew={draw:(t,e,n)=>{t.rect(0,-n/2,e,n).fill(16777215)},origin:(t,e,n)=>({x:t-n/2,y:e}),axes:"x"},tw={draw:(t,e,n)=>{t.circle(0,0,Math.hypot(e,n)*.55).fill(16777215)},origin:(t,e)=>({x:t,y:e}),axes:"both"},nw={draw:(t,e,n)=>{const r=Math.max(e,n)*.2,i=e+n+r*2,o=-n/2-r,s=n/2+r;t.moveTo(0,o).lineTo(i,o).lineTo(i-n,s).lineTo(-n,s).closePath().fill(16777215)},origin:(t,e,n,r)=>({x:t-n/2-Math.max(n,r)*.2,y:e}),axes:"x"};function Na(t,e,n,r){try{const i=Ma(t);if(!i)throw new Error("LOGO_REVEAL target is not a PIXI.Container");const o=e.duration??.9,s=e.ease||r,a=e.x??0,l=e.y??0,c=e.alpha??1,{w:u,h:f}=$S(i,e);E.set(i,{pixi:{alpha:c,x:a,y:l,scaleX:e.scaleX??1,scaleY:e.scaleY??1}});const d=JS(i),{x:h,y:p}=n.origin(a,l,u,f);d.clear(),n.draw(d,u,f),d.position.set(h,p),d.pivot.set(0,0);const m=n.axes==="both";return E.fromTo(d.scale,{x:0,y:m?0:1},{x:1,y:1,duration:o,ease:s,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto",onReverseComplete:()=>{QS(i)}})}catch(i){return console.error("[LOGO_REVEAL] mask effect error:",i),E.timeline()}}E.registerEffect({name:"SCALE_POP",effect(t,e){try{const n=e.duration??.65,r=e.x??0,i=e.y??0,o=e.scaleX??1,s=e.scaleY??1,a=e.alpha??1,l=e.ease||"back.out(1.7)";return E.fromTo(t,{pixi:{scaleX:.28*o,scaleY:.28*s,alpha:0,x:r,y:i}},{pixi:{scaleX:o,scaleY:s,alpha:a,x:r,y:i},duration:n,ease:l,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(n){return console.error("[SCALE_POP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"WIPE_LEFT_RIGHT",effect(t,e){return Na(t,e,ew,"power2.inOut")}}),E.registerEffect({name:"WIPE_RADIAL",effect(t,e){return Na(t,e,tw,"power2.out")}}),E.registerEffect({name:"MASK_PAINT_ON",effect(t,e){return Na(t,e,nw,"power3.out")}});const fm="__staggerSplitText",Qi="__staggerBaseX",eo="__staggerBaseY";function ka(t){const e=[t];for(;e.length;){const n=e.shift();for(const r of n.children??[]){if(r instanceof W.Text)return r;r instanceof W.Container&&e.push(r)}}return null}const Da=t=>t==null?"-":typeof t=="number"?String(t):`${t.x},${t.y}`;function rw(t,e,n){const r=t.style;return[e,t.text,r.fontFamily,r.fontSize,r.fontWeight,r.letterSpacing,r.wordWrap?r.wordWrapWidth:"nowrap",Da(n.charAnchor),Da(n.wordAnchor),Da(n.lineAnchor)].join("|")}function iw(t,e,n){const r=ka(t);if(!r)return null;const i=t,o=i[fm],s=rw(r,e,n);if(o&&!o.split.destroyed&&o.signature===s)return o.split;o&&!o.split.destroyed&&(o.split.parent?.removeChild(o.split),o.split.destroy({children:!0}));const a=W.SplitText.from(r,n);return a.position.copyFrom(r.position),a.rotation=r.rotation,a.scale.copyFrom(r.scale),(r.parent??t).addChild(a),r.alpha=0,i[fm]={signature:s,split:a},a}function Fa(t,e){const n=Ma(t);return n||(console.error(`[${e}] target is not a PIXI.Container`),null)}function dm(t,e){E.set(t,{pixi:{alpha:e.alpha??1,x:e.x??0,y:e.y??0,scaleX:e.scaleX??1,scaleY:e.scaleY??1}})}function hm(t,e,n={}){const r=iw(t,e,n),i=r?e==="letter"?r.chars:r.words:[];if(i.length===0)return null;for(const s of i){const a=s;typeof a[Qi]!="number"&&(a[Qi]=s.x),typeof a[eo]!="number"&&(a[eo]=s.y)}const o=s=>a=>a[s]??0;return{node:t,units:i,baseX:o(Qi),baseY:o(eo),fontSize:Number(ka(t)?.style?.fontSize)||48}}function pm(t,e,n){const i=(typeof t.stagger=="number"&&t.stagger>=0?t.stagger:Math.min(.12,n/Math.max(e,1)/2))*Math.max(e-1,0);return{amount:i,unitDuration:Math.max(.12,n-i)}}function mm(t,e,n="start"){return{amount:e,from:t.staggerFrom??n,...t.staggerEase?{ease:t.staggerEase}:{}}}const gm="__textUnitMask";function ow(t,e){const n=t.parent;if(!n)return null;const r=t,i=r[gm];if(i&&!i.mask.destroyed)if(i.signature!==e)i.mask.parent?.removeChild(i.mask),i.mask.destroy();else return i.mask.parent||n.addChild(i.mask),t.mask=i.mask,i.mask;let o=0,s=0,a=0,l=0;try{const h=t.getLocalBounds();h.width>0&&h.height>0&&(o=h.x,s=h.y,a=h.width,l=h.height)}catch{}if(!(a>0&&l>0))return null;const c=ym(r,Qi,t.x),u=ym(r,eo,t.y),f=Math.max(6,l*.12),d=new W.Graphics;return d.rect(c+o-f,u+s-f,a+f*2,l+f*2).fill(16777215),n.addChild(d),t.mask=d,r[gm]={signature:e,mask:d},d}function ym(t,e,n){const r=t[e];return typeof r=="number"?r:n}const sw={};function At(t){sw[t.name]={from:t.from??"start",unit:t.unit??"word"},E.registerEffect({name:t.name,effect(e,n){const r=Fa(e,t.name);if(!r)return E.timeline();try{const i=n.duration??.75,o=n.ease||t.ease,s=n.revealUnit==="letter"||n.revealUnit==="word"?n.revealUnit:t.unit??"word";dm(r,n);const a=hm(r,s,t.anchors);if(!a)return Ba(r,n,!1,o);const{units:l,baseX:c,baseY:u,fontSize:f}=a,d=new Map;if(t.masked){for(const g of l){let y=f;try{const b=g.getLocalBounds();b.height>0&&(y=b.height)}catch{}d.set(g,y)}for(const g of l)ow(g,t.name)}const h={baseX:c,baseY:u,unitH:g=>d.get(g)??f,fontSize:f},{amount:p,unitDuration:m}=pm(n,l.length,i);return E.fromTo(l,t.from_(h),{...t.to(h),duration:m,ease:o,stagger:mm(n,p,t.from??"start"),immediateRender:n.immediateRender??!0,overwrite:n.overwrite??"auto"})}catch(i){return console.error(`[${t.name}] Animation error:`,i),E.timeline()}}})}function Ba(t,e,n,r){const i=e.duration??.75,o=e.ease||r,s=e.alpha??1,a=e.y??0,l=n?e.yOffset??24:0;return E.fromTo(t,{pixi:{alpha:0,y:a+l}},{pixi:{alpha:s,y:a},duration:i,ease:o,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}function Ua(t,e,n,r){const i=Fa(t,"STAGGER_TEXT");if(!i)return E.timeline();try{const o=e.duration??.75,s=e.ease||r,a=e.revealUnit==="letter"?"letter":"word";dm(i,e);const l=hm(i,a);if(!l)return Ba(i,e,n,s);const{units:c,baseY:u,fontSize:f}=l,d=n?e.yOffset??Math.max(12,f*.35):0,{amount:h,unitDuration:p}=pm(e,c.length,o);return E.fromTo(c,{alpha:0,y:(m,g)=>u(g)+d},{alpha:1,y:(m,g)=>u(g),duration:p,ease:s,stagger:mm(e,h),immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(o){return console.error("[STAGGER_TEXT] Animation error:",o),E.timeline()}}E.registerEffect({name:"STAGGER_FADE_UP_TEXT",effect(t,e){return Ua(t,e,!0,"power2.out")}}),E.registerEffect({name:"STAGGER_FADE_TEXT",effect(t,e){return Ua(t,e,!1,"power1.out")}});function _m(t,e,n,r){const i=Fa(t,"STAGGER_FADE");return i?ka(i)?Ua(t,e,n,r):Ba(i,e,n,e.ease||r):E.timeline()}E.registerEffect({name:"STAGGER_FADE_UP",effect(t,e){return _m(t,e,!0,"power2.out")}}),E.registerEffect({name:"STAGGER_FADE",effect(t,e){return _m(t,e,!1,"power1.out")}});const Vr=Math.PI/180;function aw(t,e){let n=Math.imul(t+1,374761393)+Math.imul(e+1,668265263);return n=Math.imul(n^n>>>13,1274126177),((n^n>>>16)>>>0)/4294967296}const Kr=(t,e,n,r)=>n+aw(t,e)*(r-n);At({name:"TEXT_CASCADE",ease:"back.out(1.4)",from:"start",unit:"word",from_:({baseY:t,fontSize:e})=>({alpha:0,rotation:-15*Vr,y:(n,r)=>t(r)-e*1.2}),to:({baseY:t})=>({alpha:1,rotation:0,y:(e,n)=>t(n)})}),At({name:"TEXT_SPOTLIGHT",ease:"power2.out",from:"center",unit:"word",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:.1,pixi:{scaleX:.8,scaleY:.8}}),to:()=>({alpha:1,pixi:{scaleX:1,scaleY:1}})}),At({name:"TEXT_BLINDS",ease:"power2.out",from:"edges",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:0,pixi:{scaleX:0}}),to:()=>({alpha:1,pixi:{scaleX:1}})}),At({name:"TEXT_POPCORN",ease:"back.out(2)",from:"random",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:({baseY:t,fontSize:e})=>({alpha:0,pixi:{scaleX:0,scaleY:0},rotation:n=>Kr(n,1,-20,20)*Vr,y:(n,r)=>t(r)+Kr(n,2,.2,.8)*e}),to:({baseY:t})=>({alpha:1,pixi:{scaleX:1,scaleY:1},rotation:0,y:(e,n)=>t(n)})}),At({name:"TEXT_RIPPLE",ease:"elastic.out(1, 0.6)",from:"start",unit:"letter",from_:({baseY:t,fontSize:e})=>({alpha:0,y:(n,r)=>t(r)+Math.sin(n*.8)*e*.9}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_SHUFFLE",ease:"power3.out",from:"random",unit:"word",anchors:{wordAnchor:.5,charAnchor:.5},from_:({baseX:t,baseY:e,fontSize:n})=>({alpha:0,rotation:r=>Kr(r,3,-15,15)*Vr,x:(r,i)=>t(i)+Kr(r,4,-1.6,1.6)*n,y:(r,i)=>e(i)+Kr(r,5,-.9,.9)*n}),to:({baseX:t,baseY:e})=>({alpha:1,rotation:0,x:(n,r)=>t(r),y:(n,r)=>e(r)})}),At({name:"TEXT_DOMINO",ease:"power3.out",from:"start",unit:"letter",anchors:{charAnchor:{x:0,y:1},wordAnchor:{x:0,y:1}},from_:()=>({alpha:0,rotation:-90*Vr}),to:()=>({alpha:1,rotation:0})}),At({name:"TEXT_PENDULUM",ease:"elastic.out(1, 0.5)",from:"start",unit:"letter",anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,rotation:90*Vr}),to:()=>({alpha:1,rotation:0})}),At({name:"TEXT_SLIDE_REVEAL",ease:"power3.out",from:"start",unit:"word",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)+e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_SLOT",ease:"back.out(1.3)",from:"start",unit:"letter",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)-e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_CURTAIN",ease:"power2.inOut",from:"start",unit:"word",masked:!0,anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,pixi:{scaleY:0}}),to:()=>({alpha:1,pixi:{scaleY:1}})}),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerEffect({name:"SWING",effect(t,e){return E.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),E.registerEffect({name:"JELLO",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),E.registerEffect({name:"WOOBLE",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),E.registerEffect({name:"NONE",effect(t){return E.timeline().to(t,{duration:0})}}),E.registerEffect({name:"FLASH",effect(t,e){return E.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerPlugin(wn),E.registerPlugin(im);const Xe=t=>{E.effects[t.name]||E.registerEffect(t)};wn.create("springBounce","0.32, 1.06, 0.61, 0.93"),wn.create("springStiff","M0,0 C0.18,0 0.28,1.2 0.5,1 C0.66,0.88 0.78,1.05 1,1"),Xe({name:"PULSE",effect(t,e){return E.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),Xe({name:"SHAKE",effect(t,e){return E.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),Xe({name:"SWING",effect(t,e){return E.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Xe({name:"JELLO",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Xe({name:"WOOBLE",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),Xe({name:"NONE",effect(t,e){return E.timeline().to(t,{duration:0})}}),Xe({name:"FLASH",effect(t,e){return E.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),Xe({name:"BOUNCE_IN",effect(t,e){return E.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e?.x,y:e?.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),Xe({name:"BOUNCE_IN_DOWN",effect(t,e){return E.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e?.x,y:-2500,alpha:0}})}}),Xe({name:"BOUNCE_IN_LEFT",effect(t,e){return E.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),Xe({name:"BOUNCE_IN_RIGHT",effect(t,e){const n=Math.max(1e3,e?.maxX+500);return E.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:n}})}}),Xe({name:"BOUNCE_IN_UP",effect(t,e){return E.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),Xe({name:"BOUNCE_OUT",effect(t,e){return E.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),Xe({name:"FADE_IN",effect(t){return E.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),Xe({name:"FADE_IN_DOWN",effect(t,e){return E.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Xe({name:"FADE_IN_LEFT",effect(t,e){return E.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),Xe({name:"FADE_IN_RIGHT",effect(t,e){return E.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),Xe({name:"FADE_IN_UP",effect(t,e){return E.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Xe({name:"MOTION_PATH_SPRING",effect(t,e){const{path:n,duration:r=2,autoRotate:i=!1,alignOrigin:o=[.5,.5],ease:s="springStiff",repeat:a=0,yoyo:l=!1,start:c=0,end:u=1}=e||{};return E.to(t,{duration:r,ease:s,repeat:a,yoyo:l,motionPath:{path:n,autoRotate:i,alignOrigin:o,start:c,end:u}})}}),Xe({name:"SPIN",effect(t){return E.to(t,{rotation:(e,n)=>E.utils.snap(360,Number(E.getProperty(n,"rotation"))+360)})}});const bm=200,cw=t=>{try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return bm},lw=t=>{try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return bm},mn=(t,e,n,r)=>{Xe({name:t,effect(i,o){const s=o?.x??0,a=o?.y??0,l=o?.scaleX??1,c=o?.scaleY??1,u=o?.alpha??1,f=o?.rotation??0,d=o?.duration??.5,h=e==="x"?cw(i):lw(i),p=e==="x"?s+r*h:s,m=e==="y"?a+r*h:a,g=n==="in"?{x:p,y:m,alpha:0}:{x:s,y:a,alpha:u},y=n==="in"?{x:s,y:a,alpha:u}:{x:p,y:m,alpha:0};return E.fromTo(i,{pixi:{x:g.x,y:g.y,scaleX:l,scaleY:c,alpha:g.alpha,rotation:f}},{pixi:{x:y.x,y:y.y,scaleX:l,scaleY:c,alpha:y.alpha,rotation:f},duration:d,ease:o?.ease||"power2.out",immediateRender:o?.immediateRender??!0,overwrite:o?.overwrite})}})};mn("SLIDE_IN_LEFT","x","in",-1),mn("SLIDE_IN_RIGHT","x","in",1),mn("SLIDE_IN_TOP","y","in",-1),mn("SLIDE_IN_BOTTOM","y","in",1),mn("SLIDE_OUT_LEFT","x","out",-1),mn("SLIDE_OUT_RIGHT","x","out",1),mn("SLIDE_OUT_TOP","y","out",-1),mn("SLIDE_OUT_BOTTOM","y","out",1);const cr=.7,Ga=.7,uw=-1200,fw=700;Xe({name:"BACK_IN",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+uw,u=l*.8,f=l*.2,d=E.timeline();return d.fromTo(t,{pixi:{x:n,y:c,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a}},{pixi:{x:n,y:r,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{scaleX:i,scaleY:o,alpha:s},duration:f,ease:"power1.out",immediateRender:!1},u),d}}),Xe({name:"BACK_OUT",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+fw,u=l*.2,f=l*.8,d=E.timeline();return d.fromTo(t,{pixi:{x:n,y:r,scaleX:i,scaleY:o,alpha:s,rotation:a}},{pixi:{x:n,y:r,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{x:n,y:c},duration:f,ease:"power1.in",immediateRender:!1},u),d}});function xm(){return{updateEffect:S.useCallback((e,n,r)=>{if(!e)return console.warn("useGsapEffect: Target container is null or undefined"),E.to({},{duration:0});if(!n||typeof n!="string")return console.warn("useGsapEffect: Invalid effect name provided"),E.to(e,{duration:0});const i={immediateRender:!1,overwrite:!0,...r};try{return E.effects[n]?E.effects[n](e,i):E.effects.NONE?(console.warn(`useGsapEffect: Effect "${n}" not found, falling back to NONE`),E.effects.NONE(e,i)):(console.warn("useGsapEffect: NONE effect not found, returning empty tween"),E.to(e,{duration:0}))}catch(o){return console.error("useGsapEffect: Error applying effect:",o),E.to(e,{duration:0})}},[])}}const Dt={DEFAULT_DURATION_MS:1e3,DEFAULT_DURATION_SEC:1,MIN_DURATION_SEC:.1,MAX_DURATION_SEC:5,ENTRANCE_OVERLAP_SEC:.25,DEFAULT_LOOP_ROTATIONS_PER_SEC:.25,MIN_LOOP_ROTATIONS_PER_SEC:.05,MAX_LOOP_ROTATIONS_PER_SEC:1},Zr={WIDTH:1920,HEIGHT:1080},ja=new Set(["NONE","HEART_BEAT","PULSE","SHAKE","SHAKE_X","SHAKE_Y","HEAD_SHAKE","SWING","TADA","WOBBLE","JELLO","RUBBER_BAND","TYPEWRITER","RISE","TEXT_CASCADE","TEXT_SPOTLIGHT","TEXT_BLINDS","TEXT_POPCORN","TEXT_RIPPLE","TEXT_SHUFFLE","TEXT_DOMINO","TEXT_PENDULUM","TEXT_SLIDE_REVEAL","TEXT_SLOT","TEXT_CURTAIN"]),$r=new Set(["TYPEWRITER","RISE"]),vm=new Set(["SPIN_360"]);function Tm(t){return vm.has(t)}const Em={NONE:"NONE",BOUNCE:"BOUNCE",FLASH:"FLASH",PULSE:"PULSE",RUBBER_BAND:"RUBBER_BAND",SHAKE_X:"SHAKE_X",SHAKE_Y:"SHAKE_Y",HEAD_SHAKE:"HEAD_SHAKE",SWING:"SWING",TADA:"TADA",WOBBLE:"WOBBLE",JELLO:"JELLO",HEART_BEAT:"HEART_BEAT",BACK_IN_DOWN:"BACK_IN_DOWN",BACK_IN_LEFT:"BACK_IN_LEFT",BACK_IN_RIGHT:"BACK_IN_RIGHT",BACK_IN_UP:"BACK_IN_UP",BACK_OUT_DOWN:"BACK_OUT_DOWN",BACK_OUT_LEFT:"BACK_OUT_LEFT",BACK_OUT_RIGHT:"BACK_OUT_RIGHT",BACK_OUT_UP:"BACK_OUT_UP",BOUNCE_IN:"BOUNCE_IN",BOUNCE_IN_DOWN:"BOUNCE_IN_DOWN",BOUNCE_IN_LEFT:"BOUNCE_IN_LEFT",BOUNCE_IN_RIGHT:"BOUNCE_IN_RIGHT",BOUNCE_IN_UP:"BOUNCE_IN_UP",BOUNCE_OUT:"BOUNCE_OUT",BOUNCE_OUT_DOWN:"BOUNCE_OUT_DOWN",BOUNCE_OUT_LEFT:"BOUNCE_OUT_LEFT",BOUNCE_OUT_RIGHT:"BOUNCE_OUT_RIGHT",BOUNCE_OUT_UP:"BOUNCE_OUT_UP",FADE_IN:"FADE_IN",FADE_IN_DOWN:"FADE_IN_DOWN",FADE_IN_DOWN_BIG:"FADE_IN_DOWN_BIG",FADE_IN_LEFT:"FADE_IN_LEFT",FADE_IN_LEFT_BIG:"FADE_IN_LEFT_BIG",FADE_IN_RIGHT:"FADE_IN_RIGHT",FADE_IN_RIGHT_BIG:"FADE_IN_RIGHT_BIG",FADE_IN_UP:"FADE_IN_UP",FADE_IN_UP_BIG:"FADE_IN_UP_BIG",FADE_IN_TOP_LEFT:"FADE_IN_TOP_LEFT",FADE_IN_TOP_RIGHT:"FADE_IN_TOP_RIGHT",FADE_IN_BOTTOM_LEFT:"FADE_IN_BOTTOM_LEFT",FADE_IN_BOTTOM_RIGHT:"FADE_IN_BOTTOM_RIGHT",FADE_OUT:"FADE_OUT",FADE_OUT_DOWN:"FADE_OUT_DOWN",FADE_OUT_DOWN_BIG:"FADE_OUT_DOWN_BIG",FADE_OUT_LEFT:"FADE_OUT_LEFT",FADE_OUT_LEFT_BIG:"FADE_OUT_LEFT_BIG",FADE_OUT_RIGHT:"FADE_OUT_RIGHT",FADE_OUT_RIGHT_BIG:"FADE_OUT_RIGHT_BIG",FADE_OUT_UP:"FADE_OUT_UP",FADE_OUT_UP_BIG:"FADE_OUT_UP_BIG",FADE_OUT_TOP_LEFT:"FADE_OUT_TOP_LEFT",FADE_OUT_TOP_RIGHT:"FADE_OUT_TOP_RIGHT",FADE_OUT_BOTTOM_RIGHT:"FADE_OUT_BOTTOM_RIGHT",FADE_OUT_BOTTOM_LEFT:"FADE_OUT_BOTTOM_LEFT",FLIP:"FLIP",FLIP_IN_X:"FLIP_IN_X",FLIP_IN_Y:"FLIP_IN_Y",FLIP_OUT_X:"FLIP_OUT_X",FLIP_OUT_Y:"FLIP_OUT_Y",LIGHT_SPEED_IN_RIGHT:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_IN_LEFT:"LIGHT_SPEED_IN_LEFT",LIGHT_SPEED_OUT_RIGHT:"LIGHT_SPEED_OUT_RIGHT",LIGHT_SPEED_OUT_LEFT:"LIGHT_SPEED_OUT_LEFT",ROTATE_IN:"ROTATE_IN",ROTATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROTATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROTATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROTATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT",ROTATE_OUT:"ROTATE_OUT",ROTATE_OUT_DOWN_LEFT:"ROTATE_OUT_DOWN_LEFT",ROTATE_OUT_DOWN_RIGHT:"ROTATE_OUT_DOWN_RIGHT",ROTATE_OUT_UP_LEFT:"ROTATE_OUT_UP_LEFT",ROTATE_OUT_UP_RIGHT:"ROTATE_OUT_UP_RIGHT",HINGE:"HINGE",JACK_IN_THE_BOX:"JACK_IN_THE_BOX",ROLL_IN:"ROLL_IN",ROLL_OUT:"ROLL_OUT",ZOOM_IN:"ZOOM_IN",ZOOM_IN_DOWN:"ZOOM_IN_DOWN",ZOOM_IN_LEFT:"ZOOM_IN_LEFT",ZOOM_IN_RIGHT:"ZOOM_IN_RIGHT",ZOOM_IN_UP:"ZOOM_IN_UP",ZOOM_OUT:"ZOOM_OUT",ZOOM_OUT_DOWN:"ZOOM_OUT_DOWN",ZOOM_OUT_LEFT:"ZOOM_OUT_LEFT",ZOOM_OUT_RIGHT:"ZOOM_OUT_RIGHT",ZOOM_OUT_UP:"ZOOM_OUT_UP",SLIDE_IN_DOWN:"SLIDE_IN_DOWN",SLIDE_IN_LEFT:"SLIDE_IN_LEFT",SLIDE_IN_RIGHT:"SLIDE_IN_RIGHT",SLIDE_IN_UP:"SLIDE_IN_UP",SLIDE_OUT_DOWN:"SLIDE_OUT_DOWN",SLIDE_OUT_LEFT:"SLIDE_OUT_LEFT",SLIDE_OUT_RIGHT:"SLIDE_OUT_RIGHT",SLIDE_OUT_UP:"SLIDE_OUT_UP",SPIN_360:"SPIN_360",SCALE_POP:"SCALE_POP",WIPE_LEFT_RIGHT:"WIPE_LEFT_RIGHT",WIPE_RADIAL:"WIPE_RADIAL",MASK_PAINT_ON:"MASK_PAINT_ON",TYPEWRITER:"TYPEWRITER",RISE:"RISE",STAGGER_FADE_UP_TEXT:"STAGGER_FADE_UP_TEXT",STAGGER_FADE_TEXT:"STAGGER_FADE_TEXT",STAGGER_FADE_UP:"STAGGER_FADE_UP",STAGGER_FADE:"STAGGER_FADE",TEXT_CASCADE:"TEXT_CASCADE",TEXT_SPOTLIGHT:"TEXT_SPOTLIGHT",TEXT_BLINDS:"TEXT_BLINDS",TEXT_POPCORN:"TEXT_POPCORN",TEXT_RIPPLE:"TEXT_RIPPLE",TEXT_SHUFFLE:"TEXT_SHUFFLE",TEXT_DOMINO:"TEXT_DOMINO",TEXT_PENDULUM:"TEXT_PENDULUM",TEXT_SLIDE_REVEAL:"TEXT_SLIDE_REVEAL",TEXT_SLOT:"TEXT_SLOT",TEXT_CURTAIN:"TEXT_CURTAIN",LIGHT_SPEED_IN:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_OUT:"LIGHT_SPEED_OUT_RIGHT",ROATATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROATATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROATATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROATATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT"},Sm={bounce:"BOUNCE",flash:"FLASH",pulse:"PULSE",rubberBand:"RUBBER_BAND",shakeX:"SHAKE_X",shakeY:"SHAKE_Y",headShake:"HEAD_SHAKE",swing:"SWING",tada:"TADA",wobble:"WOBBLE",jello:"JELLO",heartBeat:"HEART_BEAT",backInDown:"BACK_IN_DOWN",backInLeft:"BACK_IN_LEFT",backInRight:"BACK_IN_RIGHT",backInUp:"BACK_IN_UP",backOutDown:"BACK_OUT_DOWN",backOutLeft:"BACK_OUT_LEFT",backOutRight:"BACK_OUT_RIGHT",backOutUp:"BACK_OUT_UP",bounceIn:"BOUNCE_IN",bounceInDown:"BOUNCE_IN_DOWN",bounceInLeft:"BOUNCE_IN_LEFT",bounceInRight:"BOUNCE_IN_RIGHT",bounceInUp:"BOUNCE_IN_UP",bounceOut:"BOUNCE_OUT",bounceOutDown:"BOUNCE_OUT_DOWN",bounceOutLeft:"BOUNCE_OUT_LEFT",bounceOutRight:"BOUNCE_OUT_RIGHT",bounceOutUp:"BOUNCE_OUT_UP",fadeIn:"FADE_IN",fadeInDown:"FADE_IN_DOWN",fadeInDownBig:"FADE_IN_DOWN_BIG",fadeInLeft:"FADE_IN_LEFT",fadeInLeftBig:"FADE_IN_LEFT_BIG",fadeInRight:"FADE_IN_RIGHT",fadeInRightBig:"FADE_IN_RIGHT_BIG",fadeInUp:"FADE_IN_UP",fadeInUpBig:"FADE_IN_UP_BIG",fadeInTopLeft:"FADE_IN_TOP_LEFT",fadeInTopRight:"FADE_IN_TOP_RIGHT",fadeInBottomLeft:"FADE_IN_BOTTOM_LEFT",fadeInBottomRight:"FADE_IN_BOTTOM_RIGHT",fadeOut:"FADE_OUT",fadeOutDown:"FADE_OUT_DOWN",fadeOutDownBig:"FADE_OUT_DOWN_BIG",fadeOutLeft:"FADE_OUT_LEFT",fadeOutLeftBig:"FADE_OUT_LEFT_BIG",fadeOutRight:"FADE_OUT_RIGHT",fadeOutRightBig:"FADE_OUT_RIGHT_BIG",fadeOutUp:"FADE_OUT_UP",fadeOutUpBig:"FADE_OUT_UP_BIG",fadeOutTopLeft:"FADE_OUT_TOP_LEFT",fadeOutTopRight:"FADE_OUT_TOP_RIGHT",fadeOutBottomRight:"FADE_OUT_BOTTOM_RIGHT",fadeOutBottomLeft:"FADE_OUT_BOTTOM_LEFT",flip:"FLIP",flipInX:"FLIP_IN_X",flipInY:"FLIP_IN_Y",flipOutX:"FLIP_OUT_X",flipOutY:"FLIP_OUT_Y",lightSpeedInRight:"LIGHT_SPEED_IN_RIGHT",lightSpeedInLeft:"LIGHT_SPEED_IN_LEFT",lightSpeedOutRight:"LIGHT_SPEED_OUT_RIGHT",lightSpeedOutLeft:"LIGHT_SPEED_OUT_LEFT",rotateIn:"ROTATE_IN",rotateInDownLeft:"ROTATE_IN_DOWN_LEFT",rotateInDownRight:"ROTATE_IN_DOWN_RIGHT",rotateInUpLeft:"ROTATE_IN_UP_LEFT",rotateInUpRight:"ROTATE_IN_UP_RIGHT",rotateOut:"ROTATE_OUT",rotateOutDownLeft:"ROTATE_OUT_DOWN_LEFT",rotateOutDownRight:"ROTATE_OUT_DOWN_RIGHT",rotateOutUpLeft:"ROTATE_OUT_UP_LEFT",rotateOutUpRight:"ROTATE_OUT_UP_RIGHT",hinge:"HINGE",jackInTheBox:"JACK_IN_THE_BOX",rollIn:"ROLL_IN",rollOut:"ROLL_OUT",zoomIn:"ZOOM_IN",zoomInDown:"ZOOM_IN_DOWN",zoomInLeft:"ZOOM_IN_LEFT",zoomInRight:"ZOOM_IN_RIGHT",zoomInUp:"ZOOM_IN_UP",scalePop:"SCALE_POP",wipeLeftRight:"WIPE_LEFT_RIGHT",wipeRadial:"WIPE_RADIAL",maskPaintOn:"MASK_PAINT_ON",typewriter:"TYPEWRITER",rise:"RISE",textCascade:"TEXT_CASCADE",textSpotlight:"TEXT_SPOTLIGHT",textBlinds:"TEXT_BLINDS",textPopcorn:"TEXT_POPCORN",textRipple:"TEXT_RIPPLE",textShuffle:"TEXT_SHUFFLE",textDomino:"TEXT_DOMINO",textPendulum:"TEXT_PENDULUM",textSlideReveal:"TEXT_SLIDE_REVEAL",textSlot:"TEXT_SLOT",textCurtain:"TEXT_CURTAIN",staggerFadeUpText:"STAGGER_FADE_UP_TEXT",staggerFadeText:"STAGGER_FADE_TEXT",staggerFadeUp:"STAGGER_FADE_UP",staggerFade:"STAGGER_FADE",zoomOut:"ZOOM_OUT",zoomOutDown:"ZOOM_OUT_DOWN",zoomOutLeft:"ZOOM_OUT_LEFT",zoomOutRight:"ZOOM_OUT_RIGHT",zoomOutUp:"ZOOM_OUT_UP",slideInDown:"SLIDE_IN_DOWN",slideInLeft:"SLIDE_IN_LEFT",slideInRight:"SLIDE_IN_RIGHT",slideInUp:"SLIDE_IN_UP",slideOutDown:"SLIDE_OUT_DOWN",slideOutLeft:"SLIDE_OUT_LEFT",slideOutRight:"SLIDE_OUT_RIGHT",slideOutUp:"SLIDE_OUT_UP"};function lr(t){return t?t===t.toUpperCase()?t:Sm[t]?Sm[t]:t.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,""):"NONE"}function Ha(t){const e={name:"NONE",durationSec:Dt.DEFAULT_DURATION_SEC};if(t==null)return e;if(typeof t=="string")return{name:lr(t)||"NONE",durationSec:Dt.DEFAULT_DURATION_SEC};if(typeof t=="object"){const n=lr(t.name??"NONE"),r=t.duration??Dt.DEFAULT_DURATION_MS;return{name:n,durationSec:r/1e3}}return e}function wm(t){const e={name:"NONE",rotationsPerSecond:Dt.DEFAULT_LOOP_ROTATIONS_PER_SEC,direction:1};if(t==null)return e;if(typeof t=="string")return{...e,name:lr(t)||"NONE"};if(typeof t=="object"){const n=lr(t.name??"NONE"),r=typeof t.rotationsPerSecond=="number"&&t.rotationsPerSecond>0?Math.min(Math.max(t.rotationsPerSecond,Dt.MIN_LOOP_ROTATIONS_PER_SEC),Dt.MAX_LOOP_ROTATIONS_PER_SEC):Dt.DEFAULT_LOOP_ROTATIONS_PER_SEC,i=t.direction===-1?-1:1;return{name:n,rotationsPerSecond:r,direction:i}}return e}function dw(t){return!ja.has(t)}function hw(t){return $r.has(t)}function pw(t){if(!t||t==="NONE")return!1;if(typeof window<"u"&&window.gsap){const e=window.gsap;if(e.effects)return typeof e.effects[t]=="function"}return Object.values(Em).includes(t)}const Am=({targetRef:t,transformation:e,start:n,end:r,effectOptions:i={}})=>{const{tl:o}=S.useContext(Ye),s=S.useRef(null),{x:a=0,y:l=0,maxX:c=Zr.WIDTH,maxY:u=Zr.HEIGHT,scale:f=1,rotation:d=0,opacity:h=1,animationIn:p,animationOut:m,animationLoop:g,keyframes:y}=e||{},b=d*(180/Math.PI),x=S.useMemo(()=>Ha(p),[p]),v=S.useMemo(()=>Ha(m),[m]),T=S.useMemo(()=>wm(g),[g]),w=T.name!=="NONE"&&Tm(T.name),O=S.useMemo(()=>!Array.isArray(y)||y.length===0?[]:[...y].sort((N,D)=>N.time-D.time),[y]),C=S.useMemo(()=>{if(Array.isArray(f))return f;const N=typeof f=="number"?f:1;return[N,N]},[f]),R=Number(n)||0,P=Number(r)||R,A=Math.max(P-R,0),L=Math.min(Math.max(Number(e?.entranceOverlapSec)||0,0),A);return S.useLayoutEffect(()=>{const N=t?.current,D=o?.current,F=D;if(!N||!D||A<=0)return;s.current&&(D.remove(s.current),s.current.kill(),s.current=null);const G=C[0]??1,z=C[1]??1,K={x:a,y:l,rotation:b,scaleX:G,scaleY:z,alpha:h},se=x.name&&x.name!=="NONE"&&!$r.has(x.name)&&E.effects[x.name],pe=v.name&&v.name!=="NONE"&&!$r.has(v.name)&&E.effects[v.name];se&&ja.has(x.name);const X=x.durationSec,he=v.durationSec,j=se?X:0,te=pe?Math.max(A-he,j):A,H=c||Zr.WIDTH,ae=u||Zr.HEIGHT,Z={x:K.x,y:K.y,rotation:K.rotation,scaleX:K.scaleX,scaleY:K.scaleY,alpha:K.alpha,maxX:c,maxY:u,canvasWidth:H,canvasHeight:ae,...i,immediateRender:!0,overwrite:!1},ce=p&&typeof p=="object"&&typeof p.ease=="string"?p.ease:void 0,J=m&&typeof m=="object"&&typeof m.ease=="string"?m.ease:void 0,ie=p&&typeof p=="object"?{revealUnit:p.revealUnit,stagger:p.stagger,staggerFrom:p.staggerFrom,staggerEase:p.staggerEase,text:typeof p.text=="string"?p.text:void 0,yOffset:p.yOffset}:{},xe=E.timeline();if(se){const ye=N.x,$=N.y,we=N.alpha,me=N.rotation,Ue=N.scale?.x??1,ze=N.scale?.y??1,ht=N.skew?.x??0,zt=N.skew?.y??0,ve=E.effects[x.name](N,{duration:X,...Z,...ie,...ce?{ease:ce}:{}});N.x=ye,N.y=$,N.alpha=we,N.rotation=me,N.scale&&N.scale.set(Ue,ze),N.skew&&N.skew.set(ht,zt),xe.add(ve,0)}else xe.set(N,{pixi:K},0);const Y=ye=>{const $={};return ye.x!==void 0&&($.x=ye.x),ye.y!==void 0&&($.y=ye.y),ye.scaleX!==void 0&&($.scaleX=ye.scaleX),ye.scaleY!==void 0&&($.scaleY=ye.scaleY),ye.rotation!==void 0&&($.rotation=ye.rotation),ye.alpha!==void 0&&($.alpha=ye.alpha),$};if(O.length>0){const ye=O[0],$=O[O.length-1],we=Math.max(ye.time,j);we>j&&xe.to(N,{pixi:K,duration:we-j,immediateRender:!1},j),xe.set(N,{pixi:Y(ye.properties)},we);for(let me=1;me<O.length;me++){const Ue=O[me-1],ze=O[me],ht=ze.time-Ue.time;ht<=0?xe.set(N,{pixi:Y(ze.properties)},ze.time):xe.to(N,{pixi:Y(ze.properties),duration:ht,ease:ze.easing||"none",immediateRender:!1},Ue.time)}te>$.time&&xe.to(N,{pixi:Y($.properties),duration:te-$.time,immediateRender:!1},$.time)}else if(w&&te>j){const ye=te-j,$=360*T.rotationsPerSecond*T.direction*ye;xe.set(N,{pixi:{rotation:K.rotation}},j),xe.to(N,{pixi:{rotation:K.rotation+$},duration:ye,ease:"none",immediateRender:!1},j)}else te>j&&xe.to(N,{duration:te-j,pixi:K,immediateRender:!1},j);if(pe){const ye=E.effects[v.name](N,{duration:he,...Z,immediateRender:!1,...J?{ease:J}:{}});xe.add(ye,te)}s.current=xe,D.add(xe,R-L);const De=D.time();return D.time(De,!1),()=>{s.current&&(F&&F.remove(s.current),s.current.kill(),s.current=null)}},[t,o,a,l,d,b,C,h,c,u,x,v,T,w,O,R,P,A,L,i,p,m]),{childTimelineRef:s}};var to=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t.SPIN="SPIN",t))(to||{});const Ya=0,Om=1,mw=2,Cm=3,gw=new Set([2,4,5,6,7,8,9,10]),yw=t=>t==null||t===Ya?"none":t===Om||t===Cm||gw.has(t)?"native":"none",_w={[Ya]:"normal",[Om]:"add",[mw]:"multiply",[Cm]:"screen",4:"overlay",5:"darken",6:"lighten",7:"color-dodge",8:"color-burn",9:"hard-light",10:"soft-light"},Xa=t=>t==null?"normal":_w[t]??"normal",Rm=(t=Ya)=>S.useMemo(()=>Xa(t),[t]),no=`in vec2 aPosition;
|
|
968
968
|
out vec2 vTextureCoord;
|
|
969
969
|
|
|
970
970
|
uniform vec4 uInputSize;
|
|
@@ -1023,7 +1023,7 @@ void main(void) {
|
|
|
1023
1023
|
|
|
1024
1024
|
finalColor = color;
|
|
1025
1025
|
}
|
|
1026
|
-
`;class xw extends B.Filter{edge;constructor(e){const n=B.GlProgram.from({vertex:no,fragment:bw,name:"edge-feather-filter"});super({glProgram:n,resources:{edgeUniforms:{uDimensions:{value:new Float32Array(2),type:"vec2<f32>"},uFeatherAmount:{value:e,type:"f32"}}}}),this.edge=this.resources.edgeUniforms.uniforms}apply(e,n,r,i){this.edge.uDimensions[0]=n.frame.width,this.edge.uDimensions[1]=n.frame.height,e.applyFilter(this,n,r,i)}get featherAmount(){return this.edge.uFeatherAmount}set featherAmount(e){this.edge.uFeatherAmount=e}}const gn=t=>1+t/100,Dn=t=>t/100,Im=(t,e,n)=>Math.max(e,Math.min(n,t)),vw=(t,e)=>{const n=new Array(20).fill(0);n[0]=n[6]=n[12]=n[18]=1;const r=Dn(t),i=Dn(e);return n[4]=i*.3,n[9]=i*.3,n[14]=i*.3,n[0]+=r*.2,n[6]+=r*.2,n[12]+=r*.2,n},Tw=({brightness:t,contrast:e,saturation:n,red:r,green:i,blue:o,gamma:s,alpha:a})=>t!==0||e!==0||n!==0||r!==0||i!==0||o!==0||s!==1||a!==1?new
|
|
1026
|
+
`;class xw extends B.Filter{edge;constructor(e){const n=B.GlProgram.from({vertex:no,fragment:bw,name:"edge-feather-filter"});super({glProgram:n,resources:{edgeUniforms:{uDimensions:{value:new Float32Array(2),type:"vec2<f32>"},uFeatherAmount:{value:e,type:"f32"}}}}),this.edge=this.resources.edgeUniforms.uniforms}apply(e,n,r,i){this.edge.uDimensions[0]=n.frame.width,this.edge.uDimensions[1]=n.frame.height,e.applyFilter(this,n,r,i)}get featherAmount(){return this.edge.uFeatherAmount}set featherAmount(e){this.edge.uFeatherAmount=e}}const gn=t=>1+t/100,Dn=t=>t/100,Im=(t,e,n)=>Math.max(e,Math.min(n,t)),vw=(t,e)=>{const n=new Array(20).fill(0);n[0]=n[6]=n[12]=n[18]=1;const r=Dn(t),i=Dn(e);return n[4]=i*.3,n[9]=i*.3,n[14]=i*.3,n[0]+=r*.2,n[6]+=r*.2,n[12]+=r*.2,n},Tw=({brightness:t,contrast:e,saturation:n,red:r,green:i,blue:o,gamma:s,alpha:a})=>t!==0||e!==0||n!==0||r!==0||i!==0||o!==0||s!==1||a!==1?new ne.AdjustmentFilter({gamma:s,brightness:gn(t),contrast:gn(e),saturation:gn(n),red:gn(r),green:gn(i),blue:gn(o),alpha:a}):null,Ew=t=>{if(t===0)return null;const e=gn(t);return new ne.AdjustmentFilter({brightness:e,gamma:1/e})},Sw=(t,e)=>{if(t===0&&e===0)return null;const n=new W.ColorMatrixFilter,r=new Array(20).fill(0);if(r[0]=r[6]=r[12]=r[18]=1,t!==0){const i=Dn(t);r[0]+=i*.8,r[4]+=i*.15,r[6]+=i*.15,r[12]-=i*.8,r[14]+=-i*.1}if(e!==0){const i=Dn(e);r[0]-=i*.4,r[4]+=-i*.08,r[6]+=i*.6,r[9]+=i*.12,r[12]-=i*.4,r[14]+=-i*.08}return n.matrix=r,n},ww=(t,e)=>{if(t===0&&e===0)return null;const n=new W.ColorMatrixFilter;return n.matrix=vw(t,e),n},Aw=t=>{if(t===0)return null;const e=gn(t*.7);return new ne.AdjustmentFilter({saturation:e})},Ow=t=>{if(t===0)return null;const e=Im(t,-180,180);return new ne.HslAdjustmentFilter({hue:e,saturation:0,lightness:0,colorize:!1})},Cw=t=>{if(t===0)return null;const e=Dn(t)*.5;return new ne.ConvolutionFilter({matrix:[0,-e,0,-e,1+4*e,-e,0,-e,0],width:200,height:200})},Rw=t=>t===0?null:new ne.KawaseBlurFilter({strength:t,quality:1,clamp:!0}),Iw=t=>{if(t===0)return null;const e=Dn(t);return new ne.OldFilmFilter({vignetting:Math.abs(e),sepia:0,noise:0,scratch:0})},Mw=t=>{if(t===0)return null;const e=Dn(t);return new W.NoiseFilter({noise:Math.abs(e)*.5})},Lw=t=>t?new xw(Im(t/100,0,1)):null,Mm=(t={})=>{const{contrast:e=0,saturation:n=0,brightness:r=0,alpha:i=1,gamma:o=1,red:s=0,green:a=0,blue:l=0,temperature:c=0,tint:u=0,hue:f=0,highlights:d=0,shadows:h=0,exposure:p=0,vibrance:m=0,sharpness:g=0,blurRadius:y=0,vignette:b=0,noise:x=0,edgeFeather:v=0}=t,T=Tw({brightness:r,contrast:e,saturation:n,red:s,green:a,blue:l,gamma:o,alpha:i}),w=Ew(p),O=Sw(c,u),C=ww(d,h),R=Aw(m),P=Ow(f),A=Cw(g),L=Rw(y),N=Iw(b),D=Mw(x),F=Lw(v);return{adjustmentFilter:T,exposureFilter:w,temperatureTintFilter:O,tonalFilter:C,vibranceFilter:R,hslFilter:P,sharpnessFilter:A,blurFilter:L,vignetteFilter:N,noiseFilter:D,edgeFeatherFilter:F}},Pw=`precision highp float;
|
|
1027
1027
|
in vec2 vTextureCoord;
|
|
1028
1028
|
out vec4 finalColor;
|
|
1029
1029
|
|
|
@@ -1367,7 +1367,7 @@ void main(void) {
|
|
|
1367
1367
|
vec3 col = mix(base, fx, clamp(uIntensity, 0.0, 1.0));
|
|
1368
1368
|
finalColor = vec4(col, texture(uTexture, uv).a);
|
|
1369
1369
|
}
|
|
1370
|
-
`,qw=(t,e=1)=>Math.max(0,Math.min(100,t))/100*e,ur={WaveTearDown:{shaderName:"vfx-wave-tear-down",direction:new Float32Array([0,1])},WaveTearUp:{shaderName:"vfx-wave-tear-up",direction:new Float32Array([0,-1])},WaveTearAcross:{shaderName:"vfx-wave-tear-across",direction:new Float32Array([1,.4])}},Bt=(t,e,n,r,i)=>new Dw({fragment:kw(t),name:e,intensity:qw(n,r),uniforms:i}),Wa=(t,e=50)=>Bt(Ww,t.shaderName,e,1,{uDirection:{value:t.direction,type:"vec2<f32>"}}),Lm={VHS:{shaderName:"vfx-vhs",defaultIntensity:50,create:(t=50)=>Bt(Fw,"vfx-vhs",t,1.2)},GlitchWave:{shaderName:"vfx-glitch-wave",defaultIntensity:50,create:(t=50)=>Bt(Bw,"vfx-glitch-wave",t,1.4)},LightLeak:{shaderName:"vfx-light-leak",defaultIntensity:50,create:(t=50)=>Bt(Uw,"vfx-light-leak",t,1.3)},FilmGrain:{shaderName:"vfx-film-grain",defaultIntensity:55,create:(t=50)=>Bt(Gw,"vfx-film-grain",t,1.2)},ChromaticWave:{shaderName:"vfx-chromatic-wave",defaultIntensity:50,create:(t=50)=>Bt(jw,"vfx-chromatic-wave",t,1.5)},LiquidGlass:{shaderName:"vfx-liquid-glass",defaultIntensity:65,create:(t=50)=>Bt(Hw,"vfx-liquid-glass",t,1.25)},BrokenGlass:{shaderName:"vfx-broken-glass",defaultIntensity:55,create:(t=50)=>Bt(Yw,"vfx-broken-glass",t,1)},Comic:{shaderName:"vfx-comic",defaultIntensity:60,create:(t=50)=>Bt(Xw,"vfx-comic",t,1)},WaveTearDown:{shaderName:ur.WaveTearDown.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearDown,t)},WaveTearUp:{shaderName:ur.WaveTearUp.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearUp,t)},WaveTearAcross:{shaderName:ur.WaveTearAcross.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearAcross,t)},WaveBrush:{shaderName:"vfx-wave-brush",defaultIntensity:100,create:(t=50)=>Bt(zw,"vfx-wave-brush",t,1)}},Vw=t=>t in Lm,Kw=(t=100)=>{const e=t/100;return new te.HslAdjustmentFilter({hue:0,saturation:-1*e,lightness:0})},Zw=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.393*n+(1-n),.769*n,.189*n,0,0,.349*n,.686*n+(1-n),.168*n,0,0,.272*n,.534*n,.131*n+(1-n),0,0,0,0,0,1,0],e},$w=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100,r=[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0];for(let i=0;i<20;i++)e.matrix[i]=i===0?r[i]*1.1*n+(1-n):r[i]*n+(i<15?1-n:0);return e},Jw=()=>{const t=new te.GlowFilter({distance:10,outerStrength:1,innerStrength:1,color:65280,quality:.5}),e=new W.ColorMatrixFilter;return e.matrix=[.1,.5,.1,0,0,.1,.8,.1,0,0,.1,.5,.1,0,0,0,0,0,1,0],[t,e]},Qw=(t=65535,e=50)=>{const n=e/50,r=new te.GlowFilter({distance:8*n,outerStrength:1.5*n,innerStrength:.8*n,color:t,quality:.6}),i=new te.GlowFilter({distance:16*n,outerStrength:.8*n,innerStrength:0,color:t,quality:.4});return[r,i]},eA=()=>{const t=new W.ColorMatrixFilter;return t.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],t},tA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,.05*n,0,0,.05*n,.05*n,1+.05*n,0,0,.02*n,0,0,1-.15*n,0,0,0,0,0,1,0],e},nA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1-.1*n,0,.05*n,0,0,0,1,.05*n,0,0,.05*n,.05*n,1+.15*n,0,.05*n,0,0,0,1,0],e},rA=(t=100)=>{const e=t/100;return new te.AdjustmentFilter({saturation:1+.5*e,contrast:1+.2*e,brightness:1+.05*e})},iA=(t=100)=>{const e=t/100,n=new W.ColorMatrixFilter,r=1-.3*e,i=.15*e;return n.matrix=[r*.9,.1*e,0,0,i,.1*e,r*.9,.1*e,0,i,0,.1*e,r*.9,0,i,0,0,0,1,0],n},oA=(t=100)=>{const e=t/100;return new te.OldFilmFilter({sepia:.4*e,noise:.2*e,scratch:.3*e,scratchDensity:.2*e,vignetting:.3*e})},sA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1.1-.1*(1-n),.1*n,0,0,.05*n,.05*n,1.05-.05*(1-n),.05*n,0,.03*n,0,.1*n,.9+.1*(1-n),0,.02*n,0,0,0,1,0],e},aA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1.2*n+(1-n),.2*n,0,0,.1*n,.1*n,1*n+(1-n),.1*n,0,.05*n,0,.1*n,.7*n+(1-n),0,0,0,0,0,1,0],e},cA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,0,-.1*n,0,0,-.05*n,1+.05*n,.1*n,0,0,-.1*n,.1*n,1+.15*n,0,0,0,0,0,1,0],e},lA=(t=100)=>{const e=t/100;return new te.AdjustmentFilter({contrast:1+.5*e,brightness:1-.1*e,saturation:1+.2*e,gamma:1-.2*e})},uA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),0,.1*n,0,-.05*n,0,.9+.1*(1-n),.15*n,0,-.05*n,.1*n,.1*n,1+.1*n,0,0,0,0,0,1,0],e},fA=(t=100)=>{const e=t/100,n=new te.HslAdjustmentFilter({saturation:-1*e,lightness:-.1*e}),r=new te.AdjustmentFilter({contrast:1+.4*e,gamma:.9});return[n,r]},dA=(t=100)=>{const e=t/100,n=new te.KawaseBlurFilter(2*e,1,!0),r=new te.AdjustmentFilter({brightness:1+.05*e,contrast:1-.1*e});return[n,r]},hA=(t=100,e={})=>{const n=(e.intensity??t)/100,r=(e.spin??10)/100,i=(e.grain??30)/100*n,o=(e.glow??40)/100*n,s=(e.gloom??35)/100*n;e.centerX,e.centerY;const a=new te.HslAdjustmentFilter({saturation:-.05-.14*s,lightness:-.03-.11*s}),l=new te.AdjustmentFilter({contrast:1-.05-.1*s,gamma:.97-.05*s,brightness:1-.025*s}),c=new te.AdvancedBloomFilter({bloomScale:.22+.8*o,threshold:.54-.16*o,blur:1.5+2.5*o,brightness:1+.04*o,quality:3});c.__vfxDreamy="bloom",c.__baseBloomScale=c.bloomScale,c.__baseBrightness=c.brightness,c.__spinSpeed=r;const u=new te.KawaseBlurFilter(.35+1*o,1,!0);u.__vfxDreamy="blur",u.__baseBlur=.35+1*o,u.__spinSpeed=r;const f=new te.OldFilmFilter({noise:.05+.4*i,vignetting:.18+.55*s,vignettingAlpha:.32+.4*s,vignettingBlur:.4,sepia:0,scratch:0,scratchDensity:0});return f.__vfxDreamy="grain",f.__baseVignetting=f.vignetting,f.__spinSpeed=r,[a,l,c,u,f]},pA=(t=100)=>{const e=t/100;return new te.AdjustmentFilter({brightness:1-.3*e,contrast:1+.2*e,saturation:1-.3*e,gamma:.8+.2*(1-e)})},mA=(t=100)=>{const e=t/100;return new te.AdjustmentFilter({contrast:1+.3*e,saturation:1+.4*e,brightness:1+.1*e})},gA=(t=100)=>{const e=t/100;return new te.AdjustmentFilter({saturation:1+.6*e,contrast:1+.3*e,brightness:1+.1*e})},yA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),.1*n,.1*n,0,.1*n,.1*n,.9+.1*(1-n),.1*n,0,.1*n,.1*n,.1*n,.9+.1*(1-n),0,.1*n,0,0,0,1,0],e},_A=(t=50,e={})=>{if(e.horizontalCount!=null||e.verticalCount!=null){const i=Math.max(1,e.horizontalCount??20),o=Math.max(1,e.verticalCount??20);return new te.PixelateFilter([i,o])}const n=t/100,r=Math.max(1,Math.floor(1+31*n));return new te.PixelateFilter(r)},bA=(t=50,e={})=>{if(e.radiusPerRow!=null||e.sizePerRow!=null){const s=e.radiusPerRow??5,a=e.sizePerRow??0,l=Math.max(1,s+a),c=new te.PixelateFilter(l),u=new te.ZoomBlurFilter({strength:.01*s,innerRadius:40+(20-s)*5,radius:-1});return[c,u]}const n=t/100,r=Math.max(1,Math.floor(1+20*n)),i=new te.PixelateFilter(r),o=new te.ZoomBlurFilter({strength:.05*n,innerRadius:100,radius:-1});return[i,o]},xA=(t=50,e={})=>{const n=new te.CrossHatchFilter;if(e.horizontalOffset!=null||e.horizontalCuts!=null){const o=e.horizontalOffset??7,s=e.horizontalCuts??5,a=e.verticalOffset??50,l=e.variation??100;return[new te.AdjustmentFilter({contrast:1+s/20*.6,brightness:1+o/100*.15,saturation:1-a/100*.7,gamma:1-l/100*.3+.15}),n]}const r=t/100;return[new te.AdjustmentFilter({contrast:1+.3*r,saturation:1-.5*r}),n]},vA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.scale??62)/100,i=(e.variation??50)/100,o=new te.BulgePinchFilter({radius:100+400*r,strength:.5*n,center:[.5,.5]}),s=new te.TwistFilter({angle:3*n*i,radius:200+400*r,padding:20});return[o,s]},TA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.blending??50)/100,i=Math.max(1,Math.floor(1+4*n)),o=new te.OutlineFilter(i,0,1);return[new te.AdjustmentFilter({contrast:1+.4*r,saturation:1-.3*r}),o]},EA=(t=50,e={})=>{if(e.globalBlur!=null||e.numberOfDots!=null){const i=(e.globalBlur??30)/100,o=e.numberOfDots??30,s=Math.max(1,Math.floor(1+o/100*9)),a=new te.DotFilter(s,45);return i>.01?[new te.KawaseBlurFilter(1+4*i,1,!0),a]:a}const n=t/100,r=Math.max(1,Math.floor(2+6*n));return new te.DotFilter(r,45)},SA=(t=50,e={})=>{const n=e.lineWidth??5,r=(e.curvature??50)/100,i=(e.lineContrast??30)/100;return new te.CRTFilter({lineWidth:n,lineContrast:i*.5,curvature:r*10,noise:.1,noiseSize:1,vignetting:.2,vignettingAlpha:.5,vignettingBlur:.3,seed:Math.random()})},wA=(t=50,e={})=>{const r=(10-(e.numberOfLevels??Math.max(2,Math.floor(10-8*(t/100)))))/8,i=1+1.5*r,o=(1-i)/2,s=new W.ColorMatrixFilter;s.matrix=[i,0,0,0,o,0,i,0,0,o,0,0,i,0,o,0,0,0,1,0];const a=new te.AdjustmentFilter({saturation:1+.5*r});return[s,a]},AA=(t=50,e={})=>{const n=e.roughDistortion??t/100*10,r=e.fineDistortion??t/100*5,i=e.verticalOffset??t/100*5,o=e.variance??t/100*5,s=new te.GlitchFilter({slices:Math.max(3,Math.floor(3+n*1.5)),offset:5+n*4,direction:0,fillMode:2,average:!1,seed:Math.random()}),a=new te.RGBSplitFilter({red:{x:-(1+r*.8),y:i*.5},green:{x:0,y:0},blue:{x:1+r*.8,y:-(i*.5)}}),l=new te.AdjustmentFilter({contrast:1+o*.05,brightness:1-o*.02});return[s,a,l]},OA=(t=50,e={})=>{const n=e.angleOfPattern??5,r=e.scaleOfPattern??Math.max(1,Math.floor(2+8*(t/100))),i=Math.max(1,Math.floor(1+r/100*9)),o=new te.DotFilter(i,n);return[new te.AdjustmentFilter({contrast:1+.15}),o]},CA=(t=50,e={})=>{const n=e.charSize??Math.max(2,Math.floor(2+18*(t/100)));return new te.AsciiFilter(n)},RA=(t=50,e={})=>{const n=(e.strength??t)/100;return new te.EmbossFilter(2+8*n)},IA=(t=50,e={})=>{const n=(e.scaleOfPattern??50)/100,r=new te.HslAdjustmentFilter({saturation:-1,lightness:0}),i=new te.AdjustmentFilter({contrast:1+.5+1.5*n,brightness:1+.15*n,gamma:.6+.4*(1-n)}),o=new te.CrossHatchFilter;return[r,i,o]},MA=(t=50,e={})=>{const n=e.distance??t/100*10,i=(e.shiftDirection??3)/10*Math.PI,o=n*Math.cos(i),s=n*Math.sin(i);return new te.RGBSplitFilter({red:{x:-o,y:-s},green:{x:0,y:0},blue:{x:o,y:s}})},LA=(t=50,e={})=>{const n=e.mirroredSide??1,r=.5,i=new te.ReflectionFilter({mirror:!0,boundary:r,amplitude:[0,0],waveLength:[0,0]});return n===0||n===1?i.boundary=.5:n===2?i.boundary=.3:i.boundary=.7,i},PA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.darkening??30)/100,i=e.bloom??4,o=new te.GlowFilter({distance:i*3+10*n,outerStrength:1+3*n,innerStrength:.5+1.5*n,color:16777215,quality:.3});return r>.01?[new te.AdjustmentFilter({brightness:1-.4*r,gamma:1-.3*r}),o]:o},NA=(t=50)=>{const e=t/100;return new te.OldFilmFilter({vignetting:.3+.7*e,vignettingAlpha:.5+.5*e,vignettingBlur:.3,sepia:0,noise:0,scratch:0,scratchDensity:0})},kA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.position??40)/100,i=Math.floor(400*r);return new te.TiltShiftFilter({blur:15+45*n,gradientBlur:400+800*n,start:{x:0,y:i},end:{x:600,y:i}})},DA=(t=50,e={})=>{const n=(e.intensity??t)/100;return new te.ZoomBlurFilter({strength:.05+.15*n,center:[.5,.5],innerRadius:50+100*(1-n),radius:-1})},FA=(t=50)=>{const n=.3+.7*(t/100);return new te.ConvolutionFilter([0,-n,0,-n,1+4*n,-n,0,-n,0])},BA=(t=50)=>{const e=t/100;return new te.HslAdjustmentFilter({hue:180*e,saturation:0,lightness:0,colorize:!1})},UA=(t=50)=>{const e=t/100,n=new W.ColorMatrixFilter,r=1-.8*e;return n.matrix=[1,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,-.5*e,0,1,0],n},GA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=e.angle??30,i=(e.lacunarity??25)/10;return new te.GodrayFilter({gain:.3+.7*n,lacunarity:i,angle:r,parallel:!0,time:0})},jA=(t=50,e={})=>{const n=e.velocityX??t/100*20,r=e.velocityY??0;return new te.MotionBlurFilter([n,r],5)},HA=(t=50,e={})=>{const n=(e.bloomStrength??t)/100,r=(e.threshold??50)/100,i=(e.bloomBlur??50)/100;return new te.AdvancedBloomFilter({bloomScale:.5+2.5*n,threshold:r,blur:2+12*i,brightness:1+.5*n,quality:4})},YA=(t=50,e={})=>{const n=t/100,r=(e.dots??50)/100,i=(e.contrast??70)/100,o=(e.offset??20)/100,s=(e.texture??30)/100,a=(e.rasterize??0)/100,l=e.primaryColor??"#00BFFF",c=e.accentColor??"#FF44AA",u=[],f=new W.Color(l),d=new W.Color(c),h=f.toRgb(),p=d.toRgb(),m=[h.r,h.g,h.b],g=[p.r,p.g,p.b],y=m[0]-g[0],b=m[1]-g[1],x=m[2]-g[2],v=.299,T=.587,w=.114,O=n,C=new W.ColorMatrixFilter;if(C.matrix=[1+(g[0]-1+y*v)*O,y*T*O,y*w*O,0,g[0]*O,b*v*O,1+(g[1]-1+b*T)*O,b*w*O,0,g[1]*O,x*v*O,x*T*O,1+(g[2]-1+x*w)*O,0,g[2]*O,0,0,0,1,0],u.push(C),i>.05){const A=new te.AdjustmentFilter({contrast:1+.4*i+.3*n,saturation:1+.3*n,brightness:1+.05*n,gamma:1-.1*n});u.push(A)}const R=Math.max(1,Math.floor(1+(r*.8+n*.2)*9)),P=new te.DotFilter(R,45);if(u.push(P),o>.05){const A=1+o*6,L=new te.RGBSplitFilter({red:{x:-(A*.7),y:A*.3},green:{x:0,y:0},blue:{x:A*.7,y:-(A*.3)}});u.push(L)}return a>.05&&u.push(new te.CrossHatchFilter),s>.05&&u.push(new W.NoiseFilter(s*.25)),u},Pm=(t,e=null,n=100,r={})=>{if(typeof t=="string"&&Vw(t))return Lm[t].create(n);switch(t){case ue.Warm:case"Warm":return tA(n);case ue.Cool:case"Cool":return nA(n);case ue.BlackAndWhite:case"BlackAndWhite":return Kw(n);case ue.Vivid:case"Vivid":return rA(n);case ue.Fade:case"Fade":return iA(n);case ue.Sepia:case"Sepia":return Zw(n);case ue.RetroVintage:case"RetroVintage":return $w(n);case ue.OldFilm:case"OldFilm":return oA(n);case ue.Polaroid:case"Polaroid":return sA(n);case ue.Seventies:case"70s":return aA(n);case ue.Cinematic:case"Cinematic":return cA(n);case ue.Dramatic:case"Dramatic":return lA(n);case ue.Moody:case"Moody":return uA(n);case ue.FilmNoir:case"FilmNoir":return fA(n);case ue.SoftFocus:case"SoftFocus":return dA(n);case ue.Dreamy:case"Dreamy":case ue.DreamyVintage:case"DreamyVintage":return hA(n,r);case ue.DarkMood:case"DarkMood":return pA(n);case ue.HDR:case"HDR":return mA(n);case ue.Pop:case"Pop":return gA(n);case ue.Pastel:case"Pastel":return yA(n);case ue.Neon:case"Neon":{let i=65535;if(e!=null)if(typeof e=="string")try{e.startsWith("#")?i=parseInt(e.replace("#",""),16):e.startsWith("0x")?i=parseInt(e,16):i=new W.Color(e).toNumber()}catch{i=65535}else typeof e=="number"&&(i=e);return Qw(i,n)}case ue.Pixelize:case"Pixelize":return _A(n,r);case ue.RadialPixel:case"RadialPixel":return bA(n,r);case ue.CrossCut:case"CrossCut":return xA(n,r);case ue.Liquid:case"Liquid":return vA(n,r);case ue.Outliner:case"Outliner":return TA(n,r);case ue.DotPattern:case"DotPattern":return EA(n,r);case ue.CRT:case"CRT":return SA(n,r);case ue.Posterize:case"Posterize":return wA(n,r);case ue.TVGlitch:case"TVGlitch":return AA(n,r);case ue.HalfTone:case"HalfTone":return OA(n,r);case ue.Linocut:case"Linocut":return IA(n,r);case ue.Shifter:case"Shifter":return MA(n,r);case ue.Mirror:case"Mirror":return LA(n,r);case ue.ASCII:case"ASCII":return CA(n,r);case ue.Emboss:case"Emboss":return RA(n,r);case ue.Glow:case"Glow":return PA(n,r);case ue.Vignette:case"Vignette":return NA(n);case ue.TiltShift:case"TiltShift":return kA(n,r);case ue.ExtrudeBlur:case"ExtrudeBlur":return DA(n,r);case ue.Sharpie:case"Sharpie":return FA(n);case ue.Recolor:case"Recolor":return BA(n);case ue.GreenScreen:case"GreenScreen":return UA(n);case ue.Godray:case"Godray":return GA(n,r);case ue.MotionBlur:case"MotionBlur":return jA(n,r);case ue.AdvancedBloom:case"AdvancedBloom":return HA(n,r);case ue.RetroHalfTone:case"RetroHalfTone":return YA(n,r);case ue.NightVision:case"NightVision":return Jw();case ue.CYAN:case"CYAN":return eA();case ue.Normal:case ue.None:default:return null}},za=(t={})=>{const{effect:e=ue.Normal,neonColor:n=null,effectIntensity:r=100,effectParams:i={},neonGlowIntensity:o=null}=t,a=Pm(e,n,o??r,i);return{effectFilter:a,blackAndWhiteFilter:e===ue.BlackAndWhite?a:null,sepiaFilter:e===ue.Sepia?a:null,retroVintageFilter:e===ue.RetroVintage?a:null,nightVisionFilter:e===ue.NightVision?a:null,cyanFilter:e===ue.CYAN?a:null,neonFilter:e===ue.Neon?a:null}},XA=za,WA=`
|
|
1370
|
+
`,qw=(t,e=1)=>Math.max(0,Math.min(100,t))/100*e,ur={WaveTearDown:{shaderName:"vfx-wave-tear-down",direction:new Float32Array([0,1])},WaveTearUp:{shaderName:"vfx-wave-tear-up",direction:new Float32Array([0,-1])},WaveTearAcross:{shaderName:"vfx-wave-tear-across",direction:new Float32Array([1,.4])}},Ft=(t,e,n,r,i)=>new Dw({fragment:kw(t),name:e,intensity:qw(n,r),uniforms:i}),Wa=(t,e=50)=>Ft(Ww,t.shaderName,e,1,{uDirection:{value:t.direction,type:"vec2<f32>"}}),Lm={VHS:{shaderName:"vfx-vhs",defaultIntensity:50,create:(t=50)=>Ft(Fw,"vfx-vhs",t,1.2)},GlitchWave:{shaderName:"vfx-glitch-wave",defaultIntensity:50,create:(t=50)=>Ft(Bw,"vfx-glitch-wave",t,1.4)},LightLeak:{shaderName:"vfx-light-leak",defaultIntensity:50,create:(t=50)=>Ft(Uw,"vfx-light-leak",t,1.3)},FilmGrain:{shaderName:"vfx-film-grain",defaultIntensity:55,create:(t=50)=>Ft(Gw,"vfx-film-grain",t,1.2)},ChromaticWave:{shaderName:"vfx-chromatic-wave",defaultIntensity:50,create:(t=50)=>Ft(jw,"vfx-chromatic-wave",t,1.5)},LiquidGlass:{shaderName:"vfx-liquid-glass",defaultIntensity:65,create:(t=50)=>Ft(Hw,"vfx-liquid-glass",t,1.25)},BrokenGlass:{shaderName:"vfx-broken-glass",defaultIntensity:55,create:(t=50)=>Ft(Yw,"vfx-broken-glass",t,1)},Comic:{shaderName:"vfx-comic",defaultIntensity:60,create:(t=50)=>Ft(Xw,"vfx-comic",t,1)},WaveTearDown:{shaderName:ur.WaveTearDown.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearDown,t)},WaveTearUp:{shaderName:ur.WaveTearUp.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearUp,t)},WaveTearAcross:{shaderName:ur.WaveTearAcross.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearAcross,t)},WaveBrush:{shaderName:"vfx-wave-brush",defaultIntensity:100,create:(t=50)=>Ft(zw,"vfx-wave-brush",t,1)}},Vw=t=>t in Lm,Kw=(t=100)=>{const e=t/100;return new ne.HslAdjustmentFilter({hue:0,saturation:-1*e,lightness:0})},Zw=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.393*n+(1-n),.769*n,.189*n,0,0,.349*n,.686*n+(1-n),.168*n,0,0,.272*n,.534*n,.131*n+(1-n),0,0,0,0,0,1,0],e},$w=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100,r=[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0];for(let i=0;i<20;i++)e.matrix[i]=i===0?r[i]*1.1*n+(1-n):r[i]*n+(i<15?1-n:0);return e},Jw=()=>{const t=new ne.GlowFilter({distance:10,outerStrength:1,innerStrength:1,color:65280,quality:.5}),e=new W.ColorMatrixFilter;return e.matrix=[.1,.5,.1,0,0,.1,.8,.1,0,0,.1,.5,.1,0,0,0,0,0,1,0],[t,e]},Qw=(t=65535,e=50)=>{const n=e/50,r=new ne.GlowFilter({distance:8*n,outerStrength:1.5*n,innerStrength:.8*n,color:t,quality:.6}),i=new ne.GlowFilter({distance:16*n,outerStrength:.8*n,innerStrength:0,color:t,quality:.4});return[r,i]},eA=()=>{const t=new W.ColorMatrixFilter;return t.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],t},tA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,.05*n,0,0,.05*n,.05*n,1+.05*n,0,0,.02*n,0,0,1-.15*n,0,0,0,0,0,1,0],e},nA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1-.1*n,0,.05*n,0,0,0,1,.05*n,0,0,.05*n,.05*n,1+.15*n,0,.05*n,0,0,0,1,0],e},rA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({saturation:1+.5*e,contrast:1+.2*e,brightness:1+.05*e})},iA=(t=100)=>{const e=t/100,n=new W.ColorMatrixFilter,r=1-.3*e,i=.15*e;return n.matrix=[r*.9,.1*e,0,0,i,.1*e,r*.9,.1*e,0,i,0,.1*e,r*.9,0,i,0,0,0,1,0],n},oA=(t=100)=>{const e=t/100;return new ne.OldFilmFilter({sepia:.4*e,noise:.2*e,scratch:.3*e,scratchDensity:.2*e,vignetting:.3*e})},sA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1.1-.1*(1-n),.1*n,0,0,.05*n,.05*n,1.05-.05*(1-n),.05*n,0,.03*n,0,.1*n,.9+.1*(1-n),0,.02*n,0,0,0,1,0],e},aA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1.2*n+(1-n),.2*n,0,0,.1*n,.1*n,1*n+(1-n),.1*n,0,.05*n,0,.1*n,.7*n+(1-n),0,0,0,0,0,1,0],e},cA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,0,-.1*n,0,0,-.05*n,1+.05*n,.1*n,0,0,-.1*n,.1*n,1+.15*n,0,0,0,0,0,1,0],e},lA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({contrast:1+.5*e,brightness:1-.1*e,saturation:1+.2*e,gamma:1-.2*e})},uA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),0,.1*n,0,-.05*n,0,.9+.1*(1-n),.15*n,0,-.05*n,.1*n,.1*n,1+.1*n,0,0,0,0,0,1,0],e},fA=(t=100)=>{const e=t/100,n=new ne.HslAdjustmentFilter({saturation:-1*e,lightness:-.1*e}),r=new ne.AdjustmentFilter({contrast:1+.4*e,gamma:.9});return[n,r]},dA=(t=100)=>{const e=t/100,n=new ne.KawaseBlurFilter(2*e,1,!0),r=new ne.AdjustmentFilter({brightness:1+.05*e,contrast:1-.1*e});return[n,r]},hA=(t=100,e={})=>{const n=(e.intensity??t)/100,r=(e.spin??10)/100,i=(e.grain??30)/100*n,o=(e.glow??40)/100*n,s=(e.gloom??35)/100*n;e.centerX,e.centerY;const a=new ne.HslAdjustmentFilter({saturation:-.05-.14*s,lightness:-.03-.11*s}),l=new ne.AdjustmentFilter({contrast:1-.05-.1*s,gamma:.97-.05*s,brightness:1-.025*s}),c=new ne.AdvancedBloomFilter({bloomScale:.22+.8*o,threshold:.54-.16*o,blur:1.5+2.5*o,brightness:1+.04*o,quality:3});c.__vfxDreamy="bloom",c.__baseBloomScale=c.bloomScale,c.__baseBrightness=c.brightness,c.__spinSpeed=r;const u=new ne.KawaseBlurFilter(.35+1*o,1,!0);u.__vfxDreamy="blur",u.__baseBlur=.35+1*o,u.__spinSpeed=r;const f=new ne.OldFilmFilter({noise:.05+.4*i,vignetting:.18+.55*s,vignettingAlpha:.32+.4*s,vignettingBlur:.4,sepia:0,scratch:0,scratchDensity:0});return f.__vfxDreamy="grain",f.__baseVignetting=f.vignetting,f.__spinSpeed=r,[a,l,c,u,f]},pA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({brightness:1-.3*e,contrast:1+.2*e,saturation:1-.3*e,gamma:.8+.2*(1-e)})},mA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({contrast:1+.3*e,saturation:1+.4*e,brightness:1+.1*e})},gA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({saturation:1+.6*e,contrast:1+.3*e,brightness:1+.1*e})},yA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),.1*n,.1*n,0,.1*n,.1*n,.9+.1*(1-n),.1*n,0,.1*n,.1*n,.1*n,.9+.1*(1-n),0,.1*n,0,0,0,1,0],e},_A=(t=50,e={})=>{if(e.horizontalCount!=null||e.verticalCount!=null){const i=Math.max(1,e.horizontalCount??20),o=Math.max(1,e.verticalCount??20);return new ne.PixelateFilter([i,o])}const n=t/100,r=Math.max(1,Math.floor(1+31*n));return new ne.PixelateFilter(r)},bA=(t=50,e={})=>{if(e.radiusPerRow!=null||e.sizePerRow!=null){const s=e.radiusPerRow??5,a=e.sizePerRow??0,l=Math.max(1,s+a),c=new ne.PixelateFilter(l),u=new ne.ZoomBlurFilter({strength:.01*s,innerRadius:40+(20-s)*5,radius:-1});return[c,u]}const n=t/100,r=Math.max(1,Math.floor(1+20*n)),i=new ne.PixelateFilter(r),o=new ne.ZoomBlurFilter({strength:.05*n,innerRadius:100,radius:-1});return[i,o]},xA=(t=50,e={})=>{const n=new ne.CrossHatchFilter;if(e.horizontalOffset!=null||e.horizontalCuts!=null){const o=e.horizontalOffset??7,s=e.horizontalCuts??5,a=e.verticalOffset??50,l=e.variation??100;return[new ne.AdjustmentFilter({contrast:1+s/20*.6,brightness:1+o/100*.15,saturation:1-a/100*.7,gamma:1-l/100*.3+.15}),n]}const r=t/100;return[new ne.AdjustmentFilter({contrast:1+.3*r,saturation:1-.5*r}),n]},vA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.scale??62)/100,i=(e.variation??50)/100,o=new ne.BulgePinchFilter({radius:100+400*r,strength:.5*n,center:[.5,.5]}),s=new ne.TwistFilter({angle:3*n*i,radius:200+400*r,padding:20});return[o,s]},TA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.blending??50)/100,i=Math.max(1,Math.floor(1+4*n)),o=new ne.OutlineFilter(i,0,1);return[new ne.AdjustmentFilter({contrast:1+.4*r,saturation:1-.3*r}),o]},EA=(t=50,e={})=>{if(e.globalBlur!=null||e.numberOfDots!=null){const i=(e.globalBlur??30)/100,o=e.numberOfDots??30,s=Math.max(1,Math.floor(1+o/100*9)),a=new ne.DotFilter(s,45);return i>.01?[new ne.KawaseBlurFilter(1+4*i,1,!0),a]:a}const n=t/100,r=Math.max(1,Math.floor(2+6*n));return new ne.DotFilter(r,45)},SA=(t=50,e={})=>{const n=e.lineWidth??5,r=(e.curvature??50)/100,i=(e.lineContrast??30)/100;return new ne.CRTFilter({lineWidth:n,lineContrast:i*.5,curvature:r*10,noise:.1,noiseSize:1,vignetting:.2,vignettingAlpha:.5,vignettingBlur:.3,seed:Math.random()})},wA=(t=50,e={})=>{const r=(10-(e.numberOfLevels??Math.max(2,Math.floor(10-8*(t/100)))))/8,i=1+1.5*r,o=(1-i)/2,s=new W.ColorMatrixFilter;s.matrix=[i,0,0,0,o,0,i,0,0,o,0,0,i,0,o,0,0,0,1,0];const a=new ne.AdjustmentFilter({saturation:1+.5*r});return[s,a]},AA=(t=50,e={})=>{const n=e.roughDistortion??t/100*10,r=e.fineDistortion??t/100*5,i=e.verticalOffset??t/100*5,o=e.variance??t/100*5,s=new ne.GlitchFilter({slices:Math.max(3,Math.floor(3+n*1.5)),offset:5+n*4,direction:0,fillMode:2,average:!1,seed:Math.random()}),a=new ne.RGBSplitFilter({red:{x:-(1+r*.8),y:i*.5},green:{x:0,y:0},blue:{x:1+r*.8,y:-(i*.5)}}),l=new ne.AdjustmentFilter({contrast:1+o*.05,brightness:1-o*.02});return[s,a,l]},OA=(t=50,e={})=>{const n=e.angleOfPattern??5,r=e.scaleOfPattern??Math.max(1,Math.floor(2+8*(t/100))),i=Math.max(1,Math.floor(1+r/100*9)),o=new ne.DotFilter(i,n);return[new ne.AdjustmentFilter({contrast:1+.15}),o]},CA=(t=50,e={})=>{const n=e.charSize??Math.max(2,Math.floor(2+18*(t/100)));return new ne.AsciiFilter(n)},RA=(t=50,e={})=>{const n=(e.strength??t)/100;return new ne.EmbossFilter(2+8*n)},IA=(t=50,e={})=>{const n=(e.scaleOfPattern??50)/100,r=new ne.HslAdjustmentFilter({saturation:-1,lightness:0}),i=new ne.AdjustmentFilter({contrast:1+.5+1.5*n,brightness:1+.15*n,gamma:.6+.4*(1-n)}),o=new ne.CrossHatchFilter;return[r,i,o]},MA=(t=50,e={})=>{const n=e.distance??t/100*10,i=(e.shiftDirection??3)/10*Math.PI,o=n*Math.cos(i),s=n*Math.sin(i);return new ne.RGBSplitFilter({red:{x:-o,y:-s},green:{x:0,y:0},blue:{x:o,y:s}})},LA=(t=50,e={})=>{const n=e.mirroredSide??1,r=.5,i=new ne.ReflectionFilter({mirror:!0,boundary:r,amplitude:[0,0],waveLength:[0,0]});return n===0||n===1?i.boundary=.5:n===2?i.boundary=.3:i.boundary=.7,i},PA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.darkening??30)/100,i=e.bloom??4,o=new ne.GlowFilter({distance:i*3+10*n,outerStrength:1+3*n,innerStrength:.5+1.5*n,color:16777215,quality:.3});return r>.01?[new ne.AdjustmentFilter({brightness:1-.4*r,gamma:1-.3*r}),o]:o},NA=(t=50)=>{const e=t/100;return new ne.OldFilmFilter({vignetting:.3+.7*e,vignettingAlpha:.5+.5*e,vignettingBlur:.3,sepia:0,noise:0,scratch:0,scratchDensity:0})},kA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.position??40)/100,i=Math.floor(400*r);return new ne.TiltShiftFilter({blur:15+45*n,gradientBlur:400+800*n,start:{x:0,y:i},end:{x:600,y:i}})},DA=(t=50,e={})=>{const n=(e.intensity??t)/100;return new ne.ZoomBlurFilter({strength:.05+.15*n,center:[.5,.5],innerRadius:50+100*(1-n),radius:-1})},FA=(t=50)=>{const n=.3+.7*(t/100);return new ne.ConvolutionFilter([0,-n,0,-n,1+4*n,-n,0,-n,0])},BA=(t=50)=>{const e=t/100;return new ne.HslAdjustmentFilter({hue:180*e,saturation:0,lightness:0,colorize:!1})},UA=(t=50)=>{const e=t/100,n=new W.ColorMatrixFilter,r=1-.8*e;return n.matrix=[1,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,-.5*e,0,1,0],n},GA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=e.angle??30,i=(e.lacunarity??25)/10;return new ne.GodrayFilter({gain:.3+.7*n,lacunarity:i,angle:r,parallel:!0,time:0})},jA=(t=50,e={})=>{const n=e.velocityX??t/100*20,r=e.velocityY??0;return new ne.MotionBlurFilter([n,r],5)},HA=(t=50,e={})=>{const n=(e.bloomStrength??t)/100,r=(e.threshold??50)/100,i=(e.bloomBlur??50)/100;return new ne.AdvancedBloomFilter({bloomScale:.5+2.5*n,threshold:r,blur:2+12*i,brightness:1+.5*n,quality:4})},YA=(t=50,e={})=>{const n=t/100,r=(e.dots??50)/100,i=(e.contrast??70)/100,o=(e.offset??20)/100,s=(e.texture??30)/100,a=(e.rasterize??0)/100,l=e.primaryColor??"#00BFFF",c=e.accentColor??"#FF44AA",u=[],f=new W.Color(l),d=new W.Color(c),h=f.toRgb(),p=d.toRgb(),m=[h.r,h.g,h.b],g=[p.r,p.g,p.b],y=m[0]-g[0],b=m[1]-g[1],x=m[2]-g[2],v=.299,T=.587,w=.114,O=n,C=new W.ColorMatrixFilter;if(C.matrix=[1+(g[0]-1+y*v)*O,y*T*O,y*w*O,0,g[0]*O,b*v*O,1+(g[1]-1+b*T)*O,b*w*O,0,g[1]*O,x*v*O,x*T*O,1+(g[2]-1+x*w)*O,0,g[2]*O,0,0,0,1,0],u.push(C),i>.05){const A=new ne.AdjustmentFilter({contrast:1+.4*i+.3*n,saturation:1+.3*n,brightness:1+.05*n,gamma:1-.1*n});u.push(A)}const R=Math.max(1,Math.floor(1+(r*.8+n*.2)*9)),P=new ne.DotFilter(R,45);if(u.push(P),o>.05){const A=1+o*6,L=new ne.RGBSplitFilter({red:{x:-(A*.7),y:A*.3},green:{x:0,y:0},blue:{x:A*.7,y:-(A*.3)}});u.push(L)}return a>.05&&u.push(new ne.CrossHatchFilter),s>.05&&u.push(new W.NoiseFilter(s*.25)),u},Pm=(t,e=null,n=100,r={})=>{if(typeof t=="string"&&Vw(t))return Lm[t].create(n);switch(t){case ue.Warm:case"Warm":return tA(n);case ue.Cool:case"Cool":return nA(n);case ue.BlackAndWhite:case"BlackAndWhite":return Kw(n);case ue.Vivid:case"Vivid":return rA(n);case ue.Fade:case"Fade":return iA(n);case ue.Sepia:case"Sepia":return Zw(n);case ue.RetroVintage:case"RetroVintage":return $w(n);case ue.OldFilm:case"OldFilm":return oA(n);case ue.Polaroid:case"Polaroid":return sA(n);case ue.Seventies:case"70s":return aA(n);case ue.Cinematic:case"Cinematic":return cA(n);case ue.Dramatic:case"Dramatic":return lA(n);case ue.Moody:case"Moody":return uA(n);case ue.FilmNoir:case"FilmNoir":return fA(n);case ue.SoftFocus:case"SoftFocus":return dA(n);case ue.Dreamy:case"Dreamy":case ue.DreamyVintage:case"DreamyVintage":return hA(n,r);case ue.DarkMood:case"DarkMood":return pA(n);case ue.HDR:case"HDR":return mA(n);case ue.Pop:case"Pop":return gA(n);case ue.Pastel:case"Pastel":return yA(n);case ue.Neon:case"Neon":{let i=65535;if(e!=null)if(typeof e=="string")try{e.startsWith("#")?i=parseInt(e.replace("#",""),16):e.startsWith("0x")?i=parseInt(e,16):i=new W.Color(e).toNumber()}catch{i=65535}else typeof e=="number"&&(i=e);return Qw(i,n)}case ue.Pixelize:case"Pixelize":return _A(n,r);case ue.RadialPixel:case"RadialPixel":return bA(n,r);case ue.CrossCut:case"CrossCut":return xA(n,r);case ue.Liquid:case"Liquid":return vA(n,r);case ue.Outliner:case"Outliner":return TA(n,r);case ue.DotPattern:case"DotPattern":return EA(n,r);case ue.CRT:case"CRT":return SA(n,r);case ue.Posterize:case"Posterize":return wA(n,r);case ue.TVGlitch:case"TVGlitch":return AA(n,r);case ue.HalfTone:case"HalfTone":return OA(n,r);case ue.Linocut:case"Linocut":return IA(n,r);case ue.Shifter:case"Shifter":return MA(n,r);case ue.Mirror:case"Mirror":return LA(n,r);case ue.ASCII:case"ASCII":return CA(n,r);case ue.Emboss:case"Emboss":return RA(n,r);case ue.Glow:case"Glow":return PA(n,r);case ue.Vignette:case"Vignette":return NA(n);case ue.TiltShift:case"TiltShift":return kA(n,r);case ue.ExtrudeBlur:case"ExtrudeBlur":return DA(n,r);case ue.Sharpie:case"Sharpie":return FA(n);case ue.Recolor:case"Recolor":return BA(n);case ue.GreenScreen:case"GreenScreen":return UA(n);case ue.Godray:case"Godray":return GA(n,r);case ue.MotionBlur:case"MotionBlur":return jA(n,r);case ue.AdvancedBloom:case"AdvancedBloom":return HA(n,r);case ue.RetroHalfTone:case"RetroHalfTone":return YA(n,r);case ue.NightVision:case"NightVision":return Jw();case ue.CYAN:case"CYAN":return eA();case ue.Normal:case ue.None:default:return null}},za=(t={})=>{const{effect:e=ue.Normal,neonColor:n=null,effectIntensity:r=100,effectParams:i={},neonGlowIntensity:o=null}=t,a=Pm(e,n,o??r,i);return{effectFilter:a,blackAndWhiteFilter:e===ue.BlackAndWhite?a:null,sepiaFilter:e===ue.Sepia?a:null,retroVintageFilter:e===ue.RetroVintage?a:null,nightVisionFilter:e===ue.NightVision?a:null,cyanFilter:e===ue.CYAN?a:null,neonFilter:e===ue.Neon?a:null}},XA=za,WA=`
|
|
1371
1371
|
precision highp float;
|
|
1372
1372
|
|
|
1373
1373
|
in vec2 vTextureCoord;
|
|
@@ -1414,15 +1414,15 @@ void main(void) {
|
|
|
1414
1414
|
float outAlpha = color.a * keep;
|
|
1415
1415
|
finalColor = vec4(straight * outAlpha, outAlpha);
|
|
1416
1416
|
}
|
|
1417
|
-
`;class ZA extends B.Filter{plate;constructor(e,n=.16,r=.05){const i=B.GlProgram.from({vertex:no,fragment:KA,name:"plate-key-filter"});super({glProgram:i,resources:{plateUniforms:{uKeyColor:{value:new Float32Array(e),type:"vec3<f32>"},uTolerance:{value:n,type:"f32"},uSoftness:{value:r,type:"f32"}}}}),this.plate=this.resources.plateUniforms.uniforms}get tolerance(){return this.plate.uTolerance}set tolerance(e){this.plate.uTolerance=e}set keyColor(e){this.plate.uKeyColor[0]=e[0],this.plate.uKeyColor[1]=e[1],this.plate.uKeyColor[2]=e[2]}}function $A(t){if(t==null)return null;if(typeof t=="number")return[(t>>16&255)/255,(t>>8&255)/255,(t&255)/255];const e=t.trim(),n=/^#?([0-9a-f]{6})$/i.exec(e)||/^0x([0-9a-f]{6})$/i.exec(e);if(n){const i=parseInt(n[1],16);return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255]}const r=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return r?[Number(r[1])/255,Number(r[2])/255,Number(r[3])/255]:null}const JA=[236/255,234/255,219/255],QA=t=>{if(!t)return{};const e={...t};for(const n of["brightness","contrast","saturation","red","green","blue"])typeof t[n]=="number"&&(e[n]=(t[n]-1)*100);return e},eO=[],Nm=t=>{if(t)for(const e of t)try{e.destroy()}catch{}},ut=({colorCorrection:t,effects:e,neonColor:n=null,blendMode:r=0,plateKey:i=null})=>{const{brightness:o=0,contrast:s=0,saturation:a=0,red:l=0,green:c=0,blue:u=0,gamma:f=1,alpha:d=1,temperature:h=0,tint:p=0,hue:m=0,highlights:g=0,shadows:y=0,exposure:b=0,vibrance:x=0,sharpness:v=0,blurRadius:T=0,vignette:w=0,noise:O=0,edgeFeather:C=0}=t??{},R=e?.name||"None",P=e?.intensity??(R==="None"||R==="Normal"?0:100),A=e?.params?JSON.stringify(e.params):"",L=i&&typeof i=="object"?JSON.stringify(i):i,N=S.useMemo(()=>{const{exposureFilter:pe,temperatureTintFilter:X,tonalFilter:he,adjustmentFilter:j,vibranceFilter:$,hslFilter:H,sharpnessFilter:ce,blurFilter:Z,vignetteFilter:se,noiseFilter:J,edgeFeatherFilter:ie}=Mm({brightness:o,contrast:s,saturation:a,red:l,green:c,blue:u,gamma:f,alpha:d,temperature:h,tint:p,hue:m,highlights:g,shadows:y,exposure:b,vibrance:x,sharpness:v,blurRadius:T,vignette:w,noise:O,edgeFeather:C}),{effectFilter:xe}=za({effect:R,effectIntensity:P,effectParams:e?.params,neonColor:n}),Y=[];if(i){const Oe=typeof i=="object"?i:{},ge=typeof i=="string"?i:Oe.color??null,re=$A(ge)??JA;Y.push(new ZA(re,Oe.tolerance??40/255))}if(pe&&Y.push(pe),X&&Y.push(X),he&&Y.push(he),j&&Y.push(j),$&&Y.push($),H&&Y.push(H),ce&&Y.push(ce),ie&&C>0&&Y.push(ie),xe&&(Array.isArray(xe)?Y.push(...xe.filter(Oe=>Oe!=null)):Y.push(xe)),Z&&T>0&&Y.push(Z),se&&w>0&&Y.push(se),J&&O>0&&Y.push(J),Y.length>0){const Oe=VA(r);Oe&&Y.push(Oe)}return Y},[o,s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R,P,A,n,r,L]),D=S.useRef(null);S.useEffect(()=>{const pe=D.current;D.current=N,pe&&pe!==N&&Nm(pe)},[N]),S.useEffect(()=>()=>{Nm(D.current),D.current=null},[]);const F=S.useContext(Ye),G=F?.registerTimeUpdateListener,z=F?.unregisterTimeUpdateListener,K=S.useRef(eO);K.current=N;const ae=S.useRef(-1);return S.useEffect(()=>{if(!G||!z)return;const pe=X=>{const he=X,j=K.current;if(!(!j||j.length===0))for(const $ of j){if(!$)continue;const H=$;if(H.__vfxAnimated===!0){H.time=he;continue}if(typeof H.refresh=="function"){const Z=Math.floor(he*12);if(Z!==ae.current){const se=Math.sin(Z*12.9898)*43758.5453;H.seed=se-Math.floor(se),H.refresh(),ae.current=Z}continue}if(typeof H.time=="number"&&(H.time=he*.5),typeof H.seed=="number"&&!H.__vfxDreamy&&(H.seed=Math.floor(he*24)%997/997),typeof H.angle=="number"&&typeof H.time!="number"&&H.offset!==null&&typeof H.offset=="object"&&(H.angle=Math.sin(he*1.5)*3),typeof H.strength=="number"&&typeof H.centerX=="number"&&typeof H.angle>"u"&&typeof H.time>"u"){H.centerX=.5+Math.sin(he*.8)*.12,H.centerY=.5+Math.cos(he*.6)*.12;continue}const ce=Z=>.35+(Z.__spinSpeed??.1)*2.5;if(H.__vfxDreamy==="bloom"){const Z=Math.sin(he*.8*ce(H));H.bloomScale=H.__baseBloomScale*(1+.08*Z),H.brightness=H.__baseBrightness*(1+.04*Z);continue}if(H.__vfxDreamy==="blur"){const Z=Math.sin(he*.6*ce(H)+.4);H.strength=H.__baseBlur*(1+.08*Z);continue}if(H.__vfxDreamy==="grain"){const Z=Math.floor(he*(6+ce(H)*14));if(H.seed=Z%997/997,typeof H.__baseVignetting=="number"){const se=Math.sin(he*.45*ce(H));H.vignetting=H.__baseVignetting*(.94+.08*se)}continue}}};return G(pe),()=>z(pe)},[G,z]),N},qa="element-",Va=t=>`${qa}${t}`,tO=t=>t?.startsWith(qa)?t.slice(qa.length):null,Ka=(t,e)=>!t||!e?null:t.getChildByLabel(e,!0)??null,nO=t=>{const e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${e}$`)},Za=(t,e)=>{if(!t)return[];const n=nO(e),r=[],i=o=>{for(const s of o.children){const a=s;a.label&&n.test(a.label)&&r.push(a),a.children?.length&&i(a)}};return i(t),r},rO=t=>{const e=(n=>Ka(t,n));return e.all=n=>Za(t,n),e.byId=n=>Ka(t,Va(n)),e.byType=n=>Za(t,`${n}-*`),e},iO={x:0,y:0,width:0,height:0,anchor:.5,animation:to.NONE,maxX:0,maxY:0,scale:1,rotation:0,effect:ue.Normal,overlay:Gr.NONE,fontSize:10},Je=({ref:t,...e})=>{const[n]=S.useState(!1),[r]=S.useState(!1),i=S.useRef(null),o=S.useRef(null),s=S.useRef(null),a=S.useRef(null),l=S.useRef(null),{tl:c}=S.useContext(Ye),{app:u}=at.useApplication(),f=u?.renderer?.screen,d=f?.width||1920,h=f?.height||1080,{uniqueId:p,visible:m,startAt:g,endAt:y,transformation:b=iO,disabled:x,pointerdown:v,pointerout:T,pointerover:w,isDragging:O,isGif:C,onContainerRefReady:R,onSpriteRefReady:P,id:A,sortableChildren:L,animationText:N}=e,{x:D=0,y:F=0,width:G,height:z,scale:K=[1,1],rotation:ae=0,effect:pe,effects:X,neonColor:he,blendMode:j,overlay:$,animation:H=to.NONE,fontFamily:ce,fontSize:Z,fontWeight:se,fill:J,color:ie,letterSpacing:xe}=b,Y=xm(),Oe=b,ge=S.useMemo(()=>{const ze=Se=>Se!=null&&(typeof Se=="string"?Se!==""&&Se!=="NONE":typeof Se=="object"?(Se.name??"NONE")!=="NONE":!1);return ze(Oe.animationIn)||ze(Oe.animationOut)||ze(Oe.animationLoop)||Array.isArray(Oe.keyframes)&&Oe.keyframes.length>0},[Oe.animationIn,Oe.animationOut,Oe.animationLoop,Oe.keyframes]),re=Number(g)||0,we=Number(y),me=ge&&Number.isFinite(we)&&we>re;Am(me?{targetRef:i,transformation:{...b,maxX:d,maxY:h},start:re,end:we,effectOptions:{width:typeof G=="number"?G:void 0,height:typeof z=="number"?z:void 0,text:typeof N=="string"?N:void 0,fontFamily:ce,fontSize:Z,fontWeight:se,fill:J,color:ie,letterSpacing:xe}}:{targetRef:{current:null},transformation:{},start:0,end:0,effectOptions:{}}),$e(ke.COMPLETE,()=>{i.current}),I.useImperativeHandle(t,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>r}),[n,r]),I.useEffect(()=>{R&&R(p,i)},[R,p]),I.useEffect(()=>{P&&P(p,s)},[P,p]);const Ue=S.useMemo(()=>({x:D,y:F,width:G,height:z,animation:H,maxX:d,maxY:h}),[H,D,F,G,z,d,h]);I.useEffect(()=>{if(o.current&&!ge){if(c.current){const{x:ze,y:Se,animation:De,maxX:Ie,maxY:Ge}=Ue,je=c.current.progress(),Le=Y.updateEffect(i.current,De,{immediateRender:!1,x:ze,y:Se,overwrite:!0,maxX:Ie,maxY:Ge});a.current&&(c.current.remove(a.current),a.current.progress(0).kill()),je>.1?(Le.eventCallback("onComplete",()=>{Le.remove("onComplete"),c.current.add(Le,g),a.current=Le}),Le.play()):(Le.progress(1),c.current.add(Le,g),a.current=Le)}else a.current&&a.current.progress(0).kill();return()=>{}}},[g,Ue,ge]);const pt=ut({effects:X??{name:pe},neonColor:he}),Mt=Rm(j??0),ve=A||Va(p),Me=S.useCallback(ze=>{i.current=ze,ze&&R&&R(p,i)},[R,p]),ct=typeof K=="number"?K:{x:K[0]??1,y:K[1]??1};return M.jsx("pixiContainer",{ref:o,label:`container-${p}`,sortableChildren:L,blendMode:Mt,children:M.jsx("pixiContainer",{label:ve,ref:Me,position:{x:D,y:F},pivot:{x:D,y:F},scale:ct,rotation:ae,eventMode:"passive",children:M.jsxs("pixiContainer",{ref:l,children:[!C&&M.jsx("pixiContainer",{scale:1,filters:pt,children:M.jsx("pixiContainer",{ref:s,children:e.children})}),C&&M.jsx("pixiContainer",{ref:s,children:e.children}),!ya($)&&$!==Gr.NONE&&$!==Gr.NORMAL&&M.jsx(kp,{overlay:$,width:G,height:z,x:D,y:F}),M.jsx("pixiSprite",{texture:W.Texture.WHITE,alpha:0,anchor:.5,x:D,y:F,width:G,height:z,eventMode:!x&&m&&!n&&!O?"static":"none",cursor:"pointer",onPointerDown:v,onPointerOver:w,onPointerOut:T})]})})})};var Ut=(t=>(t.NONE="none",t.HORIZONTAL="horizontal",t.MIRROR="mirror",t.CIRCLE="circle",t.RECTANGLE="rectangle",t.HEART="heart",t.STARS="stars",t))(Ut||{});function $a(t,e,n,r,i,o,s){const a=s?n-i/2+s.x+s.w/2:n,l=s?r-o/2+s.y+s.h/2:r,c=s?s.w:i,u=s?s.h:o,f=c/2,d=u/2;switch(e){case Ut.HORIZONTAL:{const h=u*.6;t.rect(a-f,l-h/2,c,h);break}case Ut.MIRROR:{const h=u*.35;t.rect(a-f,l-d,c,h),t.rect(a-f,l+d-h,c,h);break}case Ut.CIRCLE:{const h=Math.min(f,d);t.circle(a,l,h);break}case Ut.RECTANGLE:{const h=Math.min(c,u)*.15;t.roundRect(a-f,l-d,c,u,h);break}case Ut.HEART:{oO(t,a,l,c,u);break}case Ut.STARS:{const h=Math.min(f,d);t.star(a,l,5,h,h*.5,-Math.PI/2);break}default:t.rect(a-f,l-d,c,u)}}function oO(t,e,n,r,i){const o=e-r/2,s=e+r/2,a=n-i/2,l=n+i/2,c=a+i*.3,u=a+i*.6;t.moveTo(e,c),t.bezierCurveTo(e,a,o,a,o,c),t.bezierCurveTo(o,u,e,l-i*.1,e,l),t.bezierCurveTo(e,l-i*.1,s,u,s,c),t.bezierCurveTo(s,a,e,a,e,c),t.closePath()}const sO=t=>{if(t==null)return 0;if(typeof t=="number")return t;const e=t.replace("#",""),n=parseInt(e,16);return Number.isFinite(n)?n:0},Ot=({x:t=0,y:e=0,width:n=0,height:r=0,border:i,roundedCorners:o=!1,maskShape:s=Ut.NONE,crop:a,spriteRef:l,children:c})=>{const u=S.useRef(null),f=i?.width??0,d=i?.color??null,h=S.useMemo(()=>o?typeof o=="number"?o:Math.min(n,r)*.1:0,[o,n,r]),p=s&&s!==Ut.NONE?s:null,m=!!p||!!o&&h>0||!!a,g=f>0&&d!=null,y=S.useMemo(()=>sO(d),[d]),b=S.useCallback(T=>{if(T.clear(),!!m){if(p)$a(T,p,t,e,n,r,a);else{const w=a?t-n/2+a.x:t-n/2,O=a?e-r/2+a.y:e-r/2,C=a?a.w:n,R=a?a.h:r;T.roundRect(w,O,C,R,h)}T.fill({color:16777215,alpha:1})}},[m,p,t,e,n,r,h,a]),x=S.useCallback(T=>{if(T.clear(),!!g){if(p)$a(T,p,t,e,n,r,a);else{const w=a?t-n/2+a.x:t-n/2,O=a?e-r/2+a.y:e-r/2,C=a?a.w:n,R=a?a.h:r;h>0?T.roundRect(w,O,C,R,h):T.rect(w,O,C,R)}T.stroke({width:f,color:y,alpha:1})}},[g,f,y,h,p,a,t,e,n,r]),v=S.useRef(null);return S.useLayoutEffect(()=>{const T=l?.current??null,w=m&&u.current?u.current:null;v.current&&v.current!==T&&(v.current.mask=null),v.current=T,T&&(T.mask??null)!==w&&(T.mask=w)}),S.useLayoutEffect(()=>()=>{v.current&&(v.current.mask=null),v.current=null},[]),M.jsxs("pixiContainer",{children:[m&&M.jsx("pixiGraphics",{ref:u,draw:b,eventMode:"none"}),c,g&&M.jsx("pixiGraphics",{draw:x,eventMode:"none"})]})};Ot.displayName="BorderMaskContainer";const aO=3e3;function Ja(t=aO){const e=new Map,n=new Map;return{acquire(r){const i=n.get(r);i&&(clearTimeout(i),n.delete(r)),e.set(r,(e.get(r)??0)+1)},release(r){const i=(e.get(r)??1)-1;if(i>0){e.set(r,i);return}e.delete(r),!n.has(r)&&n.set(r,setTimeout(()=>{n.delete(r),!e.has(r)&&W.Assets.unload(r).catch(()=>{})},t))}}}function Qa(t){if(!t||typeof t!="string")return t;const e=t.indexOf("/data:");if(e!==-1&&t.startsWith("https://")){const n=t.slice(e+1),r=n.indexOf("?");return r!==-1?n.slice(0,r):n}return t}const km=Ja();function ro(t,e){const n=Qa(t)||t;let r=!1,i=!1;km.acquire(n);const o=()=>{i||(i=!0,km.release(n))};let s;const a=new Promise(c=>{s=c});return(e?.forceTextureParser===!1?W.Assets.load(n):W.Assets.load({src:n,loadParser:"loadTextures"})).then(c=>{if(r){s(null);return}try{c?.source&&(c.source.scaleMode=e?.scaleMode??"linear",c.source.autoGenerateMipmaps=e?.enableMipmap??!0)}catch{}s(c)}).catch(c=>{r||console.error("[loadSpriteTexture]",n,c),s(null)}),{promise:a,cancel:()=>{r=!0,s(null),o()},dispose:o}}async function cO(t,e){return ro(t,e)}var ec,Dm;function lO(){if(Dm)return ec;Dm=1;function t(){this.__data__=[],this.size=0}return ec=t,ec}var tc,Fm;function nc(){if(Fm)return tc;Fm=1;function t(e,n){return e===n||e!==e&&n!==n}return tc=t,tc}var rc,Bm;function io(){if(Bm)return rc;Bm=1;var t=nc();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return rc=e,rc}var ic,Um;function uO(){if(Um)return ic;Um=1;var t=io(),e=Array.prototype,n=e.splice;function r(i){var o=this.__data__,s=t(o,i);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():n.call(o,s,1),--this.size,!0}return ic=r,ic}var oc,Gm;function fO(){if(Gm)return oc;Gm=1;var t=io();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return oc=e,oc}var sc,jm;function dO(){if(jm)return sc;jm=1;var t=io();function e(n){return t(this.__data__,n)>-1}return sc=e,sc}var ac,Hm;function hO(){if(Hm)return ac;Hm=1;var t=io();function e(n,r){var i=this.__data__,o=t(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return ac=e,ac}var cc,Ym;function oo(){if(Ym)return cc;Ym=1;var t=lO(),e=uO(),n=fO(),r=dO(),i=hO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,cc=o,cc}var lc,Xm;function pO(){if(Xm)return lc;Xm=1;var t=oo();function e(){this.__data__=new t,this.size=0}return lc=e,lc}var uc,Wm;function mO(){if(Wm)return uc;Wm=1;function t(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}return uc=t,uc}var fc,zm;function gO(){if(zm)return fc;zm=1;function t(e){return this.__data__.get(e)}return fc=t,fc}var dc,qm;function yO(){if(qm)return dc;qm=1;function t(e){return this.__data__.has(e)}return dc=t,dc}var hc,Vm;function so(){if(Vm)return hc;Vm=1;var t=Nn(),e=t(Object,"create");return hc=e,hc}var pc,Km;function _O(){if(Km)return pc;Km=1;var t=so();function e(){this.__data__=t?t(null):{},this.size=0}return pc=e,pc}var mc,Zm;function bO(){if(Zm)return mc;Zm=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return mc=t,mc}var gc,$m;function xO(){if($m)return gc;$m=1;var t=so(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(t){var a=s[o];return a===e?void 0:a}return r.call(s,o)?s[o]:void 0}return gc=i,gc}var yc,Jm;function vO(){if(Jm)return yc;Jm=1;var t=so(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var o=this.__data__;return t?o[i]!==void 0:n.call(o,i)}return yc=r,yc}var _c,Qm;function TO(){if(Qm)return _c;Qm=1;var t=so(),e="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=t&&i===void 0?e:i,this}return _c=n,_c}var bc,e0;function EO(){if(e0)return bc;e0=1;var t=_O(),e=bO(),n=xO(),r=vO(),i=TO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,bc=o,bc}var xc,t0;function SO(){if(t0)return xc;t0=1;var t=EO(),e=oo(),n=Zs();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return xc=r,xc}var vc,n0;function wO(){if(n0)return vc;n0=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return vc=t,vc}var Tc,r0;function ao(){if(r0)return Tc;r0=1;var t=wO();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Tc=e,Tc}var Ec,i0;function AO(){if(i0)return Ec;i0=1;var t=ao();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return Ec=e,Ec}var Sc,o0;function OO(){if(o0)return Sc;o0=1;var t=ao();function e(n){return t(this,n).get(n)}return Sc=e,Sc}var wc,s0;function CO(){if(s0)return wc;s0=1;var t=ao();function e(n){return t(this,n).has(n)}return wc=e,wc}var Ac,a0;function RO(){if(a0)return Ac;a0=1;var t=ao();function e(n,r){var i=t(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ac=e,Ac}var Oc,c0;function Cc(){if(c0)return Oc;c0=1;var t=SO(),e=AO(),n=OO(),r=CO(),i=RO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Oc=o,Oc}var Rc,l0;function IO(){if(l0)return Rc;l0=1;var t=oo(),e=Zs(),n=Cc(),r=200;function i(o,s){var a=this.__data__;if(a instanceof t){var l=a.__data__;if(!e||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(o,s),this.size=a.size,this}return Rc=i,Rc}var Ic,u0;function f0(){if(u0)return Ic;u0=1;var t=oo(),e=pO(),n=mO(),r=gO(),i=yO(),o=IO();function s(a){var l=this.__data__=new t(a);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=o,Ic=s,Ic}var Mc,d0;function MO(){if(d0)return Mc;d0=1;var t="__lodash_hash_undefined__";function e(n){return this.__data__.set(n,t),this}return Mc=e,Mc}var Lc,h0;function LO(){if(h0)return Lc;h0=1;function t(e){return this.__data__.has(e)}return Lc=t,Lc}var Pc,p0;function PO(){if(p0)return Pc;p0=1;var t=Cc(),e=MO(),n=LO();function r(i){var o=-1,s=i==null?0:i.length;for(this.__data__=new t;++o<s;)this.add(i[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=n,Pc=r,Pc}var Nc,m0;function NO(){if(m0)return Nc;m0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(e[r],r,e))return!0;return!1}return Nc=t,Nc}var kc,g0;function kO(){if(g0)return kc;g0=1;function t(e,n){return e.has(n)}return kc=t,kc}var Dc,y0;function _0(){if(y0)return Dc;y0=1;var t=PO(),e=NO(),n=kO(),r=1,i=2;function o(s,a,l,c,u,f){var d=l&r,h=s.length,p=a.length;if(h!=p&&!(d&&p>h))return!1;var m=f.get(s),g=f.get(a);if(m&&g)return m==a&&g==s;var y=-1,b=!0,x=l&i?new t:void 0;for(f.set(s,a),f.set(a,s);++y<h;){var v=s[y],T=a[y];if(c)var w=d?c(T,v,y,a,s,f):c(v,T,y,s,a,f);if(w!==void 0){if(w)continue;b=!1;break}if(x){if(!e(a,function(O,C){if(!n(x,C)&&(v===O||u(v,O,l,c,f)))return x.push(C)})){b=!1;break}}else if(!(v===T||u(v,T,l,c,f))){b=!1;break}}return f.delete(s),f.delete(a),b}return Dc=o,Dc}var Fc,b0;function x0(){if(b0)return Fc;b0=1;var t=St(),e=t.Uint8Array;return Fc=e,Fc}var Bc,v0;function DO(){if(v0)return Bc;v0=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i,o){r[++n]=[o,i]}),r}return Bc=t,Bc}var Uc,T0;function FO(){if(T0)return Uc;T0=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i){r[++n]=i}),r}return Uc=t,Uc}var Gc,E0;function BO(){if(E0)return Gc;E0=1;var t=er(),e=x0(),n=nc(),r=_0(),i=DO(),o=FO(),s=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",m="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",x=t?t.prototype:void 0,v=x?x.valueOf:void 0;function T(w,O,C,R,P,A,L){switch(C){case b:if(w.byteLength!=O.byteLength||w.byteOffset!=O.byteOffset)return!1;w=w.buffer,O=O.buffer;case y:return!(w.byteLength!=O.byteLength||!A(new e(w),new e(O)));case l:case c:case d:return n(+w,+O);case u:return w.name==O.name&&w.message==O.message;case h:case m:return w==O+"";case f:var N=i;case p:var D=R&s;if(N||(N=o),w.size!=O.size&&!D)return!1;var F=L.get(w);if(F)return F==O;R|=a,L.set(w,O);var G=r(N(w),N(O),R,P,A,L);return L.delete(w),G;case g:if(v)return v.call(w)==v.call(O)}return!1}return Gc=T,Gc}var jc,S0;function Hc(){if(S0)return jc;S0=1;function t(e,n){for(var r=-1,i=n.length,o=e.length;++r<i;)e[o+r]=n[r];return e}return jc=t,jc}var Yc,w0;function A0(){if(w0)return Yc;w0=1;var t=Hc(),e=Vt();function n(r,i,o){var s=i(r);return e(r)?s:t(s,o(r))}return Yc=n,Yc}var Xc,O0;function UO(){if(O0)return Xc;O0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=0,s=[];++r<i;){var a=e[r];n(a,r,e)&&(s[o++]=a)}return s}return Xc=t,Xc}var Wc,C0;function R0(){if(C0)return Wc;C0=1;function t(){return[]}return Wc=t,Wc}var zc,I0;function qc(){if(I0)return zc;I0=1;var t=UO(),e=R0(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(s){return s==null?[]:(s=Object(s),t(i(s),function(a){return r.call(s,a)}))}:e;return zc=o,zc}var Vc,M0;function GO(){if(M0)return Vc;M0=1;function t(e,n){for(var r=-1,i=Array(e);++r<e;)i[r]=n(r);return i}return Vc=t,Vc}var Kc,L0;function jO(){if(L0)return Kc;L0=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??t,!!i&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return Kc=n,Kc}var Zc,P0;function N0(){if(P0)return Zc;P0=1;var t=GO(),e=ia(),n=Vt(),r=Yi(),i=jO(),o=ma(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var f=n(c),d=!f&&e(c),h=!f&&!d&&r(c),p=!f&&!d&&!h&&o(c),m=f||d||h||p,g=m?t(c.length,String):[],y=g.length;for(var b in c)(u||a.call(c,b))&&!(m&&(b=="length"||h&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||i(b,y)))&&g.push(b);return g}return Zc=l,Zc}var $c,k0;function Jc(){if(k0)return $c;k0=1;var t=N0(),e=Zh(),n=ca();function r(i){return n(i)?t(i):e(i)}return $c=r,$c}var Qc,D0;function F0(){if(D0)return Qc;D0=1;var t=A0(),e=qc(),n=Jc();function r(i){return t(i,n,e)}return Qc=r,Qc}var el,B0;function HO(){if(B0)return el;B0=1;var t=F0(),e=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a,l,c,u){var f=a&e,d=t(o),h=d.length,p=t(s),m=p.length;if(h!=m&&!f)return!1;for(var g=h;g--;){var y=d[g];if(!(f?y in s:r.call(s,y)))return!1}var b=u.get(o),x=u.get(s);if(b&&x)return b==s&&x==o;var v=!0;u.set(o,s),u.set(s,o);for(var T=f;++g<h;){y=d[g];var w=o[y],O=s[y];if(l)var C=f?l(O,w,y,s,o,u):l(w,O,y,o,s,u);if(!(C===void 0?w===O||c(w,O,a,l,u):C)){v=!1;break}T||(T=y=="constructor")}if(v&&!T){var R=o.constructor,P=s.constructor;R!=P&&"constructor"in o&&"constructor"in s&&!(typeof R=="function"&&R instanceof R&&typeof P=="function"&&P instanceof P)&&(v=!1)}return u.delete(o),u.delete(s),v}return el=i,el}var tl,U0;function YO(){if(U0)return tl;U0=1;var t=f0(),e=_0(),n=BO(),r=HO(),i=Fr(),o=Vt(),s=Yi(),a=ma(),l=1,c="[object Arguments]",u="[object Array]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function p(m,g,y,b,x,v){var T=o(m),w=o(g),O=T?u:i(m),C=w?u:i(g);O=O==c?f:O,C=C==c?f:C;var R=O==f,P=C==f,A=O==C;if(A&&s(m)){if(!s(g))return!1;T=!0,R=!1}if(A&&!R)return v||(v=new t),T||a(m)?e(m,g,y,b,x,v):n(m,g,O,y,b,x,v);if(!(y&l)){var L=R&&h.call(m,"__wrapped__"),N=P&&h.call(g,"__wrapped__");if(L||N){var D=L?m.value():m,F=N?g.value():g;return v||(v=new t),x(D,F,y,b,v)}}return A?(v||(v=new t),r(m,g,y,b,x,v)):!1}return tl=p,tl}var nl,G0;function XO(){if(G0)return nl;G0=1;var t=YO(),e=dn();function n(r,i,o,s,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:t(r,i,o,s,n,a)}return nl=n,nl}var rl,j0;function WO(){if(j0)return rl;j0=1;var t=XO();function e(n,r){return t(n,r)}return rl=e,rl}var zO=WO();const qO=Jn(zO);var il,H0;function Y0(){if(H0)return il;H0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=n(e[r],r,e);return o}return il=t,il}var ol,X0;function VO(){if(X0)return ol;X0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i&&n(e[r],r,e)!==!1;);return e}return ol=t,ol}var sl,W0;function z0(){if(W0)return sl;W0=1;var t=Nn(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return sl=e,sl}var al,q0;function V0(){if(q0)return al;q0=1;var t=z0();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return al=e,al}var cl,K0;function Z0(){if(K0)return cl;K0=1;var t=V0(),e=nc(),n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a){var l=o[s];(!(r.call(o,s)&&e(l,a))||a===void 0&&!(s in o))&&t(o,s,a)}return cl=i,cl}var ll,$0;function Jr(){if($0)return ll;$0=1;var t=Z0(),e=V0();function n(r,i,o,s){var a=!o;o||(o={});for(var l=-1,c=i.length;++l<c;){var u=i[l],f=s?s(o[u],r[u],u,o,r):void 0;f===void 0&&(f=r[u]),a?e(o,u,f):t(o,u,f)}return o}return ll=n,ll}var ul,J0;function KO(){if(J0)return ul;J0=1;var t=Jr(),e=Jc();function n(r,i){return r&&t(i,e(i),r)}return ul=n,ul}var fl,Q0;function ZO(){if(Q0)return fl;Q0=1;function t(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}return fl=t,fl}var dl,eg;function $O(){if(eg)return dl;eg=1;var t=Pn(),e=Hi(),n=ZO(),r=Object.prototype,i=r.hasOwnProperty;function o(s){if(!t(s))return n(s);var a=e(s),l=[];for(var c in s)c=="constructor"&&(a||!i.call(s,c))||l.push(c);return l}return dl=o,dl}var hl,tg;function pl(){if(tg)return hl;tg=1;var t=N0(),e=$O(),n=ca();function r(i){return n(i)?t(i,!0):e(i)}return hl=r,hl}var ml,ng;function JO(){if(ng)return ml;ng=1;var t=Jr(),e=pl();function n(r,i){return r&&t(i,e(i),r)}return ml=n,ml}var Qr={exports:{}};Qr.exports;var rg;function QO(){return rg||(rg=1,(function(t,e){var n=St(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var f=c.length,d=a?a(f):new c.constructor(f);return c.copy(d),d}t.exports=l})(Qr,Qr.exports)),Qr.exports}var gl,ig;function eC(){if(ig)return gl;ig=1;function t(e,n){var r=-1,i=e.length;for(n||(n=Array(i));++r<i;)n[r]=e[r];return n}return gl=t,gl}var yl,og;function tC(){if(og)return yl;og=1;var t=Jr(),e=qc();function n(r,i){return t(r,e(r),i)}return yl=n,yl}var _l,sg;function bl(){if(sg)return _l;sg=1;var t=qh(),e=t(Object.getPrototypeOf,Object);return _l=e,_l}var xl,ag;function cg(){if(ag)return xl;ag=1;var t=Hc(),e=bl(),n=qc(),r=R0(),i=Object.getOwnPropertySymbols,o=i?function(s){for(var a=[];s;)t(a,n(s)),s=e(s);return a}:r;return xl=o,xl}var vl,lg;function nC(){if(lg)return vl;lg=1;var t=Jr(),e=cg();function n(r,i){return t(r,e(r),i)}return vl=n,vl}var Tl,ug;function fg(){if(ug)return Tl;ug=1;var t=A0(),e=cg(),n=pl();function r(i){return t(i,n,e)}return Tl=r,Tl}var El,dg;function rC(){if(dg)return El;dg=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return El=n,El}var Sl,hg;function wl(){if(hg)return Sl;hg=1;var t=x0();function e(n){var r=new n.constructor(n.byteLength);return new t(r).set(new t(n)),r}return Sl=e,Sl}var Al,pg;function iC(){if(pg)return Al;pg=1;var t=wl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return Al=e,Al}var Ol,mg;function oC(){if(mg)return Ol;mg=1;var t=/\w*$/;function e(n){var r=new n.constructor(n.source,t.exec(n));return r.lastIndex=n.lastIndex,r}return Ol=e,Ol}var Cl,gg;function sC(){if(gg)return Cl;gg=1;var t=er(),e=t?t.prototype:void 0,n=e?e.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return Cl=r,Cl}var Rl,yg;function aC(){if(yg)return Rl;yg=1;var t=wl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return Rl=e,Rl}var Il,_g;function cC(){if(_g)return Il;_g=1;var t=wl(),e=iC(),n=oC(),r=sC(),i=aC(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",f="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",x="[object Int32Array]",v="[object Uint8Array]",T="[object Uint8ClampedArray]",w="[object Uint16Array]",O="[object Uint32Array]";function C(R,P,A){var L=R.constructor;switch(P){case h:return t(R);case o:case s:return new L(+R);case p:return e(R,A);case m:case g:case y:case b:case x:case v:case T:case w:case O:return i(R,A);case a:return new L;case l:case f:return new L(R);case c:return n(R);case u:return new L;case d:return r(R)}}return Il=C,Il}var Ml,bg;function lC(){if(bg)return Ml;bg=1;var t=Pn(),e=Object.create,n=(function(){function r(){}return function(i){if(!t(i))return{};if(e)return e(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return Ml=n,Ml}var Ll,xg;function uC(){if(xg)return Ll;xg=1;var t=lC(),e=bl(),n=Hi();function r(i){return typeof i.constructor=="function"&&!n(i)?t(e(i)):{}}return Ll=r,Ll}var Pl,vg;function fC(){if(vg)return Pl;vg=1;var t=Fr(),e=dn(),n="[object Map]";function r(i){return e(i)&&t(i)==n}return Pl=r,Pl}var Nl,Tg;function dC(){if(Tg)return Nl;Tg=1;var t=fC(),e=da(),n=ha(),r=n&&n.isMap,i=r?e(r):t;return Nl=i,Nl}var kl,Eg;function hC(){if(Eg)return kl;Eg=1;var t=Fr(),e=dn(),n="[object Set]";function r(i){return e(i)&&t(i)==n}return kl=r,kl}var Dl,Sg;function pC(){if(Sg)return Dl;Sg=1;var t=hC(),e=da(),n=ha(),r=n&&n.isSet,i=r?e(r):t;return Dl=i,Dl}var Fl,wg;function mC(){if(wg)return Fl;wg=1;var t=f0(),e=VO(),n=Z0(),r=KO(),i=JO(),o=QO(),s=eC(),a=tC(),l=nC(),c=F0(),u=fg(),f=Fr(),d=rC(),h=cC(),p=uC(),m=Vt(),g=Yi(),y=dC(),b=Pn(),x=pC(),v=Jc(),T=pl(),w=1,O=2,C=4,R="[object Arguments]",P="[object Array]",A="[object Boolean]",L="[object Date]",N="[object Error]",D="[object Function]",F="[object GeneratorFunction]",G="[object Map]",z="[object Number]",K="[object Object]",ae="[object RegExp]",pe="[object Set]",X="[object String]",he="[object Symbol]",j="[object WeakMap]",$="[object ArrayBuffer]",H="[object DataView]",ce="[object Float32Array]",Z="[object Float64Array]",se="[object Int8Array]",J="[object Int16Array]",ie="[object Int32Array]",xe="[object Uint8Array]",Y="[object Uint8ClampedArray]",Oe="[object Uint16Array]",ge="[object Uint32Array]",re={};re[R]=re[P]=re[$]=re[H]=re[A]=re[L]=re[ce]=re[Z]=re[se]=re[J]=re[ie]=re[G]=re[z]=re[K]=re[ae]=re[pe]=re[X]=re[he]=re[xe]=re[Y]=re[Oe]=re[ge]=!0,re[N]=re[D]=re[j]=!1;function we(me,Ue,qe,pt,Mt,ve){var Me,ct=Ue&w,ze=Ue&O,Se=Ue&C;if(qe&&(Me=Mt?qe(me,pt,Mt,ve):qe(me)),Me!==void 0)return Me;if(!b(me))return me;var De=m(me);if(De){if(Me=d(me),!ct)return s(me,Me)}else{var Ie=f(me),Ge=Ie==D||Ie==F;if(g(me))return o(me,ct);if(Ie==K||Ie==R||Ge&&!Mt){if(Me=ze||Ge?{}:p(me),!ct)return ze?l(me,i(Me,me)):a(me,r(Me,me))}else{if(!re[Ie])return Mt?me:{};Me=h(me,Ie,ct)}}ve||(ve=new t);var je=ve.get(me);if(je)return je;ve.set(me,Me),x(me)?me.forEach(function(Ve){Me.add(we(Ve,Ue,qe,Ve,me,ve))}):y(me)&&me.forEach(function(Ve,ot){Me.set(ot,we(Ve,Ue,qe,ot,me,ve))});var Le=Se?ze?u:c:ze?T:v,lt=De?void 0:Le(me);return e(lt||me,function(Ve,ot){lt&&(ot=Ve,Ve=me[ot]),n(Me,ot,we(Ve,Ue,qe,ot,me,ve))}),Me}return Fl=we,Fl}var Bl,Ag;function co(){if(Ag)return Bl;Ag=1;var t=tr(),e=dn(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return Bl=r,Bl}var Ul,Og;function gC(){if(Og)return Ul;Og=1;var t=Vt(),e=co(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(t(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||e(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return Ul=i,Ul}var Gl,Cg;function yC(){if(Cg)return Gl;Cg=1;var t=Cc(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var o=function(){var s=arguments,a=i?i.apply(this,s):s[0],l=o.cache;if(l.has(a))return l.get(a);var c=r.apply(this,s);return o.cache=l.set(a,c)||l,c};return o.cache=new(n.Cache||t),o}return n.Cache=t,Gl=n,Gl}var jl,Rg;function _C(){if(Rg)return jl;Rg=1;var t=yC(),e=500;function n(r){var i=t(r,function(s){return o.size===e&&o.clear(),s}),o=i.cache;return i}return jl=n,jl}var Hl,Ig;function bC(){if(Ig)return Hl;Ig=1;var t=_C(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(e,function(s,a,l,c){o.push(l?c.replace(n,"$1"):a||s)}),o});return Hl=r,Hl}var Yl,Mg;function xC(){if(Mg)return Yl;Mg=1;var t=er(),e=Y0(),n=Vt(),r=co(),i=t?t.prototype:void 0,o=i?i.toString:void 0;function s(a){if(typeof a=="string")return a;if(n(a))return e(a,s)+"";if(r(a))return o?o.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return Yl=s,Yl}var Xl,Lg;function vC(){if(Lg)return Xl;Lg=1;var t=xC();function e(n){return n==null?"":t(n)}return Xl=e,Xl}var Wl,Pg;function zl(){if(Pg)return Wl;Pg=1;var t=Vt(),e=gC(),n=bC(),r=vC();function i(o,s){return t(o)?o:e(o,s)?[o]:n(r(o))}return Wl=i,Wl}var ql,Ng;function TC(){if(Ng)return ql;Ng=1;function t(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}return ql=t,ql}var Vl,kg;function Dg(){if(kg)return Vl;kg=1;var t=co();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Vl=e,Vl}var Kl,Fg;function EC(){if(Fg)return Kl;Fg=1;var t=zl(),e=Dg();function n(r,i){i=t(i,r);for(var o=0,s=i.length;r!=null&&o<s;)r=r[e(i[o++])];return o&&o==s?r:void 0}return Kl=n,Kl}var Zl,Bg;function SC(){if(Bg)return Zl;Bg=1;function t(e,n,r){var i=-1,o=e.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(o);++i<o;)s[i]=e[i+n];return s}return Zl=t,Zl}var $l,Ug;function wC(){if(Ug)return $l;Ug=1;var t=EC(),e=SC();function n(r,i){return i.length<2?r:t(r,e(i,0,-1))}return $l=n,$l}var Jl,Gg;function AC(){if(Gg)return Jl;Gg=1;var t=zl(),e=TC(),n=wC(),r=Dg();function i(o,s){return s=t(s,o),o=n(o,s),o==null||delete o[r(e(s))]}return Jl=i,Jl}var Ql,jg;function OC(){if(jg)return Ql;jg=1;var t=tr(),e=bl(),n=dn(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(u){if(!n(u)||t(u)!=r)return!1;var f=e(u);if(f===null)return!0;var d=a.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&s.call(d)==l}return Ql=c,Ql}var eu,Hg;function CC(){if(Hg)return eu;Hg=1;var t=OC();function e(n){return t(n)?void 0:n}return eu=e,eu}var tu,Yg;function RC(){if(Yg)return tu;Yg=1;var t=er(),e=ia(),n=Vt(),r=t?t.isConcatSpreadable:void 0;function i(o){return n(o)||e(o)||!!(r&&o&&o[r])}return tu=i,tu}var nu,Xg;function IC(){if(Xg)return nu;Xg=1;var t=Hc(),e=RC();function n(r,i,o,s,a){var l=-1,c=r.length;for(o||(o=e),a||(a=[]);++l<c;){var u=r[l];i>0&&o(u)?i>1?n(u,i-1,o,s,a):t(a,u):s||(a[a.length]=u)}return a}return nu=n,nu}var ru,Wg;function MC(){if(Wg)return ru;Wg=1;var t=IC();function e(n){var r=n==null?0:n.length;return r?t(n,1):[]}return ru=e,ru}var iu,zg;function LC(){if(zg)return iu;zg=1;function t(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}return iu=t,iu}var ou,qg;function PC(){if(qg)return ou;qg=1;var t=LC(),e=Math.max;function n(r,i,o){return i=e(i===void 0?r.length-1:i,0),function(){for(var s=arguments,a=-1,l=e(s.length-i,0),c=Array(l);++a<l;)c[a]=s[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=s[a];return u[i]=o(c),t(r,this,u)}}return ou=n,ou}var su,Vg;function NC(){if(Vg)return su;Vg=1;function t(e){return function(){return e}}return su=t,su}var au,Kg;function kC(){if(Kg)return au;Kg=1;function t(e){return e}return au=t,au}var cu,Zg;function DC(){if(Zg)return cu;Zg=1;var t=NC(),e=z0(),n=kC(),r=e?function(i,o){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n;return cu=r,cu}var lu,$g;function FC(){if($g)return lu;$g=1;var t=800,e=16,n=Date.now;function r(i){var o=0,s=0;return function(){var a=n(),l=e-(a-s);if(s=a,l>0){if(++o>=t)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return lu=r,lu}var uu,Jg;function BC(){if(Jg)return uu;Jg=1;var t=DC(),e=FC(),n=e(t);return uu=n,uu}var fu,Qg;function UC(){if(Qg)return fu;Qg=1;var t=MC(),e=PC(),n=BC();function r(i){return n(e(i,void 0,t),i+"")}return fu=r,fu}var du,ey;function GC(){if(ey)return du;ey=1;var t=Y0(),e=mC(),n=AC(),r=zl(),i=Jr(),o=CC(),s=UC(),a=fg(),l=1,c=2,u=4,f=s(function(d,h){var p={};if(d==null)return p;var m=!1;h=t(h,function(y){return y=r(y,d),m||(m=y.length>1),y}),i(d,a(d),p),m&&(p=e(p,l|c|u,o));for(var g=h.length;g--;)n(p,h[g]);return p});return du=f,du}var jC=GC();const ty=Jn(jC),ny=["mouseOverSpriteRef","mouseOverTransformerRef","spriteHelperRef","canvasImageRef","textEditorRef","onContainerRefReady","onSpriteRefReady"];function tt(t,e,n=[]){if(e.mouseOverTransformerRef?.current?.isDragging)return!0;const i=[...ny,...n];return qO(ty(t,i),ty(e,i))}const HC=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),{src:s,uniqueId:a,visible:l,disabled:c,mouseOverSpriteRef:u,transformation:{x:f,y:d,width:h,height:p,anchor:m,colorCorrection:g,effect:y,effects:b,neonColor:x,blendMode:v,border:T,roundedCorners:w,maskShape:O,crop:C,plateKey:R},pointerdown:P}=e,A=Qa(s)||void 0,L=ut({colorCorrection:g,effects:b??{name:y},neonColor:x,blendMode:v,plateKey:R});S.useEffect(()=>{if(!A){r(null);return}const G=ro(A);let z=!0;return G.promise.then(K=>{z&&r(K)}),()=>{z=!1,G.cancel(),r(null),G.dispose()}},[A]),S.useEffect(()=>()=>{u&&(u.current=!1)},[u]);const N=h&&h>0?h:n?.orig?.width||0,D=p&&p>0?p:n?.orig?.height||0,F=!!n&&n!==W.Texture.EMPTY;return M.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:o,children:M.jsx(Ot,{x:f,y:d,width:N,height:D,border:T,roundedCorners:w,maskShape:O,crop:C,spriteRef:i,children:F&&M.jsx("pixiSprite",{label:`sprite-${a}`,texture:n,width:N,height:D,anchor:m,ref:i,alpha:l?1:0,x:f,y:d,filters:L,...!c&&l&&{eventMode:"static",onPointerDown:P}})})})})},hu=I.memo(HC,(t,e)=>tt(t,e,["isDragging"]));hu.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};var pu,ry;function YC(){if(ry)return pu;ry=1;var t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(h){return h===10||h===13||h===8232||h===8233||h===32||h===9||h===11||h===12||h===160||h>=5760&&e.indexOf(h)>=0}function r(h){switch(h|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function i(h){return(h|32)===97}function o(h){return h>=48&&h<=57}function s(h){return h>=48&&h<=57||h===43||h===45||h===46}function a(h){this.index=0,this.path=h,this.max=h.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function l(h){for(;h.index<h.max&&n(h.path.charCodeAt(h.index));)h.index++}function c(h){var p=h.path.charCodeAt(h.index);if(p===48){h.param=0,h.index++;return}if(p===49){h.param=1,h.index++;return}h.err="SvgPath: arc flag can be 0 or 1 only (at pos "+h.index+")"}function u(h){var p=h.index,m=p,g=h.max,y=!1,b=!1,x=!1,v=!1,T;if(m>=g){h.err="SvgPath: missed param (at pos "+m+")";return}if(T=h.path.charCodeAt(m),(T===43||T===45)&&(m++,T=m<g?h.path.charCodeAt(m):0),!o(T)&&T!==46){h.err="SvgPath: param should start with 0..9 or `.` (at pos "+m+")";return}if(T!==46){if(y=T===48,m++,T=m<g?h.path.charCodeAt(m):0,y&&m<g&&T&&o(T)){h.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+p+")";return}for(;m<g&&o(h.path.charCodeAt(m));)m++,b=!0;T=m<g?h.path.charCodeAt(m):0}if(T===46){for(v=!0,m++;o(h.path.charCodeAt(m));)m++,x=!0;T=m<g?h.path.charCodeAt(m):0}if(T===101||T===69){if(v&&!b&&!x){h.err="SvgPath: invalid float exponent (at pos "+m+")";return}if(m++,T=m<g?h.path.charCodeAt(m):0,(T===43||T===45)&&m++,m<g&&o(h.path.charCodeAt(m)))for(;m<g&&o(h.path.charCodeAt(m));)m++;else{h.err="SvgPath: invalid float exponent (at pos "+m+")";return}}h.index=m,h.param=parseFloat(h.path.slice(p,m))+0}function f(h){var p,m;p=h.path[h.segmentStart],m=p.toLowerCase();var g=h.data;if(m==="m"&&g.length>2&&(h.result.push([p,g[0],g[1]]),g=g.slice(2),m="l",p=p==="m"?"l":"L"),m==="r")h.result.push([p].concat(g));else for(;g.length>=t[m]&&(h.result.push([p].concat(g.splice(0,t[m]))),!!t[m]););}function d(h){var p=h.max,m,g,y,b,x;if(h.segmentStart=h.index,m=h.path.charCodeAt(h.index),g=i(m),!r(m)){h.err="SvgPath: bad command "+h.path[h.index]+" (at pos "+h.index+")";return}if(b=t[h.path[h.index].toLowerCase()],h.index++,l(h),h.data=[],!b){f(h);return}for(y=!1;;){for(x=b;x>0;x--){if(g&&(x===3||x===4)?c(h):u(h),h.err.length){f(h);return}h.data.push(h.param),l(h),y=!1,h.index<p&&h.path.charCodeAt(h.index)===44&&(h.index++,l(h),y=!0)}if(!y&&(h.index>=h.max||!s(h.path.charCodeAt(h.index))))break}f(h)}return pu=function(p){var m=new a(p),g=m.max;for(l(m);m.index<g&&!m.err.length;)d(m);return m.result.length&&("mM".indexOf(m.result[0][0])<0?(m.err="SvgPath: string should start with `M` or `m`",m.result=[]):m.result[0][0]="M"),{err:m.err,segments:m.result}},pu}var mu,iy;function oy(){if(iy)return mu;iy=1;function t(n,r){return[n[0]*r[0]+n[2]*r[1],n[1]*r[0]+n[3]*r[1],n[0]*r[2]+n[2]*r[3],n[1]*r[2]+n[3]*r[3],n[0]*r[4]+n[2]*r[5]+n[4],n[1]*r[4]+n[3]*r[5]+n[5]]}function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}return e.prototype.matrix=function(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0?this:(this.cache=null,this.queue.push(n),this)},e.prototype.translate=function(n,r){return(n!==0||r!==0)&&(this.cache=null,this.queue.push([1,0,0,1,n,r])),this},e.prototype.scale=function(n,r){return(n!==1||r!==1)&&(this.cache=null,this.queue.push([n,0,0,r,0,0])),this},e.prototype.rotate=function(n,r,i){var o,s,a;return n!==0&&(this.translate(r,i),o=n*Math.PI/180,s=Math.cos(o),a=Math.sin(o),this.queue.push([s,a,-a,s,0,0]),this.cache=null,this.translate(-r,-i)),this},e.prototype.skewX=function(n){return n!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(n*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(n){return n!==0&&(this.cache=null,this.queue.push([1,Math.tan(n*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var n=1;n<this.queue.length;n++)this.cache=t(this.cache,this.queue[n]);return this.cache},e.prototype.calc=function(n,r,i){var o;return this.queue.length?(this.cache||(this.cache=this.toArray()),o=this.cache,[n*o[0]+r*o[2]+(i?0:o[4]),n*o[1]+r*o[3]+(i?0:o[5])]):[n,r]},mu=e,mu}var gu,sy;function XC(){if(sy)return gu;sy=1;var t=oy(),e={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},n=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,r=/[\s,]+/;return gu=function(o){var s=new t,a,l;return o.split(n).forEach(function(c){if(c.length){if(typeof e[c]<"u"){a=c;return}switch(l=c.split(r).map(function(u){return+u||0}),a){case"matrix":l.length===6&&s.matrix(l);return;case"scale":l.length===1?s.scale(l[0],l[0]):l.length===2&&s.scale(l[0],l[1]);return;case"rotate":l.length===1?s.rotate(l[0],0,0):l.length===3&&s.rotate(l[0],l[1],l[2]);return;case"translate":l.length===1?s.translate(l[0],0):l.length===2&&s.translate(l[0],l[1]);return;case"skewX":l.length===1&&s.skewX(l[0]);return;case"skewY":l.length===1&&s.skewY(l[0]);return}}}),s},gu}var yu,ay;function WC(){if(ay)return yu;ay=1;var t=Math.PI*2;function e(i,o,s,a){var l=i*a-o*s<0?-1:1,c=i*s+o*a;return c>1&&(c=1),c<-1&&(c=-1),l*Math.acos(c)}function n(i,o,s,a,l,c,u,f,d,h){var p=h*(i-s)/2+d*(o-a)/2,m=-d*(i-s)/2+h*(o-a)/2,g=u*u,y=f*f,b=p*p,x=m*m,v=g*y-g*x-y*b;v<0&&(v=0),v/=g*x+y*b,v=Math.sqrt(v)*(l===c?-1:1);var T=v*u/f*m,w=v*-f/u*p,O=h*T-d*w+(i+s)/2,C=d*T+h*w+(o+a)/2,R=(p-T)/u,P=(m-w)/f,A=(-p-T)/u,L=(-m-w)/f,N=e(1,0,R,P),D=e(R,P,A,L);return c===0&&D>0&&(D-=t),c===1&&D<0&&(D+=t),[O,C,N,D]}function r(i,o){var s=1.3333333333333333*Math.tan(o/4),a=Math.cos(i),l=Math.sin(i),c=Math.cos(i+o),u=Math.sin(i+o);return[a,l,a-l*s,l+a*s,c+u*s,u-c*s,c,u]}return yu=function(o,s,a,l,c,u,f,d,h){var p=Math.sin(h*t/360),m=Math.cos(h*t/360),g=m*(o-a)/2+p*(s-l)/2,y=-p*(o-a)/2+m*(s-l)/2;if(g===0&&y===0)return[];if(f===0||d===0)return[];f=Math.abs(f),d=Math.abs(d);var b=g*g/(f*f)+y*y/(d*d);b>1&&(f*=Math.sqrt(b),d*=Math.sqrt(b));var x=n(o,s,a,l,c,u,f,d,p,m),v=[],T=x[2],w=x[3],O=Math.max(Math.ceil(Math.abs(w)/(t/4)),1);w/=O;for(var C=0;C<O;C++)v.push(r(T,w)),T+=w;return v.map(function(R){for(var P=0;P<R.length;P+=2){var A=R[P+0],L=R[P+1];A*=f,L*=d;var N=m*A-p*L,D=p*A+m*L;R[P+0]=N+x[0],R[P+1]=D+x[1]}return R})},yu}var _u,cy;function zC(){if(cy)return _u;cy=1;var t=1e-10,e=Math.PI/180;function n(r,i,o){if(!(this instanceof n))return new n(r,i,o);this.rx=r,this.ry=i,this.ax=o}return n.prototype.transform=function(r){var i=Math.cos(this.ax*e),o=Math.sin(this.ax*e),s=[this.rx*(r[0]*i+r[2]*o),this.rx*(r[1]*i+r[3]*o),this.ry*(-r[0]*o+r[2]*i),this.ry*(-r[1]*o+r[3]*i)],a=s[0]*s[0]+s[2]*s[2],l=s[1]*s[1]+s[3]*s[3],c=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(a+l)/2;if(c<t*u)return this.rx=this.ry=Math.sqrt(u),this.ax=0,this;var f=s[0]*s[1]+s[2]*s[3];c=Math.sqrt(c);var d=u+c/2,h=u-c/2;return this.ax=Math.abs(f)<t&&Math.abs(d-l)<t?90:Math.atan(Math.abs(f)>Math.abs(d-l)?(d-a)/f:f/(d-l))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)):(this.ax+=90,this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)),this},n.prototype.isDegenerate=function(){return this.rx<t*this.ry||this.ry<t*this.rx},_u=n,_u}var bu,ly;function qC(){if(ly)return bu;ly=1;var t=YC(),e=XC(),n=oy(),r=WC(),i=zC();function o(s){if(!(this instanceof o))return new o(s);var a=t(s);this.segments=a.segments,this.err=a.err,this.__stack=[]}return o.from=function(s){if(typeof s=="string")return new o(s);if(s instanceof o){var a=new o("");return a.err=s.err,a.segments=s.segments.map(function(l){return l.slice()}),a.__stack=s.__stack.map(function(l){return n().matrix(l.toArray())}),a}throw new Error("SvgPath.from: invalid param type "+s)},o.prototype.__matrix=function(s){var a=this,l;s.queue.length&&this.iterate(function(c,u,f,d){var h,p,m,g;switch(c[0]){case"v":h=s.calc(0,c[1],!0),p=h[0]===0?["v",h[1]]:["l",h[0],h[1]];break;case"V":h=s.calc(f,c[1],!1),p=h[0]===s.calc(f,d,!1)[0]?["V",h[1]]:["L",h[0],h[1]];break;case"h":h=s.calc(c[1],0,!0),p=h[1]===0?["h",h[0]]:["l",h[0],h[1]];break;case"H":h=s.calc(c[1],d,!1),p=h[1]===s.calc(f,d,!1)[1]?["H",h[0]]:["L",h[0],h[1]];break;case"a":case"A":var y=s.toArray(),b=i(c[1],c[2],c[3]).transform(y);if(y[0]*y[3]-y[1]*y[2]<0&&(c[5]=c[5]?"0":"1"),h=s.calc(c[6],c[7],c[0]==="a"),c[0]==="A"&&c[6]===f&&c[7]===d||c[0]==="a"&&c[6]===0&&c[7]===0){p=[c[0]==="a"?"l":"L",h[0],h[1]];break}b.isDegenerate()?p=[c[0]==="a"?"l":"L",h[0],h[1]]:p=[c[0],b.rx,b.ry,b.ax,c[4],c[5],h[0],h[1]];break;case"m":g=u>0,h=s.calc(c[1],c[2],g),p=["m",h[0],h[1]];break;default:for(m=c[0],p=[m],g=m.toLowerCase()===m,l=1;l<c.length;l+=2)h=s.calc(c[l],c[l+1],g),p.push(h[0],h[1])}a.segments[u]=p},!0)},o.prototype.__evaluateStack=function(){var s,a;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(s=n(),a=this.__stack.length;--a>=0;)s.matrix(this.__stack[a].toArray());this.__matrix(s),this.__stack=[]}},o.prototype.toString=function(){var s="",a="",l=!1;this.__evaluateStack();for(var c=0,u=this.segments.length;c<u;c++){var f=this.segments[c],d=f[0];d!==a||d==="m"||d==="M"?(d==="m"&&a==="z"&&(s+=" "),s+=d,l=!1):l=!0;for(var h=1;h<f.length;h++){var p=f[h];h===1?l&&p>=0&&(s+=" "):p>=0&&(s+=" "),s+=p}a=d}return s},o.prototype.translate=function(s,a){return this.__stack.push(n().translate(s,a||0)),this},o.prototype.scale=function(s,a){return this.__stack.push(n().scale(s,!a&&a!==0?s:a)),this},o.prototype.rotate=function(s,a,l){return this.__stack.push(n().rotate(s,a||0,l||0)),this},o.prototype.skewX=function(s){return this.__stack.push(n().skewX(s)),this},o.prototype.skewY=function(s){return this.__stack.push(n().skewY(s)),this},o.prototype.matrix=function(s){return this.__stack.push(n().matrix(s)),this},o.prototype.transform=function(s){return s.trim()?(this.__stack.push(e(s)),this):this},o.prototype.round=function(s){var a=0,l=0,c=0,u=0,f;return s=s||0,this.__evaluateStack(),this.segments.forEach(function(d){var h=d[0].toLowerCase()===d[0];switch(d[0]){case"H":case"h":h&&(d[1]+=c),c=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"V":case"v":h&&(d[1]+=u),u=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"Z":case"z":c=a,u=l;return;case"M":case"m":h&&(d[1]+=c,d[2]+=u),c=d[1]-d[1].toFixed(s),u=d[2]-d[2].toFixed(s),a=c,l=u,d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s);return;case"A":case"a":h&&(d[6]+=c,d[7]+=u),c=d[6]-d[6].toFixed(s),u=d[7]-d[7].toFixed(s),d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s),d[3]=+d[3].toFixed(s+2),d[6]=+d[6].toFixed(s),d[7]=+d[7].toFixed(s);return;default:f=d.length,h&&(d[f-2]+=c,d[f-1]+=u),c=d[f-2]-d[f-2].toFixed(s),u=d[f-1]-d[f-1].toFixed(s),d.forEach(function(p,m){m&&(d[m]=+d[m].toFixed(s))});return}}),this},o.prototype.iterate=function(s,a){var l=this.segments,c={},u=!1,f=0,d=0,h=0,p=0,m,g,y;if(a||this.__evaluateStack(),l.forEach(function(b,x){var v=s(b,x,f,d);Array.isArray(v)&&(c[x]=v,u=!0);var T=b[0]===b[0].toLowerCase();switch(b[0]){case"m":case"M":f=b[1]+(T?f:0),d=b[2]+(T?d:0),h=f,p=d;return;case"h":case"H":f=b[1]+(T?f:0);return;case"v":case"V":d=b[1]+(T?d:0);return;case"z":case"Z":f=h,d=p;return;default:f=b[b.length-2]+(T?f:0),d=b[b.length-1]+(T?d:0)}}),!u)return this;for(y=[],m=0;m<l.length;m++)if(typeof c[m]<"u")for(g=0;g<c[m].length;g++)y.push(c[m][g]);else y.push(l[m]);return this.segments=y,this},o.prototype.abs=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toUpperCase(),d;if(u!==f)switch(s[0]=f,u){case"v":s[1]+=c;return;case"a":s[6]+=l,s[7]+=c;return;default:for(d=1;d<s.length;d++)s[d]+=d%2?l:c}},!0),this},o.prototype.rel=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toLowerCase(),d;if(u!==f&&!(a===0&&u==="M"))switch(s[0]=f,u){case"V":s[1]-=c;return;case"A":s[6]-=l,s[7]-=c;return;default:for(d=1;d<s.length;d++)s[d]-=d%2?l:c}},!0),this},o.prototype.unarc=function(){return this.iterate(function(s,a,l,c){var u,f,d,h=[],p=s[0];return p!=="A"&&p!=="a"?null:(p==="a"?(f=l+s[6],d=c+s[7]):(f=s[6],d=s[7]),u=r(l,c,f,d,s[4],s[5],s[1],s[2],s[3]),u.length===0?[[s[0]==="a"?"l":"L",s[6],s[7]]]:(u.forEach(function(m){h.push(["C",m[2],m[3],m[4],m[5],m[6],m[7]])}),h))}),this},o.prototype.unshort=function(){var s=this.segments,a,l,c,u,f;return this.iterate(function(d,h,p,m){var g=d[0],y=g.toUpperCase(),b;h&&(y==="T"?(b=g==="t",c=s[h-1],c[0]==="Q"?(a=c[1]-p,l=c[2]-m):c[0]==="q"?(a=c[1]-c[3],l=c[2]-c[4]):(a=0,l=0),u=-a,f=-l,b||(u+=p,f+=m),s[h]=[b?"q":"Q",u,f,d[1],d[2]]):y==="S"&&(b=g==="s",c=s[h-1],c[0]==="C"?(a=c[3]-p,l=c[4]-m):c[0]==="c"?(a=c[3]-c[5],l=c[4]-c[6]):(a=0,l=0),u=-a,f=-l,b||(u+=p,f+=m),s[h]=[b?"c":"C",u,f,d[1],d[2],d[3],d[4]]))}),this},bu=o,bu}var xu,uy;function VC(){return uy||(uy=1,xu=qC()),xu}var KC=VC();const ZC=Jn(KC),fy=2,dy=t=>{const e=t.getAttribute("viewBox");if(e){const i=e.trim().split(/[\s,]+/);if(i.length>=4)return Math.max(parseFloat(i[2])||512,parseFloat(i[3])||512)}const n=parseFloat(t.getAttribute("width")||"")||512,r=parseFloat(t.getAttribute("height")||"")||512;return Math.max(n,r)},hy=t=>t.getAttribute("fill")==="none"||t.querySelector('[fill="none"]')!==null||t.querySelector("[stroke]")!==null,$C=({shouldApply:t,strokeWidth:e,resolution:n,renderWidth:r,renderHeight:i,originalSize:o,isOutline:s})=>{if(t&&e>0){const u=e*n;if(s){const d=Math.min(r,i)/o;return u/d}const f=Math.max(r,i);return u*(o/f)}const l=Math.max(r,i)/n/o,c=s?2:1.5;return Math.max(fy*l,c*n)},JC=(t,e,n)=>{t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(n)),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.querySelectorAll("path, rect, circle, ellipse, polygon, polyline, line").forEach(r=>{r.setAttribute("stroke",e),r.setAttribute("stroke-width",String(n)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");const i=r.getAttribute("fill");(i==="none"||!i)&&r.setAttribute("fill","none")})},QC=(t,e,n,r,i,o)=>{const s=t.getElementsByTagName("*");for(let a=0;a<s.length;a++){const l=s[a];if(l.hasAttribute("stroke-width")){const c=parseFloat(l.getAttribute("stroke-width")||"")||fy;l.setAttribute("stroke-width",String(Math.max(c*e,n*r*(i/o))))}}};function py(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.querySelector("svg");if(!r)return t;const{resolution:i,stroke:o,strokeWidth:s}=e,a=dy(r),l=hy(r),c=e.width||a,u=e.height||a,f=c*i,d=u*i,h=!!o&&(s||0)>0,p=$C({shouldApply:h,strokeWidth:s||0,resolution:i,renderWidth:f,renderHeight:d,originalSize:a,isOutline:l});if(r.getAttribute("viewBox")||r.setAttribute("viewBox",`0 0 ${a} ${a}`),r.setAttribute("width",String(f)),r.setAttribute("height",String(d)),r.setAttribute("preserveAspectRatio",l?"xMidYMid meet":"none"),h)JC(r,o,p);else if(l){const m=Math.max(c,u);QC(r,m/a,2,i,a,Math.max(f,d))}return new XMLSerializer().serializeToString(n)}function my(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.documentElement;if(r.tagName!=="svg")return t;if(!r.getAttribute("viewBox")){const i=parseFloat(r.getAttribute("width")||"")||e.width,o=parseFloat(r.getAttribute("height")||"")||e.height;r.setAttribute("viewBox",`0 0 ${i} ${o}`)}return r.setAttribute("width",String(e.width)),r.setAttribute("height",String(e.height)),e.fill&&r.setAttribute("fill",e.fill),e.stroke&&r.setAttribute("stroke",e.stroke),e.strokeWidth!=null&&r.setAttribute("stroke-width",String(e.strokeWidth)),new XMLSerializer().serializeToString(n)}const gy=t=>{const e=t.toLowerCase();return e.includes(".svg")||e.startsWith("data:image/svg")};function ei(t,e){const[n,r]=S.useState(t);return S.useEffect(()=>{if(Object.is(n,t))return;const i=setTimeout(()=>r(t),Math.max(0,e));return()=>clearTimeout(i)},[t,e]),n}const eR=({ref:t,...e})=>{const n=S.useRef(null),[r,i]=S.useState(null),{app:o}=at.useApplication(),{src:s,visible:a,mouseOverSpriteRef:l,transformation:{x:c,y:u,width:f,height:d,colorCorrection:h,effect:p,effects:m,neonColor:g,blendMode:y,border:b,roundedCorners:x,crop:v,fill:T,stroke:w,strokeWidth:O}}=e,C=ut({colorCorrection:h,effects:m??{name:p},neonColor:g,blendMode:y}),R=ei(f,120),P=ei(d,120);return S.useEffect(()=>{if(!s||!o?.renderer)return;let A=!1,L=null;return(async()=>{try{const D=Math.max(window.devicePixelRatio||2,2),F=Math.max((R||512)*D,512),G=Math.max((P||512)*D,512),z=await fetch(s);if(A||!z.ok)return;const K=await z.text();if(A)return;const ae=new W.Graphics().svg(my(K,{width:F,height:G,fill:T,stroke:w,strokeWidth:O}));try{L=o.renderer.generateTexture(ae)}finally{ae.destroy()}if(A){L.destroy(!0),L=null;return}i(L)}catch{}})(),()=>{if(A=!0,L){const D=L;L=null,i(F=>F===D?null:F);try{D.destroy(!0)}catch{}}}},[o,s,T,w,O,R,P]),S.useEffect(()=>()=>{l&&(l.current=!1)},[l]),M.jsx(Je,{...e,ref:t,children:M.jsx(Ot,{x:c,y:u,width:f,height:d,border:b,roundedCorners:x,crop:v,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r??W.Texture.EMPTY,alpha:r&&a?1:0,x:c,y:u,anchor:.5,width:f,height:d,filters:C,eventMode:"none"})})})},yy=I.memo(eR,(t,e)=>tt(t,e,["isDragging"])),tR=({ref:t,...e})=>e.src&&!e.path&&!e.svg?M.jsx(yy,{...e,ref:t}):M.jsx(nR,{...e,ref:t}),nR=({ref:t,...e})=>{const[n,r]=I.useState(null),i=S.useRef(null),o=S.useRef(null),s=S.useRef(null),{path:a,svg:l,visible:c,disabled:u,transformation:{x:f,y:d,width:h,height:p,anchor:m,hexColor:g,fill:y,stroke:b="none",strokeWidth:x=0,colorCorrection:v={},effect:T},pointerdown:w,pointerup:O}=e,{app:C}=at.useApplication(),R=ut({colorCorrection:v,effects:{name:T}});return S.useEffect(()=>{if(!C?.renderer)return;let P;if(l)P=l;else if(a){const N=ZC(a).scale(5).translate(0,0).toString();P=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${p}">
|
|
1417
|
+
`;class ZA extends B.Filter{plate;constructor(e,n=.16,r=.05){const i=B.GlProgram.from({vertex:no,fragment:KA,name:"plate-key-filter"});super({glProgram:i,resources:{plateUniforms:{uKeyColor:{value:new Float32Array(e),type:"vec3<f32>"},uTolerance:{value:n,type:"f32"},uSoftness:{value:r,type:"f32"}}}}),this.plate=this.resources.plateUniforms.uniforms}get tolerance(){return this.plate.uTolerance}set tolerance(e){this.plate.uTolerance=e}set keyColor(e){this.plate.uKeyColor[0]=e[0],this.plate.uKeyColor[1]=e[1],this.plate.uKeyColor[2]=e[2]}}function $A(t){if(t==null)return null;if(typeof t=="number")return[(t>>16&255)/255,(t>>8&255)/255,(t&255)/255];const e=t.trim(),n=/^#?([0-9a-f]{6})$/i.exec(e)||/^0x([0-9a-f]{6})$/i.exec(e);if(n){const i=parseInt(n[1],16);return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255]}const r=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return r?[Number(r[1])/255,Number(r[2])/255,Number(r[3])/255]:null}const JA=[236/255,234/255,219/255],QA=t=>{if(!t)return{};const e={...t};for(const n of["brightness","contrast","saturation","red","green","blue"])typeof t[n]=="number"&&(e[n]=(t[n]-1)*100);return e},eO=[],Nm=t=>{if(t)for(const e of t)try{e.destroy()}catch{}},lt=({colorCorrection:t,effects:e,neonColor:n=null,blendMode:r=0,plateKey:i=null})=>{const{brightness:o=0,contrast:s=0,saturation:a=0,red:l=0,green:c=0,blue:u=0,gamma:f=1,alpha:d=1,temperature:h=0,tint:p=0,hue:m=0,highlights:g=0,shadows:y=0,exposure:b=0,vibrance:x=0,sharpness:v=0,blurRadius:T=0,vignette:w=0,noise:O=0,edgeFeather:C=0}=t??{},R=e?.name||"None",P=e?.intensity??(R==="None"||R==="Normal"?0:100),A=e?.params?JSON.stringify(e.params):"",L=i&&typeof i=="object"?JSON.stringify(i):i,N=S.useMemo(()=>{const{exposureFilter:pe,temperatureTintFilter:X,tonalFilter:he,adjustmentFilter:j,vibranceFilter:te,hslFilter:H,sharpnessFilter:ae,blurFilter:Z,vignetteFilter:ce,noiseFilter:J,edgeFeatherFilter:ie}=Mm({brightness:o,contrast:s,saturation:a,red:l,green:c,blue:u,gamma:f,alpha:d,temperature:h,tint:p,hue:m,highlights:g,shadows:y,exposure:b,vibrance:x,sharpness:v,blurRadius:T,vignette:w,noise:O,edgeFeather:C}),{effectFilter:xe}=za({effect:R,effectIntensity:P,effectParams:e?.params,neonColor:n}),Y=[];if(i){const De=typeof i=="object"?i:{},ye=typeof i=="string"?i:De.color??null,$=$A(ye)??JA;Y.push(new ZA($,De.tolerance??40/255))}if(pe&&Y.push(pe),X&&Y.push(X),he&&Y.push(he),j&&Y.push(j),te&&Y.push(te),H&&Y.push(H),ae&&Y.push(ae),ie&&C>0&&Y.push(ie),xe&&(Array.isArray(xe)?Y.push(...xe.filter(De=>De!=null)):Y.push(xe)),Z&&T>0&&Y.push(Z),ce&&w>0&&Y.push(ce),J&&O>0&&Y.push(J),Y.length>0){const De=VA(r);De&&Y.push(De)}return Y},[o,s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R,P,A,n,r,L]),D=S.useRef(null);S.useEffect(()=>{const pe=D.current;D.current=N,pe&&pe!==N&&Nm(pe)},[N]),S.useEffect(()=>()=>{Nm(D.current),D.current=null},[]);const F=S.useContext(Ye),G=F?.registerTimeUpdateListener,z=F?.unregisterTimeUpdateListener,K=S.useRef(eO);K.current=N;const se=S.useRef(-1);return S.useEffect(()=>{if(!G||!z)return;const pe=X=>{const he=X,j=K.current;if(!(!j||j.length===0))for(const te of j){if(!te)continue;const H=te;if(H.__vfxAnimated===!0){H.time=he;continue}if(typeof H.refresh=="function"){const Z=Math.floor(he*12);if(Z!==se.current){const ce=Math.sin(Z*12.9898)*43758.5453;H.seed=ce-Math.floor(ce),H.refresh(),se.current=Z}continue}if(typeof H.time=="number"&&(H.time=he*.5),typeof H.seed=="number"&&!H.__vfxDreamy&&(H.seed=Math.floor(he*24)%997/997),typeof H.angle=="number"&&typeof H.time!="number"&&H.offset!==null&&typeof H.offset=="object"&&(H.angle=Math.sin(he*1.5)*3),typeof H.strength=="number"&&typeof H.centerX=="number"&&typeof H.angle>"u"&&typeof H.time>"u"){H.centerX=.5+Math.sin(he*.8)*.12,H.centerY=.5+Math.cos(he*.6)*.12;continue}const ae=Z=>.35+(Z.__spinSpeed??.1)*2.5;if(H.__vfxDreamy==="bloom"){const Z=Math.sin(he*.8*ae(H));H.bloomScale=H.__baseBloomScale*(1+.08*Z),H.brightness=H.__baseBrightness*(1+.04*Z);continue}if(H.__vfxDreamy==="blur"){const Z=Math.sin(he*.6*ae(H)+.4);H.strength=H.__baseBlur*(1+.08*Z);continue}if(H.__vfxDreamy==="grain"){const Z=Math.floor(he*(6+ae(H)*14));if(H.seed=Z%997/997,typeof H.__baseVignetting=="number"){const ce=Math.sin(he*.45*ae(H));H.vignetting=H.__baseVignetting*(.94+.08*ce)}continue}}};return G(pe),()=>z(pe)},[G,z]),N},qa="element-",Va=t=>`${qa}${t}`,tO=t=>t?.startsWith(qa)?t.slice(qa.length):null,Ka=(t,e)=>!t||!e?null:t.getChildByLabel(e,!0)??null,nO=t=>{const e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${e}$`)},Za=(t,e)=>{if(!t)return[];const n=nO(e),r=[],i=o=>{for(const s of o.children){const a=s;a.label&&n.test(a.label)&&r.push(a),a.children?.length&&i(a)}};return i(t),r},rO=t=>{const e=(n=>Ka(t,n));return e.all=n=>Za(t,n),e.byId=n=>Ka(t,Va(n)),e.byType=n=>Za(t,`${n}-*`),e},iO={x:0,y:0,width:0,height:0,anchor:.5,animation:to.NONE,maxX:0,maxY:0,scale:1,rotation:0,effect:ue.Normal,overlay:Gr.NONE,fontSize:10},$e=({ref:t,...e})=>{const[n]=S.useState(!1),[r]=S.useState(!1),i=S.useRef(null),o=S.useRef(null),s=S.useRef(null),a=S.useRef(null),l=S.useRef(null),{tl:c}=S.useContext(Ye),{app:u}=at.useApplication(),f=u?.renderer?.screen,d=f?.width||1920,h=f?.height||1080,{uniqueId:p,visible:m,startAt:g,endAt:y,transformation:b=iO,disabled:x,pointerdown:v,pointerout:T,pointerover:w,isDragging:O,isGif:C,onContainerRefReady:R,onSpriteRefReady:P,id:A,sortableChildren:L,animationText:N,pivotOffset:D}=e,{x:F=0,y:G=0,width:z,height:K,scale:se=[1,1],rotation:pe=0,alpha:X,effect:he,effects:j,neonColor:te,blendMode:H,overlay:ae,animation:Z=to.NONE,fontFamily:ce,fontSize:J,fontWeight:ie,fill:xe,color:Y,letterSpacing:De}=b,ye=xm(),$=b,we=S.useMemo(()=>{const Re=Se=>Se!=null&&(typeof Se=="string"?Se!==""&&Se!=="NONE":typeof Se=="object"?(Se.name??"NONE")!=="NONE":!1);return Re($.animationIn)||Re($.animationOut)||Re($.animationLoop)||Array.isArray($.keyframes)&&$.keyframes.length>0},[$.animationIn,$.animationOut,$.animationLoop,$.keyframes]),me=Number(g)||0,Ue=Number(y),ze=we&&Number.isFinite(Ue)&&Ue>me;Am(ze?{targetRef:i,transformation:{...b,maxX:d,maxY:h},start:me,end:Ue,effectOptions:{width:typeof z=="number"?z:void 0,height:typeof K=="number"?K:void 0,text:typeof N=="string"?N:void 0,fontFamily:ce,fontSize:J,fontWeight:ie,fill:xe,color:Y,letterSpacing:De}}:{targetRef:{current:null},transformation:{},start:0,end:0,effectOptions:{}}),Ze(ke.COMPLETE,()=>{i.current}),I.useImperativeHandle(t,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>r}),[n,r]),I.useEffect(()=>{R&&R(p,i)},[R,p]),I.useEffect(()=>{P&&P(p,s)},[P,p]);const ht=S.useMemo(()=>({x:F,y:G,width:z,height:K,animation:Z,maxX:d,maxY:h}),[Z,F,G,z,K,d,h]);I.useEffect(()=>{if(o.current&&!we){if(c.current){const{x:Re,y:Se,animation:Ge,maxX:je,maxY:qe}=ht,it=c.current.progress(),Le=ye.updateEffect(i.current,Ge,{immediateRender:!1,x:Re,y:Se,overwrite:!0,maxX:je,maxY:qe});a.current&&(c.current.remove(a.current),a.current.progress(0).kill()),it>.1?(Le.eventCallback("onComplete",()=>{Le.remove("onComplete"),c.current.add(Le,g),a.current=Le}),Le.play()):(Le.progress(1),c.current.add(Le,g),a.current=Le)}else a.current&&a.current.progress(0).kill();return()=>{}}},[g,ht,we]);const ve=lt({effects:j??{name:he},neonColor:te}),Ie=Rm(H??0),ct=A||Va(p),ut=S.useCallback(Re=>{i.current=Re,Re&&R&&R(p,i)},[R,p]),Me=typeof se=="number"?se:{x:se[0]??1,y:se[1]??1};return M.jsx("pixiContainer",{ref:o,label:`container-${p}`,sortableChildren:L,blendMode:Ie,children:M.jsx("pixiContainer",{label:ct,ref:ut,position:{x:F+(D?.x??0),y:G+(D?.y??0)},pivot:{x:F+(D?.x??0),y:G+(D?.y??0)},scale:Me,rotation:pe,...!we&&typeof X=="number"?{alpha:X}:{},eventMode:"passive",children:M.jsxs("pixiContainer",{ref:l,children:[!C&&M.jsx("pixiContainer",{scale:1,filters:ve,children:M.jsx("pixiContainer",{ref:s,children:e.children})}),C&&M.jsx("pixiContainer",{ref:s,children:e.children}),!ya(ae)&&ae!==Gr.NONE&&ae!==Gr.NORMAL&&M.jsx(kp,{overlay:ae,width:z,height:K,x:F,y:G}),M.jsx("pixiSprite",{texture:W.Texture.WHITE,alpha:0,anchor:.5,x:F,y:G,width:z,height:K,eventMode:!x&&m&&!n&&!O?"static":"none",cursor:"pointer",onPointerDown:v,onPointerOver:w,onPointerOut:T})]})})})};var Bt=(t=>(t.NONE="none",t.HORIZONTAL="horizontal",t.MIRROR="mirror",t.CIRCLE="circle",t.RECTANGLE="rectangle",t.HEART="heart",t.STARS="stars",t))(Bt||{});function $a(t,e,n,r,i,o,s){const a=s?n-i/2+s.x+s.w/2:n,l=s?r-o/2+s.y+s.h/2:r,c=s?s.w:i,u=s?s.h:o,f=c/2,d=u/2;switch(e){case Bt.HORIZONTAL:{const h=u*.6;t.rect(a-f,l-h/2,c,h);break}case Bt.MIRROR:{const h=u*.35;t.rect(a-f,l-d,c,h),t.rect(a-f,l+d-h,c,h);break}case Bt.CIRCLE:{const h=Math.min(f,d);t.circle(a,l,h);break}case Bt.RECTANGLE:{const h=Math.min(c,u)*.15;t.roundRect(a-f,l-d,c,u,h);break}case Bt.HEART:{oO(t,a,l,c,u);break}case Bt.STARS:{const h=Math.min(f,d);t.star(a,l,5,h,h*.5,-Math.PI/2);break}default:t.rect(a-f,l-d,c,u)}}function oO(t,e,n,r,i){const o=e-r/2,s=e+r/2,a=n-i/2,l=n+i/2,c=a+i*.3,u=a+i*.6;t.moveTo(e,c),t.bezierCurveTo(e,a,o,a,o,c),t.bezierCurveTo(o,u,e,l-i*.1,e,l),t.bezierCurveTo(e,l-i*.1,s,u,s,c),t.bezierCurveTo(s,a,e,a,e,c),t.closePath()}const sO=t=>{if(t==null)return 0;if(typeof t=="number")return t;const e=t.replace("#",""),n=parseInt(e,16);return Number.isFinite(n)?n:0},Ot=({x:t=0,y:e=0,width:n=0,height:r=0,border:i,roundedCorners:o=!1,maskShape:s=Bt.NONE,crop:a,spriteRef:l,children:c})=>{const u=S.useRef(null),f=i?.width??0,d=i?.color??null,h=S.useMemo(()=>o?typeof o=="number"?o:Math.min(n,r)*.1:0,[o,n,r]),p=s&&s!==Bt.NONE?s:null,m=!!p||!!o&&h>0||!!a,g=f>0&&d!=null,y=S.useMemo(()=>sO(d),[d]),b=S.useCallback(T=>{if(T.clear(),!!m){if(p)$a(T,p,t,e,n,r,a);else{const w=a?t-n/2+a.x:t-n/2,O=a?e-r/2+a.y:e-r/2,C=a?a.w:n,R=a?a.h:r;T.roundRect(w,O,C,R,h)}T.fill({color:16777215,alpha:1})}},[m,p,t,e,n,r,h,a]),x=S.useCallback(T=>{if(T.clear(),!!g){if(p)$a(T,p,t,e,n,r,a);else{const w=a?t-n/2+a.x:t-n/2,O=a?e-r/2+a.y:e-r/2,C=a?a.w:n,R=a?a.h:r;h>0?T.roundRect(w,O,C,R,h):T.rect(w,O,C,R)}T.stroke({width:f,color:y,alpha:1})}},[g,f,y,h,p,a,t,e,n,r]),v=S.useRef(null);return S.useLayoutEffect(()=>{const T=l?.current??null,w=m&&u.current?u.current:null;v.current&&v.current!==T&&(v.current.mask=null),v.current=T,T&&(T.mask??null)!==w&&(T.mask=w)}),S.useLayoutEffect(()=>()=>{v.current&&(v.current.mask=null),v.current=null},[]),M.jsxs("pixiContainer",{children:[m&&M.jsx("pixiGraphics",{ref:u,draw:b,eventMode:"none"}),c,g&&M.jsx("pixiGraphics",{draw:x,eventMode:"none"})]})};Ot.displayName="BorderMaskContainer";const aO=3e3;function Ja(t=aO){const e=new Map,n=new Map;return{acquire(r){const i=n.get(r);i&&(clearTimeout(i),n.delete(r)),e.set(r,(e.get(r)??0)+1)},release(r){const i=(e.get(r)??1)-1;if(i>0){e.set(r,i);return}e.delete(r),!n.has(r)&&n.set(r,setTimeout(()=>{n.delete(r),!e.has(r)&&W.Assets.unload(r).catch(()=>{})},t))}}}function Qa(t){if(!t||typeof t!="string")return t;const e=t.indexOf("/data:");if(e!==-1&&t.startsWith("https://")){const n=t.slice(e+1),r=n.indexOf("?");return r!==-1?n.slice(0,r):n}return t}const km=Ja();function ro(t,e){const n=Qa(t)||t;let r=!1,i=!1;km.acquire(n);const o=()=>{i||(i=!0,km.release(n))};let s;const a=new Promise(c=>{s=c});return(e?.forceTextureParser===!1?W.Assets.load(n):W.Assets.load({src:n,loadParser:"loadTextures"})).then(c=>{if(r){s(null);return}try{c?.source&&(c.source.scaleMode=e?.scaleMode??"linear",c.source.autoGenerateMipmaps=e?.enableMipmap??!0)}catch{}s(c)}).catch(c=>{r||console.error("[loadSpriteTexture]",n,c),s(null)}),{promise:a,cancel:()=>{r=!0,s(null),o()},dispose:o}}async function cO(t,e){return ro(t,e)}var ec,Dm;function lO(){if(Dm)return ec;Dm=1;function t(){this.__data__=[],this.size=0}return ec=t,ec}var tc,Fm;function nc(){if(Fm)return tc;Fm=1;function t(e,n){return e===n||e!==e&&n!==n}return tc=t,tc}var rc,Bm;function io(){if(Bm)return rc;Bm=1;var t=nc();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return rc=e,rc}var ic,Um;function uO(){if(Um)return ic;Um=1;var t=io(),e=Array.prototype,n=e.splice;function r(i){var o=this.__data__,s=t(o,i);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():n.call(o,s,1),--this.size,!0}return ic=r,ic}var oc,Gm;function fO(){if(Gm)return oc;Gm=1;var t=io();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return oc=e,oc}var sc,jm;function dO(){if(jm)return sc;jm=1;var t=io();function e(n){return t(this.__data__,n)>-1}return sc=e,sc}var ac,Hm;function hO(){if(Hm)return ac;Hm=1;var t=io();function e(n,r){var i=this.__data__,o=t(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return ac=e,ac}var cc,Ym;function oo(){if(Ym)return cc;Ym=1;var t=lO(),e=uO(),n=fO(),r=dO(),i=hO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,cc=o,cc}var lc,Xm;function pO(){if(Xm)return lc;Xm=1;var t=oo();function e(){this.__data__=new t,this.size=0}return lc=e,lc}var uc,Wm;function mO(){if(Wm)return uc;Wm=1;function t(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}return uc=t,uc}var fc,zm;function gO(){if(zm)return fc;zm=1;function t(e){return this.__data__.get(e)}return fc=t,fc}var dc,qm;function yO(){if(qm)return dc;qm=1;function t(e){return this.__data__.has(e)}return dc=t,dc}var hc,Vm;function so(){if(Vm)return hc;Vm=1;var t=Nn(),e=t(Object,"create");return hc=e,hc}var pc,Km;function _O(){if(Km)return pc;Km=1;var t=so();function e(){this.__data__=t?t(null):{},this.size=0}return pc=e,pc}var mc,Zm;function bO(){if(Zm)return mc;Zm=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return mc=t,mc}var gc,$m;function xO(){if($m)return gc;$m=1;var t=so(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(t){var a=s[o];return a===e?void 0:a}return r.call(s,o)?s[o]:void 0}return gc=i,gc}var yc,Jm;function vO(){if(Jm)return yc;Jm=1;var t=so(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var o=this.__data__;return t?o[i]!==void 0:n.call(o,i)}return yc=r,yc}var _c,Qm;function TO(){if(Qm)return _c;Qm=1;var t=so(),e="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=t&&i===void 0?e:i,this}return _c=n,_c}var bc,e0;function EO(){if(e0)return bc;e0=1;var t=_O(),e=bO(),n=xO(),r=vO(),i=TO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,bc=o,bc}var xc,t0;function SO(){if(t0)return xc;t0=1;var t=EO(),e=oo(),n=Zs();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return xc=r,xc}var vc,n0;function wO(){if(n0)return vc;n0=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return vc=t,vc}var Tc,r0;function ao(){if(r0)return Tc;r0=1;var t=wO();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Tc=e,Tc}var Ec,i0;function AO(){if(i0)return Ec;i0=1;var t=ao();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return Ec=e,Ec}var Sc,o0;function OO(){if(o0)return Sc;o0=1;var t=ao();function e(n){return t(this,n).get(n)}return Sc=e,Sc}var wc,s0;function CO(){if(s0)return wc;s0=1;var t=ao();function e(n){return t(this,n).has(n)}return wc=e,wc}var Ac,a0;function RO(){if(a0)return Ac;a0=1;var t=ao();function e(n,r){var i=t(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ac=e,Ac}var Oc,c0;function Cc(){if(c0)return Oc;c0=1;var t=SO(),e=AO(),n=OO(),r=CO(),i=RO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Oc=o,Oc}var Rc,l0;function IO(){if(l0)return Rc;l0=1;var t=oo(),e=Zs(),n=Cc(),r=200;function i(o,s){var a=this.__data__;if(a instanceof t){var l=a.__data__;if(!e||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(o,s),this.size=a.size,this}return Rc=i,Rc}var Ic,u0;function f0(){if(u0)return Ic;u0=1;var t=oo(),e=pO(),n=mO(),r=gO(),i=yO(),o=IO();function s(a){var l=this.__data__=new t(a);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=o,Ic=s,Ic}var Mc,d0;function MO(){if(d0)return Mc;d0=1;var t="__lodash_hash_undefined__";function e(n){return this.__data__.set(n,t),this}return Mc=e,Mc}var Lc,h0;function LO(){if(h0)return Lc;h0=1;function t(e){return this.__data__.has(e)}return Lc=t,Lc}var Pc,p0;function PO(){if(p0)return Pc;p0=1;var t=Cc(),e=MO(),n=LO();function r(i){var o=-1,s=i==null?0:i.length;for(this.__data__=new t;++o<s;)this.add(i[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=n,Pc=r,Pc}var Nc,m0;function NO(){if(m0)return Nc;m0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(e[r],r,e))return!0;return!1}return Nc=t,Nc}var kc,g0;function kO(){if(g0)return kc;g0=1;function t(e,n){return e.has(n)}return kc=t,kc}var Dc,y0;function _0(){if(y0)return Dc;y0=1;var t=PO(),e=NO(),n=kO(),r=1,i=2;function o(s,a,l,c,u,f){var d=l&r,h=s.length,p=a.length;if(h!=p&&!(d&&p>h))return!1;var m=f.get(s),g=f.get(a);if(m&&g)return m==a&&g==s;var y=-1,b=!0,x=l&i?new t:void 0;for(f.set(s,a),f.set(a,s);++y<h;){var v=s[y],T=a[y];if(c)var w=d?c(T,v,y,a,s,f):c(v,T,y,s,a,f);if(w!==void 0){if(w)continue;b=!1;break}if(x){if(!e(a,function(O,C){if(!n(x,C)&&(v===O||u(v,O,l,c,f)))return x.push(C)})){b=!1;break}}else if(!(v===T||u(v,T,l,c,f))){b=!1;break}}return f.delete(s),f.delete(a),b}return Dc=o,Dc}var Fc,b0;function x0(){if(b0)return Fc;b0=1;var t=St(),e=t.Uint8Array;return Fc=e,Fc}var Bc,v0;function DO(){if(v0)return Bc;v0=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i,o){r[++n]=[o,i]}),r}return Bc=t,Bc}var Uc,T0;function FO(){if(T0)return Uc;T0=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i){r[++n]=i}),r}return Uc=t,Uc}var Gc,E0;function BO(){if(E0)return Gc;E0=1;var t=er(),e=x0(),n=nc(),r=_0(),i=DO(),o=FO(),s=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",m="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",x=t?t.prototype:void 0,v=x?x.valueOf:void 0;function T(w,O,C,R,P,A,L){switch(C){case b:if(w.byteLength!=O.byteLength||w.byteOffset!=O.byteOffset)return!1;w=w.buffer,O=O.buffer;case y:return!(w.byteLength!=O.byteLength||!A(new e(w),new e(O)));case l:case c:case d:return n(+w,+O);case u:return w.name==O.name&&w.message==O.message;case h:case m:return w==O+"";case f:var N=i;case p:var D=R&s;if(N||(N=o),w.size!=O.size&&!D)return!1;var F=L.get(w);if(F)return F==O;R|=a,L.set(w,O);var G=r(N(w),N(O),R,P,A,L);return L.delete(w),G;case g:if(v)return v.call(w)==v.call(O)}return!1}return Gc=T,Gc}var jc,S0;function Hc(){if(S0)return jc;S0=1;function t(e,n){for(var r=-1,i=n.length,o=e.length;++r<i;)e[o+r]=n[r];return e}return jc=t,jc}var Yc,w0;function A0(){if(w0)return Yc;w0=1;var t=Hc(),e=Vt();function n(r,i,o){var s=i(r);return e(r)?s:t(s,o(r))}return Yc=n,Yc}var Xc,O0;function UO(){if(O0)return Xc;O0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=0,s=[];++r<i;){var a=e[r];n(a,r,e)&&(s[o++]=a)}return s}return Xc=t,Xc}var Wc,C0;function R0(){if(C0)return Wc;C0=1;function t(){return[]}return Wc=t,Wc}var zc,I0;function qc(){if(I0)return zc;I0=1;var t=UO(),e=R0(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(s){return s==null?[]:(s=Object(s),t(i(s),function(a){return r.call(s,a)}))}:e;return zc=o,zc}var Vc,M0;function GO(){if(M0)return Vc;M0=1;function t(e,n){for(var r=-1,i=Array(e);++r<e;)i[r]=n(r);return i}return Vc=t,Vc}var Kc,L0;function jO(){if(L0)return Kc;L0=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??t,!!i&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return Kc=n,Kc}var Zc,P0;function N0(){if(P0)return Zc;P0=1;var t=GO(),e=ia(),n=Vt(),r=Yi(),i=jO(),o=ma(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var f=n(c),d=!f&&e(c),h=!f&&!d&&r(c),p=!f&&!d&&!h&&o(c),m=f||d||h||p,g=m?t(c.length,String):[],y=g.length;for(var b in c)(u||a.call(c,b))&&!(m&&(b=="length"||h&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||i(b,y)))&&g.push(b);return g}return Zc=l,Zc}var $c,k0;function Jc(){if(k0)return $c;k0=1;var t=N0(),e=Zh(),n=ca();function r(i){return n(i)?t(i):e(i)}return $c=r,$c}var Qc,D0;function F0(){if(D0)return Qc;D0=1;var t=A0(),e=qc(),n=Jc();function r(i){return t(i,n,e)}return Qc=r,Qc}var el,B0;function HO(){if(B0)return el;B0=1;var t=F0(),e=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a,l,c,u){var f=a&e,d=t(o),h=d.length,p=t(s),m=p.length;if(h!=m&&!f)return!1;for(var g=h;g--;){var y=d[g];if(!(f?y in s:r.call(s,y)))return!1}var b=u.get(o),x=u.get(s);if(b&&x)return b==s&&x==o;var v=!0;u.set(o,s),u.set(s,o);for(var T=f;++g<h;){y=d[g];var w=o[y],O=s[y];if(l)var C=f?l(O,w,y,s,o,u):l(w,O,y,o,s,u);if(!(C===void 0?w===O||c(w,O,a,l,u):C)){v=!1;break}T||(T=y=="constructor")}if(v&&!T){var R=o.constructor,P=s.constructor;R!=P&&"constructor"in o&&"constructor"in s&&!(typeof R=="function"&&R instanceof R&&typeof P=="function"&&P instanceof P)&&(v=!1)}return u.delete(o),u.delete(s),v}return el=i,el}var tl,U0;function YO(){if(U0)return tl;U0=1;var t=f0(),e=_0(),n=BO(),r=HO(),i=Fr(),o=Vt(),s=Yi(),a=ma(),l=1,c="[object Arguments]",u="[object Array]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function p(m,g,y,b,x,v){var T=o(m),w=o(g),O=T?u:i(m),C=w?u:i(g);O=O==c?f:O,C=C==c?f:C;var R=O==f,P=C==f,A=O==C;if(A&&s(m)){if(!s(g))return!1;T=!0,R=!1}if(A&&!R)return v||(v=new t),T||a(m)?e(m,g,y,b,x,v):n(m,g,O,y,b,x,v);if(!(y&l)){var L=R&&h.call(m,"__wrapped__"),N=P&&h.call(g,"__wrapped__");if(L||N){var D=L?m.value():m,F=N?g.value():g;return v||(v=new t),x(D,F,y,b,v)}}return A?(v||(v=new t),r(m,g,y,b,x,v)):!1}return tl=p,tl}var nl,G0;function XO(){if(G0)return nl;G0=1;var t=YO(),e=dn();function n(r,i,o,s,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:t(r,i,o,s,n,a)}return nl=n,nl}var rl,j0;function WO(){if(j0)return rl;j0=1;var t=XO();function e(n,r){return t(n,r)}return rl=e,rl}var zO=WO();const qO=Jn(zO);var il,H0;function Y0(){if(H0)return il;H0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=n(e[r],r,e);return o}return il=t,il}var ol,X0;function VO(){if(X0)return ol;X0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i&&n(e[r],r,e)!==!1;);return e}return ol=t,ol}var sl,W0;function z0(){if(W0)return sl;W0=1;var t=Nn(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return sl=e,sl}var al,q0;function V0(){if(q0)return al;q0=1;var t=z0();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return al=e,al}var cl,K0;function Z0(){if(K0)return cl;K0=1;var t=V0(),e=nc(),n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a){var l=o[s];(!(r.call(o,s)&&e(l,a))||a===void 0&&!(s in o))&&t(o,s,a)}return cl=i,cl}var ll,$0;function Jr(){if($0)return ll;$0=1;var t=Z0(),e=V0();function n(r,i,o,s){var a=!o;o||(o={});for(var l=-1,c=i.length;++l<c;){var u=i[l],f=s?s(o[u],r[u],u,o,r):void 0;f===void 0&&(f=r[u]),a?e(o,u,f):t(o,u,f)}return o}return ll=n,ll}var ul,J0;function KO(){if(J0)return ul;J0=1;var t=Jr(),e=Jc();function n(r,i){return r&&t(i,e(i),r)}return ul=n,ul}var fl,Q0;function ZO(){if(Q0)return fl;Q0=1;function t(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}return fl=t,fl}var dl,eg;function $O(){if(eg)return dl;eg=1;var t=Pn(),e=Hi(),n=ZO(),r=Object.prototype,i=r.hasOwnProperty;function o(s){if(!t(s))return n(s);var a=e(s),l=[];for(var c in s)c=="constructor"&&(a||!i.call(s,c))||l.push(c);return l}return dl=o,dl}var hl,tg;function pl(){if(tg)return hl;tg=1;var t=N0(),e=$O(),n=ca();function r(i){return n(i)?t(i,!0):e(i)}return hl=r,hl}var ml,ng;function JO(){if(ng)return ml;ng=1;var t=Jr(),e=pl();function n(r,i){return r&&t(i,e(i),r)}return ml=n,ml}var Qr={exports:{}};Qr.exports;var rg;function QO(){return rg||(rg=1,(function(t,e){var n=St(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var f=c.length,d=a?a(f):new c.constructor(f);return c.copy(d),d}t.exports=l})(Qr,Qr.exports)),Qr.exports}var gl,ig;function eC(){if(ig)return gl;ig=1;function t(e,n){var r=-1,i=e.length;for(n||(n=Array(i));++r<i;)n[r]=e[r];return n}return gl=t,gl}var yl,og;function tC(){if(og)return yl;og=1;var t=Jr(),e=qc();function n(r,i){return t(r,e(r),i)}return yl=n,yl}var _l,sg;function bl(){if(sg)return _l;sg=1;var t=qh(),e=t(Object.getPrototypeOf,Object);return _l=e,_l}var xl,ag;function cg(){if(ag)return xl;ag=1;var t=Hc(),e=bl(),n=qc(),r=R0(),i=Object.getOwnPropertySymbols,o=i?function(s){for(var a=[];s;)t(a,n(s)),s=e(s);return a}:r;return xl=o,xl}var vl,lg;function nC(){if(lg)return vl;lg=1;var t=Jr(),e=cg();function n(r,i){return t(r,e(r),i)}return vl=n,vl}var Tl,ug;function fg(){if(ug)return Tl;ug=1;var t=A0(),e=cg(),n=pl();function r(i){return t(i,n,e)}return Tl=r,Tl}var El,dg;function rC(){if(dg)return El;dg=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return El=n,El}var Sl,hg;function wl(){if(hg)return Sl;hg=1;var t=x0();function e(n){var r=new n.constructor(n.byteLength);return new t(r).set(new t(n)),r}return Sl=e,Sl}var Al,pg;function iC(){if(pg)return Al;pg=1;var t=wl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return Al=e,Al}var Ol,mg;function oC(){if(mg)return Ol;mg=1;var t=/\w*$/;function e(n){var r=new n.constructor(n.source,t.exec(n));return r.lastIndex=n.lastIndex,r}return Ol=e,Ol}var Cl,gg;function sC(){if(gg)return Cl;gg=1;var t=er(),e=t?t.prototype:void 0,n=e?e.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return Cl=r,Cl}var Rl,yg;function aC(){if(yg)return Rl;yg=1;var t=wl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return Rl=e,Rl}var Il,_g;function cC(){if(_g)return Il;_g=1;var t=wl(),e=iC(),n=oC(),r=sC(),i=aC(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",f="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",x="[object Int32Array]",v="[object Uint8Array]",T="[object Uint8ClampedArray]",w="[object Uint16Array]",O="[object Uint32Array]";function C(R,P,A){var L=R.constructor;switch(P){case h:return t(R);case o:case s:return new L(+R);case p:return e(R,A);case m:case g:case y:case b:case x:case v:case T:case w:case O:return i(R,A);case a:return new L;case l:case f:return new L(R);case c:return n(R);case u:return new L;case d:return r(R)}}return Il=C,Il}var Ml,bg;function lC(){if(bg)return Ml;bg=1;var t=Pn(),e=Object.create,n=(function(){function r(){}return function(i){if(!t(i))return{};if(e)return e(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return Ml=n,Ml}var Ll,xg;function uC(){if(xg)return Ll;xg=1;var t=lC(),e=bl(),n=Hi();function r(i){return typeof i.constructor=="function"&&!n(i)?t(e(i)):{}}return Ll=r,Ll}var Pl,vg;function fC(){if(vg)return Pl;vg=1;var t=Fr(),e=dn(),n="[object Map]";function r(i){return e(i)&&t(i)==n}return Pl=r,Pl}var Nl,Tg;function dC(){if(Tg)return Nl;Tg=1;var t=fC(),e=da(),n=ha(),r=n&&n.isMap,i=r?e(r):t;return Nl=i,Nl}var kl,Eg;function hC(){if(Eg)return kl;Eg=1;var t=Fr(),e=dn(),n="[object Set]";function r(i){return e(i)&&t(i)==n}return kl=r,kl}var Dl,Sg;function pC(){if(Sg)return Dl;Sg=1;var t=hC(),e=da(),n=ha(),r=n&&n.isSet,i=r?e(r):t;return Dl=i,Dl}var Fl,wg;function mC(){if(wg)return Fl;wg=1;var t=f0(),e=VO(),n=Z0(),r=KO(),i=JO(),o=QO(),s=eC(),a=tC(),l=nC(),c=F0(),u=fg(),f=Fr(),d=rC(),h=cC(),p=uC(),m=Vt(),g=Yi(),y=dC(),b=Pn(),x=pC(),v=Jc(),T=pl(),w=1,O=2,C=4,R="[object Arguments]",P="[object Array]",A="[object Boolean]",L="[object Date]",N="[object Error]",D="[object Function]",F="[object GeneratorFunction]",G="[object Map]",z="[object Number]",K="[object Object]",se="[object RegExp]",pe="[object Set]",X="[object String]",he="[object Symbol]",j="[object WeakMap]",te="[object ArrayBuffer]",H="[object DataView]",ae="[object Float32Array]",Z="[object Float64Array]",ce="[object Int8Array]",J="[object Int16Array]",ie="[object Int32Array]",xe="[object Uint8Array]",Y="[object Uint8ClampedArray]",De="[object Uint16Array]",ye="[object Uint32Array]",$={};$[R]=$[P]=$[te]=$[H]=$[A]=$[L]=$[ae]=$[Z]=$[ce]=$[J]=$[ie]=$[G]=$[z]=$[K]=$[se]=$[pe]=$[X]=$[he]=$[xe]=$[Y]=$[De]=$[ye]=!0,$[N]=$[D]=$[j]=!1;function we(me,Ue,ze,ht,zt,ve){var Ie,ct=Ue&w,ut=Ue&O,Me=Ue&C;if(ze&&(Ie=zt?ze(me,ht,zt,ve):ze(me)),Ie!==void 0)return Ie;if(!b(me))return me;var Re=m(me);if(Re){if(Ie=d(me),!ct)return s(me,Ie)}else{var Se=f(me),Ge=Se==D||Se==F;if(g(me))return o(me,ct);if(Se==K||Se==R||Ge&&!zt){if(Ie=ut||Ge?{}:p(me),!ct)return ut?l(me,i(Ie,me)):a(me,r(Ie,me))}else{if(!$[Se])return zt?me:{};Ie=h(me,Se,ct)}}ve||(ve=new t);var je=ve.get(me);if(je)return je;ve.set(me,Ie),x(me)?me.forEach(function(Le){Ie.add(we(Le,Ue,ze,Le,me,ve))}):y(me)&&me.forEach(function(Le,ot){Ie.set(ot,we(Le,Ue,ze,ot,me,ve))});var qe=Me?ut?u:c:ut?T:v,it=Re?void 0:qe(me);return e(it||me,function(Le,ot){it&&(ot=Le,Le=me[ot]),n(Ie,ot,we(Le,Ue,ze,ot,me,ve))}),Ie}return Fl=we,Fl}var Bl,Ag;function co(){if(Ag)return Bl;Ag=1;var t=tr(),e=dn(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return Bl=r,Bl}var Ul,Og;function gC(){if(Og)return Ul;Og=1;var t=Vt(),e=co(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(t(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||e(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return Ul=i,Ul}var Gl,Cg;function yC(){if(Cg)return Gl;Cg=1;var t=Cc(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var o=function(){var s=arguments,a=i?i.apply(this,s):s[0],l=o.cache;if(l.has(a))return l.get(a);var c=r.apply(this,s);return o.cache=l.set(a,c)||l,c};return o.cache=new(n.Cache||t),o}return n.Cache=t,Gl=n,Gl}var jl,Rg;function _C(){if(Rg)return jl;Rg=1;var t=yC(),e=500;function n(r){var i=t(r,function(s){return o.size===e&&o.clear(),s}),o=i.cache;return i}return jl=n,jl}var Hl,Ig;function bC(){if(Ig)return Hl;Ig=1;var t=_C(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(e,function(s,a,l,c){o.push(l?c.replace(n,"$1"):a||s)}),o});return Hl=r,Hl}var Yl,Mg;function xC(){if(Mg)return Yl;Mg=1;var t=er(),e=Y0(),n=Vt(),r=co(),i=t?t.prototype:void 0,o=i?i.toString:void 0;function s(a){if(typeof a=="string")return a;if(n(a))return e(a,s)+"";if(r(a))return o?o.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return Yl=s,Yl}var Xl,Lg;function vC(){if(Lg)return Xl;Lg=1;var t=xC();function e(n){return n==null?"":t(n)}return Xl=e,Xl}var Wl,Pg;function zl(){if(Pg)return Wl;Pg=1;var t=Vt(),e=gC(),n=bC(),r=vC();function i(o,s){return t(o)?o:e(o,s)?[o]:n(r(o))}return Wl=i,Wl}var ql,Ng;function TC(){if(Ng)return ql;Ng=1;function t(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}return ql=t,ql}var Vl,kg;function Dg(){if(kg)return Vl;kg=1;var t=co();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Vl=e,Vl}var Kl,Fg;function EC(){if(Fg)return Kl;Fg=1;var t=zl(),e=Dg();function n(r,i){i=t(i,r);for(var o=0,s=i.length;r!=null&&o<s;)r=r[e(i[o++])];return o&&o==s?r:void 0}return Kl=n,Kl}var Zl,Bg;function SC(){if(Bg)return Zl;Bg=1;function t(e,n,r){var i=-1,o=e.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(o);++i<o;)s[i]=e[i+n];return s}return Zl=t,Zl}var $l,Ug;function wC(){if(Ug)return $l;Ug=1;var t=EC(),e=SC();function n(r,i){return i.length<2?r:t(r,e(i,0,-1))}return $l=n,$l}var Jl,Gg;function AC(){if(Gg)return Jl;Gg=1;var t=zl(),e=TC(),n=wC(),r=Dg();function i(o,s){return s=t(s,o),o=n(o,s),o==null||delete o[r(e(s))]}return Jl=i,Jl}var Ql,jg;function OC(){if(jg)return Ql;jg=1;var t=tr(),e=bl(),n=dn(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(u){if(!n(u)||t(u)!=r)return!1;var f=e(u);if(f===null)return!0;var d=a.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&s.call(d)==l}return Ql=c,Ql}var eu,Hg;function CC(){if(Hg)return eu;Hg=1;var t=OC();function e(n){return t(n)?void 0:n}return eu=e,eu}var tu,Yg;function RC(){if(Yg)return tu;Yg=1;var t=er(),e=ia(),n=Vt(),r=t?t.isConcatSpreadable:void 0;function i(o){return n(o)||e(o)||!!(r&&o&&o[r])}return tu=i,tu}var nu,Xg;function IC(){if(Xg)return nu;Xg=1;var t=Hc(),e=RC();function n(r,i,o,s,a){var l=-1,c=r.length;for(o||(o=e),a||(a=[]);++l<c;){var u=r[l];i>0&&o(u)?i>1?n(u,i-1,o,s,a):t(a,u):s||(a[a.length]=u)}return a}return nu=n,nu}var ru,Wg;function MC(){if(Wg)return ru;Wg=1;var t=IC();function e(n){var r=n==null?0:n.length;return r?t(n,1):[]}return ru=e,ru}var iu,zg;function LC(){if(zg)return iu;zg=1;function t(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}return iu=t,iu}var ou,qg;function PC(){if(qg)return ou;qg=1;var t=LC(),e=Math.max;function n(r,i,o){return i=e(i===void 0?r.length-1:i,0),function(){for(var s=arguments,a=-1,l=e(s.length-i,0),c=Array(l);++a<l;)c[a]=s[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=s[a];return u[i]=o(c),t(r,this,u)}}return ou=n,ou}var su,Vg;function NC(){if(Vg)return su;Vg=1;function t(e){return function(){return e}}return su=t,su}var au,Kg;function kC(){if(Kg)return au;Kg=1;function t(e){return e}return au=t,au}var cu,Zg;function DC(){if(Zg)return cu;Zg=1;var t=NC(),e=z0(),n=kC(),r=e?function(i,o){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n;return cu=r,cu}var lu,$g;function FC(){if($g)return lu;$g=1;var t=800,e=16,n=Date.now;function r(i){var o=0,s=0;return function(){var a=n(),l=e-(a-s);if(s=a,l>0){if(++o>=t)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return lu=r,lu}var uu,Jg;function BC(){if(Jg)return uu;Jg=1;var t=DC(),e=FC(),n=e(t);return uu=n,uu}var fu,Qg;function UC(){if(Qg)return fu;Qg=1;var t=MC(),e=PC(),n=BC();function r(i){return n(e(i,void 0,t),i+"")}return fu=r,fu}var du,ey;function GC(){if(ey)return du;ey=1;var t=Y0(),e=mC(),n=AC(),r=zl(),i=Jr(),o=CC(),s=UC(),a=fg(),l=1,c=2,u=4,f=s(function(d,h){var p={};if(d==null)return p;var m=!1;h=t(h,function(y){return y=r(y,d),m||(m=y.length>1),y}),i(d,a(d),p),m&&(p=e(p,l|c|u,o));for(var g=h.length;g--;)n(p,h[g]);return p});return du=f,du}var jC=GC();const ty=Jn(jC),ny=["mouseOverSpriteRef","mouseOverTransformerRef","spriteHelperRef","canvasImageRef","textEditorRef","onContainerRefReady","onSpriteRefReady"];function et(t,e,n=[]){if(e.mouseOverTransformerRef?.current?.isDragging)return!0;const i=[...ny,...n];return qO(ty(t,i),ty(e,i))}const HC=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),{src:s,uniqueId:a,visible:l,disabled:c,mouseOverSpriteRef:u,transformation:{x:f,y:d,width:h,height:p,anchor:m,colorCorrection:g,effect:y,effects:b,neonColor:x,blendMode:v,border:T,roundedCorners:w,maskShape:O,crop:C,plateKey:R},pointerdown:P}=e,A=Qa(s)||void 0,L=lt({colorCorrection:g,effects:b??{name:y},neonColor:x,blendMode:v,plateKey:R});S.useEffect(()=>{if(!A){r(null);return}const G=ro(A);let z=!0;return G.promise.then(K=>{z&&r(K)}),()=>{z=!1,G.cancel(),r(null),G.dispose()}},[A]),S.useEffect(()=>()=>{u&&(u.current=!1)},[u]);const N=h&&h>0?h:n?.orig?.width||0,D=p&&p>0?p:n?.orig?.height||0,F=!!n&&n!==W.Texture.EMPTY;return M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:o,children:M.jsx(Ot,{x:f,y:d,width:N,height:D,border:T,roundedCorners:w,maskShape:O,crop:C,spriteRef:i,children:F&&M.jsx("pixiSprite",{label:`sprite-${a}`,texture:n,width:N,height:D,anchor:m,ref:i,alpha:l?1:0,x:f,y:d,filters:L,...!c&&l&&{eventMode:"static",onPointerDown:P}})})})})},hu=I.memo(HC,(t,e)=>et(t,e,["isDragging"]));hu.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};var pu,ry;function YC(){if(ry)return pu;ry=1;var t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(h){return h===10||h===13||h===8232||h===8233||h===32||h===9||h===11||h===12||h===160||h>=5760&&e.indexOf(h)>=0}function r(h){switch(h|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function i(h){return(h|32)===97}function o(h){return h>=48&&h<=57}function s(h){return h>=48&&h<=57||h===43||h===45||h===46}function a(h){this.index=0,this.path=h,this.max=h.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function l(h){for(;h.index<h.max&&n(h.path.charCodeAt(h.index));)h.index++}function c(h){var p=h.path.charCodeAt(h.index);if(p===48){h.param=0,h.index++;return}if(p===49){h.param=1,h.index++;return}h.err="SvgPath: arc flag can be 0 or 1 only (at pos "+h.index+")"}function u(h){var p=h.index,m=p,g=h.max,y=!1,b=!1,x=!1,v=!1,T;if(m>=g){h.err="SvgPath: missed param (at pos "+m+")";return}if(T=h.path.charCodeAt(m),(T===43||T===45)&&(m++,T=m<g?h.path.charCodeAt(m):0),!o(T)&&T!==46){h.err="SvgPath: param should start with 0..9 or `.` (at pos "+m+")";return}if(T!==46){if(y=T===48,m++,T=m<g?h.path.charCodeAt(m):0,y&&m<g&&T&&o(T)){h.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+p+")";return}for(;m<g&&o(h.path.charCodeAt(m));)m++,b=!0;T=m<g?h.path.charCodeAt(m):0}if(T===46){for(v=!0,m++;o(h.path.charCodeAt(m));)m++,x=!0;T=m<g?h.path.charCodeAt(m):0}if(T===101||T===69){if(v&&!b&&!x){h.err="SvgPath: invalid float exponent (at pos "+m+")";return}if(m++,T=m<g?h.path.charCodeAt(m):0,(T===43||T===45)&&m++,m<g&&o(h.path.charCodeAt(m)))for(;m<g&&o(h.path.charCodeAt(m));)m++;else{h.err="SvgPath: invalid float exponent (at pos "+m+")";return}}h.index=m,h.param=parseFloat(h.path.slice(p,m))+0}function f(h){var p,m;p=h.path[h.segmentStart],m=p.toLowerCase();var g=h.data;if(m==="m"&&g.length>2&&(h.result.push([p,g[0],g[1]]),g=g.slice(2),m="l",p=p==="m"?"l":"L"),m==="r")h.result.push([p].concat(g));else for(;g.length>=t[m]&&(h.result.push([p].concat(g.splice(0,t[m]))),!!t[m]););}function d(h){var p=h.max,m,g,y,b,x;if(h.segmentStart=h.index,m=h.path.charCodeAt(h.index),g=i(m),!r(m)){h.err="SvgPath: bad command "+h.path[h.index]+" (at pos "+h.index+")";return}if(b=t[h.path[h.index].toLowerCase()],h.index++,l(h),h.data=[],!b){f(h);return}for(y=!1;;){for(x=b;x>0;x--){if(g&&(x===3||x===4)?c(h):u(h),h.err.length){f(h);return}h.data.push(h.param),l(h),y=!1,h.index<p&&h.path.charCodeAt(h.index)===44&&(h.index++,l(h),y=!0)}if(!y&&(h.index>=h.max||!s(h.path.charCodeAt(h.index))))break}f(h)}return pu=function(p){var m=new a(p),g=m.max;for(l(m);m.index<g&&!m.err.length;)d(m);return m.result.length&&("mM".indexOf(m.result[0][0])<0?(m.err="SvgPath: string should start with `M` or `m`",m.result=[]):m.result[0][0]="M"),{err:m.err,segments:m.result}},pu}var mu,iy;function oy(){if(iy)return mu;iy=1;function t(n,r){return[n[0]*r[0]+n[2]*r[1],n[1]*r[0]+n[3]*r[1],n[0]*r[2]+n[2]*r[3],n[1]*r[2]+n[3]*r[3],n[0]*r[4]+n[2]*r[5]+n[4],n[1]*r[4]+n[3]*r[5]+n[5]]}function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}return e.prototype.matrix=function(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0?this:(this.cache=null,this.queue.push(n),this)},e.prototype.translate=function(n,r){return(n!==0||r!==0)&&(this.cache=null,this.queue.push([1,0,0,1,n,r])),this},e.prototype.scale=function(n,r){return(n!==1||r!==1)&&(this.cache=null,this.queue.push([n,0,0,r,0,0])),this},e.prototype.rotate=function(n,r,i){var o,s,a;return n!==0&&(this.translate(r,i),o=n*Math.PI/180,s=Math.cos(o),a=Math.sin(o),this.queue.push([s,a,-a,s,0,0]),this.cache=null,this.translate(-r,-i)),this},e.prototype.skewX=function(n){return n!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(n*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(n){return n!==0&&(this.cache=null,this.queue.push([1,Math.tan(n*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var n=1;n<this.queue.length;n++)this.cache=t(this.cache,this.queue[n]);return this.cache},e.prototype.calc=function(n,r,i){var o;return this.queue.length?(this.cache||(this.cache=this.toArray()),o=this.cache,[n*o[0]+r*o[2]+(i?0:o[4]),n*o[1]+r*o[3]+(i?0:o[5])]):[n,r]},mu=e,mu}var gu,sy;function XC(){if(sy)return gu;sy=1;var t=oy(),e={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},n=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,r=/[\s,]+/;return gu=function(o){var s=new t,a,l;return o.split(n).forEach(function(c){if(c.length){if(typeof e[c]<"u"){a=c;return}switch(l=c.split(r).map(function(u){return+u||0}),a){case"matrix":l.length===6&&s.matrix(l);return;case"scale":l.length===1?s.scale(l[0],l[0]):l.length===2&&s.scale(l[0],l[1]);return;case"rotate":l.length===1?s.rotate(l[0],0,0):l.length===3&&s.rotate(l[0],l[1],l[2]);return;case"translate":l.length===1?s.translate(l[0],0):l.length===2&&s.translate(l[0],l[1]);return;case"skewX":l.length===1&&s.skewX(l[0]);return;case"skewY":l.length===1&&s.skewY(l[0]);return}}}),s},gu}var yu,ay;function WC(){if(ay)return yu;ay=1;var t=Math.PI*2;function e(i,o,s,a){var l=i*a-o*s<0?-1:1,c=i*s+o*a;return c>1&&(c=1),c<-1&&(c=-1),l*Math.acos(c)}function n(i,o,s,a,l,c,u,f,d,h){var p=h*(i-s)/2+d*(o-a)/2,m=-d*(i-s)/2+h*(o-a)/2,g=u*u,y=f*f,b=p*p,x=m*m,v=g*y-g*x-y*b;v<0&&(v=0),v/=g*x+y*b,v=Math.sqrt(v)*(l===c?-1:1);var T=v*u/f*m,w=v*-f/u*p,O=h*T-d*w+(i+s)/2,C=d*T+h*w+(o+a)/2,R=(p-T)/u,P=(m-w)/f,A=(-p-T)/u,L=(-m-w)/f,N=e(1,0,R,P),D=e(R,P,A,L);return c===0&&D>0&&(D-=t),c===1&&D<0&&(D+=t),[O,C,N,D]}function r(i,o){var s=1.3333333333333333*Math.tan(o/4),a=Math.cos(i),l=Math.sin(i),c=Math.cos(i+o),u=Math.sin(i+o);return[a,l,a-l*s,l+a*s,c+u*s,u-c*s,c,u]}return yu=function(o,s,a,l,c,u,f,d,h){var p=Math.sin(h*t/360),m=Math.cos(h*t/360),g=m*(o-a)/2+p*(s-l)/2,y=-p*(o-a)/2+m*(s-l)/2;if(g===0&&y===0)return[];if(f===0||d===0)return[];f=Math.abs(f),d=Math.abs(d);var b=g*g/(f*f)+y*y/(d*d);b>1&&(f*=Math.sqrt(b),d*=Math.sqrt(b));var x=n(o,s,a,l,c,u,f,d,p,m),v=[],T=x[2],w=x[3],O=Math.max(Math.ceil(Math.abs(w)/(t/4)),1);w/=O;for(var C=0;C<O;C++)v.push(r(T,w)),T+=w;return v.map(function(R){for(var P=0;P<R.length;P+=2){var A=R[P+0],L=R[P+1];A*=f,L*=d;var N=m*A-p*L,D=p*A+m*L;R[P+0]=N+x[0],R[P+1]=D+x[1]}return R})},yu}var _u,cy;function zC(){if(cy)return _u;cy=1;var t=1e-10,e=Math.PI/180;function n(r,i,o){if(!(this instanceof n))return new n(r,i,o);this.rx=r,this.ry=i,this.ax=o}return n.prototype.transform=function(r){var i=Math.cos(this.ax*e),o=Math.sin(this.ax*e),s=[this.rx*(r[0]*i+r[2]*o),this.rx*(r[1]*i+r[3]*o),this.ry*(-r[0]*o+r[2]*i),this.ry*(-r[1]*o+r[3]*i)],a=s[0]*s[0]+s[2]*s[2],l=s[1]*s[1]+s[3]*s[3],c=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(a+l)/2;if(c<t*u)return this.rx=this.ry=Math.sqrt(u),this.ax=0,this;var f=s[0]*s[1]+s[2]*s[3];c=Math.sqrt(c);var d=u+c/2,h=u-c/2;return this.ax=Math.abs(f)<t&&Math.abs(d-l)<t?90:Math.atan(Math.abs(f)>Math.abs(d-l)?(d-a)/f:f/(d-l))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)):(this.ax+=90,this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)),this},n.prototype.isDegenerate=function(){return this.rx<t*this.ry||this.ry<t*this.rx},_u=n,_u}var bu,ly;function qC(){if(ly)return bu;ly=1;var t=YC(),e=XC(),n=oy(),r=WC(),i=zC();function o(s){if(!(this instanceof o))return new o(s);var a=t(s);this.segments=a.segments,this.err=a.err,this.__stack=[]}return o.from=function(s){if(typeof s=="string")return new o(s);if(s instanceof o){var a=new o("");return a.err=s.err,a.segments=s.segments.map(function(l){return l.slice()}),a.__stack=s.__stack.map(function(l){return n().matrix(l.toArray())}),a}throw new Error("SvgPath.from: invalid param type "+s)},o.prototype.__matrix=function(s){var a=this,l;s.queue.length&&this.iterate(function(c,u,f,d){var h,p,m,g;switch(c[0]){case"v":h=s.calc(0,c[1],!0),p=h[0]===0?["v",h[1]]:["l",h[0],h[1]];break;case"V":h=s.calc(f,c[1],!1),p=h[0]===s.calc(f,d,!1)[0]?["V",h[1]]:["L",h[0],h[1]];break;case"h":h=s.calc(c[1],0,!0),p=h[1]===0?["h",h[0]]:["l",h[0],h[1]];break;case"H":h=s.calc(c[1],d,!1),p=h[1]===s.calc(f,d,!1)[1]?["H",h[0]]:["L",h[0],h[1]];break;case"a":case"A":var y=s.toArray(),b=i(c[1],c[2],c[3]).transform(y);if(y[0]*y[3]-y[1]*y[2]<0&&(c[5]=c[5]?"0":"1"),h=s.calc(c[6],c[7],c[0]==="a"),c[0]==="A"&&c[6]===f&&c[7]===d||c[0]==="a"&&c[6]===0&&c[7]===0){p=[c[0]==="a"?"l":"L",h[0],h[1]];break}b.isDegenerate()?p=[c[0]==="a"?"l":"L",h[0],h[1]]:p=[c[0],b.rx,b.ry,b.ax,c[4],c[5],h[0],h[1]];break;case"m":g=u>0,h=s.calc(c[1],c[2],g),p=["m",h[0],h[1]];break;default:for(m=c[0],p=[m],g=m.toLowerCase()===m,l=1;l<c.length;l+=2)h=s.calc(c[l],c[l+1],g),p.push(h[0],h[1])}a.segments[u]=p},!0)},o.prototype.__evaluateStack=function(){var s,a;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(s=n(),a=this.__stack.length;--a>=0;)s.matrix(this.__stack[a].toArray());this.__matrix(s),this.__stack=[]}},o.prototype.toString=function(){var s="",a="",l=!1;this.__evaluateStack();for(var c=0,u=this.segments.length;c<u;c++){var f=this.segments[c],d=f[0];d!==a||d==="m"||d==="M"?(d==="m"&&a==="z"&&(s+=" "),s+=d,l=!1):l=!0;for(var h=1;h<f.length;h++){var p=f[h];h===1?l&&p>=0&&(s+=" "):p>=0&&(s+=" "),s+=p}a=d}return s},o.prototype.translate=function(s,a){return this.__stack.push(n().translate(s,a||0)),this},o.prototype.scale=function(s,a){return this.__stack.push(n().scale(s,!a&&a!==0?s:a)),this},o.prototype.rotate=function(s,a,l){return this.__stack.push(n().rotate(s,a||0,l||0)),this},o.prototype.skewX=function(s){return this.__stack.push(n().skewX(s)),this},o.prototype.skewY=function(s){return this.__stack.push(n().skewY(s)),this},o.prototype.matrix=function(s){return this.__stack.push(n().matrix(s)),this},o.prototype.transform=function(s){return s.trim()?(this.__stack.push(e(s)),this):this},o.prototype.round=function(s){var a=0,l=0,c=0,u=0,f;return s=s||0,this.__evaluateStack(),this.segments.forEach(function(d){var h=d[0].toLowerCase()===d[0];switch(d[0]){case"H":case"h":h&&(d[1]+=c),c=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"V":case"v":h&&(d[1]+=u),u=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"Z":case"z":c=a,u=l;return;case"M":case"m":h&&(d[1]+=c,d[2]+=u),c=d[1]-d[1].toFixed(s),u=d[2]-d[2].toFixed(s),a=c,l=u,d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s);return;case"A":case"a":h&&(d[6]+=c,d[7]+=u),c=d[6]-d[6].toFixed(s),u=d[7]-d[7].toFixed(s),d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s),d[3]=+d[3].toFixed(s+2),d[6]=+d[6].toFixed(s),d[7]=+d[7].toFixed(s);return;default:f=d.length,h&&(d[f-2]+=c,d[f-1]+=u),c=d[f-2]-d[f-2].toFixed(s),u=d[f-1]-d[f-1].toFixed(s),d.forEach(function(p,m){m&&(d[m]=+d[m].toFixed(s))});return}}),this},o.prototype.iterate=function(s,a){var l=this.segments,c={},u=!1,f=0,d=0,h=0,p=0,m,g,y;if(a||this.__evaluateStack(),l.forEach(function(b,x){var v=s(b,x,f,d);Array.isArray(v)&&(c[x]=v,u=!0);var T=b[0]===b[0].toLowerCase();switch(b[0]){case"m":case"M":f=b[1]+(T?f:0),d=b[2]+(T?d:0),h=f,p=d;return;case"h":case"H":f=b[1]+(T?f:0);return;case"v":case"V":d=b[1]+(T?d:0);return;case"z":case"Z":f=h,d=p;return;default:f=b[b.length-2]+(T?f:0),d=b[b.length-1]+(T?d:0)}}),!u)return this;for(y=[],m=0;m<l.length;m++)if(typeof c[m]<"u")for(g=0;g<c[m].length;g++)y.push(c[m][g]);else y.push(l[m]);return this.segments=y,this},o.prototype.abs=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toUpperCase(),d;if(u!==f)switch(s[0]=f,u){case"v":s[1]+=c;return;case"a":s[6]+=l,s[7]+=c;return;default:for(d=1;d<s.length;d++)s[d]+=d%2?l:c}},!0),this},o.prototype.rel=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toLowerCase(),d;if(u!==f&&!(a===0&&u==="M"))switch(s[0]=f,u){case"V":s[1]-=c;return;case"A":s[6]-=l,s[7]-=c;return;default:for(d=1;d<s.length;d++)s[d]-=d%2?l:c}},!0),this},o.prototype.unarc=function(){return this.iterate(function(s,a,l,c){var u,f,d,h=[],p=s[0];return p!=="A"&&p!=="a"?null:(p==="a"?(f=l+s[6],d=c+s[7]):(f=s[6],d=s[7]),u=r(l,c,f,d,s[4],s[5],s[1],s[2],s[3]),u.length===0?[[s[0]==="a"?"l":"L",s[6],s[7]]]:(u.forEach(function(m){h.push(["C",m[2],m[3],m[4],m[5],m[6],m[7]])}),h))}),this},o.prototype.unshort=function(){var s=this.segments,a,l,c,u,f;return this.iterate(function(d,h,p,m){var g=d[0],y=g.toUpperCase(),b;h&&(y==="T"?(b=g==="t",c=s[h-1],c[0]==="Q"?(a=c[1]-p,l=c[2]-m):c[0]==="q"?(a=c[1]-c[3],l=c[2]-c[4]):(a=0,l=0),u=-a,f=-l,b||(u+=p,f+=m),s[h]=[b?"q":"Q",u,f,d[1],d[2]]):y==="S"&&(b=g==="s",c=s[h-1],c[0]==="C"?(a=c[3]-p,l=c[4]-m):c[0]==="c"?(a=c[3]-c[5],l=c[4]-c[6]):(a=0,l=0),u=-a,f=-l,b||(u+=p,f+=m),s[h]=[b?"c":"C",u,f,d[1],d[2],d[3],d[4]]))}),this},bu=o,bu}var xu,uy;function VC(){return uy||(uy=1,xu=qC()),xu}var KC=VC();const ZC=Jn(KC),fy=2,dy=t=>{const e=t.getAttribute("viewBox");if(e){const i=e.trim().split(/[\s,]+/);if(i.length>=4)return Math.max(parseFloat(i[2])||512,parseFloat(i[3])||512)}const n=parseFloat(t.getAttribute("width")||"")||512,r=parseFloat(t.getAttribute("height")||"")||512;return Math.max(n,r)},hy=t=>t.getAttribute("fill")==="none"||t.querySelector('[fill="none"]')!==null||t.querySelector("[stroke]")!==null,$C=({shouldApply:t,strokeWidth:e,resolution:n,renderWidth:r,renderHeight:i,originalSize:o,isOutline:s})=>{if(t&&e>0){const u=e*n;if(s){const d=Math.min(r,i)/o;return u/d}const f=Math.max(r,i);return u*(o/f)}const l=Math.max(r,i)/n/o,c=s?2:1.5;return Math.max(fy*l,c*n)},JC=(t,e,n)=>{t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(n)),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.querySelectorAll("path, rect, circle, ellipse, polygon, polyline, line").forEach(r=>{r.setAttribute("stroke",e),r.setAttribute("stroke-width",String(n)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");const i=r.getAttribute("fill");(i==="none"||!i)&&r.setAttribute("fill","none")})},QC=(t,e,n,r,i,o)=>{const s=t.getElementsByTagName("*");for(let a=0;a<s.length;a++){const l=s[a];if(l.hasAttribute("stroke-width")){const c=parseFloat(l.getAttribute("stroke-width")||"")||fy;l.setAttribute("stroke-width",String(Math.max(c*e,n*r*(i/o))))}}};function py(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.querySelector("svg");if(!r)return t;const{resolution:i,stroke:o,strokeWidth:s}=e,a=dy(r),l=hy(r),c=e.width||a,u=e.height||a,f=c*i,d=u*i,h=!!o&&(s||0)>0,p=$C({shouldApply:h,strokeWidth:s||0,resolution:i,renderWidth:f,renderHeight:d,originalSize:a,isOutline:l});if(r.getAttribute("viewBox")||r.setAttribute("viewBox",`0 0 ${a} ${a}`),r.setAttribute("width",String(f)),r.setAttribute("height",String(d)),r.setAttribute("preserveAspectRatio",l?"xMidYMid meet":"none"),h)JC(r,o,p);else if(l){const m=Math.max(c,u);QC(r,m/a,2,i,a,Math.max(f,d))}return new XMLSerializer().serializeToString(n)}function my(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.documentElement;if(r.tagName!=="svg")return t;if(!r.getAttribute("viewBox")){const i=parseFloat(r.getAttribute("width")||"")||e.width,o=parseFloat(r.getAttribute("height")||"")||e.height;r.setAttribute("viewBox",`0 0 ${i} ${o}`)}return r.setAttribute("width",String(e.width)),r.setAttribute("height",String(e.height)),e.fill&&r.setAttribute("fill",e.fill),e.stroke&&r.setAttribute("stroke",e.stroke),e.strokeWidth!=null&&r.setAttribute("stroke-width",String(e.strokeWidth)),new XMLSerializer().serializeToString(n)}const gy=t=>{const e=t.toLowerCase();return e.includes(".svg")||e.startsWith("data:image/svg")};function ei(t,e){const[n,r]=S.useState(t);return S.useEffect(()=>{if(Object.is(n,t))return;const i=setTimeout(()=>r(t),Math.max(0,e));return()=>clearTimeout(i)},[t,e]),n}const eR=({ref:t,...e})=>{const n=S.useRef(null),[r,i]=S.useState(null),{app:o}=at.useApplication(),{src:s,visible:a,mouseOverSpriteRef:l,transformation:{x:c,y:u,width:f,height:d,colorCorrection:h,effect:p,effects:m,neonColor:g,blendMode:y,border:b,roundedCorners:x,crop:v,fill:T,stroke:w,strokeWidth:O}}=e,C=lt({colorCorrection:h,effects:m??{name:p},neonColor:g,blendMode:y}),R=ei(f,120),P=ei(d,120);return S.useEffect(()=>{if(!s||!o?.renderer)return;let A=!1,L=null;return(async()=>{try{const D=Math.max(window.devicePixelRatio||2,2),F=Math.max((R||512)*D,512),G=Math.max((P||512)*D,512),z=await fetch(s);if(A||!z.ok)return;const K=await z.text();if(A)return;const se=new W.Graphics().svg(my(K,{width:F,height:G,fill:T,stroke:w,strokeWidth:O}));try{L=o.renderer.generateTexture(se)}finally{se.destroy()}if(A){L.destroy(!0),L=null;return}i(L)}catch{}})(),()=>{if(A=!0,L){const D=L;L=null,i(F=>F===D?null:F);try{D.destroy(!0)}catch{}}}},[o,s,T,w,O,R,P]),S.useEffect(()=>()=>{l&&(l.current=!1)},[l]),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:c,y:u,width:f,height:d,border:b,roundedCorners:x,crop:v,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r??W.Texture.EMPTY,alpha:r&&a?1:0,x:c,y:u,anchor:.5,width:f,height:d,filters:C,eventMode:"none"})})})},yy=I.memo(eR,(t,e)=>et(t,e,["isDragging"])),tR=({ref:t,...e})=>e.src&&!e.path&&!e.svg?M.jsx(yy,{...e,ref:t}):M.jsx(nR,{...e,ref:t}),nR=({ref:t,...e})=>{const[n,r]=I.useState(null),i=S.useRef(null),o=S.useRef(null),s=S.useRef(null),{path:a,svg:l,visible:c,disabled:u,transformation:{x:f,y:d,width:h,height:p,anchor:m,hexColor:g,fill:y,stroke:b="none",strokeWidth:x=0,colorCorrection:v={},effect:T},pointerdown:w,pointerup:O}=e,{app:C}=at.useApplication(),R=lt({colorCorrection:v,effects:{name:T}});return S.useEffect(()=>{if(!C?.renderer)return;let P;if(l)P=l;else if(a){const N=ZC(a).scale(5).translate(0,0).toString();P=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${p}">
|
|
1418
1418
|
<path stroke="${b}" stroke-width="${x}" fill="${g||y}" d="${N}">
|
|
1419
1419
|
</path>
|
|
1420
|
-
</svg>`}else return;let A=null;const L=new W.Graphics().svg(P);try{A=C.renderer.generateTexture(L)}finally{L.destroy()}return r(A),()=>{const N=A;A=null,r(D=>D===N?null:D);try{N?.destroy(!0)}catch{}}},[C,a,l,b,x,g,y,h,p]),M.jsx(Je,{...e,ref:t,children:M.jsx("pixiContainer",{ref:o,children:M.jsx("pixiContainer",{ref:s,children:n&&M.jsx("pixiSprite",{texture:n,width:h,height:p,anchor:m,ref:i,x:f,y:d,alpha:c?1:0,...!u&&c&&{eventMode:"static",onPointerDown:w,onPointerUp:O},filters:R})})})})},_y=I.memo(tR,tt),vu=t=>{if(!(!t||t===W.Texture.EMPTY))try{t.destroy(!0)}catch{}};function by({src:t,width:e,height:n,stroke:r,strokeWidth:i,resolution:o=2,resizeDebounceMs:s=120}){const[a,l]=S.useState(null),[c,u]=S.useState(!0),f=S.useRef(null),d=ei(e,s),h=ei(n,s);return S.useEffect(()=>{let p=!1,m=null,g=null;const y=(b,x)=>{if(p){x&&vu(b);return}const v=f.current;f.current=x?b:null,l(b),u(!1),v&&v!==b&&vu(v)};if(!t){y(null,!1);return}return u(!0),gy(t)?(async()=>{try{const x=await fetch(t);if(p)return;if(!x.ok){y(null,!1);return}const v=py(await x.text(),{width:d,height:h,resolution:o,stroke:r,strokeWidth:i});if(p)return;const T=URL.createObjectURL(new Blob([v],{type:"image/svg+xml;charset=utf-8"}));m=new Image,m.crossOrigin="anonymous",m.onload=()=>{if(URL.revokeObjectURL(T),p)return;const w=Math.round((d||512)*o),O=Math.round((h||512)*o);try{const C=document.createElement("canvas");C.width=w,C.height=O;const R=C.getContext("2d",{alpha:!0});if(!R||!m){y(null,!1);return}R.clearRect(0,0,w,O),R.drawImage(m,0,0,w,O);const P=new W.CanvasSource({resource:C,scaleMode:"linear",resolution:o});y(new W.Texture({source:P}),!0)}catch{y(null,!1)}},m.onerror=()=>{URL.revokeObjectURL(T),y(null,!1)},m.src=T}catch{y(null,!1)}})():(g=ro(t),g.promise.then(b=>y(b,!1))),()=>{p=!0,g?.cancel(),m&&(m.onload=null,m.onerror=null)}},[t,d,h,r,i,o]),S.useEffect(()=>()=>{vu(f.current),f.current=null},[]),{texture:a,isLoading:c}}const rR=t=>{try{return new W.Color(t).toNumber()}catch{return 16777215}},iR=({ref:t,...e})=>{const n=S.useRef(null),{src:r,uniqueId:i,visible:o,mouseOverSpriteRef:s,transformation:{x:a,y:l,width:c,height:u,colorCorrection:f,effect:d,effects:h,neonColor:p,blendMode:m,border:g,roundedCorners:y,crop:b,color:x,fill:v,stroke:T,strokeColor:w,strokeWidth:O}}=e,C=ut({colorCorrection:f,effects:h??{name:d},neonColor:p,blendMode:m}),{texture:R}=by({src:r,width:c,height:u,stroke:T||w,strokeWidth:O}),P=S.useMemo(()=>rR(x||v||"black"),[x,v]),A=!!R&&R!==W.Texture.EMPTY;return S.useEffect(()=>()=>{s&&(s.current=!1)},[s]),M.jsx(Je,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:g,roundedCorners:y,crop:b,spriteRef:n,children:M.jsx("pixiSprite",{label:`sprite-${i}`,ref:n,texture:A?R:W.Texture.EMPTY,alpha:A&&o?1:0,x:a,y:l,anchor:.5,width:c||(A?c:100),height:u||(A?u:100),tint:A?P:16777215,filters:C,eventMode:"none"},`sprite-${i}`)})})},oR=I.memo(iR,(t,e)=>tt(t,e,["isDragging"]));function lo(){return lo=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lo.apply(this,arguments)}var yt,Tu,ti,xy,ni,vy,Ty=function(){return yt||typeof window<"u"&&(yt=window.gsap)&&yt.registerPlugin&&yt},Eu=function(e){return typeof e=="function"},uo=Math.atan2,Ey=Math.cos,Sy=Math.sin,Fn=Math.sqrt,fo=Math.PI,wy=fo*2,sR=fo*.3,aR=fo*.7,Su=1e20,ri=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,cR=/(^[#.][a-z]|[a-y][a-z])/i,lR=/[achlmqstvz]/i,yn=function(e){return console&&console.warn(e)},Gt=function(e){return Math.round(e*1e5)/1e5||0},Ay=function(e){var n=e.length,r=0,i=0,o;for(o=0;o<n;o++)r+=e[o++],i+=e[o];return[r/(n/2),i/(n/2)]},fr=function(e){var n=e.length,r=e[0],i=r,o=e[1],s=o,a,l,c;for(c=6;c<n;c+=6)a=e[c],l=e[c+1],a>r?r=a:a<i&&(i=a),l>o?o=l:l<s&&(s=l);return e.centerX=(r+i)/2,e.centerY=(o+s)/2,e.size=(r-i)*(o-s)},ii=function(e,n){n===void 0&&(n=3);for(var r=e.length,i=e[0][0],o=i,s=e[0][1],a=s,l=1/n,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C;--r>-1;)for(h=e[r],c=h.length,d=6;d<c;d+=6)for(y=h[d],b=h[d+1],x=h[d+2]-y,w=h[d+3]-b,v=h[d+4]-y,O=h[d+5]-b,T=h[d+6]-y,C=h[d+7]-b,p=n;--p>-1;)m=l*p,g=1-m,u=(m*m*T+3*g*(m*v+g*x))*m+y,f=(m*m*C+3*g*(m*O+g*w))*m+b,u>i?i=u:u<o&&(o=u),f>s?s=f:f<a&&(a=f);return e.centerX=(i+o)/2,e.centerY=(s+a)/2,e.left=o,e.width=i-o,e.top=a,e.height=s-a,e.size=(i-o)*(s-a)},Oy=function(e,n){return n.length-e.length},Cy=function(e,n){var r=e.size||fr(e),i=n.size||fr(n);return Math.abs(i-r)<(r+i)/20?n.centerX-e.centerX||n.centerY-e.centerY:i-r},Ry=function(e,n){var r=e.slice(0),i=e.length,o=i-2,s,a;for(n=n|0,s=0;s<i;s++)a=(s+n)%o,e[s++]=r[a],e[s]=r[a+1]},wu=function(e,n,r,i,o){var s=e.length,a=0,l=s-2,c,u,f,d;for(r*=6,u=0;u<s;u+=6)c=(u+r)%l,d=e[c]-(n[u]-i),f=e[c+1]-(n[u+1]-o),a+=Fn(f*f+d*d);return a},uR=function(e,n,r){var i=e.length,o=Ay(e),s=Ay(n),a=s[0]-o[0],l=s[1]-o[1],c=wu(e,n,0,a,l),u=0,f,d,h;for(h=6;h<i;h+=6)d=wu(e,n,h/6,a,l),d<c&&(c=d,u=h);if(r)for(f=e.slice(0),nr(f),h=6;h<i;h+=6)d=wu(f,n,h/6,a,l),d<c&&(c=d,u=-h);return u/6},fR=function(e,n,r){for(var i=e.length,o=Su,s=0,a=0,l,c,u,f,d,h;--i>-1;)for(l=e[i],h=l.length,d=0;d<h;d+=6)c=l[d]-n,u=l[d+1]-r,f=Fn(c*c+u*u),f<o&&(o=f,s=l[d],a=l[d+1]);return[s,a]},dR=function(e,n,r,i,o,s){var a=n.length,l=0,c=Math.min(e.size||fr(e),n[r].size||fr(n[r]))*i,u=Su,f=e.centerX+o,d=e.centerY+s,h,p,m,g,y;for(p=r;p<a&&(h=n[p].size||fr(n[p]),!(h<c));p++)m=n[p].centerX-f,g=n[p].centerY-d,y=Fn(m*m+g*g),y<u&&(l=p,u=y);return y=n[l],n.splice(l,1),y},hR=function(e,n,r){r===void 0&&(r=1);for(var i=e[n],o=e[n+1],s=e[n+2],a=e[n+3],l=e[n+4],c=e[n+5],u=e[n+6],f=e[n+7],d,h,p,m,g,y,b,x,v;r-- >0;)d=1-1/(r+2),h=i+(s-i)*d,p=s+(l-s)*d,m=o+(a-o)*d,g=a+(c-a)*d,y=h+(p-h)*d,b=m+(g-m)*d,x=l+(u-l)*d,v=c+(f-c)*d,p+=(x-p)*d,g+=(v-g)*d,e.splice(n+2,4,s=Gt(h),a=Gt(m),l=Gt(y),c=Gt(b),u=Gt(y+(p-y)*d),f=Gt(b+(g-b)*d),Gt(p),Gt(g),Gt(x),Gt(v))},pR=function(e){for(var n=e.length,r=-Su,i;n--;)e[n]>r&&(r=e[n],i=n);return i},ho=function(e,n){for(var r=[],i=[],o=e.length-2,s=0;s<o;s+=6)r.push(Math.pow(e[s]-e[s+6],2)+Math.pow(e[s+1]-e[s+7],2));for(;n--;)s=pR(r),i[s]=o=(i[s]||0)+1,r[s]*=o/(o+1);for(s=r.length;s--;)i[s]&&hR(e,s*6,i[s])},Au=function(e,n){return n||Zt(e),Math.max(4,Math.round(e.totalLength/4))},Iy=function(e){return e.slice(0).sort(Oy)},My=function(e){for(var n=e[0],r=e[1],i=2;i<e.length;i+=2)if(Math.abs(e[i]-n)>.01||Math.abs(e[i+1]-r)>.01)return!1;return!0},Ou=function(e,n){n=n||{};var r=n,i=r.redraw,o=r.points,s=r.maxSegments,a=s===void 0?999:s,l=0,c=e,u=Array.isArray(o)?o:0,f,d,h,p,m;if(i=i!==!1,i)Zt(e);else for(e.totalPoints=0,d=e.length;d--;)e.totalPoints+=e[d].length;for(u?(c=Iy(e),u=Iy(u),m=u[0].totalLength/Math.round(u[0].length/6)):((!o||o==="auto")&&(o=Au(e,i),i||(o-=Math.round(e.totalPoints/6))),o=Math.max(i?10:4,Math.min(999,o))),d=0;d<c.length;d++){if(h=c[d],f=Math.max(i?10:4,u?Math.round(u[d]?u[d].length/6:c[d].totalLength/m||0):Math.round((l/o+(i?h.totalLength/e.totalLength:h.length/e.totalPoints))*o)-l),!(d>=a||u&&(!u[d]||My(u[d]))))if(i){var g;p=qi(MS(h,f),n.curviness),h.length=0,(g=h).push.apply(g,p)}else ho(h,f);l+=f}return e},Cu=function(e,n,r,i,o){var s=n.length-e.length,a=s>0?n:e,l=s>0?e:n,c=0,u=i==="complexity"?Oy:Cy,f=i==="position"?0:typeof i=="number"?i:.8,d=l.length,h=typeof r=="object"&&r.push?r.slice(0):[r],p=h[0]==="reverse"||h[0]<0,m=r==="log",g,y,b,x,v,T,w;if(l[0]){if(a.length>1&&(e.sort(u),n.sort(u),a.size||ii(a),l.size||ii(l),T=a.centerX-l.centerX,w=a.centerY-l.centerY,u===Cy))for(d=0;d<l.length;d++)a.splice(d,0,dR(l[d],a,d,f,T,w));if(s)for(s<0&&(s=-s),a[0].length>l[0].length&&ho(l[0],(a[0].length-l[0].length)/6|0),d=l.length;c<s;)x=a[d].size||fr(a[d]),b=fR(l,a[d].centerX,a[d].centerY),x=b[0],v=b[1],l[d++]=[x,v,x,v,x,v,x,v],l.totalPoints+=8,c++;for(d=0;d<e.length;d++)g=n[d],y=e[d],s=g.length-y.length,s<0?ho(g,-s/6|0):s>0&&ho(y,s/6|0),p&&o!==!1&&!y.reversed&&nr(y),r=h[d]||h[d]===0?h[d]:"auto",r&&(y.closed||Math.abs(y[0]-y[y.length-2])<.5&&Math.abs(y[1]-y[y.length-1])<.5?r==="auto"||r==="log"?(h[d]=r=uR(y,g,!d||o===!1),r<0&&(p=!0,nr(y),r=-r),Ry(y,r*6)):r!=="reverse"&&(d&&r<0&&nr(y),Ry(y,(r<0?-r:r)*6)):!p&&(r==="auto"&&Math.abs(g[0]-y[0])+Math.abs(g[1]-y[1])+Math.abs(g[g.length-2]-y[y.length-2])+Math.abs(g[g.length-1]-y[y.length-1])>Math.abs(g[0]-y[y.length-2])+Math.abs(g[1]-y[y.length-1])+Math.abs(g[g.length-2]-y[0])+Math.abs(g[g.length-1]-y[1])||r%2)?(nr(y),h[d]=-1,p=!0):r==="auto"?h[d]=0:r==="reverse"&&(h[d]=-1),y.closed!==g.closed&&(y.closed=g.closed=!1));return m&&yn("shapeIndex:["+h.join(",")+"]"),e.shapeIndex=h,h}},Ly=function(e,n,r,i,o){var s=Dt(e[0]),a=Dt(e[1]);Cu(s,a,n||n===0?n:"auto",r,o)&&(e[0]=hn(s),e[1]=hn(a),(i==="log"||i===!0)&&yn('precompile:["'+e[0]+'","'+e[1]+'"]'))},mR=function(e,n){if(!n)return e;var r=e.match(ri)||[],i=r.length,o="",s,a,l;for(n==="reverse"?(a=i-1,s=-2):(a=((parseInt(n,10)||0)*2+1+i*100)%i,s=2),l=0;l<i;l+=2)o+=r[a-1]+","+r[a]+" ",a=(a+s)%i;return o},Py=function(e,n){var r=0,i=parseFloat(e[0]),o=parseFloat(e[1]),s=i+","+o+" ",a=.999999,l,c,u,f,d,h,p;for(u=e.length,l=n*.5/(u*.5-1),c=0;c<u-2;c+=2){if(r+=l,h=parseFloat(e[c+2]),p=parseFloat(e[c+3]),r>a)for(d=1/(Math.floor(r)+1),f=1;r>a;)s+=(i+(h-i)*d*f).toFixed(2)+","+(o+(p-o)*d*f).toFixed(2)+" ",r--,f++;s+=h+","+p+" ",i=h,o=p}return s},Ru=function(e){var n=e[0].match(ri)||[],r=e[1].match(ri)||[],i=r.length-n.length;i>0?e[0]=Py(n,i):e[1]=Py(r,-i)},gR=function(e){return isNaN(e)?Ru:function(n){Ru(n),n[1]=mR(n[1],parseInt(e,10))}},yR=function(e,n,r){var i=typeof e=="string",o,s;return(!i||cR.test(e)||(e.match(ri)||[]).length<3)&&(o=Tu(e)[0],o?(s=(o.nodeName+"").toUpperCase(),n&&s!=="PATH"&&(o=va(o,!1),s="PATH"),e=o.getAttribute(s==="PATH"?"d":"points")||"",o===r&&(e=o.getAttributeNS(null,"data-original")||e)):(yn("WARNING: invalid morph to: "+e),e=!1)),e},Ny=function(e){for(var n=e.length,r,i,o,s,a,l,c,u;--n>-1;)for(r=e[n],u=r.cpData=r.cpData||[],u.length=0,c=r.length-2,l=0;l<c;l+=6)i=r[l]-r[l+2],o=r[l+1]-r[l+3],s=r[l+6]-r[l+4],a=r[l+7]-r[l+5],u[l+2]=uo(o,i),u[l+3]=Fn(i*i+o*o),u[l+4]=uo(a,s),u[l+5]=Fn(s*s+a*a);return e},ky=function(e){var n=e.trim().split(" "),r=~e.indexOf("left")?0:~e.indexOf("right")?100:isNaN(parseFloat(n[0]))?50:parseFloat(n[0]),i=~e.indexOf("top")?0:~e.indexOf("bottom")?100:isNaN(parseFloat(n[1]))?50:parseFloat(n[1]);return{x:r/100,y:i/100}},Dy=function(e){return e!==e%fo?e+(e<0?wy:-wy):e},Fy="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",_R=function(e,n,r,i){var o=this._origin,s=this._eOrigin,a=e[r]-o.x,l=e[r+1]-o.y,c=Fn(a*a+l*l),u=uo(l,a),f,d;return a=n[r]-s.x,l=n[r+1]-s.y,f=uo(l,a)-u,d=Dy(f),!i&&ti&&Math.abs(d+ti.ca)<sR&&(i=ti),this._anchorPT=ti={_next:this._anchorPT,t:e,sa:u,ca:i&&d*i.ca<0&&Math.abs(d)>aR?f:d,sl:c,cl:Fn(a*a+l*l)-c,i:r}},By=function(e){yt=Ty(),ni=ni||yt&&yt.plugins.morphSVG,yt&&ni?(Tu=yt.utils.toArray,vy=yt.core.reverting||function(){},ni.prototype._tweenRotation=_R,xy=1):e&&yn("Please gsap.registerPlugin(MorphSVGPlugin)")},dr={version:"3.15.0",name:"morphSVG",rawVars:1,register:function(e,n){yt=e,ni=n,By()},init:function(e,n,r,i,o){if(xy||By(1),!n)return yn("invalid shape"),!1;Eu(n)&&(n=n.call(r,i,e,o));var s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R;if(typeof n=="string"||n.getBBox||n[0])n={shape:n};else if(typeof n=="object"){s={};for(a in n)s[a]=Eu(n[a])&&a!=="render"?n[a].call(r,i,e,o):n[a];n=s}var P=e.nodeType?window.getComputedStyle(e):{},A=P.fill+"",L=!(A==="none"||(A.match(ri)||[])[3]==="0"||P.fillRule==="evenodd"),N=n.smooth,D=(n.origin||"50 50").split(",");if(N===!0||N==="auto"?N={}:typeof N=="number"&&(N={points:N}),s=(e.nodeName+"").toUpperCase(),u=s==="POLYLINE"||s==="POLYGON",s!=="PATH"&&!u&&!n.prop)return yn("Cannot morph a <"+s+"> element. "+Fy),!1;if(a=s==="PATH"?"d":"points",!n.prop&&!Eu(e.setAttribute))return!1;if(c=yR(n.shape||n.d||n.points||"",a==="d",e),u&&lR.test(c))return yn("A <"+s+"> cannot accept path data. "+Fy),!1;if(f=n.shapeIndex||n.shapeIndex===0?n.shapeIndex:"auto",d=n.map||dr.defaultMap,this._prop=n.prop,this._render=n.render||dr.defaultRender,this._apply="updateTarget"in n?n.updateTarget:dr.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(n.precision)?2:+n.precision),this._tween=r,c){if(this._target=e,w=typeof n.precompile=="object",m=this._original=this._prop?e[this._prop]:e.getAttribute(a),!this._prop&&!e.getAttributeNS(null,"data-original")&&e.setAttributeNS(null,"data-original",m),a==="d"||this._prop){if(m=Dt(w?n.precompile[0]:m),g=Dt(w?n.precompile[1]:c),N){for(b=m.length;--b;)My(m[b])&&m.splice(b,1);Ou(m,lo({},N,{points:+N.points||Math.max(Au(m),Au(g)),maxSegments:g.length})),Ou(g,N.redraw===!1?N:lo({},N,{points:m}))}if(!w&&!Cu(m,g,f,d,L))return!1;for((n.precompile==="log"||n.precompile===!0)&&yn('precompile:["'+hn(m)+'","'+hn(g)+'"]'),C=(n.type||dr.defaultType)!=="linear",R=n.curveMode||C,Ny(m),Ny(g),C&&(m.size||ii(m),g.size||ii(g),O=ky(D[0]),this._origin=m.origin={x:m.left+O.x*m.width,y:m.top+O.y*m.height},D[1]&&(O=ky(D[1])),this._eOrigin={x:g.left+O.x*g.width,y:g.top+O.y*g.height}),this._rawPath=e._gsRawPath=m,b=m.length;--b>-1;){for(v=m[b],T=g[b],h=v.cpData,p=T.cpData,x=v.length,ti=0,y=0;y<x;y+=6)(T[y]!==v[y]||T[y+1]!==v[y+1])&&(C?l=this._tweenRotation(v,T,y):(l=this.add(v,y,v[y],T[y],0,0,0,0,0,1),l=this.add(v,y+1,v[y+1],T[y+1],0,0,0,0,0,1)||l));for(y=0;y<x;y+=2)R&&(h[y]!==p[y]||h[y+1]!==p[y+1])&&h[y+1]&&p[y+1]?this._controlPT={_next:this._controlPT,i:y,j:b,ai:y%6>3?y+2:y-2,sa:h[y],ca:Dy(p[y]-h[y]),sl:h[y+1],cl:p[y+1]-h[y+1]}:(T[y]!==v[y]&&(l=this.add(v,y,v[y],T[y],0,0,0,0,0,1)),T[y+1]!==v[y+1]&&(l=this.add(v,y+1,v[y+1],T[y+1],0,0,0,0,0,1)||l))}}else l=this.add(e,"setAttribute",e.getAttribute(a)+"",c+"",i,o,0,gR(f),a);C&&(this.add(this._origin,"x",this._origin.x,this._eOrigin.x,0,0,0,0,0,1),l=this.add(this._origin,"y",this._origin.y,this._eOrigin.y,0,0,0,0,0,1)),l&&(this._props.push("morphSVG"),l.end=N&&N.persist!==!1?hn(g):c,l.endProp=a)}return 1},render:function(e,n){for(var r=n._rawPath,i=n._controlPT,o=n._anchorPT,s=n._rnd,a=n._target,l=n._pt,c,u,f,d,h,p,m,g,y;l;)l.r(e,l.d),l=l._next;if(e===1&&n._apply)for(l=n._pt;l;)l.end&&(n._prop?a[n._prop]=l.end:a.setAttribute(l.endProp,l.end)),l=l._next;else if(r){for(;o;)h=o.sa+e*o.ca,d=o.sl+e*o.cl,o.t[o.i]=n._origin.x+Ey(h)*d,o.t[o.i+1]=n._origin.y+Sy(h)*d,o=o._next;for(;i;)f=r[i.j],p=i.i,h=i.sa+e*i.ca,g=Sy(h),y=Ey(h),d=i.sl+e*i.cl,f[p]=f[i.ai]-y*d,f[p+1]=f[i.ai+1]-g*d,i=i._next;if(!e&&vy()&&(r=Dt(n._original)),a._gsRawPath=r,n._apply){for(c="",u=" ",m=0;m<r.length;m++){for(f=r[m],d=f.length,c+="M"+(f[0]*s|0)/s+u+(f[1]*s|0)/s+" C",p=2;p<d;p++)c+=(f[p]*s|0)/s+u;f.closed&&(c+="z")}n._prop?a[n._prop]=c:a.setAttribute("d",c)}}n._render&&r&&n._render.call(n._tween,r,a)},kill:function(e){this._pt=this._rawPath=0},getRawPath:Hr,stringToRawPath:Dt,rawPathToString:hn,smoothRawPath:Ou,normalizeStrings:function(e,n,r){var i=r.shapeIndex,o=r.map,s=[e,n];return Ly(s,i,o),s},pathFilter:Ly,pointsFilter:Ru,getTotalSize:ii,equalizeSegmentQuantity:Cu,convertToPath:function(e,n){return Tu(e).map(function(r){return va(r,n!==!1)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};Ty()&&yt.registerPlugin(dr),E.gsap.registerPlugin(dr);const Uy=(t,e,n,r,i,o,s)=>`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${n}" viewBox="${r}">
|
|
1420
|
+
</svg>`}else return;let A=null;const L=new W.Graphics().svg(P);try{A=C.renderer.generateTexture(L)}finally{L.destroy()}return r(A),()=>{const N=A;A=null,r(D=>D===N?null:D);try{N?.destroy(!0)}catch{}}},[C,a,l,b,x,g,y,h,p]),M.jsx($e,{...e,ref:t,children:M.jsx("pixiContainer",{ref:o,children:M.jsx("pixiContainer",{ref:s,children:n&&M.jsx("pixiSprite",{texture:n,width:h,height:p,anchor:m,ref:i,x:f,y:d,alpha:c?1:0,...!u&&c&&{eventMode:"static",onPointerDown:w,onPointerUp:O},filters:R})})})})},_y=I.memo(tR,et),vu=t=>{if(!(!t||t===W.Texture.EMPTY))try{t.destroy(!0)}catch{}};function by({src:t,width:e,height:n,stroke:r,strokeWidth:i,resolution:o=2,resizeDebounceMs:s=120}){const[a,l]=S.useState(null),[c,u]=S.useState(!0),f=S.useRef(null),d=ei(e,s),h=ei(n,s);return S.useEffect(()=>{let p=!1,m=null,g=null;const y=(b,x)=>{if(p){x&&vu(b);return}const v=f.current;f.current=x?b:null,l(b),u(!1),v&&v!==b&&vu(v)};if(!t){y(null,!1);return}return u(!0),gy(t)?(async()=>{try{const x=await fetch(t);if(p)return;if(!x.ok){y(null,!1);return}const v=py(await x.text(),{width:d,height:h,resolution:o,stroke:r,strokeWidth:i});if(p)return;const T=URL.createObjectURL(new Blob([v],{type:"image/svg+xml;charset=utf-8"}));m=new Image,m.crossOrigin="anonymous",m.onload=()=>{if(URL.revokeObjectURL(T),p)return;const w=Math.round((d||512)*o),O=Math.round((h||512)*o);try{const C=document.createElement("canvas");C.width=w,C.height=O;const R=C.getContext("2d",{alpha:!0});if(!R||!m){y(null,!1);return}R.clearRect(0,0,w,O),R.drawImage(m,0,0,w,O);const P=new W.CanvasSource({resource:C,scaleMode:"linear",resolution:o});y(new W.Texture({source:P}),!0)}catch{y(null,!1)}},m.onerror=()=>{URL.revokeObjectURL(T),y(null,!1)},m.src=T}catch{y(null,!1)}})():(g=ro(t),g.promise.then(b=>y(b,!1))),()=>{p=!0,g?.cancel(),m&&(m.onload=null,m.onerror=null)}},[t,d,h,r,i,o]),S.useEffect(()=>()=>{vu(f.current),f.current=null},[]),{texture:a,isLoading:c}}const rR=t=>{try{return new W.Color(t).toNumber()}catch{return 16777215}},iR=({ref:t,...e})=>{const n=S.useRef(null),{src:r,uniqueId:i,visible:o,mouseOverSpriteRef:s,transformation:{x:a,y:l,width:c,height:u,colorCorrection:f,effect:d,effects:h,neonColor:p,blendMode:m,border:g,roundedCorners:y,crop:b,color:x,fill:v,stroke:T,strokeColor:w,strokeWidth:O}}=e,C=lt({colorCorrection:f,effects:h??{name:d},neonColor:p,blendMode:m}),{texture:R}=by({src:r,width:c,height:u,stroke:T||w,strokeWidth:O}),P=S.useMemo(()=>rR(x||v||"black"),[x,v]),A=!!R&&R!==W.Texture.EMPTY;return S.useEffect(()=>()=>{s&&(s.current=!1)},[s]),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:g,roundedCorners:y,crop:b,spriteRef:n,children:M.jsx("pixiSprite",{label:`sprite-${i}`,ref:n,texture:A?R:W.Texture.EMPTY,alpha:A&&o?1:0,x:a,y:l,anchor:.5,width:c||(A?c:100),height:u||(A?u:100),tint:A?P:16777215,filters:C,eventMode:"none"},`sprite-${i}`)})})},oR=I.memo(iR,(t,e)=>et(t,e,["isDragging"]));function lo(){return lo=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lo.apply(this,arguments)}var yt,Tu,ti,xy,ni,vy,Ty=function(){return yt||typeof window<"u"&&(yt=window.gsap)&&yt.registerPlugin&&yt},Eu=function(e){return typeof e=="function"},uo=Math.atan2,Ey=Math.cos,Sy=Math.sin,Fn=Math.sqrt,fo=Math.PI,wy=fo*2,sR=fo*.3,aR=fo*.7,Su=1e20,ri=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,cR=/(^[#.][a-z]|[a-y][a-z])/i,lR=/[achlmqstvz]/i,yn=function(e){return console&&console.warn(e)},Ut=function(e){return Math.round(e*1e5)/1e5||0},Ay=function(e){var n=e.length,r=0,i=0,o;for(o=0;o<n;o++)r+=e[o++],i+=e[o];return[r/(n/2),i/(n/2)]},fr=function(e){var n=e.length,r=e[0],i=r,o=e[1],s=o,a,l,c;for(c=6;c<n;c+=6)a=e[c],l=e[c+1],a>r?r=a:a<i&&(i=a),l>o?o=l:l<s&&(s=l);return e.centerX=(r+i)/2,e.centerY=(o+s)/2,e.size=(r-i)*(o-s)},ii=function(e,n){n===void 0&&(n=3);for(var r=e.length,i=e[0][0],o=i,s=e[0][1],a=s,l=1/n,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C;--r>-1;)for(h=e[r],c=h.length,d=6;d<c;d+=6)for(y=h[d],b=h[d+1],x=h[d+2]-y,w=h[d+3]-b,v=h[d+4]-y,O=h[d+5]-b,T=h[d+6]-y,C=h[d+7]-b,p=n;--p>-1;)m=l*p,g=1-m,u=(m*m*T+3*g*(m*v+g*x))*m+y,f=(m*m*C+3*g*(m*O+g*w))*m+b,u>i?i=u:u<o&&(o=u),f>s?s=f:f<a&&(a=f);return e.centerX=(i+o)/2,e.centerY=(s+a)/2,e.left=o,e.width=i-o,e.top=a,e.height=s-a,e.size=(i-o)*(s-a)},Oy=function(e,n){return n.length-e.length},Cy=function(e,n){var r=e.size||fr(e),i=n.size||fr(n);return Math.abs(i-r)<(r+i)/20?n.centerX-e.centerX||n.centerY-e.centerY:i-r},Ry=function(e,n){var r=e.slice(0),i=e.length,o=i-2,s,a;for(n=n|0,s=0;s<i;s++)a=(s+n)%o,e[s++]=r[a],e[s]=r[a+1]},wu=function(e,n,r,i,o){var s=e.length,a=0,l=s-2,c,u,f,d;for(r*=6,u=0;u<s;u+=6)c=(u+r)%l,d=e[c]-(n[u]-i),f=e[c+1]-(n[u+1]-o),a+=Fn(f*f+d*d);return a},uR=function(e,n,r){var i=e.length,o=Ay(e),s=Ay(n),a=s[0]-o[0],l=s[1]-o[1],c=wu(e,n,0,a,l),u=0,f,d,h;for(h=6;h<i;h+=6)d=wu(e,n,h/6,a,l),d<c&&(c=d,u=h);if(r)for(f=e.slice(0),nr(f),h=6;h<i;h+=6)d=wu(f,n,h/6,a,l),d<c&&(c=d,u=-h);return u/6},fR=function(e,n,r){for(var i=e.length,o=Su,s=0,a=0,l,c,u,f,d,h;--i>-1;)for(l=e[i],h=l.length,d=0;d<h;d+=6)c=l[d]-n,u=l[d+1]-r,f=Fn(c*c+u*u),f<o&&(o=f,s=l[d],a=l[d+1]);return[s,a]},dR=function(e,n,r,i,o,s){var a=n.length,l=0,c=Math.min(e.size||fr(e),n[r].size||fr(n[r]))*i,u=Su,f=e.centerX+o,d=e.centerY+s,h,p,m,g,y;for(p=r;p<a&&(h=n[p].size||fr(n[p]),!(h<c));p++)m=n[p].centerX-f,g=n[p].centerY-d,y=Fn(m*m+g*g),y<u&&(l=p,u=y);return y=n[l],n.splice(l,1),y},hR=function(e,n,r){r===void 0&&(r=1);for(var i=e[n],o=e[n+1],s=e[n+2],a=e[n+3],l=e[n+4],c=e[n+5],u=e[n+6],f=e[n+7],d,h,p,m,g,y,b,x,v;r-- >0;)d=1-1/(r+2),h=i+(s-i)*d,p=s+(l-s)*d,m=o+(a-o)*d,g=a+(c-a)*d,y=h+(p-h)*d,b=m+(g-m)*d,x=l+(u-l)*d,v=c+(f-c)*d,p+=(x-p)*d,g+=(v-g)*d,e.splice(n+2,4,s=Ut(h),a=Ut(m),l=Ut(y),c=Ut(b),u=Ut(y+(p-y)*d),f=Ut(b+(g-b)*d),Ut(p),Ut(g),Ut(x),Ut(v))},pR=function(e){for(var n=e.length,r=-Su,i;n--;)e[n]>r&&(r=e[n],i=n);return i},ho=function(e,n){for(var r=[],i=[],o=e.length-2,s=0;s<o;s+=6)r.push(Math.pow(e[s]-e[s+6],2)+Math.pow(e[s+1]-e[s+7],2));for(;n--;)s=pR(r),i[s]=o=(i[s]||0)+1,r[s]*=o/(o+1);for(s=r.length;s--;)i[s]&&hR(e,s*6,i[s])},Au=function(e,n){return n||Zt(e),Math.max(4,Math.round(e.totalLength/4))},Iy=function(e){return e.slice(0).sort(Oy)},My=function(e){for(var n=e[0],r=e[1],i=2;i<e.length;i+=2)if(Math.abs(e[i]-n)>.01||Math.abs(e[i+1]-r)>.01)return!1;return!0},Ou=function(e,n){n=n||{};var r=n,i=r.redraw,o=r.points,s=r.maxSegments,a=s===void 0?999:s,l=0,c=e,u=Array.isArray(o)?o:0,f,d,h,p,m;if(i=i!==!1,i)Zt(e);else for(e.totalPoints=0,d=e.length;d--;)e.totalPoints+=e[d].length;for(u?(c=Iy(e),u=Iy(u),m=u[0].totalLength/Math.round(u[0].length/6)):((!o||o==="auto")&&(o=Au(e,i),i||(o-=Math.round(e.totalPoints/6))),o=Math.max(i?10:4,Math.min(999,o))),d=0;d<c.length;d++){if(h=c[d],f=Math.max(i?10:4,u?Math.round(u[d]?u[d].length/6:c[d].totalLength/m||0):Math.round((l/o+(i?h.totalLength/e.totalLength:h.length/e.totalPoints))*o)-l),!(d>=a||u&&(!u[d]||My(u[d]))))if(i){var g;p=qi(MS(h,f),n.curviness),h.length=0,(g=h).push.apply(g,p)}else ho(h,f);l+=f}return e},Cu=function(e,n,r,i,o){var s=n.length-e.length,a=s>0?n:e,l=s>0?e:n,c=0,u=i==="complexity"?Oy:Cy,f=i==="position"?0:typeof i=="number"?i:.8,d=l.length,h=typeof r=="object"&&r.push?r.slice(0):[r],p=h[0]==="reverse"||h[0]<0,m=r==="log",g,y,b,x,v,T,w;if(l[0]){if(a.length>1&&(e.sort(u),n.sort(u),a.size||ii(a),l.size||ii(l),T=a.centerX-l.centerX,w=a.centerY-l.centerY,u===Cy))for(d=0;d<l.length;d++)a.splice(d,0,dR(l[d],a,d,f,T,w));if(s)for(s<0&&(s=-s),a[0].length>l[0].length&&ho(l[0],(a[0].length-l[0].length)/6|0),d=l.length;c<s;)x=a[d].size||fr(a[d]),b=fR(l,a[d].centerX,a[d].centerY),x=b[0],v=b[1],l[d++]=[x,v,x,v,x,v,x,v],l.totalPoints+=8,c++;for(d=0;d<e.length;d++)g=n[d],y=e[d],s=g.length-y.length,s<0?ho(g,-s/6|0):s>0&&ho(y,s/6|0),p&&o!==!1&&!y.reversed&&nr(y),r=h[d]||h[d]===0?h[d]:"auto",r&&(y.closed||Math.abs(y[0]-y[y.length-2])<.5&&Math.abs(y[1]-y[y.length-1])<.5?r==="auto"||r==="log"?(h[d]=r=uR(y,g,!d||o===!1),r<0&&(p=!0,nr(y),r=-r),Ry(y,r*6)):r!=="reverse"&&(d&&r<0&&nr(y),Ry(y,(r<0?-r:r)*6)):!p&&(r==="auto"&&Math.abs(g[0]-y[0])+Math.abs(g[1]-y[1])+Math.abs(g[g.length-2]-y[y.length-2])+Math.abs(g[g.length-1]-y[y.length-1])>Math.abs(g[0]-y[y.length-2])+Math.abs(g[1]-y[y.length-1])+Math.abs(g[g.length-2]-y[0])+Math.abs(g[g.length-1]-y[1])||r%2)?(nr(y),h[d]=-1,p=!0):r==="auto"?h[d]=0:r==="reverse"&&(h[d]=-1),y.closed!==g.closed&&(y.closed=g.closed=!1));return m&&yn("shapeIndex:["+h.join(",")+"]"),e.shapeIndex=h,h}},Ly=function(e,n,r,i,o){var s=kt(e[0]),a=kt(e[1]);Cu(s,a,n||n===0?n:"auto",r,o)&&(e[0]=hn(s),e[1]=hn(a),(i==="log"||i===!0)&&yn('precompile:["'+e[0]+'","'+e[1]+'"]'))},mR=function(e,n){if(!n)return e;var r=e.match(ri)||[],i=r.length,o="",s,a,l;for(n==="reverse"?(a=i-1,s=-2):(a=((parseInt(n,10)||0)*2+1+i*100)%i,s=2),l=0;l<i;l+=2)o+=r[a-1]+","+r[a]+" ",a=(a+s)%i;return o},Py=function(e,n){var r=0,i=parseFloat(e[0]),o=parseFloat(e[1]),s=i+","+o+" ",a=.999999,l,c,u,f,d,h,p;for(u=e.length,l=n*.5/(u*.5-1),c=0;c<u-2;c+=2){if(r+=l,h=parseFloat(e[c+2]),p=parseFloat(e[c+3]),r>a)for(d=1/(Math.floor(r)+1),f=1;r>a;)s+=(i+(h-i)*d*f).toFixed(2)+","+(o+(p-o)*d*f).toFixed(2)+" ",r--,f++;s+=h+","+p+" ",i=h,o=p}return s},Ru=function(e){var n=e[0].match(ri)||[],r=e[1].match(ri)||[],i=r.length-n.length;i>0?e[0]=Py(n,i):e[1]=Py(r,-i)},gR=function(e){return isNaN(e)?Ru:function(n){Ru(n),n[1]=mR(n[1],parseInt(e,10))}},yR=function(e,n,r){var i=typeof e=="string",o,s;return(!i||cR.test(e)||(e.match(ri)||[]).length<3)&&(o=Tu(e)[0],o?(s=(o.nodeName+"").toUpperCase(),n&&s!=="PATH"&&(o=va(o,!1),s="PATH"),e=o.getAttribute(s==="PATH"?"d":"points")||"",o===r&&(e=o.getAttributeNS(null,"data-original")||e)):(yn("WARNING: invalid morph to: "+e),e=!1)),e},Ny=function(e){for(var n=e.length,r,i,o,s,a,l,c,u;--n>-1;)for(r=e[n],u=r.cpData=r.cpData||[],u.length=0,c=r.length-2,l=0;l<c;l+=6)i=r[l]-r[l+2],o=r[l+1]-r[l+3],s=r[l+6]-r[l+4],a=r[l+7]-r[l+5],u[l+2]=uo(o,i),u[l+3]=Fn(i*i+o*o),u[l+4]=uo(a,s),u[l+5]=Fn(s*s+a*a);return e},ky=function(e){var n=e.trim().split(" "),r=~e.indexOf("left")?0:~e.indexOf("right")?100:isNaN(parseFloat(n[0]))?50:parseFloat(n[0]),i=~e.indexOf("top")?0:~e.indexOf("bottom")?100:isNaN(parseFloat(n[1]))?50:parseFloat(n[1]);return{x:r/100,y:i/100}},Dy=function(e){return e!==e%fo?e+(e<0?wy:-wy):e},Fy="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",_R=function(e,n,r,i){var o=this._origin,s=this._eOrigin,a=e[r]-o.x,l=e[r+1]-o.y,c=Fn(a*a+l*l),u=uo(l,a),f,d;return a=n[r]-s.x,l=n[r+1]-s.y,f=uo(l,a)-u,d=Dy(f),!i&&ti&&Math.abs(d+ti.ca)<sR&&(i=ti),this._anchorPT=ti={_next:this._anchorPT,t:e,sa:u,ca:i&&d*i.ca<0&&Math.abs(d)>aR?f:d,sl:c,cl:Fn(a*a+l*l)-c,i:r}},By=function(e){yt=Ty(),ni=ni||yt&&yt.plugins.morphSVG,yt&&ni?(Tu=yt.utils.toArray,vy=yt.core.reverting||function(){},ni.prototype._tweenRotation=_R,xy=1):e&&yn("Please gsap.registerPlugin(MorphSVGPlugin)")},dr={version:"3.15.0",name:"morphSVG",rawVars:1,register:function(e,n){yt=e,ni=n,By()},init:function(e,n,r,i,o){if(xy||By(1),!n)return yn("invalid shape"),!1;Eu(n)&&(n=n.call(r,i,e,o));var s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R;if(typeof n=="string"||n.getBBox||n[0])n={shape:n};else if(typeof n=="object"){s={};for(a in n)s[a]=Eu(n[a])&&a!=="render"?n[a].call(r,i,e,o):n[a];n=s}var P=e.nodeType?window.getComputedStyle(e):{},A=P.fill+"",L=!(A==="none"||(A.match(ri)||[])[3]==="0"||P.fillRule==="evenodd"),N=n.smooth,D=(n.origin||"50 50").split(",");if(N===!0||N==="auto"?N={}:typeof N=="number"&&(N={points:N}),s=(e.nodeName+"").toUpperCase(),u=s==="POLYLINE"||s==="POLYGON",s!=="PATH"&&!u&&!n.prop)return yn("Cannot morph a <"+s+"> element. "+Fy),!1;if(a=s==="PATH"?"d":"points",!n.prop&&!Eu(e.setAttribute))return!1;if(c=yR(n.shape||n.d||n.points||"",a==="d",e),u&&lR.test(c))return yn("A <"+s+"> cannot accept path data. "+Fy),!1;if(f=n.shapeIndex||n.shapeIndex===0?n.shapeIndex:"auto",d=n.map||dr.defaultMap,this._prop=n.prop,this._render=n.render||dr.defaultRender,this._apply="updateTarget"in n?n.updateTarget:dr.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(n.precision)?2:+n.precision),this._tween=r,c){if(this._target=e,w=typeof n.precompile=="object",m=this._original=this._prop?e[this._prop]:e.getAttribute(a),!this._prop&&!e.getAttributeNS(null,"data-original")&&e.setAttributeNS(null,"data-original",m),a==="d"||this._prop){if(m=kt(w?n.precompile[0]:m),g=kt(w?n.precompile[1]:c),N){for(b=m.length;--b;)My(m[b])&&m.splice(b,1);Ou(m,lo({},N,{points:+N.points||Math.max(Au(m),Au(g)),maxSegments:g.length})),Ou(g,N.redraw===!1?N:lo({},N,{points:m}))}if(!w&&!Cu(m,g,f,d,L))return!1;for((n.precompile==="log"||n.precompile===!0)&&yn('precompile:["'+hn(m)+'","'+hn(g)+'"]'),C=(n.type||dr.defaultType)!=="linear",R=n.curveMode||C,Ny(m),Ny(g),C&&(m.size||ii(m),g.size||ii(g),O=ky(D[0]),this._origin=m.origin={x:m.left+O.x*m.width,y:m.top+O.y*m.height},D[1]&&(O=ky(D[1])),this._eOrigin={x:g.left+O.x*g.width,y:g.top+O.y*g.height}),this._rawPath=e._gsRawPath=m,b=m.length;--b>-1;){for(v=m[b],T=g[b],h=v.cpData,p=T.cpData,x=v.length,ti=0,y=0;y<x;y+=6)(T[y]!==v[y]||T[y+1]!==v[y+1])&&(C?l=this._tweenRotation(v,T,y):(l=this.add(v,y,v[y],T[y],0,0,0,0,0,1),l=this.add(v,y+1,v[y+1],T[y+1],0,0,0,0,0,1)||l));for(y=0;y<x;y+=2)R&&(h[y]!==p[y]||h[y+1]!==p[y+1])&&h[y+1]&&p[y+1]?this._controlPT={_next:this._controlPT,i:y,j:b,ai:y%6>3?y+2:y-2,sa:h[y],ca:Dy(p[y]-h[y]),sl:h[y+1],cl:p[y+1]-h[y+1]}:(T[y]!==v[y]&&(l=this.add(v,y,v[y],T[y],0,0,0,0,0,1)),T[y+1]!==v[y+1]&&(l=this.add(v,y+1,v[y+1],T[y+1],0,0,0,0,0,1)||l))}}else l=this.add(e,"setAttribute",e.getAttribute(a)+"",c+"",i,o,0,gR(f),a);C&&(this.add(this._origin,"x",this._origin.x,this._eOrigin.x,0,0,0,0,0,1),l=this.add(this._origin,"y",this._origin.y,this._eOrigin.y,0,0,0,0,0,1)),l&&(this._props.push("morphSVG"),l.end=N&&N.persist!==!1?hn(g):c,l.endProp=a)}return 1},render:function(e,n){for(var r=n._rawPath,i=n._controlPT,o=n._anchorPT,s=n._rnd,a=n._target,l=n._pt,c,u,f,d,h,p,m,g,y;l;)l.r(e,l.d),l=l._next;if(e===1&&n._apply)for(l=n._pt;l;)l.end&&(n._prop?a[n._prop]=l.end:a.setAttribute(l.endProp,l.end)),l=l._next;else if(r){for(;o;)h=o.sa+e*o.ca,d=o.sl+e*o.cl,o.t[o.i]=n._origin.x+Ey(h)*d,o.t[o.i+1]=n._origin.y+Sy(h)*d,o=o._next;for(;i;)f=r[i.j],p=i.i,h=i.sa+e*i.ca,g=Sy(h),y=Ey(h),d=i.sl+e*i.cl,f[p]=f[i.ai]-y*d,f[p+1]=f[i.ai+1]-g*d,i=i._next;if(!e&&vy()&&(r=kt(n._original)),a._gsRawPath=r,n._apply){for(c="",u=" ",m=0;m<r.length;m++){for(f=r[m],d=f.length,c+="M"+(f[0]*s|0)/s+u+(f[1]*s|0)/s+" C",p=2;p<d;p++)c+=(f[p]*s|0)/s+u;f.closed&&(c+="z")}n._prop?a[n._prop]=c:a.setAttribute("d",c)}}n._render&&r&&n._render.call(n._tween,r,a)},kill:function(e){this._pt=this._rawPath=0},getRawPath:Hr,stringToRawPath:kt,rawPathToString:hn,smoothRawPath:Ou,normalizeStrings:function(e,n,r){var i=r.shapeIndex,o=r.map,s=[e,n];return Ly(s,i,o),s},pathFilter:Ly,pointsFilter:Ru,getTotalSize:ii,equalizeSegmentQuantity:Cu,convertToPath:function(e,n){return Tu(e).map(function(r){return va(r,n!==!1)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};Ty()&&yt.registerPlugin(dr),E.gsap.registerPlugin(dr);const Uy=(t,e,n,r,i,o,s)=>`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${n}" viewBox="${r}">
|
|
1421
1421
|
<path d="${t}" fill="${i}" stroke="${o}" stroke-width="${s}" />
|
|
1422
|
-
</svg>`,bR=({ref:t,...e})=>{const{pathSequence:n,morphDuration:r=1.4,morphEase:i="expo.inOut",loopBackToStart:o=!0,viewBox:s="0 0 100 100",transformation:{x:a,y:l,width:c,height:u,anchor:f,fill:d="#f59e0b",stroke:h="none",strokeWidth:p=0},startAt:m,visible:g,onSpriteRefReady:y}=e,{app:b}=at.useApplication(),{tl:x}=S.useContext(Ye),v=S.useRef(null),T=S.useRef(null),w=S.useRef(null),O=S.useRef(null),[C,R]=S.useState(null);return S.useEffect(()=>{const P="http://www.w3.org/2000/svg",A=document.createElementNS(P,"svg");A.setAttribute("width","0"),A.setAttribute("height","0"),A.style.position="absolute",A.style.left="-9999px",A.style.pointerEvents="none";const L=document.createElementNS(P,"path");return L.setAttribute("d",n[0]),A.appendChild(L),document.body.appendChild(A),w.current=L,()=>{A.remove(),w.current=null}},[n]),S.useEffect(()=>{if(!b?.renderer)return;const P=Uy(n[0],c,u,s,d,h,p),A=new W.Graphics().svg(P),L=b.renderer.generateTexture(A);O.current?.destroy(!0),O.current=L,R(L),A.destroy()},[b,n,c,u,s,d,h,p]),S.useEffect(()=>{if(!x?.current||!b?.renderer||!w.current||n.length<2)return;const P=w.current,A=()=>{const D=P.getAttribute("d");if(!D||!v.current)return;const F=Uy(D,c,u,s,d,h,p),G=new W.Graphics().svg(F),z=b.renderer.generateTexture(G),K=O.current;O.current=z,v.current.texture=z,G.destroy(),K?.destroy(!0)},L=E.gsap.timeline({defaults:{duration:r,ease:i}});return(o?[...n.slice(1),n[0]]:n.slice(1)).forEach(D=>{L.to(P,{morphSVG:D,onUpdate:A})}),x.current.add(L,m),()=>{L.kill()}},[x,b,n,r,i,o,c,u,s,d,h,p,m]),S.useEffect(()=>()=>{O.current?.destroy(!0),O.current=null},[]),S.useEffect(()=>{v.current&&y&&y(e.uniqueId,T)},[C,y,e.uniqueId]),M.jsx(Je,{...e,ref:t,children:M.jsx("pixiContainer",{ref:T,children:C&&M.jsx("pixiSprite",{ref:v,texture:C,width:c,height:u,anchor:f,x:a,y:l,alpha:g?1:0})})})},Gy=t=>{try{t.pause()}catch{}try{t.removeAttribute("src"),t.load()}catch{}},xR=()=>{if(typeof window>"u")return null;const t=window;return t.AudioContext??t.webkitAudioContext??null};function jy(){const t=new Map,e=new Map,n=new Map;let r=null;const i=new Set;let o=0;const s=()=>{o+=1,i.forEach(c=>c())},a=()=>r&&r.state!=="closed"?r:null,l=()=>{const c=a();if(c)return c;const u=xR();return u?(r=new u,r):null};return{get:c=>t.get(c),set(c,u,f){t.set(c,u),e.set(c,f),s()},srcFor:c=>e.get(c),has:c=>t.has(c),delete(c){const u=t.get(c);u&&Gy(u),t.delete(c),e.delete(c),s()},forEach:c=>t.forEach(c),get size(){return t.size},get version(){return o},subscribe(c){return i.add(c),()=>{i.delete(c)}},getContext:l,getContextIfExists:a,getOrCreateSourceNode(c){const u=n.get(c);if(u)return u;const f=t.get(c),d=l();if(!f||!d)return null;try{f.crossOrigin!=="anonymous"&&(f.crossOrigin="anonymous");const h=d.createMediaElementSource(f);return h.connect(d.destination),n.set(c,h),h}catch{return null}},getSourceNode:c=>n.get(c),setSourceNode(c,u){n.set(c,u)},hasSourceNode:c=>n.has(c),clear(){t.forEach(Gy),t.clear(),e.clear(),n.clear(),s(),r&&r.state!=="closed"&&r.close().catch(()=>{}),r=null}}}const hr=jy(),po=.15,Iu=.15,vR=.6,Hy=["voiceover","narration","dialogue"];function TR(t){return Math.pow(10,t/20)}function ER(t){return 20*Math.log10(Math.max(t,1e-6))}const pr=t=>t<0?0:t>1?1:t;function Yy(t,e,n,r){if(!r)return n;let i=n;const o=r.fadeIn;if(o?.enabled&&(o.duration??0)>0){const a=o.duration;if(t<=a){const l=(o.volume??0)/100,c=a>0?t/a:1;i=l+(n-l)*pr(c)}}const s=r.fadeOut;if(s?.enabled&&(s.duration??0)>0){const a=s.duration,l=e-a;if(t>=l){const c=(s.volume??0)/100,u=a>0?(t-l)/a:1;i=i+(c-i)*pr(u)}}return pr(i)}function Xy(t,e,n=Iu,r=po){if(!e||e.length===0)return 1;const i=pr(n),o=Math.max(0,r);let s=1;for(const a of e){if(a.endSec<=a.startSec)continue;const l=a.startSec-o,c=a.endSec+o;if(t<l||t>c)continue;let u;o>0&&t<a.startSec?u=1+(i-1)*((t-l)/o):t<=a.endSec?u=i:o>0?u=i+(1-i)*((t-a.endSec)/o):u=i,u<s&&(s=u)}return pr(s)}function Wy(t,e){if(e.muted||t<0||t>e.clipDuration)return 0;const n=Yy(t,e.clipDuration,e.baseVolume,e.fade),r=Xy(t,e.duckWindows,e.duckTo,e.duckFade);return pr(n*r)}function zy(t,e=0){if(!t||t.length===0)return[];const n=[...t].sort((o,s)=>o.tMs-s.tMs),r=[];let i=null;for(const o of n){const s=o.gainDb<0;s&&i===null?i=o.tMs:!s&&i!==null&&(r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e}),i=null)}if(i!==null){const o=n[n.length-1];r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e})}return r}function qy(t,e,n={}){if(!t?.duckDuring)return[];const r=n.mergeGapSec??po*2,i=t.start??0,s=(t.end??0)-i;if(s<=0)return[];const a=new Set(Hy),l=e.filter(u=>!(!u||u.uniqueId&&t.uniqueId&&u.uniqueId===t.uniqueId||t.duckDuring==="voiceover"&&!a.has(u.trackRole??"")||u.mute||u.muted||typeof u.volume=="number"&&u.volume<=0)).map(u=>({startSec:(u.start??0)-i,endSec:(u.end??0)-i})).map(u=>({startSec:Math.max(0,u.startSec),endSec:Math.min(s,u.endSec)})).filter(u=>u.endSec>u.startSec).sort((u,f)=>u.startSec-f.startSec);if(l.length===0)return[];const c=[l[0]];for(let u=1;u<l.length;u+=1){const f=c[c.length-1],d=l[u];d.startSec-f.endSec<=r?f.endSec=Math.max(f.endSec,d.endSec):c.push(d)}return c}function SR(t,e){const n=t.start??0,r=t.end??0,i=t.transformation?.musicDuckEnvelope,o=i?.length?zy(i,n):qy({uniqueId:t.uniqueId,start:n,end:r,trackRole:t.trackRole,duckTo:t.duckTo,duckDuring:t.duckDuring},e);return{baseVolume:typeof t.volume=="number"?t.volume:1,muted:!!(t.mute??t.muted),clipDuration:Math.max(0,r-n),fade:t.transformation?.audioFade,duckTo:t.duckTo??Iu,duckWindows:o,duckFade:po}}const Vy=.2,wR=.05,AR=t=>t<0?0:t>1?1:t,OR=(t,e)=>e>=t.start&&e<t.end;function Ky(t,e,n=NaN){const r=t.speed&&t.speed>0?t.speed:1;let i=t.frameStartAt+(e-t.start)*r;return Number.isFinite(n)&&n>0&&(i=Math.min(i,n-wR)),i<0?0:i}function Zy(t,e){const n=t.getVolume?t.getVolume(e):t.volume??1;return AR(Wy(e-t.start,{baseVolume:Number.isFinite(n)?n:1,muted:t.mute,clipDuration:t.end-t.start,fade:t.audioFade,duckWindows:t.duckWindows,duckTo:t.duckTo}))}function Mu(t,e,n,r){if(!OR(t,e)||!n.playing||n.reverse||n.seeking)return{kind:"pause"};const i=Ky(t,e,r.duration),o=t.speed&&t.speed>0?t.speed:1,s=Zy(t,e);return r.paused?{kind:"play",seekTo:i,volume:s,rate:o,start:!0}:{kind:"play",seekTo:Math.abs(r.currentTime-i)>Vy?i:null,volume:s,rate:o,start:!1}}const $y=t=>({paused:t.paused,currentTime:t.currentTime,duration:t.duration});function Lu(t,e,n){if(e.kind==="pause"){t.paused||t.pause();return}if(e.seekTo!==null&&(t.currentTime=e.seekTo),t.volume=e.volume,t.playbackRate!==e.rate&&(t.playbackRate=e.rate),e.start)try{const r=t.play();r&&typeof r.catch=="function"&&r.catch(i=>n?.(i))}catch(r){n?.(r)}}const Pu=({audioElements:t,registry:e=hr,clearOnUnmount:n=!0})=>{const r=S.useContext(Ye),{registerTimeUpdateListener:i,unregisterTimeUpdateListener:o}=r,s=S.useRef(t);s.current=t;const a=S.useRef(null),l=S.useRef(new Set);S.useEffect(()=>{const u=new Set(t.map(f=>f.uniqueId));for(const f of[...l.current])u.has(f)||(e.delete(f),l.current.delete(f));for(const{uniqueId:f,src:d,speed:h}of t){if(e.srcFor(f)===d&&e.has(f)){l.current.add(f);continue}e.has(f)&&e.delete(f),l.current.add(f);const p=new Audio;p.crossOrigin="anonymous",p.preload="auto",p.loop=!1,p.playbackRate=h&&h>0?h:1,p.volume=0,p.addEventListener("error",()=>{console.error("[AudioPlaybackManager] load error",f,p.error)}),p.src=d,e.set(f,p,d)}},[t,e]),S.useEffect(()=>{if(!i||!o)return;const u=f=>{const d=a.current;a.current=f;const h={playing:r.playStateRef?.current??!1,reverse:d!==null&&f<d-1e-6,seeking:r.isSeekingRef?.current??!1};for(const p of s.current){const m=e.get(p.uniqueId);if(!m||m.readyState===0)continue;const g=Mu(p,f,h,$y(m));if(g.kind==="play"){const y=e.getContextIfExists();y&&y.state==="suspended"&&y.resume().catch(()=>{})}Lu(m,g,()=>{})}};return i(u),()=>o(u)},[i,o,e,r]);const c=()=>e.forEach(u=>{u.paused||u.pause()});return $e(ke.PAUSE,c),$e(ke.SCRUBBER_CLICKED,c),$e(ke.COMPLETE,()=>{e.forEach(u=>{try{u.pause(),u.currentTime=0}catch{}}),a.current=null}),$e(ke.RESUME,()=>{a.current=null;const u=r.tl?.current?.time();if(typeof u=="number"){const f={playing:!0,reverse:!1,seeking:!1};for(const d of s.current){const h=e.get(d.uniqueId);!h||h.readyState===0||Lu(h,Mu(d,u,f,$y(h)))}}}),S.useEffect(()=>()=>{if(n){e.clear();return}for(const u of l.current)e.delete(u);l.current.clear()},[e,n]),null};Pu.displayName="AudioPlaybackManager";const Jy={[kt.NONE]:{mode:2},[kt.ROUNDBARS]:{mode:2,alphaBars:!1,ansiBands:!1,barSpace:.25,channelLayout:"single",colorMode:"bar-level",frequencyScale:"log",gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.6,lumiBars:!1,maxFreq:16e3,minFreq:30,mirror:0,radial:!1,reflexRatio:.3,reflexAlpha:1,roundBars:!0,showPeaks:!1,showScaleX:!1,showScaleY:!1,smoothing:.7,weightingFilter:"D"},[kt.LED]:{mode:3,barSpace:.6,ledBars:!0,showScaleX:!1,showScaleY:!1},[kt.RADIAL_SPECTRUM]:{mode:3,barSpace:.25,bgAlpha:.5,fillAlpha:.5,gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.8,lineWidth:1.5,maxDecibels:-30,maxFreq:16e3,radial:!0,showBgColor:!0,showPeaks:!0,spinSpeed:2,outlineBars:!0,showScaleX:!1,showScaleY:!1,reflexFit:!0},[kt.LUMI_BARS]:{mode:3,barSpace:.6,lumiBars:!0,reflexRatio:.5,fillAlpha:.3,frequencyScale:"bark",gradientLeft:"steelblue",gradientRight:"orangered",showScaleX:!1,showScaleY:!1},[kt.EQUALIZER]:{mode:2,gradient:"rainbow",lineWidth:1.5,fillAlpha:.5,showPeaks:!1,showScaleX:!1,showScaleY:!1}};function Qy(t){return S.useSyncExternalStore(t.subscribe,()=>t.version,()=>0)}const Nu={canvas:null,analyzer:null};function e_({uniqueId:t,waveform:e,width:n,height:r,registry:i=hr}){const o=e!==kt.NONE,[s,a]=I.useState(Nu),l=Qy(i),c=I.useRef(e);c.current=e;const u=i.has(t);return I.useEffect(()=>{if(!o||!u){a(Nu);return}const f=i.getContext();if(!f)return;const d=i.getOrCreateSourceNode(t);if(!d)return;const h=document.createElement("div");h.style.display="none",h.id=`${t}-audioContainer`,document.body.appendChild(h);const p=new eE(h,{audioCtx:f,connectSpeakers:!1,height:r,width:n,...Jy[c.current]??{}});return p.connectInput(d),a({canvas:p.canvas,analyzer:p}),()=>{try{p.disconnectInput(d),p.destroy()}catch{}h.remove(),a(Nu)}},[o,u,l,t,n,r,i]),I.useEffect(()=>{if(!s.analyzer||!o)return;const f=Jy[e]??{};s.analyzer.setOptions(f)},[e,o,s.analyzer]),s}const CR=({ref:t,...e})=>{const{uniqueId:n,src:r,startAt:i,endAt:o,audioStartAt:s=0,mute:a,speed:l,visible:c=!1,volume:u=1,getVolume:f,audioFade:d,duckWindows:h,duckTo:p,managePlayback:m=!0,registry:g=hr,transformation:y,onAudioElementReady:b}=e,{width:x=300,height:v=300,x:T=100,y:w=100,waveform:O=kt.NONE}=y||{},C=S.useRef(null),R=I.useMemo(()=>[{uniqueId:n,src:r,start:i,end:o,frameStartAt:s,volume:u,getVolume:f,mute:a||!c,speed:l,audioFade:d,duckWindows:h,duckTo:p}],[n,r,i,o,s,u,f,a,c,l,d,h,p]),P=Qy(g),A=g.get(n);S.useEffect(()=>{A&&b?.(n,A)},[A,n,P]);const L=e_({uniqueId:n,waveform:O,width:x,height:v,registry:g}),N=I.useMemo(()=>L.canvas?new W.Texture({source:new W.CanvasSource({resource:L.canvas})}):null,[L.canvas]);S.useEffect(()=>()=>{N?.destroy(!0)},[N]),S.useEffect(()=>{if(!N)return;const F=()=>{N.source.update?.()};return W.Ticker.shared.add(F),()=>{W.Ticker.shared.remove(F)}},[N]);const D=O!==kt.NONE&&!!N;return M.jsxs(M.Fragment,{children:[m&&M.jsx(Pu,{audioElements:R,registry:g,clearOnUnmount:!1}),D&&M.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,isGif:!0,children:M.jsx("pixiSprite",{texture:N,width:x,height:v,anchor:.5,x:T,y:w,ref:C,alpha:c?1:0})})]})},t_=I.memo(CR,tt),n_=({src:t,start:e,end:n})=>{const r=S.useRef(null),[i,o]=S.useState({audio:null,isPlaying:!1,currentTime:0});S.useEffect(()=>{const f=new Audio(t);f.preload="auto",f.currentTime=e,r.current=f;const d=()=>o(g=>({...g,isPlaying:!0})),h=()=>o(g=>({...g,isPlaying:!1})),p=()=>o(g=>({...g,isPlaying:!1,currentTime:0})),m=()=>{f.currentTime>=n&&(f.pause(),f.currentTime=e)};return f.addEventListener("play",d),f.addEventListener("pause",h),f.addEventListener("ended",p),f.addEventListener("timeupdate",m),o(g=>({...g,audio:f})),()=>{f.pause(),f.removeEventListener("play",d),f.removeEventListener("pause",h),f.removeEventListener("ended",p),f.removeEventListener("timeupdate",m),f.src="",r.current=null}},[t,e,n]);const s=S.useCallback(()=>{const f=r.current;f&&f.play().catch(()=>{})},[]),a=S.useCallback(()=>{r.current?.pause()},[]),l=S.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,o(h=>({...h,currentTime:f})))},[]),c=S.useCallback(()=>{const f=r.current;f&&(f.paused?s():f.pause())},[s]),u=S.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,s(),o(h=>({...h,currentTime:f})))},[s]);return{...i,handlePause:a,handlePlay:s,togglePlay:c,handleSeek:l,playFromTime:u}},RR=n_;function r_(t,e,{loop:n=!0,speed:r=1}={}){const i=t.length;if(i<=1)return 0;const o=t[i-1].end;if(!(o>0))return 0;let s=e*1e3*(Number.isFinite(r)?r:1);if(Number.isNaN(s)||s<=0)return 0;if(s===1/0)return n?0:i-1;if(n)s%=o;else if(s>=o)return i-1;let a=0,l=i-1,c=0;for(;a<=l;){const u=a+l>>>1;t[u].start<=s?(c=u,a=u+1):l=u-1}return c}const IR=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),s=S.useRef(void 0),{src:a,uniqueId:l,startAt:c,endAt:u,loop:f=!0,animationSpeed:d=1,visible:h,disabled:p,transformation:{width:m=0,height:g=0,x:y,y:b,colorCorrection:x,effect:v,effects:T,neonColor:w,blendMode:O,border:C,roundedCorners:R,maskShape:P,crop:A,anchor:L=.5},pointerdown:N}=e,{tl:D}=S.useContext(Ye),F=ut({colorCorrection:x,effects:T??{name:v},neonColor:w,blendMode:O});S.useEffect(()=>{let z=!1;return r(null),W.Assets.load(a).then(K=>{z||r(K)}).catch(K=>{console.error("[PixiGifSprite] failed to load",a,K)}),()=>{z=!0}},[a]);const G=()=>{const z=o.current,K=s.current;!z||!K||!n||(z.currentFrame=r_(n.frames,K.time(),{loop:f,speed:d}))};return S.useEffect(()=>{if(!D?.current||!i.current)return;const z=i.current,K=E.context(()=>{s.current&&(s.current.kill(),D.current.remove(s.current)),s.current=E.timeline().set(z,{alpha:h?1:0}).to(z,{pixi:{},duration:Number(u)-Number(c),onUpdate:G}),D.current.add(s.current,c)});return()=>{s.current&&(D.current.remove(s.current),s.current.progress(0).kill()),K.revert()}},[c,u,l,D,h,f,n,d]),M.jsx(Je,{...e,ref:t,isGif:!0,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:i,children:n&&M.jsx(Ot,{x:y,y:b,width:m,height:g,border:C,roundedCorners:R,maskShape:P,crop:A,spriteRef:o,children:M.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!1,autoUpdate:!1,loop:f,animationSpeed:d,width:m,height:g,anchor:L,x:y,y:b,alpha:h?1:0,filters:F,...!p&&h&&{eventMode:"static",onPointerDown:N}})})})})},i_=I.memo(IR,tt),o_=({width:t=800,height:e=500,background:n="#1a1d24",camera:r,defaultLights:i=!0,children:o})=>M.jsx("div",{style:{position:"relative",width:t,height:e,background:n,overflow:"hidden"},children:M.jsxs(is.Canvas,{style:{width:"100%",height:"100%"},camera:{position:r?.position??[0,0,6],fov:r?.fov??60},dpr:[1,2],gl:{antialias:!0,alpha:!0},children:[i&&M.jsxs(M.Fragment,{children:[M.jsx("ambientLight",{intensity:.55}),M.jsx("directionalLight",{position:[5,6,5],intensity:1}),M.jsx("directionalLight",{position:[-5,-2,-3],intensity:.3})]}),o]})}),jt={ambientIntensity:.6,directionalIntensity:1.2,fillIntensity:.8,spinSpeed:.5,playbackSpeed:1};function s_(t,e){const n=t.scale??1,r=t.spinSpeed??jt.spinSpeed;return{position:[t.positionX??0,t.positionY??0,t.positionZ??0],rotation:[t.rotationX??Math.sin(e*.3)*.2,(t.rotationY??0)+e*r,t.rotationZ??0],scale:[n*(t.flipX??1),n*(t.flipY??1),n]}}function a_(t,e,n=jt.playbackSpeed,r=!0){if(!(e>0))return 0;const i=Math.max(0,t*n);return r?i%e:Math.min(i,e)}function c_(t){return t.materialColor!=null||t.roughness!=null||t.metalness!=null||t.emissiveIntensity!=null}function l_(t,e){c_(e)&&t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;e.materialColor!=null&&s.color?.setStyle(e.materialColor),e.roughness!=null&&"roughness"in s&&(s.roughness=e.roughness),e.metalness!=null&&"metalness"in s&&(s.metalness=e.metalness),e.emissiveIntensity!=null&&"emissiveIntensity"in s&&(s.emissiveIntensity=e.emissiveIntensity)}})}function ku(t){return[t.materialColor,t.roughness,t.metalness,t.emissiveIntensity].join("|")}function Du(t,e,n=1.5){return t>0?t/(2*Math.tan(e*Math.PI/360))*n:3}function u_(t,e,n=1.5){const r=new V.Box3().setFromObject(e);if(r.isEmpty())return;const i=r.getCenter(new V.Vector3),o=r.getSize(new V.Vector3),s=Math.max(o.x,o.y,o.z);t.position.set(i.x,i.y,i.z+Du(s,t.fov,n)),t.lookAt(i)}function f_(t,e){if(!e||!Object.keys(e).length)return;const n=t.slice(0,t.lastIndexOf("/")+1),r=new Map;for(const[i,o]of Object.entries(e))r.set(`${n}${i}`,o);return i=>r.get(i)??i}function Fu(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i))o&&o.isTexture&&o.dispose();i.dispose()}})}const MR=({ref:t,...e})=>{const{src:n,resources:r,uniqueId:i,startAt:o,endAt:s,visible:a,disabled:l,threeD:c,pointerdown:u,transformation:{width:f=0,height:d=0,x:h,y:p,colorCorrection:m,effect:g,effects:y,neonColor:b,blendMode:x,border:v,roundedCorners:T,maskShape:w,crop:O,anchor:C=.5}}=e,R=f||400,P=d||400,[A,L]=S.useState(null),N=S.useRef(null),D=S.useRef(null),F=S.useRef(null),G=S.useRef(void 0),z=S.useRef(0),K=S.useRef(c??{});K.current=c??{};const{tl:ae}=S.useContext(Ye),pe=ut({colorCorrection:m,effects:y??{name:g},neonColor:b,blendMode:x}),X=S.useCallback(he=>{const j=F.current;if(!j)return;z.current=he;const $=K.current;if(j.ambient.intensity=$.ambientIntensity??jt.ambientIntensity,j.key.intensity=$.directionalIntensity??jt.directionalIntensity,j.fill.intensity=$.fillIntensity??jt.fillIntensity,j.model){const H=s_($,he);j.model.position.set(...H.position),j.model.rotation.set(...H.rotation),j.model.scale.set(...H.scale);const ce=ku($);ce!==j.overrideKey&&(l_(j.model,$),j.overrideKey=ce)}j.mixer&&j.mixer.setTime(a_(he,j.clipDuration,$.playbackSpeed??jt.playbackSpeed)),j.renderer.render(j.scene,j.camera),j.texture.source.update()},[]);return S.useEffect(()=>{let he=!1;const j=document.createElement("canvas");j.width=R,j.height=P;const $=new V.WebGLRenderer({canvas:j,alpha:!0,antialias:!0,preserveDrawingBuffer:!0});$.setPixelRatio(1),$.setSize(R,P,!1),$.setClearColor(0,0),$.outputColorSpace=V.SRGBColorSpace;const H=new V.Scene,ce=new V.PerspectiveCamera(45,R/P,.1,1e3);ce.position.set(0,0,3);const Z=K.current,se=new V.AmbientLight(16777215,Z.ambientIntensity??jt.ambientIntensity),J=new V.DirectionalLight(16777215,Z.directionalIntensity??jt.directionalIntensity);J.position.set(5,5,5);const ie=new V.DirectionalLight(16777215,Z.fillIntensity??jt.fillIntensity);ie.position.set(-5,0,5),H.add(se,J,ie);const xe=W.Texture.from(j),Y={renderer:$,scene:H,camera:ce,ambient:se,key:J,fill:ie,model:null,mixer:null,clipDuration:0,overrideKey:"",texture:xe};F.current=Y;const Oe=re=>{H.add(re),Y.model=re,u_(ce,re)},ge=re=>{const we=re==="cube"?new V.BoxGeometry(.8,.8,.8):new V.TorusKnotGeometry(.6,.25,100,16),me=new V.MeshStandardMaterial({color:new V.Color(Z.materialColor??"#0095dd"),metalness:Z.metalness??(re==="knot"?.6:0),roughness:Z.roughness??.3,emissive:new V.Color(17544),emissiveIntensity:Z.emissiveIntensity??.2}),Ue=new V.Mesh(we,me);H.add(Ue),Y.model=Ue,Y.overrideKey=ku(Z)};if(n){const re=new V.LoadingManager,we=f_(n,r);we&&re.setURLModifier(we),new Vd.GLTFLoader(re).load(n,me=>{if(he){Fu(me.scene);return}if(Oe(me.scene),me.animations?.length){const Ue=Math.max(0,Math.min(Z.clipIndex??0,me.animations.length-1)),qe=me.animations[Ue];Y.mixer=new V.AnimationMixer(me.scene),Y.mixer.clipAction(qe).play(),Y.clipDuration=qe.duration}X(z.current)},void 0,me=>{he||(console.error("[PixiThreeModelSprite] model load failed",n,me),ge("cube"),X(z.current))})}else ge("knot");return X(z.current),L(xe),()=>{he=!0,Y.mixer?.stopAllAction(),Y.model&&Fu(Y.model),$.dispose(),F.current=null,L(null),xe.destroy(!0)}},[R,P,n,r,X]),S.useEffect(()=>{X(z.current)},[c,X]),S.useEffect(()=>{if(!ae?.current||!N.current)return;const he=N.current,j=E.context(()=>{G.current&&(G.current.kill(),ae.current.remove(G.current)),G.current=E.timeline().set(he,{alpha:a?1:0}).to(he,{pixi:{},duration:Number(s)-Number(o),onUpdate:()=>{G.current&&X(G.current.time())}}),ae.current.add(G.current,o)});return()=>{G.current&&(ae.current.remove(G.current),G.current.progress(0).kill()),j.revert()}},[o,s,i,ae,a,X]),M.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:N,children:A&&M.jsx(Ot,{x:h,y:p,width:R,height:P,border:v,roundedCorners:T,maskShape:w,crop:O,spriteRef:D,children:M.jsx("pixiSprite",{ref:D,texture:A,width:R,height:P,anchor:C,x:h,y:p,alpha:a?1:0,filters:pe,...!l&&a&&{eventMode:"static",onPointerDown:u}})})})})},LR=I.memo(MR,tt);let mo;function PR(){if(mo!==void 0)return mo;const t=Intl.Segmenter;return mo=t?new t(void 0,{granularity:"grapheme"}):null,mo}function d_(t){if(t==="")return[];const e=PR();if(e){const n=[];for(const r of e.segment(t))n.push(r.segment);return n}return Array.from(t)}const NR=/^\s$/;function h_(t){return t.length>0&&NR.test(t[0])}function kR(t,e){return e.tracking!=null?e.tracking:t.tracking??0}function DR({input:t,metrics:e}){const n=[];let r=0;const i=t.paragraphBreak==="crlf";for(let o=0;o<t.runs.length;o++){const s=t.runs[o],a=d_(s.text),l=kR(t,s),c=s.baselineShift??0;for(let u=0;u<a.length;u++){const f=a[u];if(f===`
|
|
1422
|
+
</svg>`,bR=({ref:t,...e})=>{const{pathSequence:n,morphDuration:r=1.4,morphEase:i="expo.inOut",loopBackToStart:o=!0,viewBox:s="0 0 100 100",transformation:{x:a,y:l,width:c,height:u,anchor:f,fill:d="#f59e0b",stroke:h="none",strokeWidth:p=0},startAt:m,visible:g,onSpriteRefReady:y}=e,{app:b}=at.useApplication(),{tl:x}=S.useContext(Ye),v=S.useRef(null),T=S.useRef(null),w=S.useRef(null),O=S.useRef(null),[C,R]=S.useState(null);return S.useEffect(()=>{const P="http://www.w3.org/2000/svg",A=document.createElementNS(P,"svg");A.setAttribute("width","0"),A.setAttribute("height","0"),A.style.position="absolute",A.style.left="-9999px",A.style.pointerEvents="none";const L=document.createElementNS(P,"path");return L.setAttribute("d",n[0]),A.appendChild(L),document.body.appendChild(A),w.current=L,()=>{A.remove(),w.current=null}},[n]),S.useEffect(()=>{if(!b?.renderer)return;const P=Uy(n[0],c,u,s,d,h,p),A=new W.Graphics().svg(P),L=b.renderer.generateTexture(A);O.current?.destroy(!0),O.current=L,R(L),A.destroy()},[b,n,c,u,s,d,h,p]),S.useEffect(()=>{if(!x?.current||!b?.renderer||!w.current||n.length<2)return;const P=w.current,A=()=>{const D=P.getAttribute("d");if(!D||!v.current)return;const F=Uy(D,c,u,s,d,h,p),G=new W.Graphics().svg(F),z=b.renderer.generateTexture(G),K=O.current;O.current=z,v.current.texture=z,G.destroy(),K?.destroy(!0)},L=E.gsap.timeline({defaults:{duration:r,ease:i}});return(o?[...n.slice(1),n[0]]:n.slice(1)).forEach(D=>{L.to(P,{morphSVG:D,onUpdate:A})}),x.current.add(L,m),()=>{L.kill()}},[x,b,n,r,i,o,c,u,s,d,h,p,m]),S.useEffect(()=>()=>{O.current?.destroy(!0),O.current=null},[]),S.useEffect(()=>{v.current&&y&&y(e.uniqueId,T)},[C,y,e.uniqueId]),M.jsx($e,{...e,ref:t,children:M.jsx("pixiContainer",{ref:T,children:C&&M.jsx("pixiSprite",{ref:v,texture:C,width:c,height:u,anchor:f,x:a,y:l,alpha:g?1:0})})})},Gy=t=>{try{t.pause()}catch{}try{t.removeAttribute("src"),t.load()}catch{}},xR=()=>{if(typeof window>"u")return null;const t=window;return t.AudioContext??t.webkitAudioContext??null};function jy(){const t=new Map,e=new Map,n=new Map;let r=null;const i=new Set;let o=0;const s=()=>{o+=1,i.forEach(c=>c())},a=()=>r&&r.state!=="closed"?r:null,l=()=>{const c=a();if(c)return c;const u=xR();return u?(r=new u,r):null};return{get:c=>t.get(c),set(c,u,f){t.set(c,u),e.set(c,f),s()},srcFor:c=>e.get(c),has:c=>t.has(c),delete(c){const u=t.get(c);u&&Gy(u),t.delete(c),e.delete(c),s()},forEach:c=>t.forEach(c),get size(){return t.size},get version(){return o},subscribe(c){return i.add(c),()=>{i.delete(c)}},getContext:l,getContextIfExists:a,getOrCreateSourceNode(c){const u=n.get(c);if(u)return u;const f=t.get(c),d=l();if(!f||!d)return null;try{f.crossOrigin!=="anonymous"&&(f.crossOrigin="anonymous");const h=d.createMediaElementSource(f);return h.connect(d.destination),n.set(c,h),h}catch{return null}},getSourceNode:c=>n.get(c),setSourceNode(c,u){n.set(c,u)},hasSourceNode:c=>n.has(c),clear(){t.forEach(Gy),t.clear(),e.clear(),n.clear(),s(),r&&r.state!=="closed"&&r.close().catch(()=>{}),r=null}}}const hr=jy(),po=.15,Iu=.15,vR=.6,Hy=["voiceover","narration","dialogue"];function TR(t){return Math.pow(10,t/20)}function ER(t){return 20*Math.log10(Math.max(t,1e-6))}const pr=t=>t<0?0:t>1?1:t;function Yy(t,e,n,r){if(!r)return n;let i=n;const o=r.fadeIn;if(o?.enabled&&(o.duration??0)>0){const a=o.duration;if(t<=a){const l=(o.volume??0)/100,c=a>0?t/a:1;i=l+(n-l)*pr(c)}}const s=r.fadeOut;if(s?.enabled&&(s.duration??0)>0){const a=s.duration,l=e-a;if(t>=l){const c=(s.volume??0)/100,u=a>0?(t-l)/a:1;i=i+(c-i)*pr(u)}}return pr(i)}function Xy(t,e,n=Iu,r=po){if(!e||e.length===0)return 1;const i=pr(n),o=Math.max(0,r);let s=1;for(const a of e){if(a.endSec<=a.startSec)continue;const l=a.startSec-o,c=a.endSec+o;if(t<l||t>c)continue;let u;o>0&&t<a.startSec?u=1+(i-1)*((t-l)/o):t<=a.endSec?u=i:o>0?u=i+(1-i)*((t-a.endSec)/o):u=i,u<s&&(s=u)}return pr(s)}function Wy(t,e){if(e.muted||t<0||t>e.clipDuration)return 0;const n=Yy(t,e.clipDuration,e.baseVolume,e.fade),r=Xy(t,e.duckWindows,e.duckTo,e.duckFade);return pr(n*r)}function zy(t,e=0){if(!t||t.length===0)return[];const n=[...t].sort((o,s)=>o.tMs-s.tMs),r=[];let i=null;for(const o of n){const s=o.gainDb<0;s&&i===null?i=o.tMs:!s&&i!==null&&(r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e}),i=null)}if(i!==null){const o=n[n.length-1];r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e})}return r}function qy(t,e,n={}){if(!t?.duckDuring)return[];const r=n.mergeGapSec??po*2,i=t.start??0,s=(t.end??0)-i;if(s<=0)return[];const a=new Set(Hy),l=e.filter(u=>!(!u||u.uniqueId&&t.uniqueId&&u.uniqueId===t.uniqueId||t.duckDuring==="voiceover"&&!a.has(u.trackRole??"")||u.mute||u.muted||typeof u.volume=="number"&&u.volume<=0)).map(u=>({startSec:(u.start??0)-i,endSec:(u.end??0)-i})).map(u=>({startSec:Math.max(0,u.startSec),endSec:Math.min(s,u.endSec)})).filter(u=>u.endSec>u.startSec).sort((u,f)=>u.startSec-f.startSec);if(l.length===0)return[];const c=[l[0]];for(let u=1;u<l.length;u+=1){const f=c[c.length-1],d=l[u];d.startSec-f.endSec<=r?f.endSec=Math.max(f.endSec,d.endSec):c.push(d)}return c}function SR(t,e){const n=t.start??0,r=t.end??0,i=t.transformation?.musicDuckEnvelope,o=i?.length?zy(i,n):qy({uniqueId:t.uniqueId,start:n,end:r,trackRole:t.trackRole,duckTo:t.duckTo,duckDuring:t.duckDuring},e);return{baseVolume:typeof t.volume=="number"?t.volume:1,muted:!!(t.mute??t.muted),clipDuration:Math.max(0,r-n),fade:t.transformation?.audioFade,duckTo:t.duckTo??Iu,duckWindows:o,duckFade:po}}const Vy=.2,wR=.05,AR=t=>t<0?0:t>1?1:t,OR=(t,e)=>e>=t.start&&e<t.end;function Ky(t,e,n=NaN){const r=t.speed&&t.speed>0?t.speed:1;let i=t.frameStartAt+(e-t.start)*r;return Number.isFinite(n)&&n>0&&(i=Math.min(i,n-wR)),i<0?0:i}function Zy(t,e){const n=t.getVolume?t.getVolume(e):t.volume??1;return AR(Wy(e-t.start,{baseVolume:Number.isFinite(n)?n:1,muted:t.mute,clipDuration:t.end-t.start,fade:t.audioFade,duckWindows:t.duckWindows,duckTo:t.duckTo}))}function Mu(t,e,n,r){if(!OR(t,e)||!n.playing||n.reverse||n.seeking)return{kind:"pause"};const i=Ky(t,e,r.duration),o=t.speed&&t.speed>0?t.speed:1,s=Zy(t,e);return r.paused?{kind:"play",seekTo:i,volume:s,rate:o,start:!0}:{kind:"play",seekTo:Math.abs(r.currentTime-i)>Vy?i:null,volume:s,rate:o,start:!1}}const $y=t=>({paused:t.paused,currentTime:t.currentTime,duration:t.duration});function Lu(t,e,n){if(e.kind==="pause"){t.paused||t.pause();return}if(e.seekTo!==null&&(t.currentTime=e.seekTo),t.volume=e.volume,t.playbackRate!==e.rate&&(t.playbackRate=e.rate),e.start)try{const r=t.play();r&&typeof r.catch=="function"&&r.catch(i=>n?.(i))}catch(r){n?.(r)}}const Pu=({audioElements:t,registry:e=hr,clearOnUnmount:n=!0})=>{const r=S.useContext(Ye),{registerTimeUpdateListener:i,unregisterTimeUpdateListener:o}=r,s=S.useRef(t);s.current=t;const a=S.useRef(null),l=S.useRef(new Set);S.useEffect(()=>{const u=new Set(t.map(f=>f.uniqueId));for(const f of[...l.current])u.has(f)||(e.delete(f),l.current.delete(f));for(const{uniqueId:f,src:d,speed:h}of t){if(e.srcFor(f)===d&&e.has(f)){l.current.add(f);continue}e.has(f)&&e.delete(f),l.current.add(f);const p=new Audio;p.crossOrigin="anonymous",p.preload="auto",p.loop=!1,p.playbackRate=h&&h>0?h:1,p.volume=0,p.addEventListener("error",()=>{console.error("[AudioPlaybackManager] load error",f,p.error)}),p.src=d,e.set(f,p,d)}},[t,e]),S.useEffect(()=>{if(!i||!o)return;const u=f=>{const d=a.current;a.current=f;const h={playing:r.playStateRef?.current??!1,reverse:d!==null&&f<d-1e-6,seeking:r.isSeekingRef?.current??!1};for(const p of s.current){const m=e.get(p.uniqueId);if(!m||m.readyState===0)continue;const g=Mu(p,f,h,$y(m));if(g.kind==="play"){const y=e.getContextIfExists();y&&y.state==="suspended"&&y.resume().catch(()=>{})}Lu(m,g,()=>{})}};return i(u),()=>o(u)},[i,o,e,r]);const c=()=>e.forEach(u=>{u.paused||u.pause()});return Ze(ke.PAUSE,c),Ze(ke.SCRUBBER_CLICKED,c),Ze(ke.COMPLETE,()=>{e.forEach(u=>{try{u.pause(),u.currentTime=0}catch{}}),a.current=null}),Ze(ke.RESUME,()=>{a.current=null;const u=r.tl?.current?.time();if(typeof u=="number"){const f={playing:!0,reverse:!1,seeking:!1};for(const d of s.current){const h=e.get(d.uniqueId);!h||h.readyState===0||Lu(h,Mu(d,u,f,$y(h)))}}}),S.useEffect(()=>()=>{if(n){e.clear();return}for(const u of l.current)e.delete(u);l.current.clear()},[e,n]),null};Pu.displayName="AudioPlaybackManager";const Jy={[Nt.NONE]:{mode:2},[Nt.ROUNDBARS]:{mode:2,alphaBars:!1,ansiBands:!1,barSpace:.25,channelLayout:"single",colorMode:"bar-level",frequencyScale:"log",gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.6,lumiBars:!1,maxFreq:16e3,minFreq:30,mirror:0,radial:!1,reflexRatio:.3,reflexAlpha:1,roundBars:!0,showPeaks:!1,showScaleX:!1,showScaleY:!1,smoothing:.7,weightingFilter:"D"},[Nt.LED]:{mode:3,barSpace:.6,ledBars:!0,showScaleX:!1,showScaleY:!1},[Nt.RADIAL_SPECTRUM]:{mode:3,barSpace:.25,bgAlpha:.5,fillAlpha:.5,gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.8,lineWidth:1.5,maxDecibels:-30,maxFreq:16e3,radial:!0,showBgColor:!0,showPeaks:!0,spinSpeed:2,outlineBars:!0,showScaleX:!1,showScaleY:!1,reflexFit:!0},[Nt.LUMI_BARS]:{mode:3,barSpace:.6,lumiBars:!0,reflexRatio:.5,fillAlpha:.3,frequencyScale:"bark",gradientLeft:"steelblue",gradientRight:"orangered",showScaleX:!1,showScaleY:!1},[Nt.EQUALIZER]:{mode:2,gradient:"rainbow",lineWidth:1.5,fillAlpha:.5,showPeaks:!1,showScaleX:!1,showScaleY:!1}};function Qy(t){return S.useSyncExternalStore(t.subscribe,()=>t.version,()=>0)}const Nu={canvas:null,analyzer:null};function e_({uniqueId:t,waveform:e,width:n,height:r,registry:i=hr}){const o=e!==Nt.NONE,[s,a]=I.useState(Nu),l=Qy(i),c=I.useRef(e);c.current=e;const u=i.has(t);return I.useEffect(()=>{if(!o||!u){a(Nu);return}const f=i.getContext();if(!f)return;const d=i.getOrCreateSourceNode(t);if(!d)return;const h=document.createElement("div");h.style.display="none",h.id=`${t}-audioContainer`,document.body.appendChild(h);const p=new eE(h,{audioCtx:f,connectSpeakers:!1,height:r,width:n,...Jy[c.current]??{}});return p.connectInput(d),a({canvas:p.canvas,analyzer:p}),()=>{try{p.disconnectInput(d),p.destroy()}catch{}h.remove(),a(Nu)}},[o,u,l,t,n,r,i]),I.useEffect(()=>{if(!s.analyzer||!o)return;const f=Jy[e]??{};s.analyzer.setOptions(f)},[e,o,s.analyzer]),s}const CR=({ref:t,...e})=>{const{uniqueId:n,src:r,startAt:i,endAt:o,audioStartAt:s=0,mute:a,speed:l,visible:c=!1,volume:u=1,getVolume:f,audioFade:d,duckWindows:h,duckTo:p,managePlayback:m=!0,registry:g=hr,transformation:y,onAudioElementReady:b}=e,{width:x=300,height:v=300,x:T=100,y:w=100,waveform:O=Nt.NONE}=y||{},C=S.useRef(null),R=I.useMemo(()=>[{uniqueId:n,src:r,start:i,end:o,frameStartAt:s,volume:u,getVolume:f,mute:a||!c,speed:l,audioFade:d,duckWindows:h,duckTo:p}],[n,r,i,o,s,u,f,a,c,l,d,h,p]),P=Qy(g),A=g.get(n);S.useEffect(()=>{A&&b?.(n,A)},[A,n,P]);const L=e_({uniqueId:n,waveform:O,width:x,height:v,registry:g}),N=I.useMemo(()=>L.canvas?new W.Texture({source:new W.CanvasSource({resource:L.canvas})}):null,[L.canvas]);S.useEffect(()=>()=>{N?.destroy(!0)},[N]),S.useEffect(()=>{if(!N)return;const F=()=>{N.source.update?.()};return W.Ticker.shared.add(F),()=>{W.Ticker.shared.remove(F)}},[N]);const D=O!==Nt.NONE&&!!N;return M.jsxs(M.Fragment,{children:[m&&M.jsx(Pu,{audioElements:R,registry:g,clearOnUnmount:!1}),D&&M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,isGif:!0,children:M.jsx("pixiSprite",{texture:N,width:x,height:v,anchor:.5,x:T,y:w,ref:C,alpha:c?1:0})})]})},t_=I.memo(CR,et),n_=({src:t,start:e,end:n})=>{const r=S.useRef(null),[i,o]=S.useState({audio:null,isPlaying:!1,currentTime:0});S.useEffect(()=>{const f=new Audio(t);f.preload="auto",f.currentTime=e,r.current=f;const d=()=>o(g=>({...g,isPlaying:!0})),h=()=>o(g=>({...g,isPlaying:!1})),p=()=>o(g=>({...g,isPlaying:!1,currentTime:0})),m=()=>{f.currentTime>=n&&(f.pause(),f.currentTime=e)};return f.addEventListener("play",d),f.addEventListener("pause",h),f.addEventListener("ended",p),f.addEventListener("timeupdate",m),o(g=>({...g,audio:f})),()=>{f.pause(),f.removeEventListener("play",d),f.removeEventListener("pause",h),f.removeEventListener("ended",p),f.removeEventListener("timeupdate",m),f.src="",r.current=null}},[t,e,n]);const s=S.useCallback(()=>{const f=r.current;f&&f.play().catch(()=>{})},[]),a=S.useCallback(()=>{r.current?.pause()},[]),l=S.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,o(h=>({...h,currentTime:f})))},[]),c=S.useCallback(()=>{const f=r.current;f&&(f.paused?s():f.pause())},[s]),u=S.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,s(),o(h=>({...h,currentTime:f})))},[s]);return{...i,handlePause:a,handlePlay:s,togglePlay:c,handleSeek:l,playFromTime:u}},RR=n_;function r_(t,e,{loop:n=!0,speed:r=1}={}){const i=t.length;if(i<=1)return 0;const o=t[i-1].end;if(!(o>0))return 0;let s=e*1e3*(Number.isFinite(r)?r:1);if(Number.isNaN(s)||s<=0)return 0;if(s===1/0)return n?0:i-1;if(n)s%=o;else if(s>=o)return i-1;let a=0,l=i-1,c=0;for(;a<=l;){const u=a+l>>>1;t[u].start<=s?(c=u,a=u+1):l=u-1}return c}const IR=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),s=S.useRef(void 0),{src:a,uniqueId:l,startAt:c,endAt:u,loop:f=!0,animationSpeed:d=1,visible:h,disabled:p,transformation:{width:m=0,height:g=0,x:y,y:b,colorCorrection:x,effect:v,effects:T,neonColor:w,blendMode:O,border:C,roundedCorners:R,maskShape:P,crop:A,anchor:L=.5},pointerdown:N}=e,{tl:D}=S.useContext(Ye),F=lt({colorCorrection:x,effects:T??{name:v},neonColor:w,blendMode:O});S.useEffect(()=>{let z=!1;return r(null),W.Assets.load(a).then(K=>{z||r(K)}).catch(K=>{console.error("[PixiGifSprite] failed to load",a,K)}),()=>{z=!0}},[a]);const G=()=>{const z=o.current,K=s.current;!z||!K||!n||(z.currentFrame=r_(n.frames,K.time(),{loop:f,speed:d}))};return S.useEffect(()=>{if(!D?.current||!i.current)return;const z=i.current,K=E.context(()=>{s.current&&(s.current.kill(),D.current.remove(s.current)),s.current=E.timeline().set(z,{alpha:h?1:0}).to(z,{pixi:{},duration:Number(u)-Number(c),onUpdate:G}),D.current.add(s.current,c)});return()=>{s.current&&(D.current.remove(s.current),s.current.progress(0).kill()),K.revert()}},[c,u,l,D,h,f,n,d]),M.jsx($e,{...e,ref:t,isGif:!0,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:i,children:n&&M.jsx(Ot,{x:y,y:b,width:m,height:g,border:C,roundedCorners:R,maskShape:P,crop:A,spriteRef:o,children:M.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!1,autoUpdate:!1,loop:f,animationSpeed:d,width:m,height:g,anchor:L,x:y,y:b,alpha:h?1:0,filters:F,...!p&&h&&{eventMode:"static",onPointerDown:N}})})})})},i_=I.memo(IR,et),o_=({width:t=800,height:e=500,background:n="#1a1d24",camera:r,defaultLights:i=!0,children:o})=>M.jsx("div",{style:{position:"relative",width:t,height:e,background:n,overflow:"hidden"},children:M.jsxs(is.Canvas,{style:{width:"100%",height:"100%"},camera:{position:r?.position??[0,0,6],fov:r?.fov??60},dpr:[1,2],gl:{antialias:!0,alpha:!0},children:[i&&M.jsxs(M.Fragment,{children:[M.jsx("ambientLight",{intensity:.55}),M.jsx("directionalLight",{position:[5,6,5],intensity:1}),M.jsx("directionalLight",{position:[-5,-2,-3],intensity:.3})]}),o]})}),Gt={ambientIntensity:.6,directionalIntensity:1.2,fillIntensity:.8,spinSpeed:.5,playbackSpeed:1};function s_(t,e){const n=t.scale??1,r=t.spinSpeed??Gt.spinSpeed;return{position:[t.positionX??0,t.positionY??0,t.positionZ??0],rotation:[t.rotationX??Math.sin(e*.3)*.2,(t.rotationY??0)+e*r,t.rotationZ??0],scale:[n*(t.flipX??1),n*(t.flipY??1),n]}}function a_(t,e,n=Gt.playbackSpeed,r=!0){if(!(e>0))return 0;const i=Math.max(0,t*n);return r?i%e:Math.min(i,e)}function c_(t){return t.materialColor!=null||t.roughness!=null||t.metalness!=null||t.emissiveIntensity!=null}function l_(t,e){c_(e)&&t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;e.materialColor!=null&&s.color?.setStyle(e.materialColor),e.roughness!=null&&"roughness"in s&&(s.roughness=e.roughness),e.metalness!=null&&"metalness"in s&&(s.metalness=e.metalness),e.emissiveIntensity!=null&&"emissiveIntensity"in s&&(s.emissiveIntensity=e.emissiveIntensity)}})}function ku(t){return[t.materialColor,t.roughness,t.metalness,t.emissiveIntensity].join("|")}function Du(t,e,n=1.5){return t>0?t/(2*Math.tan(e*Math.PI/360))*n:3}function u_(t,e,n=1.5){const r=new V.Box3().setFromObject(e);if(r.isEmpty())return;const i=r.getCenter(new V.Vector3),o=r.getSize(new V.Vector3),s=Math.max(o.x,o.y,o.z);t.position.set(i.x,i.y,i.z+Du(s,t.fov,n)),t.lookAt(i)}function f_(t,e){if(!e||!Object.keys(e).length)return;const n=t.slice(0,t.lastIndexOf("/")+1),r=new Map;for(const[i,o]of Object.entries(e))r.set(`${n}${i}`,o);return i=>r.get(i)??i}function Fu(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i))o&&o.isTexture&&o.dispose();i.dispose()}})}const MR=({ref:t,...e})=>{const{src:n,resources:r,uniqueId:i,startAt:o,endAt:s,visible:a,disabled:l,threeD:c,pointerdown:u,transformation:{width:f=0,height:d=0,x:h,y:p,colorCorrection:m,effect:g,effects:y,neonColor:b,blendMode:x,border:v,roundedCorners:T,maskShape:w,crop:O,anchor:C=.5}}=e,R=f||400,P=d||400,[A,L]=S.useState(null),N=S.useRef(null),D=S.useRef(null),F=S.useRef(null),G=S.useRef(void 0),z=S.useRef(0),K=S.useRef(c??{});K.current=c??{};const{tl:se}=S.useContext(Ye),pe=lt({colorCorrection:m,effects:y??{name:g},neonColor:b,blendMode:x}),X=S.useCallback(he=>{const j=F.current;if(!j)return;z.current=he;const te=K.current;if(j.ambient.intensity=te.ambientIntensity??Gt.ambientIntensity,j.key.intensity=te.directionalIntensity??Gt.directionalIntensity,j.fill.intensity=te.fillIntensity??Gt.fillIntensity,j.model){const H=s_(te,he);j.model.position.set(...H.position),j.model.rotation.set(...H.rotation),j.model.scale.set(...H.scale);const ae=ku(te);ae!==j.overrideKey&&(l_(j.model,te),j.overrideKey=ae)}j.mixer&&j.mixer.setTime(a_(he,j.clipDuration,te.playbackSpeed??Gt.playbackSpeed)),j.renderer.render(j.scene,j.camera),j.texture.source.update()},[]);return S.useEffect(()=>{let he=!1;const j=document.createElement("canvas");j.width=R,j.height=P;const te=new V.WebGLRenderer({canvas:j,alpha:!0,antialias:!0,preserveDrawingBuffer:!0});te.setPixelRatio(1),te.setSize(R,P,!1),te.setClearColor(0,0),te.outputColorSpace=V.SRGBColorSpace;const H=new V.Scene,ae=new V.PerspectiveCamera(45,R/P,.1,1e3);ae.position.set(0,0,3);const Z=K.current,ce=new V.AmbientLight(16777215,Z.ambientIntensity??Gt.ambientIntensity),J=new V.DirectionalLight(16777215,Z.directionalIntensity??Gt.directionalIntensity);J.position.set(5,5,5);const ie=new V.DirectionalLight(16777215,Z.fillIntensity??Gt.fillIntensity);ie.position.set(-5,0,5),H.add(ce,J,ie);const xe=W.Texture.from(j),Y={renderer:te,scene:H,camera:ae,ambient:ce,key:J,fill:ie,model:null,mixer:null,clipDuration:0,overrideKey:"",texture:xe};F.current=Y;const De=$=>{H.add($),Y.model=$,u_(ae,$)},ye=$=>{const we=$==="cube"?new V.BoxGeometry(.8,.8,.8):new V.TorusKnotGeometry(.6,.25,100,16),me=new V.MeshStandardMaterial({color:new V.Color(Z.materialColor??"#0095dd"),metalness:Z.metalness??($==="knot"?.6:0),roughness:Z.roughness??.3,emissive:new V.Color(17544),emissiveIntensity:Z.emissiveIntensity??.2}),Ue=new V.Mesh(we,me);H.add(Ue),Y.model=Ue,Y.overrideKey=ku(Z)};if(n){const $=new V.LoadingManager,we=f_(n,r);we&&$.setURLModifier(we),new Vd.GLTFLoader($).load(n,me=>{if(he){Fu(me.scene);return}if(De(me.scene),me.animations?.length){const Ue=Math.max(0,Math.min(Z.clipIndex??0,me.animations.length-1)),ze=me.animations[Ue];Y.mixer=new V.AnimationMixer(me.scene),Y.mixer.clipAction(ze).play(),Y.clipDuration=ze.duration}X(z.current)},void 0,me=>{he||(console.error("[PixiThreeModelSprite] model load failed",n,me),ye("cube"),X(z.current))})}else ye("knot");return X(z.current),L(xe),()=>{he=!0,Y.mixer?.stopAllAction(),Y.model&&Fu(Y.model),te.dispose(),F.current=null,L(null),xe.destroy(!0)}},[R,P,n,r,X]),S.useEffect(()=>{X(z.current)},[c,X]),S.useEffect(()=>{if(!se?.current||!N.current)return;const he=N.current,j=E.context(()=>{G.current&&(G.current.kill(),se.current.remove(G.current)),G.current=E.timeline().set(he,{alpha:a?1:0}).to(he,{pixi:{},duration:Number(s)-Number(o),onUpdate:()=>{G.current&&X(G.current.time())}}),se.current.add(G.current,o)});return()=>{G.current&&(se.current.remove(G.current),G.current.progress(0).kill()),j.revert()}},[o,s,i,se,a,X]),M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:N,children:A&&M.jsx(Ot,{x:h,y:p,width:R,height:P,border:v,roundedCorners:T,maskShape:w,crop:O,spriteRef:D,children:M.jsx("pixiSprite",{ref:D,texture:A,width:R,height:P,anchor:C,x:h,y:p,alpha:a?1:0,filters:pe,...!l&&a&&{eventMode:"static",onPointerDown:u}})})})})},LR=I.memo(MR,et);let mo;function PR(){if(mo!==void 0)return mo;const t=Intl.Segmenter;return mo=t?new t(void 0,{granularity:"grapheme"}):null,mo}function d_(t){if(t==="")return[];const e=PR();if(e){const n=[];for(const r of e.segment(t))n.push(r.segment);return n}return Array.from(t)}const NR=/^\s$/;function h_(t){return t.length>0&&NR.test(t[0])}function kR(t,e){return e.tracking!=null?e.tracking:t.tracking??0}function DR({input:t,metrics:e}){const n=[];let r=0;const i=t.paragraphBreak==="crlf";for(let o=0;o<t.runs.length;o++){const s=t.runs[o],a=d_(s.text),l=kR(t,s),c=s.baselineShift??0;for(let u=0;u<a.length;u++){const f=a[u];if(f===`
|
|
1423
1423
|
`||i&&f==="\r"&&a[u+1]===`
|
|
1424
1424
|
`){i&&f==="\r"&&u++,n.push({char:`
|
|
1425
|
-
`,runIndex:o,charIndex:r++,advance:0,ascent:0,descent:0,isWhitespace:!0,isHardBreak:!0,baselineShift:c});continue}const d=e.measure(s,f),h=h_(f);n.push({char:f,runIndex:o,charIndex:r++,advance:d.advance+l,ascent:d.ascent,descent:d.descent,isWhitespace:h,isHardBreak:!1,baselineShift:c})}}return n}function FR(t,e,n){let r=0;for(let i=e;i<n;i++)r+=t[i].advance;return r}function BR(t,e,n){let r=0;for(let i=n-1;i>=e&&(t[i].isWhitespace&&!t[i].isHardBreak);i--)r++;return r}function Bu(t,e,n,r){const i=BR(t,e,n),o=n-i,s=FR(t,e,o);return{start:e,end:n,width:s,collapsedTrailing:i,endsWithHardBreak:r}}function UR({glyphs:t,maxWidth:e}){const n=[];if(t.length===0)return n;let r=0,i=0,o=0;for(;i<t.length;){const s=t[i];if(s.isHardBreak){n.push(Bu(t,r,i+1,!0)),r=i+1,o=0,i++;continue}if(e===void 0){o+=s.advance,i++;continue}if(s.isWhitespace){o+=s.advance,i++;continue}const a=i;let l=i,c=0;for(;l<t.length&&!t[l].isWhitespace&&!t[l].isHardBreak;)c+=t[l].advance,l++;a>r&&t.slice(r,a).some(f=>!f.isWhitespace)&&o+c>e&&(n.push(Bu(t,r,a,!1)),r=a,o=0);for(let f=a;f<l;f++)o+=t[f].advance;i=l}return r<t.length&&n.push(Bu(t,r,t.length,!1)),n}function GR(t,e,n){let r=0,i=0;for(let o=e;o<n;o++)t[o].ascent>r&&(r=t[o].ascent),t[o].descent>i&&(i=t[o].descent);return{ascent:r,descent:i}}function jR(t,e){return(t+e)*1.2}function HR({glyphs:t,lines:e,leading:n}){const r=[];let i=0;for(let o=0;o<e.length;o++){const s=e[o],{ascent:a,descent:l}=GR(t,s.start,s.end),c=n??jR(a,l);let u;o===0?(u=a,i=u+l):(u=i+(n!=null?n-l:a),n==null?i+=c:i=u+l),r.push({baselineY:u,ascent:a,descent:l})}return r}function YR(t,e){const n=e.end-e.collapsedTrailing;let r=0;for(let i=e.start;i<n;i++)t[i].isWhitespace&&!t[i].isHardBreak&&r++;return r}function p_(t,e,n,r){let i=n;for(let o=e.start;o<e.end;o++)r[o]={x:i,extraAdvance:0},i+=t[o].advance}function m_(t,e,n,r,i){const o=n-e.width,s=YR(t,e);if(o<=0||s===0)return Uu(t,e,r,n,i);const a=o/s;let l=0;for(let c=e.start;c<e.end;c++){i[c]={x:l,extraAdvance:0};const u=t[c];let f=u.advance;u.isWhitespace&&!u.isHardBreak&&c<e.end-e.collapsedTrailing&&(i[c].extraAdvance=a,f+=a),l+=f}}function Uu(t,e,n,r,i){const o=e.width;let s=0;r!=null&&(n==="center"||n==="justify-last-center"?s=(r-o)/2:(n==="right"||n==="justify-last-right")&&(s=r-o)),p_(t,e,s,i)}const g_={left:"left",center:"center",right:"right","justify-full":"left","justify-last-left":"left","justify-last-center":"center","justify-last-right":"right"};function XR({glyphs:t,lines:e,align:n,boxWidth:r}){const i=new Array(t.length);for(let o=0;o<e.length;o++){const s=e[o],l=o===e.length-1||s.endsWithHardBreak,c=n==="justify-full",u=n.startsWith("justify");if(r==null){p_(t,s,0,i);continue}if(!u){Uu(t,s,n,r,i);continue}if(c){m_(t,s,r,"left",i);continue}if(l){Uu(t,s,g_[n],r,i);continue}m_(t,s,r,g_[n],i)}return i}const WR=4096;function y_(t,e){return[t.font,t.weight??"",t.italic?1:0,t.size,e].join("|")}class __{map=new Map;get(e){return this.map.get(e)}set(e,n){if(this.map.size>=WR){const r=this.map.keys().next().value;r!==void 0&&this.map.delete(r)}this.map.set(e,n)}clear(){this.map.clear()}get size(){return this.map.size}}function zR(t){const e=[];return t.italic&&e.push("italic"),t.weight!=null&&e.push(String(t.weight)),e.push(`${t.size}px`),e.push(t.font.includes(" ")?`"${t.font}"`:t.font),e.join(" ")}let mr;function qR(){if(mr!==void 0)return mr;if(typeof document>"u")return mr=null,null;try{mr=document.createElement("canvas").getContext("2d")}catch{mr=null}return mr}function b_(t={}){const e=t.cache??new __;return{measure(n,r){const i=y_(n,r),o=e.get(i);if(o!==void 0)return o;const s=qR();let a=n.size*.5,l=n.size*.75,c=n.size*.25;if(s){s.font=zR(n);const f=s.measureText(r);a=f.width,typeof f.actualBoundingBoxAscent=="number"&&f.actualBoundingBoxAscent>0&&(l=f.actualBoundingBoxAscent),typeof f.actualBoundingBoxDescent=="number"&&f.actualBoundingBoxDescent>0&&(c=f.actualBoundingBoxDescent)}const u={advance:a,ascent:l,descent:c};return e.set(i,u),u}}}let go=null;function VR(){return go||(go=b_()),go}function KR(){go=null}function ZR(t,e){const n=new Array(t.length);let r=0,i=!1;for(const o of e){for(let s=o.start;s<o.end;s++)t[s].isWhitespace?(n[s]=r,i&&(i=!1,r++)):(i=!0,n[s]=r);i&&(i=!1,r++)}return n}function x_(t){const e=t.metrics??VR(),n=t.align??"left",r=t.box?.width,i=DR({input:t,metrics:e}),o=UR({glyphs:i,maxWidth:r}),s=HR({glyphs:i,lines:o,leading:t.leading}),a=XR({glyphs:i,lines:o,align:n,boxWidth:r}),l=ZR(i,o),c=[];let u=0;for(let m=0;m<o.length;m++){const g=o[m],y=s[m];for(let b=g.start;b<g.end;b++){const x=i[b];if(x.isHardBreak)continue;const v=a[b],T=c.length===0||c[c.length-1].lineIndex!==m;c.push({char:x.char,runIndex:x.runIndex,charIndex:x.charIndex,wordIndex:l[b],lineIndex:m,x:v.x,y:y.baselineY-x.baselineShift,advance:x.advance+v.extraAdvance,ascent:x.ascent,descent:x.descent,isWhitespace:x.isWhitespace,isLineStart:T,isLineEnd:!1})}c.length>0&&c[c.length-1].lineIndex===m&&(c[c.length-1].isLineEnd=!0)}const f=[];for(let m=0;m<o.length;m++){const g=s[m];let y=-1,b=-1;for(let w=0;w<c.length;w++)c[w].lineIndex===m&&(y===-1&&(y=w),b=w+1);if(y===-1){f.push({startGlyph:c.length,endGlyph:c.length,width:0,baselineY:g.baselineY,isLast:m===o.length-1});continue}const x=c[y],v=c[b-1],T=v.x+v.advance-x.x;T>u&&(u=T),f.push({startGlyph:y,endGlyph:b,width:T,baselineY:g.baselineY,isLast:m===o.length-1})}const d=f[f.length-1],h=s[s.length-1],p=d?d.baselineY+(h?.descent??0):0;return{glyphs:c,lines:f,bounds:{width:u,height:p}}}function $R(t){const{resolution:e,glyphs:n}=t,r=t.ascender??t.boundingBox?.yMax??e*.8,i=t.descender??t.boundingBox?.yMin??-e*.2;return{measure(o,s){const a=o.size,l=n[s],c=l?l.ha/e*a:a*.5,u=r/e*a,f=-i/e*a;return{advance:c,ascent:u,descent:f}}}}function oi(){const[t,e]=S.useReducer(n=>n+1,0);return $e(ke.FONTS_LOADED,()=>{W.CanvasTextMetrics.clearMetrics(),KR(),e()},[]),t}const v_=t=>t.dropShadow?typeof t.dropShadow=="object"?{dropShadow:t.dropShadow}:{dropShadow:{color:t.dropShadowColor??"#000000",alpha:t.dropShadowAlpha??1,angle:t.dropShadowAngle??Math.PI/4,blur:t.dropShadowBlur??0,distance:t.dropShadowDistance??5}}:{},T_=t=>{if(t.stroke&&typeof t.stroke=="object")return{stroke:t.stroke};const e=t.strokeThickness??0;return t.stroke==null||e<=0?{}:{stroke:{color:t.stroke,width:e}}},E_=(t,e,n)=>{if(!t||t.length<2)return;const r=(n??0)===0,i=t.length;return new W.FillGradient({type:"linear",start:{x:0,y:0},end:{x:r?0:1,y:r?1:0},textureSpace:"local",colorStops:t.map((o,s)=>({offset:e?.[s]??s/Math.max(i-1,1),color:o}))})},JR=new Set(["normal","bold","bolder","lighter"]),Gu=t=>{if(t==null||t==="")return;const e=String(t).trim().toLowerCase();if(JR.has(e))return e;const n=Number(e);if(Number.isFinite(n)&&n>=100&&n<=900&&n%100===0)return String(n)},S_=t=>{const e=typeof t=="string"?Number(t):t;return typeof e=="number"&&Number.isFinite(e)&&e!==0?e:void 0},QR=5e7,ju=(t,e)=>t==null||t===""?e:t;function Hu(t){const{fontFamily:e="Arial",fontSize:n=16,fontWeight:r,fontStyle:i,fontVariant:o,fill:s="white",gradientColors:a,gradientStops:l,gradientType:c,stroke:u,strokeWidth:f,strokeThickness:d,dropShadow:h,dropShadowColor:p,dropShadowBlur:m=0,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b,blurEnabled:x=!1,blurRadius:v=0,align:T,padding:w,letterSpacing:O,leading:C,wordWrapWidth:R,tagStyles:P}=t,A={fontFamily:e,fontSize:n,wordWrap:!0,breakWords:!0,wordWrapWidth:R&&R>0?R:QR,leading:C||0},L=E_(a,l,c);L?A.fill=L:s==="transparent"?A.fill={color:0,alpha:0}:A.fill=ju(s,"white");const N=Gu(r);N&&(A.fontWeight=N),(i==="italic"||i==="oblique")&&(A.fontStyle=i),(o==="small-caps"||o===!0)&&(A.fontVariant="small-caps"),Object.assign(A,T_({stroke:u,strokeThickness:f??d??0})),x?A.dropShadow={color:ju(p,"black"),alpha:g??1,angle:0,blur:Number(v),distance:0}:Object.assign(A,v_({dropShadow:h,dropShadowColor:ju(p,"black"),dropShadowBlur:Number(m),dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b}));const D=S_(O);return D!==void 0&&(A.letterSpacing=D),(T==="left"||T==="center"||T==="right"||T==="justify")&&(A.align=T),typeof w=="number"&&Number.isFinite(w)&&w>=0&&(A.padding=w),P&&(A.tagStyles=P),A}function eI(t,e,n,r,i,o){const s=r+2*o,a=i+2*o;return{width:s,height:a,x:t+o*(2*n.x-1),y:e+o*(2*n.y-1)}}const tI=t=>typeof t=="number"?{x:t,y:t}:{x:t?.x??.5,y:t?.y??.5},w_="pixitext-hitarea",nI=t=>`${w_}-${t}`,A_="pixitext-text",rI=({ref:t,...e})=>{const r=S.useRef(0),i=S.useRef(null),o=S.useRef(16),s=S.useRef(null),a=S.useRef(null),{app:l}=at.useApplication(),{visible:c,text:u,disabled:f,transformation:d,pointerdown:h,onDobuleClick:p,uniqueId:m,startAt:g,endAt:y,onTextRefReady:b}=e;I.useEffect(()=>{b&&b(m,i)},[b,m]);const{x,y:v,width:T,height:w,anchor:O=.5,backgroundColor:C="transparent",backgroundFit:R="box",backgroundPadding:P=0,backgroundRadius:A=0,colorCorrection:L,blendMode:N,neonColor:D}=d,F=oi(),G=ut({colorCorrection:L,effects:d.effects??{name:d.effect},neonColor:D,blendMode:N});I.useEffect(()=>{o.current=Number(d.fontSize??16)},[d.fontSize]);const z=I.useMemo(()=>{if(!C||C==="transparent")return null;try{return new W.Color(C).toNumber()}catch{return null}},[C]),K=JSON.stringify([d.tagStyles,d.gradientColors,d.gradientStops]),ae=I.useMemo(()=>new W.TextStyle(Hu({...d,blurRadius:d.blurRadius})),[F,K,d.fontFamily,d.fontSize,d.fontWeight,d.fontStyle,d.fontVariant,d.fill,d.stroke,d.strokeWidth,d.strokeThickness,d.dropShadow,d.dropShadowColor,d.dropShadowBlur,d.dropShadowAlpha,d.dropShadowAngle,d.dropShadowDistance,d.blurEnabled,d.blurRadius,d.align,d.padding,d.letterSpacing,d.leading,d.wordWrapWidth]);I.useEffect(()=>{s.current={...d}},[d]),I.useImperativeHandle(t,()=>({setWordWrap:(ce,Z={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ce;const se=1/Z.x,J=1/Z.y;i.current.scale.set(se,J)}},setFontSizeAndTransform:(ce,Z,se={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ce,i.current.style.fontSize=Z;const J=1/se.x,ie=1/se.y;i.current.scale.set(J,ie)}},resetScale:()=>{i.current&&i.current.scale.set(1,1)}}),[m,g,y]);const pe=I.useCallback((ce,Z={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ce;const se=1/Z.x,J=1/Z.y;i.current.scale.set(se,J)}},[i.current]),X=I.useCallback((ce,Z,se={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ce,i.current.style.fontSize=Z;const J=1/se.x,ie=1/se.y;i.current.scale.set(J,ie)}},[i.current,s.current]),he=tI(O),j=I.useMemo(()=>{if(z===null)return null;if(R==="hug"){const ce=W.CanvasTextMetrics.measureText(u??"",ae);return eI(x,v,he,ce.width,ce.height,P)}return{x,y:v,width:T||100,height:w||100}},[z,R,P,u,ae,x,v,T,w,O]);I.useEffect(()=>{const ce=a.current;if(!ce||z===null||!j||!l?.renderer)return;const Z=new W.Graphics,se=Math.max(1,Math.round(j.width)),J=Math.max(1,Math.round(j.height));A>0?Z.roundRect(0,0,se,J,A):Z.rect(0,0,se,J),Z.fill({color:z});let ie=null;try{ie=l.renderer.generateTexture(Z)}finally{Z.destroy()}return ce.texture=ie,()=>{a.current===ce&&(ce.texture=W.Texture.EMPTY);try{ie?.destroy(!0)}catch{}}},[l,z,j,A]);const $=()=>{const ce=new Date().getTime();ce-r.current<300&&p?p():h&&h(),r.current=ce},H=()=>{!f&&p&&p()};return M.jsxs(Je,{...e,ref:t,isText:!0,onDoubleClick:H,handleDragWordWrap:pe,handleDragFontSize:X,children:[M.jsx("pixiSprite",{texture:W.Texture.EMPTY,x:j?.x??x,y:j?.y??v,width:j?.width??(T||100),height:j?.height??(w||100),anchor:O,alpha:c&&z!==null?1:0,ref:a}),M.jsx("pixiText",{label:A_,style:ae,x,y:v,anchor:O,text:u,alpha:c?1:0,...c&&!f&&{eventMode:"static",cursor:"pointer",onPointerDown:$},ref:i,filters:G})]})},O_=I.memo(rI,tt);E.registerPlugin(wn);const iI=t=>`aep-bez-${t[0]},${t[1]},${t[2]},${t[3]}`,C_=new Set;function Bn(t){if(!t)return"none";const e=iI(t);if(!C_.has(e)){const[n,r,i,o]=t;wn.create(e,`${n},${r},${i},${o}`),C_.add(e)}return e}const oI={position:t=>{const[e,n]=t;return{x:e,y:n}},scale:t=>{const[e,n]=t;return{scaleX:e,scaleY:n}},rotation:t=>({rotation:t}),opacity:t=>({alpha:t}),skew:t=>({skewX:t}),skewAxis:t=>({skewY:t})};function sI(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function R_(t,e,n,r){const i=oI[t];if(!i||!sI(e))return[];const o=e;if(o.length===0)return[];const s=l=>(l-r)/n,a=[];a.push({at:s(o[0].t),op:"set",vars:{pixi:i(o[0].v)},props:Object.keys(i(o[0].v))});for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){a.push({at:s(u.t),op:"set",vars:{pixi:i(u.v)},props:Object.keys(i(u.v))});continue}const h=Bn(c.easeOut);a.push({at:f,op:"to",vars:{pixi:i(u.v),duration:d,ease:h},props:Object.keys(i(u.v))})}return a}function I_(t,e,n){const r=E.timeline({paused:!0}),i=[],o=t.transform,s=["position","scale","rotation","opacity","skew","skewAxis"];for(const a of s){const l=o[a];if(l===void 0)continue;const c=R_(a,l,n,t.inPoint);for(const u of c)u.op==="to"?r.to(e,u.vars,u.at):r.set(e,u.vars,u.at),i.push(u)}return{timeline:r,segments:i}}const Yu=I.createContext(null),si=({value:t,children:e})=>M.jsx(Yu.Provider,{value:t,children:e});function _t(){const t=I.useContext(Yu);if(!t)throw new Error("useAepLayerContext must be used inside <AepLayerProvider>");return t}function Jt(){return I.useContext(Yu)}const M_=I.createContext(0),L_=({depth:t,children:e})=>M.jsx(M_.Provider,{value:t,children:e});function P_(){return I.useContext(M_)}const yo=8;function ai(t,e){if(!e)return t;const n={...t};for(const[r,i]of Object.entries(e)){const o=t[r];if("type"in i&&i.type){n[r]=i;continue}if(o){n[r]={...o,...i};continue}n[r]={type:"image",src:i.src}}return n}function aI(t,e,n,r=null){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(null);I.useEffect(()=>{const a=i?.current,l=e.current;if(!a||!l||!cI(t))return;const c=o?o.framesToSeconds(t.inPoint):t.inPoint/n,{timeline:u}=I_(t,l,n);s.current=u,a.add(u,c);const f=a.time();return a.time(f===0?1e-6:0,!0),a.time(f,!1),()=>{s.current&&(a.remove(s.current),s.current.kill(),s.current=null)}},[t,n,e,r])}function gr(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function cI(t){const e=t.transform;return gr(e.position)||gr(e.scale)||gr(e.rotation)||gr(e.opacity)||gr(e.skew)||gr(e.skewAxis)}function N_(t){const{tl:e}=I.useContext(Ye),[n,r]=I.useState(0);return I.useEffect(()=>{if(!e?.current)return;let o=0,s=-1;const a=()=>{if(e.current){const l=Math.round(e.current.time()*t);l!==s&&(s=l,r(l))}o=requestAnimationFrame(a)};return o=requestAnimationFrame(a),()=>cancelAnimationFrame(o)},[t,e]),n}var Re;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(const s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Re||(Re={}));var k_;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(k_||(k_={}));const oe=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_n=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return Number.isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},U=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Qt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof Qt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Qt.create=t=>new Qt(t);const Xu=(t,e)=>{let n;switch(t.code){case U.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Re.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${Re.joinValues(t.keys,", ")}`;break;case U.invalid_union:n="Invalid input";break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Re.joinValues(t.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${Re.joinValues(t.options)}, received '${t.received}'`;break;case U.invalid_arguments:n="Invalid function arguments";break;case U.invalid_return_type:n="Invalid function return type";break;case U.invalid_date:n="Invalid date";break;case U.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case U.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case U.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case U.custom:n="Invalid input";break;case U.invalid_intersection_types:n="Intersection results could not be merged";break;case U.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case U.not_finite:n="Number must be finite";break;default:n=e.defaultError,Re.assertNever(t)}return{message:n}};let lI=Xu;function uI(){return lI}const fI=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}};function Q(t,e){const n=uI(),r=fI({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xu?void 0:Xu].filter(i=>!!i)});t.common.issues.push(r)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return _e;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return ft.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return _e;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}}const _e=Object.freeze({status:"aborted"}),ci=t=>({status:"dirty",value:t}),bt=t=>({status:"valid",value:t}),D_=t=>t.status==="aborted",F_=t=>t.status==="dirty",yr=t=>t.status==="valid",_o=t=>typeof Promise<"u"&&t instanceof Promise;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(fe||(fe={}));class Ht{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const B_=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Qt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}class Ae{get description(){return this._def.description}_getType(e){return _n(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(_o(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return B_(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return yr(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>yr(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(_o(i)?i:Promise.resolve(i));return B_(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=e(i),a=()=>o.addIssue({code:U.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new jn({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nn.create(this,this._def)}nullable(){return Hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this)}promise(){return wo.create(this,this._def)}or(e){return xo.create([this,e],this._def)}and(e){return vo.create(this,e,this._def)}transform(e){return new jn({...Ee(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ao({...Ee(this._def),innerType:this,defaultValue:n,typeName:be.ZodDefault})}brand(){return new q_({typeName:be.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Oo({...Ee(this._def),innerType:this,catchValue:n,typeName:be.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Qu.create(this,e)}readonly(){return Co.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dI=/^c[^\s-]{8,}$/i,hI=/^[0-9a-z]+$/,pI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gI=/^[a-z0-9_-]{21}$/i,yI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_I=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wu;const vI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,EI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",OI=new RegExp(`^${U_}$`);function G_(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function CI(t){return new RegExp(`^${G_(t)}$`)}function RI(t){let e=`${U_}T${G_(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function II(t,e){return!!((e==="v4"||!e)&&vI.test(t)||(e==="v6"||!e)&&EI.test(t))}function MI(t,e){if(!yI.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function LI(t,e){return!!((e==="v4"||!e)&&TI.test(t)||(e==="v6"||!e)&&SI.test(t))}class en extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.string,received:o.parsedType}),_e}const r=new ft;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?Q(i,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Q(i,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")bI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"email",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Wu||(Wu=new RegExp(xI,"u")),Wu.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"emoji",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")mI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"uuid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")gI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"nanoid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")dI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cuid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")hI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cuid2",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")pI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"ulid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Q(i,{validation:"url",code:U.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"regex",code:U.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?RI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?OI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?CI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?_I.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"duration",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?II(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"ip",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?MI(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"jwt",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?LI(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cidr",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?wI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"base64",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?AI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"base64url",code:U.invalid_string,message:o.message}),r.dirty()):Re.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:U.invalid_string,...fe.errToObj(r)})}_addCheck(e){return new en({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...fe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...fe.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...fe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...fe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...fe.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new en({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}en.create=t=>new en({checks:[],typeName:be.ZodString,coerce:t?.coerce??!1,...Ee(t)});function PI(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}class _r extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.number,received:o.parsedType}),_e}let r;const i=new ft;for(const o of this._def.checks)o.kind==="int"?Re.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Q(r,{code:U.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?PI(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_finite,message:o.message}),i.dirty()):Re.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,r,i){return new _r({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:fe.toString(i)}]})}_addCheck(e){return new _r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}_r.create=t=>new _r({checks:[],typeName:be.ZodNumber,coerce:t?.coerce||!1,...Ee(t)});class li extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==oe.bigint)return this._getInvalidInput(e);let r;const i=new ft;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Re.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Q(n,{code:U.invalid_type,expected:oe.bigint,received:n.parsedType}),_e}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,r,i){return new li({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:fe.toString(i)}]})}_addCheck(e){return new li({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}li.create=t=>new li({checks:[],typeName:be.ZodBigInt,coerce:t?.coerce??!1,...Ee(t)});class zu extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.boolean,received:r.parsedType}),_e}return bt(e.data)}}zu.create=t=>new zu({typeName:be.ZodBoolean,coerce:t?.coerce||!1,...Ee(t)});class bo extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.date,received:o.parsedType}),_e}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_date}),_e}const r=new ft;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Re.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bo({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}bo.create=t=>new bo({checks:[],coerce:t?.coerce||!1,typeName:be.ZodDate,...Ee(t)});class j_ extends Ae{_parse(e){if(this._getType(e)!==oe.symbol){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.symbol,received:r.parsedType}),_e}return bt(e.data)}}j_.create=t=>new j_({typeName:be.ZodSymbol,...Ee(t)});class qu extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.undefined,received:r.parsedType}),_e}return bt(e.data)}}qu.create=t=>new qu({typeName:be.ZodUndefined,...Ee(t)});class Vu extends Ae{_parse(e){if(this._getType(e)!==oe.null){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.null,received:r.parsedType}),_e}return bt(e.data)}}Vu.create=t=>new Vu({typeName:be.ZodNull,...Ee(t)});class H_ extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return bt(e.data)}}H_.create=t=>new H_({typeName:be.ZodAny,...Ee(t)});class Ku extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return bt(e.data)}}Ku.create=t=>new Ku({typeName:be.ZodUnknown,...Ee(t)});class bn extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return Q(n,{code:U.invalid_type,expected:oe.never,received:n.parsedType}),_e}}bn.create=t=>new bn({typeName:be.ZodNever,...Ee(t)});class Y_ extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.void,received:r.parsedType}),_e}return bt(e.data)}}Y_.create=t=>new Y_({typeName:be.ZodVoid,...Ee(t)});class Yt extends Ae{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==oe.array)return Q(n,{code:U.invalid_type,expected:oe.array,received:n.parsedType}),_e;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Q(n,{code:s?U.too_big:U.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Q(n,{code:U.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Q(n,{code:U.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Ht(n,s,n.path,a)))).then(s=>ft.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Ht(n,s,n.path,a)));return ft.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Yt({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new Yt({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new Yt({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}Yt.create=(t,e)=>new Yt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Ee(e)});function br(t){if(t instanceof nt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=nn.create(br(r))}return new nt({...t._def,shape:()=>e})}else return t instanceof Yt?new Yt({...t._def,type:br(t.element)}):t instanceof nn?nn.create(br(t.unwrap())):t instanceof Hn?Hn.create(br(t.unwrap())):t instanceof Un?Un.create(t.items.map(e=>br(e))):t}class nt extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==oe.object){const c=this._getOrReturnCtx(e);return Q(c,{code:U.invalid_type,expected:oe.object,received:c.parsedType}),_e}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof bn&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ht(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof bn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Q(i,{code:U.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ht(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,d=await u.value;c.push({key:f,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>ft.mergeObjectSync(r,c)):ft.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:fe.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};for(const r of Re.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new nt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Re.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new nt({...this._def,shape:()=>n})}deepPartial(){return br(this)}partial(e){const n={};for(const r of Re.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new nt({...this._def,shape:()=>n})}required(e){const n={};for(const r of Re.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof nn;)o=o._def.innerType;n[r]=o}return new nt({...this._def,shape:()=>n})}keyof(){return W_(Re.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)});class xo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Qt(a.ctx.common.issues));return Q(n,{code:U.invalid_union,unionErrors:s}),_e}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new Qt(l));return Q(n,{code:U.invalid_union,unionErrors:a}),_e}}get options(){return this._def.options}}xo.create=(t,e)=>new xo({options:t,typeName:be.ZodUnion,...Ee(e)});const tn=t=>t instanceof Eo?tn(t.schema):t instanceof jn?tn(t.innerType()):t instanceof So?[t.value]:t instanceof Gn?t.options:t instanceof Ju?Re.objectValues(t.enum):t instanceof Ao?tn(t._def.innerType):t instanceof qu?[void 0]:t instanceof Vu?[null]:t instanceof nn?[void 0,...tn(t.unwrap())]:t instanceof Hn?[null,...tn(t.unwrap())]:t instanceof q_||t instanceof Co?tn(t.unwrap()):t instanceof Oo?tn(t._def.innerType):[];class Zu extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return Q(n,{code:U.invalid_type,expected:oe.object,received:n.parsedType}),_e;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Q(n,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const s=tn(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Zu({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ee(r)})}}function $u(t,e){const n=_n(t),r=_n(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&r===oe.object){const i=Re.objectKeys(e),o=Re.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of o){const l=$u(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===oe.array&&r===oe.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const s=t[o],a=e[o],l=$u(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class vo extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(D_(o)||D_(s))return _e;const a=$u(o.value,s.value);return a.valid?((F_(o)||F_(s))&&n.dirty(),{status:n.value,value:a.data}):(Q(r,{code:U.invalid_intersection_types}),_e)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vo.create=(t,e,n)=>new vo({left:t,right:e,typeName:be.ZodIntersection,...Ee(n)});class Un extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.array)return Q(r,{code:U.invalid_type,expected:oe.array,received:r.parsedType}),_e;if(r.data.length<this._def.items.length)return Q(r,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&r.data.length>this._def.items.length&&(Q(r,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Ht(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ft.mergeArray(n,s)):ft.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Un({...this._def,rest:e})}}Un.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Un({items:t,typeName:be.ZodTuple,rest:null,...Ee(e)})};class To extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return Q(r,{code:U.invalid_type,expected:oe.object,received:r.parsedType}),_e;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Ht(r,a,r.path,a)),value:s._parse(new Ht(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ft.mergeObjectAsync(n,i):ft.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ae?new To({keyType:e,valueType:n,typeName:be.ZodRecord,...Ee(r)}):new To({keyType:en.create(),valueType:e,typeName:be.ZodRecord,...Ee(n)})}}class X_ extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.map)return Q(r,{code:U.invalid_type,expected:oe.map,received:r.parsedType}),_e;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Ht(r,a,r.path,[c,"key"])),value:o._parse(new Ht(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}X_.create=(t,e,n)=>new X_({valueType:e,keyType:t,typeName:be.ZodMap,...Ee(n)});class ui extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.set)return Q(r,{code:U.invalid_type,expected:oe.set,received:r.parsedType}),_e;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Q(r,{code:U.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Q(r,{code:U.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return _e;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new Ht(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new ui({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new ui({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ui.create=(t,e)=>new ui({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...Ee(e)});class Eo extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Eo.create=(t,e)=>new Eo({getter:t,typeName:be.ZodLazy,...Ee(e)});class So extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Q(n,{received:n.data,code:U.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}So.create=(t,e)=>new So({value:t,typeName:be.ZodLiteral,...Ee(e)});function W_(t,e){return new Gn({values:t,typeName:be.ZodEnum,...Ee(e)})}class Gn extends Ae{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Q(n,{expected:Re.joinValues(r),received:n.parsedType,code:U.invalid_type}),_e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Q(n,{received:n.data,code:U.invalid_enum_value,options:r}),_e}return bt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Gn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Gn.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Gn.create=W_;class Ju extends Ae{_parse(e){const n=Re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Re.objectValues(n);return Q(r,{expected:Re.joinValues(i),received:r.parsedType,code:U.invalid_type}),_e}if(this._cache||(this._cache=new Set(Re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Re.objectValues(n);return Q(r,{received:r.data,code:U.invalid_enum_value,options:i}),_e}return bt(e.data)}get enum(){return this._def.values}}Ju.create=(t,e)=>new Ju({values:t,typeName:be.ZodNativeEnum,...Ee(e)});class wo extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return Q(n,{code:U.invalid_type,expected:oe.promise,received:n.parsedType}),_e;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return bt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wo.create=(t,e)=>new wo({type:t,typeName:be.ZodPromise,...Ee(e)});class jn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{Q(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return _e;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?_e:l.status==="dirty"||n.value==="dirty"?ci(l.value):l});{if(n.value==="aborted")return _e;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?_e:a.status==="dirty"||n.value==="dirty"?ci(a.value):a}}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!yr(s))return _e;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>yr(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):_e);Re.assertNever(i)}}jn.create=(t,e,n)=>new jn({schema:t,typeName:be.ZodEffects,effect:e,...Ee(n)}),jn.createWithPreprocess=(t,e,n)=>new jn({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...Ee(n)});class nn extends Ae{_parse(e){return this._getType(e)===oe.undefined?bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nn.create=(t,e)=>new nn({innerType:t,typeName:be.ZodOptional,...Ee(e)});class Hn extends Ae{_parse(e){return this._getType(e)===oe.null?bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Hn.create=(t,e)=>new Hn({innerType:t,typeName:be.ZodNullable,...Ee(e)});class Ao extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ao.create=(t,e)=>new Ao({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Oo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return _o(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oo.create=(t,e)=>new Oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class z_ extends Ae{_parse(e){if(this._getType(e)!==oe.nan){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.nan,received:r.parsedType}),_e}return{status:"valid",value:e.data}}}z_.create=t=>new z_({typeName:be.ZodNaN,...Ee(t)});class q_ extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Qu extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?_e:o.status==="dirty"?(n.dirty(),ci(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_e:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Qu({in:e,out:n,typeName:be.ZodPipeline})}}class Co extends Ae{_parse(e){const n=this._def.innerType._parse(e),r=i=>(yr(i)&&(i.value=Object.freeze(i.value)),i);return _o(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Co.create=(t,e)=>new Co({innerType:t,typeName:be.ZodReadonly,...Ee(e)});var be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));const le=en.create,k=_r.create,Qe=zu.create,NI=Ku.create;bn.create;const et=Yt.create,de=nt.create,ht=xo.create,ef=Zu.create;vo.create;const We=Un.create,rn=To.create,V_=Eo.create,rt=So.create,it=Gn.create;wo.create,nn.create,Hn.create;const K_=it(["image","video","audio","lottie","gif","svg","font","composition","model"]),Z_=de({type:K_,src:le(),width:k().optional(),height:k().optional(),duration:k().optional()}).strict(),$_=rn(le(),Z_),tf=We([k(),k(),k(),k()]).describe("cubic-bezier(x1,y1,x2,y2)"),nf=t=>de({t:k().finite(),v:t,easeIn:tf.optional(),easeOut:tf.optional(),hold:Qe().optional()}).strict(),q=t=>ht([t,et(nf(t)).min(1)]),rf=We([k(),k()]),Ro=de({position:q(rf),anchor:q(rf),scale:q(rf),rotation:q(k()),opacity:q(k().min(0).max(1)),skew:q(k()).optional(),skewAxis:q(k()).optional()}).strict(),J_=it(["drop-shadow","gaussian-blur","directional-blur","glow","levels","curves","hue-saturation","tint","fill","tritone","fast-box-blur","color-balance","brightness-contrast"]),Q_=de({name:J_,enabled:Qe().optional(),params:rn(le(),ht([le(),Qe(),q(k()),q(le()),q(We([k(),k()])),q(We([k(),k(),k(),k()]))]))}).strict(),eb=it(["cameraLensBlur","bloom","chromaticAberration","vignette","noise"]),of=de({name:eb,enabled:Qe().optional(),params:rn(le(),ht([le(),Qe(),q(k()),q(le()),q(We([k(),k()]))]))}).strict(),sf=We([k(),k()]),fi=de({vertices:et(sf),inTangents:et(sf),outTangents:et(sf),closed:Qe()}).strict(),tb=it(["add","subtract","intersect","lighten","darken","difference","alpha"]),nb=de({id:le().min(1),mode:tb,inverted:Qe().optional(),opacity:q(k().min(0).max(1)).optional(),expansion:q(k()).optional(),path:ht([fi,et(nf(fi)).min(1)])}).strict(),af=We([k(),k(),k()]),kI=We([k(),k()]),Io=de({position:q(af),anchor:q(af),scale:q(kI),rotation:q(af),opacity:q(k().min(0).max(1))}).strict(),rb=de({kind:rt("camera"),id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),hidden:Qe().optional(),transform:Ro,transform3D:Io,fov:q(k().positive()),focusDistance:q(k().positive()).optional(),aperture:q(k().min(0)).optional(),blurLevel:q(k().min(0)).optional(),zoom:q(k().positive()).optional(),disableCameraDoF:Qe().optional()}).strict(),DI=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),ib=de({kind:rt("light"),id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),hidden:Qe().optional(),transform:Ro,transform3D:Io,lightType:it(["ambient","point","spot","parallel"]),intensity:q(k().min(0)),color:q(DI),falloff:q(k().min(0)).optional(),coneAngle:q(k().min(0).max(180)).optional(),coneFeather:q(k().min(0).max(100)).optional(),castsShadows:Qe().optional()}).strict(),ob=it(["square","ramp-up","ramp-down","triangle","round","smooth"]),sb=it(["chars","words","lines"]),ab=de({start:q(k()),end:q(k()),offset:q(k()).optional(),basedOn:sb.optional(),shape:ob.optional(),smoothness:q(k()).optional(),easeHigh:q(k()).optional(),easeLow:q(k()).optional()}).strict(),cb=de({range:ab,amount:q(k()).optional(),positionOffset:q(We([k(),k()])).optional(),scaleOffset:q(We([k(),k()])).optional(),rotationOffset:q(k()).optional(),opacityOffset:q(k()).optional(),fillOffset:le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional()}).strict(),FI=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),lb=de({from:k().int().min(0),to:k().int().min(1),font:le().optional(),size:q(k().min(0)).optional(),fill:q(FI).optional(),weight:ht([k(),le()]).optional(),italic:Qe().optional(),tracking:q(k()).optional(),baselineShift:q(k()).optional()}).strict().refine(t=>t.to>t.from,{message:"to must exceed from",path:["to"]}),ub=["left","center","right","justify-full","justify-last-left","justify-last-center","justify-last-right"],fb=it(ub);function cf(t){if(t==null||typeof t!="object")return t;const e=t,n=e.layers;if(!Array.isArray(n))return t;const r={...e,layers:[...n]};for(let i=0;i<n.length;i++){const o=n[i];if(!o||typeof o!="object"||o.kind!=="text")continue;const s=o.style;if(s&&s.align==="justify"){const a={...s,align:"justify-last-left"};r.layers[i]={...o,style:a}}}return r}class db extends Error{constructor(e){super(`text runs overlap: ${e.map(([n,r,i,o])=>`[${n},${r}) ∩ [${i},${o})`).join(", ")}`),this.ranges=e,this.name="TextRunsOverlapError"}ranges}function hb(t,e){const n=[];if(e<=0)return{runs:[],warnings:n};const r=[...t].sort((l,c)=>l.from-c.from),i=[];for(let l=1;l<r.length;l++){const c=r[l-1],u=r[l];u.from<c.to&&i.push([c.from,c.to,u.from,u.to])}if(i.length>0)throw new db(i);const o=[];for(const l of r)l.from>=e||l.to<=0||(l.to>e?(n.push(`run [${l.from},${l.to}) clipped to source length ${e}`),o.push({...l,to:e})):o.push(l));const s=[];let a=0;for(const l of o)l.from>a&&s.push({from:a,to:l.from}),s.push(l),a=l.to;return a<e&&s.push({from:a,to:e}),{runs:s,warnings:n}}const lf=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),pb=de({themeKey:le().min(1),default:lf}).strict(),mb=ht([lf,pb]),uf=q(mb),gb=rn(le(),lf);function ff(t,e){return typeof t=="string"?t:e?.[t.themeKey]??t.default}function Yn(t,e){if(t!==void 0)return typeof t=="string"?t:Array.isArray(t)?t.map(n=>({t:n.t,v:ff(n.v,e),easeIn:n.easeIn,easeOut:n.easeOut,hold:n.hold})):ff(t,e)}const BI=ht([k(),Qe(),et(k())]),yb=de({id:le().min(1),kind:it(["element","scene"]),name:le().min(1),from:ht([le().min(1),et(le().min(1)).min(1)]),to:ht([le().min(1),et(le().min(1)).min(1)]),startFrame:k().finite().min(0),durationFrames:k().finite().positive(),ease:ht([We([k(),k(),k(),k()]),le()]).optional(),params:rn(le(),BI).optional(),region:de({x:k().finite(),y:k().finite(),width:k().positive(),height:k().positive()}).strict().optional(),includeShared:Qe().optional()}).strict().superRefine((t,e)=>{t.kind==="element"&&(Array.isArray(t.from)||Array.isArray(t.to))&&e.addIssue({code:U.custom,message:"element transitions require one from and one to layer id",path:[Array.isArray(t.from)?"from":"to"]})}),df=t=>Array.isArray(t)?t:[t],di=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),UI=it(["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","add"]),GI=de({kind:rt("rect"),size:q(We([k(),k()])),position:q(We([k(),k()])).optional(),roundness:q(k()).optional()}).strict(),jI=de({kind:rt("ellipse"),size:q(We([k(),k()])),position:q(We([k(),k()])).optional()}).strict(),HI=de({kind:rt("polystar"),starType:it(["star","polygon"]),points:q(k()),innerRadius:q(k()).optional(),outerRadius:q(k()),innerRoundness:q(k()).optional(),outerRoundness:q(k()).optional(),rotation:q(k()).optional(),position:q(We([k(),k()])).optional()}).strict(),YI=de({kind:rt("bezier"),path:ht([fi,et(de({t:k(),v:fi,easeIn:We([k(),k(),k(),k()]).optional(),easeOut:We([k(),k(),k(),k()]).optional(),hold:Qe().optional()}).strict()).min(1)])}).strict(),_b=ef("kind",[GI,jI,HI,YI]),bb=de({color:q(di),width:q(k().min(0)),dashes:et(k()).optional(),lineCap:it(["butt","round","square"]).optional(),lineJoin:it(["miter","round","bevel"]).optional()}).strict(),XI=de({start:q(k().min(0).max(1)),end:q(k().min(0).max(1)),offset:q(k()).optional()}).strict(),xb=de({font:le(),size:q(k().min(0)),fill:uf.optional(),stroke:bb.optional(),weight:ht([k(),le()]).optional(),italic:Qe().optional(),letterSpacing:q(k()).optional(),lineHeight:q(k()).optional(),tracking:q(k()).optional(),leading:q(k()).optional(),boxWidth:k().positive().optional(),align:fb.optional(),runs:et(lb).optional(),tagStyles:rn(le(),de({fill:di.optional(),weight:ht([k(),le()]).optional(),italic:Qe().optional()}).strict()).optional()}).strict(),WI=de({sourceId:le().min(1),mode:it(["alpha","alpha-inverted","luma","luma-inverted"])}).strict(),Ct={id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),blendMode:UI.optional(),hidden:Qe().optional(),transform:Ro,masks:et(nb).optional(),effects:et(Q_).optional(),trackMatte:WI.optional(),is3D:Qe().optional(),transform3D:Io.optional()},on=le().min(1),zI=de({...Ct,kind:rt("image"),assetId:on}).strict(),qI=de({...Ct,kind:rt("video"),assetId:on,timeRemap:q(k()).optional(),muted:Qe().optional()}).strict(),VI=de({...Ct,kind:rt("audio"),assetId:on,level:q(k().min(0)).optional(),pan:q(k().min(-1).max(1)).optional()}).strict(),KI=de({...Ct,kind:rt("gif"),assetId:on}).strict(),ZI=de({...Ct,kind:rt("lottie"),assetId:on,speed:k().optional()}).strict(),$I=de({...Ct,kind:rt("svg"),assetId:on}).strict(),JI=de({...Ct,kind:rt("text"),source:q(le()),style:xb,animators:et(cb).optional(),splitMode:it(["single","chars","words","lines"]).optional(),extrusion:V_(()=>vb).optional()}).strict(),vb=de({depth:q(k().min(0)),bevelEnabled:Qe().optional(),bevelThickness:q(k().min(0)).optional(),bevelSize:q(k().min(0)).optional(),bevelSegments:k().int().min(0).optional(),curveSegments:k().int().min(1).optional(),sideMaterial:de({color:di.optional(),metalness:k().min(0).max(1).optional(),roughness:k().min(0).max(1).optional()}).strict().optional()}).strict(),QI=de({...Ct,kind:rt("shape"),path:_b,fill:uf.optional(),stroke:bb.optional(),trimPath:XI.optional(),extrusion:vb.optional()}).strict(),eM=de({...Ct,kind:rt("null")}).strict(),tM=de({...Ct,kind:rt("precomp"),compId:le().min(1),width:k().positive(),height:k().positive()}).strict(),nM=de({width:k().positive(),height:k().positive(),depth:k().positive().optional()}).strict(),rM=de({type:rt("primitive"),shape:it(["can","bottle","box","jar","tube","pouch"]),proportions:nM.optional()}).strict(),iM=de({type:rt("extrude"),contour:et(We([k(),k()])).min(3).max(2e3),depth:q(k().min(0)),bevel:k().min(0).optional()}).strict(),oM=de({type:rt("gltf"),assetId:on}).strict(),sM=ef("type",[rM,iM,oM]),aM=de({label:on.optional(),front:on.optional(),side:di.optional()}).strict(),cM=de({roughness:q(k().min(0).max(1)).optional(),metalness:q(k().min(0).max(1)).optional(),clearcoat:k().min(0).max(1).optional()}).strict(),lM=de({rotation:q(We([k(),k(),k()])).optional(),position:q(We([k(),k(),k()])).optional(),scale:q(k().positive()).optional()}).strict(),uM=de({azimuth:q(k()).optional(),elevation:q(k()).optional(),intensity:q(k().min(0)).optional(),color:di.optional()}).strict(),fM=de({preset:it(["studio","window","golden","night"]).optional(),key:uM.optional(),fill:de({intensity:q(k().min(0)).optional()}).strict().optional(),rim:de({intensity:q(k().min(0)).optional()}).strict().optional(),environment:it(["room","none"]).optional()}).strict(),dM=de({opacity:q(k().min(0).max(1)),softness:k().min(0).max(1).optional(),offsetY:k().optional()}).strict(),hM=de({width:k().int().min(16).max(4096),height:k().int().min(16).max(4096)}).strict(),pM=de({center:We([k(),k(),k()]).optional(),size:We([k().positive(),k().positive(),k().positive()])}).strict(),mM=de({...Ct,kind:rt("model3d"),viewport:hM,source:sM,textures:aM.optional(),material:cM.optional(),view:lM.optional(),lighting:fM.optional(),shadow:dM.optional(),bounds:pM.optional(),camera:de({fov:k().min(10).max(90).optional(),fit:k().min(.5).max(3).optional()}).strict().optional()}).strict(),Tb=ef("kind",[zI,qI,VI,KI,ZI,$I,JI,QI,eM,tM,mM,rb,ib]).superRefine((t,e)=>{t.kind==="camera"||t.kind==="light"||t.is3D===!0&&!t.transform3D&&e.addIssue({code:U.custom,message:"is3D: true requires a `transform3D` field",path:["transform3D"]})}),gM="1.10.0",hf=1,Eb="1.4.0",pf="1.10.0";function Sb(t,e){const n=t.split(".").map(i=>Number.parseInt(i,10)),r=e.split(".").map(i=>Number.parseInt(i,10));for(let i=0;i<3;i++){const o=n[i]??0,s=r[i]??0;if(o>s)return!0;if(o<s)return!1}return!0}const yM=le().regex(/^\d+\.\d+\.\d+$/,"expected semver string like '1.0.0'").refine(t=>Number.parseInt(t.split(".")[0]??"",10)===hf,`unsupported schema major; this build expects major ${hf}`),_M=de({family:le(),src:le().optional(),weight:ht([k(),le()]).optional(),style:it(["normal","italic","oblique"]).optional()}).strict(),bM=de({src:le().optional(),msdf:de({json:le(),png:le()}).strict().optional()}).strict().refine(t=>t.src!=null||t.msdf!=null,{message:"fonts3D entry must declare at least one of `src` or `msdf`"}),Mo=de({version:yM,id:le().min(1),name:le().optional(),width:k().positive(),height:k().positive(),fps:k().positive(),durationInFrames:k().positive(),bgColor:le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional(),layers:et(Tb),assets:$_,fonts:et(_M).optional(),fonts3D:rn(le(),bM).optional(),precomps:rn(le(),V_(()=>Mo)).optional(),postFx:et(of).optional(),theme:gb.optional(),transitions:et(yb).optional(),meta:rn(le(),NI()).optional()}).strict().superRefine((t,e)=>{const n=new Set;for(const u of t.layers)n.has(u.id)&&e.addIssue({code:U.custom,message:`duplicate layer id: ${u.id}`,path:["layers"]}),n.add(u.id);const r=new Set(t.layers.map(u=>u.id));for(let u=0;u<t.layers.length;u++){const f=t.layers[u].parent;f&&!r.has(f)&&e.addIssue({code:U.custom,message:`parent '${f}' is not a layer in this composition`,path:["layers",u,"parent"]})}const i=new Map(t.layers.map(u=>[u.id,u]));for(let u=0;u<t.layers.length;u++){const f=t.layers[u],d=new Set;let h=f;for(;h?.parent;){if(d.has(h.id)){e.addIssue({code:U.custom,message:`cyclic parent chain detected at layer '${f.id}'`,path:["layers",u,"parent"]});break}d.add(h.id),h=i.get(h.parent)}}for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(f.kind!=="precomp")continue;const d=t.assets[f.compId],h=t.precomps?.[f.compId];if(!d&&!h){e.addIssue({code:U.custom,message:`precomp layer '${f.id}' references unknown compId '${f.compId}'`,path:["layers",u,"compId"]});continue}d&&d.type!=="composition"&&e.addIssue({code:U.custom,message:`asset '${f.compId}' is not a composition (got '${d.type}')`,path:["layers",u,"compId"]})}const o=new Set(["image","video","audio","gif","lottie","svg"]);for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(!o.has(f.kind))continue;const d=f.assetId;t.assets[d]||e.addIssue({code:U.custom,message:`layer '${f.id}' references unknown assetId '${d}'`,path:["layers",u,"assetId"]})}for(let u=0;u<t.layers.length;u++){const d=t.layers[u].trackMatte;d&&!r.has(d.sourceId)&&e.addIssue({code:U.custom,message:`trackMatte source '${d.sourceId}' is not a layer in this composition`,path:["layers",u,"trackMatte","sourceId"]})}t.layers.some(u=>u.kind==="model3d")&&!Sb(t.version,Eb)&&e.addIssue({code:U.custom,message:`model3d layers require schema >= ${Eb} (got ${t.version})`,path:["version"]});const a=t.transitions??[];t.transitions!==void 0&&!Sb(t.version,pf)&&e.addIssue({code:U.custom,message:`transitions require schema >= ${pf} (got ${t.version})`,path:["version"]});const l=new Set,c=new Map;for(let u=0;u<a.length;u+=1){const f=a[u];l.has(f.id)&&e.addIssue({code:U.custom,message:`duplicate transition id: ${f.id}`,path:["transitions",u,"id"]}),l.add(f.id);const d=df(f.from),h=df(f.to),p=new Set(d),m=[...new Set([...d,...h])];for(const g of h)p.has(g)&&e.addIssue({code:U.custom,message:`transition '${f.id}' uses layer '${g}' as both from and to`,path:["transitions",u]});for(const g of m){const y=i.get(g);if(!y){e.addIssue({code:U.custom,message:`transition '${f.id}' references unknown layer '${g}'`,path:["transitions",u]});continue}(y.kind==="camera"||y.kind==="light"||y.kind==="audio"||"is3D"in y&&y.is3D===!0)&&e.addIssue({code:U.custom,message:`transition '${f.id}' endpoint '${g}' must be a 2D visual layer`,path:["transitions",u]});const b=c.get(g)??[],x=f.startFrame,v=x+f.durationFrames;for(const T of b)x<T.end&&T.start<v&&e.addIssue({code:U.custom,message:`transition '${f.id}' overlaps '${T.id}' on layer '${g}'`,path:["transitions",u]});b.push({start:x,end:v,id:f.id}),c.set(g,b)}f.startFrame+f.durationFrames>t.durationInFrames&&e.addIssue({code:U.custom,message:`transition '${f.id}' extends past composition duration`,path:["transitions",u,"durationFrames"]})}for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(f.kind==="model3d"){f.source.type==="gltf"&&(t.assets[f.source.assetId]||e.addIssue({code:U.custom,message:`model3d layer '${f.id}' references unknown assetId '${f.source.assetId}'`,path:["layers",u,"source","assetId"]}));for(const d of["label","front"]){const h=f.textures?.[d];h&&(t.assets[h]||e.addIssue({code:U.custom,message:`model3d layer '${f.id}' references unknown texture assetId '${h}'`,path:["layers",u,"textures",d]}))}}}});function Lo(t){return Mo.parse(cf(t))}function xM(t){const e=Mo.safeParse(cf(t));return e.success?{success:!0,data:e.data}:{success:!1,error:e.error}}function vM(t){return t?t.startsWith("http://")||t.startsWith("https://"):!1}const TM={NONE:"none",FADE:"fade",DISSOLVE:"dissolve",WIPE:"wipe",WIPE_LEFT:"wipeLeft",WIPE_RIGHT:"wipeRight",WIPE_UP:"wipeUp",WIPE_DOWN:"wipeDown",DIRECTIONAL:"directional",DIRECTIONAL_EASING:"directional-easing",DIRECTIONAL_SCALED:"directionalScaled",DIRECTIONAL_WARP:"directionalwarp",DIRECTIONAL_WIPE:"directionalwipe",LEFT_RIGHT:"leftRight",TOP_BOTTOM:"topBottom",CROSS_ZOOM:"crossZoom",SIMPLE_ZOOM:"simpleZoom",SIMPLE_ZOOM_OUT:"simpleZoomOut",ZOOM_IN_CIRCLES:"zoomInCircles",ZOOM_LEFT_WIPE:"zoomLeftWipe",ZOOM_RIGHT_WIPE:"zoomRigthWipe",SCALE_IN:"scale-in",CIRCLE:"circle",CIRCLE_OPEN:"circleopen",CIRCLE_CROP:"circleCrop",RECTANGLE:"rectangle",RECTANGLE_CROP:"rectangleCrop",HEART:"heart",HEXAGONALIZE:"hexagonalize",POLKA_DOTS_CURTAIN:"polkaDotsCurtain",RANDOM_SQUARES:"randomsquares",SQUARES_WIRE:"squareswire",ANGULAR:"angular",CUBE:"cube",ROTATE_SCALE_FADE:"rotate_scale_fade",ROTATE_SCALE_VANISH:"rotateScaleVanish",ROTATE_TRANSITION:"rotateTransition",BOOK_FLIP:"bookFlip",PAGE_CURL:"pageCurl",INVERTED_PAGE_CURL:"invertedPageCurl",BOW_TIE_HORIZONTAL:"bowTieHorizontal",BOW_TIE_VERTICAL:"bowTieVertical",BOW_TIE_WITH_PARAMETER:"bowTieWithParameter",HORIZONTAL_OPEN:"horizontalOpen",HORIZONTAL_CLOSE:"horizontalClose",VERTICAL_OPEN:"verticalOpen",VERTICAL_CLOSE:"verticalClose",LINEAR_BLUR:"linearBlur",DREAMY:"dreamy",DREAMY_ZOOM:"dreamyZoom",SWIRL:"swirl",RIPPLE:"ripple",WIND:"wind",WATER_DROP:"waterDrop",DISPLACEMENT:"displacement",SQUEEZE:"squeeze",GLITCH_DISPLACE:"glitchDisplace",GLITCH_MEMORIES:"glitchMemories",TV_STATIC:"tvStatic",STATIC_FADE:"staticFade",STATIC_WIPE:"static_wipe",PARAMETRIC_GLITCH:"parametric_glitch",BURN:"burn",FILM_BURN:"filmBurn",UNDULATING_BURN_OUT:"undulatingBurnOut",DOOM_SCREEN_TRANSITION:"doomScreenTransition",OVEREXPOSURE:"overexposure",FADE_COLOR:"fadecolor",FADE_GRAYSCALE:"fadegrayscale",COLOR_PHASE:"colorphase",COLOUR_DISTANCE:"colourDistance",MULTIPLY_BLEND:"multiply_blend",GRID_FLIP:"gridFlip",MOSAIC:"mosaic",MOSAIC_TRANSITION:"mosaic_transition",PIXELIZE:"pixelize",CROSSHATCH:"crosshatch",WINDOW_BLINDS:"windowblinds",WINDOW_SLICE:"windowslice",MORPH:"morph",SWAP:"swap",CROSSWARP:"crosswarp",POLAR_FUNCTION:"polar_function",COORD_FROM_IN:"coord-from-in",KALEIDOSCOPE:"kaleidoscope",POWER_KALEIDO:"powerKaleido",PINWHEEL:"pinwheel",FLYEYE:"flyeye",STEREO_VIEWER:"stereoViewer",PERLIN:"perlin",RANDOM_NOISEX:"randomNoisex",TANGENT_MOTION_BLUR:"tangentMotionBlur",LUMA:"luma",LUMINANCE_MELT:"luminance_melt",BOUNCE:"bounce",BUTTERFLY_WAVE_SCRAWLER:"butterflyWaveScrawler",CRAZY_PARAMETRIC_FUN:"crazyParametricFun",CANNABIS_LEAF:"cannabisleaf",RADIAL:"radial",ROLLS:"rolls",SLIDES:"slides",DOORWAY:"doorway",EDGE_TRANSITION:"edgeTransition",X_AXIS_TRANSLATION:"x_axis_translation",SIMPLE_FLIP:"simpleFlip",HSV_FADE:"hsvfade",FOLD:"fold",BLOCK_DISSOLVE:"blockDissolve",ADVANCED_MOSAIC:"advancedMosaic",DEFOCUS_BLUR:"defocusBlur",PUZZLE_RIGHT:"puzzleRight",TILES_WAVE:"tilesWave",STAR_WIPE:"starWipe",CHESSBOARD:"chessboard",BURN_EFFECT:"burn0",FRAGMENT:"fragment",ZOOM_IN_OUT:"zoomInOut"},EM={fade:"fade",dissolve:"fade",wipe:"wipeLeft",wipeLeft:"wipeLeft",wipeRight:"wipeRight",wipeUp:"wipeUp",wipeDown:"wipeDown",directional:"Directional","directional-easing":"Directional",directionalScaled:"Directional",directionalwarp:"directionalwarp",directionalwipe:"directionalwipe",leftRight:"Directional",topBottom:"Directional",crossZoom:"CrossZoom",simpleZoom:"SimpleZoom",simpleZoomOut:"SimpleZoomOut",zoomInCircles:"ZoomInCircles",zoomLeftWipe:"ZoomLeftWipe",zoomRigthWipe:"ZoomRigthWipe",zoomInOut:"zoomInOut","scale-in":"scale-in",simpleFlip:"SimpleFlip",hsvfade:"HSVfade",fold:"Fold",blockDissolve:"BlockDissolve",advancedMosaic:"AdvancedMosaic",defocusBlur:"DefocusBlur",puzzleRight:"PuzzleRight",tilesWave:"TilesWave",starWipe:"StarWipe",chessboard:"chessboard",burn0:"burn0",fragment:"fragment",circle:"circle",circleopen:"circleopen",circleCrop:"CircleCrop",heart:"heart",hexagonalize:"hexagonalize",randomsquares:"randomsquares",squareswire:"squareswire",bowTieHorizontal:"BowTieHorizontal",bowTieVertical:"BowTieVertical",bowTieWithParameter:"BowTieVertical",BowTieHorizontal:"BowTieHorizontal",BowTieVertical:"BowTieVertical",linearBlur:"LinearBlur",dreamy:"dreamy",swirl:"Swirl",mosaic:"Mosaic",Mosaic:"Mosaic",windowslice:"windowslice",WindowSlice:"windowslice",windowblinds:"windowblinds",WindowBlinds:"windowblinds",stereoviewer:"StereoViewer",StereoViewer:"StereoViewer",doorway:"doorway",Doorway:"doorway"},wb=new Set,Ab=t=>t.toLowerCase().replace(/[^a-z0-9]/g,""),Po=t=>{if(!t)return null;const e=EM[t];if(e){const i=os.find(o=>o.name.toLowerCase()===e.toLowerCase());if(i)return i}const n=t.toLowerCase(),r=Ab(t);return os.find(i=>i.name.toLowerCase()===n||Ab(i.name)===r)??null},Ob=t=>Po(t)!==null,Cb=()=>os.map(t=>t.name),SM=Po,wM=Cb,AM=t=>{wb.has(t)||(wb.add(t),console.warn(`[reacthub-pixitweenjs] Unknown GL transition "${t}"; using crossfade fallback.`))},OM=`in vec2 aPosition;
|
|
1425
|
+
`,runIndex:o,charIndex:r++,advance:0,ascent:0,descent:0,isWhitespace:!0,isHardBreak:!0,baselineShift:c});continue}const d=e.measure(s,f),h=h_(f);n.push({char:f,runIndex:o,charIndex:r++,advance:d.advance+l,ascent:d.ascent,descent:d.descent,isWhitespace:h,isHardBreak:!1,baselineShift:c})}}return n}function FR(t,e,n){let r=0;for(let i=e;i<n;i++)r+=t[i].advance;return r}function BR(t,e,n){let r=0;for(let i=n-1;i>=e&&(t[i].isWhitespace&&!t[i].isHardBreak);i--)r++;return r}function Bu(t,e,n,r){const i=BR(t,e,n),o=n-i,s=FR(t,e,o);return{start:e,end:n,width:s,collapsedTrailing:i,endsWithHardBreak:r}}function UR({glyphs:t,maxWidth:e}){const n=[];if(t.length===0)return n;let r=0,i=0,o=0;for(;i<t.length;){const s=t[i];if(s.isHardBreak){n.push(Bu(t,r,i+1,!0)),r=i+1,o=0,i++;continue}if(e===void 0){o+=s.advance,i++;continue}if(s.isWhitespace){o+=s.advance,i++;continue}const a=i;let l=i,c=0;for(;l<t.length&&!t[l].isWhitespace&&!t[l].isHardBreak;)c+=t[l].advance,l++;a>r&&t.slice(r,a).some(f=>!f.isWhitespace)&&o+c>e&&(n.push(Bu(t,r,a,!1)),r=a,o=0);for(let f=a;f<l;f++)o+=t[f].advance;i=l}return r<t.length&&n.push(Bu(t,r,t.length,!1)),n}function GR(t,e,n){let r=0,i=0;for(let o=e;o<n;o++)t[o].ascent>r&&(r=t[o].ascent),t[o].descent>i&&(i=t[o].descent);return{ascent:r,descent:i}}function jR(t,e){return(t+e)*1.2}function HR({glyphs:t,lines:e,leading:n}){const r=[];let i=0;for(let o=0;o<e.length;o++){const s=e[o],{ascent:a,descent:l}=GR(t,s.start,s.end),c=n??jR(a,l);let u;o===0?(u=a,i=u+l):(u=i+(n!=null?n-l:a),n==null?i+=c:i=u+l),r.push({baselineY:u,ascent:a,descent:l})}return r}function YR(t,e){const n=e.end-e.collapsedTrailing;let r=0;for(let i=e.start;i<n;i++)t[i].isWhitespace&&!t[i].isHardBreak&&r++;return r}function p_(t,e,n,r){let i=n;for(let o=e.start;o<e.end;o++)r[o]={x:i,extraAdvance:0},i+=t[o].advance}function m_(t,e,n,r,i){const o=n-e.width,s=YR(t,e);if(o<=0||s===0)return Uu(t,e,r,n,i);const a=o/s;let l=0;for(let c=e.start;c<e.end;c++){i[c]={x:l,extraAdvance:0};const u=t[c];let f=u.advance;u.isWhitespace&&!u.isHardBreak&&c<e.end-e.collapsedTrailing&&(i[c].extraAdvance=a,f+=a),l+=f}}function Uu(t,e,n,r,i){const o=e.width;let s=0;r!=null&&(n==="center"||n==="justify-last-center"?s=(r-o)/2:(n==="right"||n==="justify-last-right")&&(s=r-o)),p_(t,e,s,i)}const g_={left:"left",center:"center",right:"right","justify-full":"left","justify-last-left":"left","justify-last-center":"center","justify-last-right":"right"};function XR({glyphs:t,lines:e,align:n,boxWidth:r}){const i=new Array(t.length);for(let o=0;o<e.length;o++){const s=e[o],l=o===e.length-1||s.endsWithHardBreak,c=n==="justify-full",u=n.startsWith("justify");if(r==null){p_(t,s,0,i);continue}if(!u){Uu(t,s,n,r,i);continue}if(c){m_(t,s,r,"left",i);continue}if(l){Uu(t,s,g_[n],r,i);continue}m_(t,s,r,g_[n],i)}return i}const WR=4096;function y_(t,e){return[t.font,t.weight??"",t.italic?1:0,t.size,e].join("|")}class __{map=new Map;get(e){return this.map.get(e)}set(e,n){if(this.map.size>=WR){const r=this.map.keys().next().value;r!==void 0&&this.map.delete(r)}this.map.set(e,n)}clear(){this.map.clear()}get size(){return this.map.size}}function zR(t){const e=[];return t.italic&&e.push("italic"),t.weight!=null&&e.push(String(t.weight)),e.push(`${t.size}px`),e.push(t.font.includes(" ")?`"${t.font}"`:t.font),e.join(" ")}let mr;function qR(){if(mr!==void 0)return mr;if(typeof document>"u")return mr=null,null;try{mr=document.createElement("canvas").getContext("2d")}catch{mr=null}return mr}function b_(t={}){const e=t.cache??new __;return{measure(n,r){const i=y_(n,r),o=e.get(i);if(o!==void 0)return o;const s=qR();let a=n.size*.5,l=n.size*.75,c=n.size*.25;if(s){s.font=zR(n);const f=s.measureText(r);a=f.width,typeof f.actualBoundingBoxAscent=="number"&&f.actualBoundingBoxAscent>0&&(l=f.actualBoundingBoxAscent),typeof f.actualBoundingBoxDescent=="number"&&f.actualBoundingBoxDescent>0&&(c=f.actualBoundingBoxDescent)}const u={advance:a,ascent:l,descent:c};return e.set(i,u),u}}}let go=null;function VR(){return go||(go=b_()),go}function KR(){go=null}function ZR(t,e){const n=new Array(t.length);let r=0,i=!1;for(const o of e){for(let s=o.start;s<o.end;s++)t[s].isWhitespace?(n[s]=r,i&&(i=!1,r++)):(i=!0,n[s]=r);i&&(i=!1,r++)}return n}function x_(t){const e=t.metrics??VR(),n=t.align??"left",r=t.box?.width,i=DR({input:t,metrics:e}),o=UR({glyphs:i,maxWidth:r}),s=HR({glyphs:i,lines:o,leading:t.leading}),a=XR({glyphs:i,lines:o,align:n,boxWidth:r}),l=ZR(i,o),c=[];let u=0;for(let m=0;m<o.length;m++){const g=o[m],y=s[m];for(let b=g.start;b<g.end;b++){const x=i[b];if(x.isHardBreak)continue;const v=a[b],T=c.length===0||c[c.length-1].lineIndex!==m;c.push({char:x.char,runIndex:x.runIndex,charIndex:x.charIndex,wordIndex:l[b],lineIndex:m,x:v.x,y:y.baselineY-x.baselineShift,advance:x.advance+v.extraAdvance,ascent:x.ascent,descent:x.descent,isWhitespace:x.isWhitespace,isLineStart:T,isLineEnd:!1})}c.length>0&&c[c.length-1].lineIndex===m&&(c[c.length-1].isLineEnd=!0)}const f=[];for(let m=0;m<o.length;m++){const g=s[m];let y=-1,b=-1;for(let w=0;w<c.length;w++)c[w].lineIndex===m&&(y===-1&&(y=w),b=w+1);if(y===-1){f.push({startGlyph:c.length,endGlyph:c.length,width:0,baselineY:g.baselineY,isLast:m===o.length-1});continue}const x=c[y],v=c[b-1],T=v.x+v.advance-x.x;T>u&&(u=T),f.push({startGlyph:y,endGlyph:b,width:T,baselineY:g.baselineY,isLast:m===o.length-1})}const d=f[f.length-1],h=s[s.length-1],p=d?d.baselineY+(h?.descent??0):0;return{glyphs:c,lines:f,bounds:{width:u,height:p}}}function $R(t){const{resolution:e,glyphs:n}=t,r=t.ascender??t.boundingBox?.yMax??e*.8,i=t.descender??t.boundingBox?.yMin??-e*.2;return{measure(o,s){const a=o.size,l=n[s],c=l?l.ha/e*a:a*.5,u=r/e*a,f=-i/e*a;return{advance:c,ascent:u,descent:f}}}}function oi(){const[t,e]=S.useReducer(n=>n+1,0);return Ze(ke.FONTS_LOADED,()=>{W.CanvasTextMetrics.clearMetrics(),KR(),e()},[]),t}const v_=t=>t.dropShadow?typeof t.dropShadow=="object"?{dropShadow:t.dropShadow}:{dropShadow:{color:t.dropShadowColor??"#000000",alpha:t.dropShadowAlpha??1,angle:t.dropShadowAngle??Math.PI/4,blur:t.dropShadowBlur??0,distance:t.dropShadowDistance??5}}:{},T_=t=>{if(t.stroke&&typeof t.stroke=="object")return{stroke:t.stroke};const e=t.strokeThickness??0;return t.stroke==null||e<=0?{}:{stroke:{color:t.stroke,width:e}}},E_=(t,e,n)=>{if(!t||t.length<2)return;const r=(n??0)===0,i=t.length;return new W.FillGradient({type:"linear",start:{x:0,y:0},end:{x:r?0:1,y:r?1:0},textureSpace:"local",colorStops:t.map((o,s)=>({offset:e?.[s]??s/Math.max(i-1,1),color:o}))})},JR=new Set(["normal","bold","bolder","lighter"]),Gu=t=>{if(t==null||t==="")return;const e=String(t).trim().toLowerCase();if(JR.has(e))return e;const n=Number(e);if(Number.isFinite(n)&&n>=100&&n<=900&&n%100===0)return String(n)},S_=t=>{const e=typeof t=="string"?Number(t):t;return typeof e=="number"&&Number.isFinite(e)&&e!==0?e:void 0},QR=5e7,ju=(t,e)=>t==null||t===""?e:t;function Hu(t){const{fontFamily:e="Arial",fontSize:n=16,fontWeight:r,fontStyle:i,fontVariant:o,fill:s="white",gradientColors:a,gradientStops:l,gradientType:c,stroke:u,strokeWidth:f,strokeThickness:d,dropShadow:h,dropShadowColor:p,dropShadowBlur:m=0,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b,blurEnabled:x=!1,blurRadius:v=0,align:T,padding:w,letterSpacing:O,leading:C,wordWrapWidth:R,tagStyles:P}=t,A={fontFamily:e,fontSize:n,wordWrap:!0,breakWords:!0,wordWrapWidth:R&&R>0?R:QR,leading:C||0},L=E_(a,l,c);L?A.fill=L:s==="transparent"?A.fill={color:0,alpha:0}:A.fill=ju(s,"white");const N=Gu(r);N&&(A.fontWeight=N),(i==="italic"||i==="oblique")&&(A.fontStyle=i),(o==="small-caps"||o===!0)&&(A.fontVariant="small-caps"),Object.assign(A,T_({stroke:u,strokeThickness:f??d??0})),x?A.dropShadow={color:ju(p,"black"),alpha:g??1,angle:0,blur:Number(v),distance:0}:Object.assign(A,v_({dropShadow:h,dropShadowColor:ju(p,"black"),dropShadowBlur:Number(m),dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b}));const D=S_(O);return D!==void 0&&(A.letterSpacing=D),(T==="left"||T==="center"||T==="right"||T==="justify")&&(A.align=T),typeof w=="number"&&Number.isFinite(w)&&w>=0&&(A.padding=w),P&&(A.tagStyles=P),A}function eI(t,e,n,r,i,o){const s=r+2*o,a=i+2*o;return{width:s,height:a,x:t+o*(2*n.x-1),y:e+o*(2*n.y-1)}}const tI=t=>typeof t=="number"?{x:t,y:t}:{x:t?.x??.5,y:t?.y??.5},w_="pixitext-hitarea",nI=t=>`${w_}-${t}`,A_="pixitext-text",rI=({ref:t,...e})=>{const r=S.useRef(0),i=S.useRef(null),o=S.useRef(16),s=S.useRef(null),a=S.useRef(null),{app:l}=at.useApplication(),{visible:c,text:u,disabled:f,transformation:d,pointerdown:h,onDobuleClick:p,uniqueId:m,startAt:g,endAt:y,onTextRefReady:b}=e;I.useEffect(()=>{b&&b(m,i)},[b,m]);const{x,y:v,width:T,height:w,anchor:O=.5,backgroundColor:C="transparent",backgroundFit:R="box",backgroundPadding:P=0,backgroundRadius:A=0,colorCorrection:L,blendMode:N,neonColor:D}=d,F=oi(),G=lt({colorCorrection:L,effects:d.effects??{name:d.effect},neonColor:D,blendMode:N});I.useEffect(()=>{o.current=Number(d.fontSize??16)},[d.fontSize]);const z=I.useMemo(()=>{if(!C||C==="transparent")return null;try{return new W.Color(C).toNumber()}catch{return null}},[C]),K=JSON.stringify([d.tagStyles,d.gradientColors,d.gradientStops]),se=I.useMemo(()=>new W.TextStyle(Hu({...d,blurRadius:d.blurRadius})),[F,K,d.fontFamily,d.fontSize,d.fontWeight,d.fontStyle,d.fontVariant,d.fill,d.stroke,d.strokeWidth,d.strokeThickness,d.dropShadow,d.dropShadowColor,d.dropShadowBlur,d.dropShadowAlpha,d.dropShadowAngle,d.dropShadowDistance,d.blurEnabled,d.blurRadius,d.align,d.padding,d.letterSpacing,d.leading,d.wordWrapWidth]);I.useEffect(()=>{s.current={...d}},[d]),I.useImperativeHandle(t,()=>({setWordWrap:(ae,Z={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae;const ce=1/Z.x,J=1/Z.y;i.current.scale.set(ce,J)}},setFontSizeAndTransform:(ae,Z,ce={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae,i.current.style.fontSize=Z;const J=1/ce.x,ie=1/ce.y;i.current.scale.set(J,ie)}},resetScale:()=>{i.current&&i.current.scale.set(1,1)}}),[m,g,y]);const pe=I.useCallback((ae,Z={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae;const ce=1/Z.x,J=1/Z.y;i.current.scale.set(ce,J)}},[i.current]),X=I.useCallback((ae,Z,ce={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae,i.current.style.fontSize=Z;const J=1/ce.x,ie=1/ce.y;i.current.scale.set(J,ie)}},[i.current,s.current]),he=tI(O),j=I.useMemo(()=>{if(z===null)return null;if(R==="hug"){const ae=W.CanvasTextMetrics.measureText(u??"",se);return eI(x,v,he,ae.width,ae.height,P)}return{x,y:v,width:T||100,height:w||100}},[z,R,P,u,se,x,v,T,w,O]);I.useEffect(()=>{const ae=a.current;if(!ae||z===null||!j||!l?.renderer)return;const Z=new W.Graphics,ce=Math.max(1,Math.round(j.width)),J=Math.max(1,Math.round(j.height));A>0?Z.roundRect(0,0,ce,J,A):Z.rect(0,0,ce,J),Z.fill({color:z});let ie=null;try{ie=l.renderer.generateTexture(Z)}finally{Z.destroy()}return ae.texture=ie,()=>{a.current===ae&&(ae.texture=W.Texture.EMPTY);try{ie?.destroy(!0)}catch{}}},[l,z,j,A]);const te=()=>{const ae=new Date().getTime();ae-r.current<300&&p?p():h&&h(),r.current=ae},H=()=>{!f&&p&&p()};return M.jsxs($e,{...e,ref:t,isText:!0,onDoubleClick:H,handleDragWordWrap:pe,handleDragFontSize:X,children:[M.jsx("pixiSprite",{texture:W.Texture.EMPTY,x:j?.x??x,y:j?.y??v,width:j?.width??(T||100),height:j?.height??(w||100),anchor:O,alpha:c&&z!==null?1:0,ref:a}),M.jsx("pixiText",{label:A_,style:se,x,y:v,anchor:O,text:u,alpha:c?1:0,...c&&!f&&{eventMode:"static",cursor:"pointer",onPointerDown:te},ref:i,filters:G})]})},O_=I.memo(rI,et);E.registerPlugin(wn);const iI=t=>`aep-bez-${t[0]},${t[1]},${t[2]},${t[3]}`,C_=new Set;function Bn(t){if(!t)return"none";const e=iI(t);if(!C_.has(e)){const[n,r,i,o]=t;wn.create(e,`${n},${r},${i},${o}`),C_.add(e)}return e}const oI={position:t=>{const[e,n]=t;return{x:e,y:n}},scale:t=>{const[e,n]=t;return{scaleX:e,scaleY:n}},rotation:t=>({rotation:t}),opacity:t=>({alpha:t}),skew:t=>({skewX:t}),skewAxis:t=>({skewY:t})};function sI(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function R_(t,e,n,r){const i=oI[t];if(!i||!sI(e))return[];const o=e;if(o.length===0)return[];const s=l=>(l-r)/n,a=[];a.push({at:s(o[0].t),op:"set",vars:{pixi:i(o[0].v)},props:Object.keys(i(o[0].v))});for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){a.push({at:s(u.t),op:"set",vars:{pixi:i(u.v)},props:Object.keys(i(u.v))});continue}const h=Bn(c.easeOut);a.push({at:f,op:"to",vars:{pixi:i(u.v),duration:d,ease:h},props:Object.keys(i(u.v))})}return a}function I_(t,e,n){const r=E.timeline({paused:!0}),i=[],o=t.transform,s=["position","scale","rotation","opacity","skew","skewAxis"];for(const a of s){const l=o[a];if(l===void 0)continue;const c=R_(a,l,n,t.inPoint);for(const u of c)u.op==="to"?r.to(e,u.vars,u.at):r.set(e,u.vars,u.at),i.push(u)}return{timeline:r,segments:i}}const Yu=I.createContext(null),si=({value:t,children:e})=>M.jsx(Yu.Provider,{value:t,children:e});function _t(){const t=I.useContext(Yu);if(!t)throw new Error("useAepLayerContext must be used inside <AepLayerProvider>");return t}function Jt(){return I.useContext(Yu)}const M_=I.createContext(0),L_=({depth:t,children:e})=>M.jsx(M_.Provider,{value:t,children:e});function P_(){return I.useContext(M_)}const yo=8;function ai(t,e){if(!e)return t;const n={...t};for(const[r,i]of Object.entries(e)){const o=t[r];if("type"in i&&i.type){n[r]=i;continue}if(o){n[r]={...o,...i};continue}n[r]={type:"image",src:i.src}}return n}function aI(t,e,n,r=null){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(null);I.useEffect(()=>{const a=i?.current,l=e.current;if(!a||!l||!cI(t))return;const c=o?o.framesToSeconds(t.inPoint):t.inPoint/n,{timeline:u}=I_(t,l,n);s.current=u,a.add(u,c);const f=a.time();return a.time(f===0?1e-6:0,!0),a.time(f,!1),()=>{s.current&&(a.remove(s.current),s.current.kill(),s.current=null)}},[t,n,e,r])}function gr(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function cI(t){const e=t.transform;return gr(e.position)||gr(e.scale)||gr(e.rotation)||gr(e.opacity)||gr(e.skew)||gr(e.skewAxis)}function N_(t){const{tl:e}=I.useContext(Ye),[n,r]=I.useState(0);return I.useEffect(()=>{if(!e?.current)return;let o=0,s=-1;const a=()=>{if(e.current){const l=Math.round(e.current.time()*t);l!==s&&(s=l,r(l))}o=requestAnimationFrame(a)};return o=requestAnimationFrame(a),()=>cancelAnimationFrame(o)},[t,e]),n}var Ce;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(const s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var k_;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(k_||(k_={}));const oe=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_n=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return Number.isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},U=Ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Qt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof Qt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Qt.create=t=>new Qt(t);const Xu=(t,e)=>{let n;switch(t.code){case U.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ce.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ce.joinValues(t.keys,", ")}`;break;case U.invalid_union:n="Invalid input";break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ce.joinValues(t.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${Ce.joinValues(t.options)}, received '${t.received}'`;break;case U.invalid_arguments:n="Invalid function arguments";break;case U.invalid_return_type:n="Invalid function return type";break;case U.invalid_date:n="Invalid date";break;case U.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ce.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case U.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case U.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case U.custom:n="Invalid input";break;case U.invalid_intersection_types:n="Intersection results could not be merged";break;case U.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case U.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ce.assertNever(t)}return{message:n}};let lI=Xu;function uI(){return lI}const fI=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}};function Q(t,e){const n=uI(),r=fI({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xu?void 0:Xu].filter(i=>!!i)});t.common.issues.push(r)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return _e;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return ft.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return _e;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}}const _e=Object.freeze({status:"aborted"}),ci=t=>({status:"dirty",value:t}),bt=t=>({status:"valid",value:t}),D_=t=>t.status==="aborted",F_=t=>t.status==="dirty",yr=t=>t.status==="valid",_o=t=>typeof Promise<"u"&&t instanceof Promise;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(fe||(fe={}));class jt{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const B_=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Qt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}class Ae{get description(){return this._def.description}_getType(e){return _n(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(_o(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return B_(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return yr(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>yr(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(_o(i)?i:Promise.resolve(i));return B_(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=e(i),a=()=>o.addIssue({code:U.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new jn({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nn.create(this,this._def)}nullable(){return Hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ht.create(this)}promise(){return wo.create(this,this._def)}or(e){return xo.create([this,e],this._def)}and(e){return vo.create(this,e,this._def)}transform(e){return new jn({...Ee(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ao({...Ee(this._def),innerType:this,defaultValue:n,typeName:be.ZodDefault})}brand(){return new q_({typeName:be.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Oo({...Ee(this._def),innerType:this,catchValue:n,typeName:be.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Qu.create(this,e)}readonly(){return Co.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dI=/^c[^\s-]{8,}$/i,hI=/^[0-9a-z]+$/,pI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gI=/^[a-z0-9_-]{21}$/i,yI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_I=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wu;const vI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,EI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",OI=new RegExp(`^${U_}$`);function G_(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function CI(t){return new RegExp(`^${G_(t)}$`)}function RI(t){let e=`${U_}T${G_(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function II(t,e){return!!((e==="v4"||!e)&&vI.test(t)||(e==="v6"||!e)&&EI.test(t))}function MI(t,e){if(!yI.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function LI(t,e){return!!((e==="v4"||!e)&&TI.test(t)||(e==="v6"||!e)&&SI.test(t))}class en extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.string,received:o.parsedType}),_e}const r=new ft;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?Q(i,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Q(i,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")bI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"email",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Wu||(Wu=new RegExp(xI,"u")),Wu.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"emoji",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")mI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"uuid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")gI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"nanoid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")dI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cuid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")hI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cuid2",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")pI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"ulid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Q(i,{validation:"url",code:U.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"regex",code:U.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?RI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?OI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?CI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?_I.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"duration",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?II(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"ip",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?MI(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"jwt",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?LI(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cidr",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?wI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"base64",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?AI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"base64url",code:U.invalid_string,message:o.message}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:U.invalid_string,...fe.errToObj(r)})}_addCheck(e){return new en({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...fe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...fe.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...fe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...fe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...fe.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new en({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}en.create=t=>new en({checks:[],typeName:be.ZodString,coerce:t?.coerce??!1,...Ee(t)});function PI(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}class _r extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.number,received:o.parsedType}),_e}let r;const i=new ft;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Q(r,{code:U.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?PI(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_finite,message:o.message}),i.dirty()):Ce.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,r,i){return new _r({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:fe.toString(i)}]})}_addCheck(e){return new _r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ce.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}_r.create=t=>new _r({checks:[],typeName:be.ZodNumber,coerce:t?.coerce||!1,...Ee(t)});class li extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==oe.bigint)return this._getInvalidInput(e);let r;const i=new ft;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ce.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Q(n,{code:U.invalid_type,expected:oe.bigint,received:n.parsedType}),_e}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,r,i){return new li({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:fe.toString(i)}]})}_addCheck(e){return new li({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}li.create=t=>new li({checks:[],typeName:be.ZodBigInt,coerce:t?.coerce??!1,...Ee(t)});class zu extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.boolean,received:r.parsedType}),_e}return bt(e.data)}}zu.create=t=>new zu({typeName:be.ZodBoolean,coerce:t?.coerce||!1,...Ee(t)});class bo extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.date,received:o.parsedType}),_e}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_date}),_e}const r=new ft;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bo({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}bo.create=t=>new bo({checks:[],coerce:t?.coerce||!1,typeName:be.ZodDate,...Ee(t)});class j_ extends Ae{_parse(e){if(this._getType(e)!==oe.symbol){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.symbol,received:r.parsedType}),_e}return bt(e.data)}}j_.create=t=>new j_({typeName:be.ZodSymbol,...Ee(t)});class qu extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.undefined,received:r.parsedType}),_e}return bt(e.data)}}qu.create=t=>new qu({typeName:be.ZodUndefined,...Ee(t)});class Vu extends Ae{_parse(e){if(this._getType(e)!==oe.null){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.null,received:r.parsedType}),_e}return bt(e.data)}}Vu.create=t=>new Vu({typeName:be.ZodNull,...Ee(t)});class H_ extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return bt(e.data)}}H_.create=t=>new H_({typeName:be.ZodAny,...Ee(t)});class Ku extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return bt(e.data)}}Ku.create=t=>new Ku({typeName:be.ZodUnknown,...Ee(t)});class bn extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return Q(n,{code:U.invalid_type,expected:oe.never,received:n.parsedType}),_e}}bn.create=t=>new bn({typeName:be.ZodNever,...Ee(t)});class Y_ extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.void,received:r.parsedType}),_e}return bt(e.data)}}Y_.create=t=>new Y_({typeName:be.ZodVoid,...Ee(t)});class Ht extends Ae{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==oe.array)return Q(n,{code:U.invalid_type,expected:oe.array,received:n.parsedType}),_e;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Q(n,{code:s?U.too_big:U.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Q(n,{code:U.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Q(n,{code:U.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new jt(n,s,n.path,a)))).then(s=>ft.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new jt(n,s,n.path,a)));return ft.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Ht({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new Ht({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new Ht({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}Ht.create=(t,e)=>new Ht({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Ee(e)});function br(t){if(t instanceof tt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=nn.create(br(r))}return new tt({...t._def,shape:()=>e})}else return t instanceof Ht?new Ht({...t._def,type:br(t.element)}):t instanceof nn?nn.create(br(t.unwrap())):t instanceof Hn?Hn.create(br(t.unwrap())):t instanceof Un?Un.create(t.items.map(e=>br(e))):t}class tt extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ce.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==oe.object){const c=this._getOrReturnCtx(e);return Q(c,{code:U.invalid_type,expected:oe.object,received:c.parsedType}),_e}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof bn&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new jt(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof bn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Q(i,{code:U.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new jt(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,d=await u.value;c.push({key:f,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>ft.mergeObjectSync(r,c)):ft.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new tt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:fe.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(e){return new tt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new tt({...this._def,catchall:e})}pick(e){const n={};for(const r of Ce.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new tt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ce.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new tt({...this._def,shape:()=>n})}deepPartial(){return br(this)}partial(e){const n={};for(const r of Ce.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new tt({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ce.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof nn;)o=o._def.innerType;n[r]=o}return new tt({...this._def,shape:()=>n})}keyof(){return W_(Ce.objectKeys(this.shape))}}tt.create=(t,e)=>new tt({shape:()=>t,unknownKeys:"strip",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)}),tt.strictCreate=(t,e)=>new tt({shape:()=>t,unknownKeys:"strict",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)}),tt.lazycreate=(t,e)=>new tt({shape:t,unknownKeys:"strip",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)});class xo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Qt(a.ctx.common.issues));return Q(n,{code:U.invalid_union,unionErrors:s}),_e}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new Qt(l));return Q(n,{code:U.invalid_union,unionErrors:a}),_e}}get options(){return this._def.options}}xo.create=(t,e)=>new xo({options:t,typeName:be.ZodUnion,...Ee(e)});const tn=t=>t instanceof Eo?tn(t.schema):t instanceof jn?tn(t.innerType()):t instanceof So?[t.value]:t instanceof Gn?t.options:t instanceof Ju?Ce.objectValues(t.enum):t instanceof Ao?tn(t._def.innerType):t instanceof qu?[void 0]:t instanceof Vu?[null]:t instanceof nn?[void 0,...tn(t.unwrap())]:t instanceof Hn?[null,...tn(t.unwrap())]:t instanceof q_||t instanceof Co?tn(t.unwrap()):t instanceof Oo?tn(t._def.innerType):[];class Zu extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return Q(n,{code:U.invalid_type,expected:oe.object,received:n.parsedType}),_e;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Q(n,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const s=tn(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Zu({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ee(r)})}}function $u(t,e){const n=_n(t),r=_n(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&r===oe.object){const i=Ce.objectKeys(e),o=Ce.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of o){const l=$u(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===oe.array&&r===oe.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const s=t[o],a=e[o],l=$u(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class vo extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(D_(o)||D_(s))return _e;const a=$u(o.value,s.value);return a.valid?((F_(o)||F_(s))&&n.dirty(),{status:n.value,value:a.data}):(Q(r,{code:U.invalid_intersection_types}),_e)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vo.create=(t,e,n)=>new vo({left:t,right:e,typeName:be.ZodIntersection,...Ee(n)});class Un extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.array)return Q(r,{code:U.invalid_type,expected:oe.array,received:r.parsedType}),_e;if(r.data.length<this._def.items.length)return Q(r,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&r.data.length>this._def.items.length&&(Q(r,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new jt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ft.mergeArray(n,s)):ft.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Un({...this._def,rest:e})}}Un.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Un({items:t,typeName:be.ZodTuple,rest:null,...Ee(e)})};class To extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return Q(r,{code:U.invalid_type,expected:oe.object,received:r.parsedType}),_e;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new jt(r,a,r.path,a)),value:s._parse(new jt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ft.mergeObjectAsync(n,i):ft.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ae?new To({keyType:e,valueType:n,typeName:be.ZodRecord,...Ee(r)}):new To({keyType:en.create(),valueType:e,typeName:be.ZodRecord,...Ee(n)})}}class X_ extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.map)return Q(r,{code:U.invalid_type,expected:oe.map,received:r.parsedType}),_e;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new jt(r,a,r.path,[c,"key"])),value:o._parse(new jt(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}X_.create=(t,e,n)=>new X_({valueType:e,keyType:t,typeName:be.ZodMap,...Ee(n)});class ui extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.set)return Q(r,{code:U.invalid_type,expected:oe.set,received:r.parsedType}),_e;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Q(r,{code:U.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Q(r,{code:U.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return _e;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new jt(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new ui({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new ui({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ui.create=(t,e)=>new ui({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...Ee(e)});class Eo extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Eo.create=(t,e)=>new Eo({getter:t,typeName:be.ZodLazy,...Ee(e)});class So extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Q(n,{received:n.data,code:U.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}So.create=(t,e)=>new So({value:t,typeName:be.ZodLiteral,...Ee(e)});function W_(t,e){return new Gn({values:t,typeName:be.ZodEnum,...Ee(e)})}class Gn extends Ae{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Q(n,{expected:Ce.joinValues(r),received:n.parsedType,code:U.invalid_type}),_e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Q(n,{received:n.data,code:U.invalid_enum_value,options:r}),_e}return bt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Gn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Gn.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Gn.create=W_;class Ju extends Ae{_parse(e){const n=Ce.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Ce.objectValues(n);return Q(r,{expected:Ce.joinValues(i),received:r.parsedType,code:U.invalid_type}),_e}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Ce.objectValues(n);return Q(r,{received:r.data,code:U.invalid_enum_value,options:i}),_e}return bt(e.data)}get enum(){return this._def.values}}Ju.create=(t,e)=>new Ju({values:t,typeName:be.ZodNativeEnum,...Ee(e)});class wo extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return Q(n,{code:U.invalid_type,expected:oe.promise,received:n.parsedType}),_e;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return bt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wo.create=(t,e)=>new wo({type:t,typeName:be.ZodPromise,...Ee(e)});class jn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{Q(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return _e;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?_e:l.status==="dirty"||n.value==="dirty"?ci(l.value):l});{if(n.value==="aborted")return _e;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?_e:a.status==="dirty"||n.value==="dirty"?ci(a.value):a}}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!yr(s))return _e;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>yr(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):_e);Ce.assertNever(i)}}jn.create=(t,e,n)=>new jn({schema:t,typeName:be.ZodEffects,effect:e,...Ee(n)}),jn.createWithPreprocess=(t,e,n)=>new jn({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...Ee(n)});class nn extends Ae{_parse(e){return this._getType(e)===oe.undefined?bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nn.create=(t,e)=>new nn({innerType:t,typeName:be.ZodOptional,...Ee(e)});class Hn extends Ae{_parse(e){return this._getType(e)===oe.null?bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Hn.create=(t,e)=>new Hn({innerType:t,typeName:be.ZodNullable,...Ee(e)});class Ao extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ao.create=(t,e)=>new Ao({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Oo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return _o(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oo.create=(t,e)=>new Oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class z_ extends Ae{_parse(e){if(this._getType(e)!==oe.nan){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.nan,received:r.parsedType}),_e}return{status:"valid",value:e.data}}}z_.create=t=>new z_({typeName:be.ZodNaN,...Ee(t)});class q_ extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Qu extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?_e:o.status==="dirty"?(n.dirty(),ci(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_e:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Qu({in:e,out:n,typeName:be.ZodPipeline})}}class Co extends Ae{_parse(e){const n=this._def.innerType._parse(e),r=i=>(yr(i)&&(i.value=Object.freeze(i.value)),i);return _o(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Co.create=(t,e)=>new Co({innerType:t,typeName:be.ZodReadonly,...Ee(e)});var be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));const le=en.create,k=_r.create,Je=zu.create,NI=Ku.create;bn.create;const Qe=Ht.create,de=tt.create,pt=xo.create,ef=Zu.create;vo.create;const We=Un.create,rn=To.create,V_=Eo.create,nt=So.create,rt=Gn.create;wo.create,nn.create,Hn.create;const K_=rt(["image","video","audio","lottie","gif","svg","font","composition","model"]),Z_=de({type:K_,src:le(),width:k().optional(),height:k().optional(),duration:k().optional()}).strict(),$_=rn(le(),Z_),tf=We([k(),k(),k(),k()]).describe("cubic-bezier(x1,y1,x2,y2)"),nf=t=>de({t:k().finite(),v:t,easeIn:tf.optional(),easeOut:tf.optional(),hold:Je().optional()}).strict(),q=t=>pt([t,Qe(nf(t)).min(1)]),rf=We([k(),k()]),Ro=de({position:q(rf),anchor:q(rf),scale:q(rf),rotation:q(k()),opacity:q(k().min(0).max(1)),skew:q(k()).optional(),skewAxis:q(k()).optional()}).strict(),J_=rt(["drop-shadow","gaussian-blur","directional-blur","glow","levels","curves","hue-saturation","tint","fill","tritone","fast-box-blur","color-balance","brightness-contrast"]),Q_=de({name:J_,enabled:Je().optional(),params:rn(le(),pt([le(),Je(),q(k()),q(le()),q(We([k(),k()])),q(We([k(),k(),k(),k()]))]))}).strict(),eb=rt(["cameraLensBlur","bloom","chromaticAberration","vignette","noise"]),of=de({name:eb,enabled:Je().optional(),params:rn(le(),pt([le(),Je(),q(k()),q(le()),q(We([k(),k()]))]))}).strict(),sf=We([k(),k()]),fi=de({vertices:Qe(sf),inTangents:Qe(sf),outTangents:Qe(sf),closed:Je()}).strict(),tb=rt(["add","subtract","intersect","lighten","darken","difference","alpha"]),nb=de({id:le().min(1),mode:tb,inverted:Je().optional(),opacity:q(k().min(0).max(1)).optional(),expansion:q(k()).optional(),path:pt([fi,Qe(nf(fi)).min(1)])}).strict(),af=We([k(),k(),k()]),kI=We([k(),k()]),Io=de({position:q(af),anchor:q(af),scale:q(kI),rotation:q(af),opacity:q(k().min(0).max(1))}).strict(),rb=de({kind:nt("camera"),id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),hidden:Je().optional(),transform:Ro,transform3D:Io,fov:q(k().positive()),focusDistance:q(k().positive()).optional(),aperture:q(k().min(0)).optional(),blurLevel:q(k().min(0)).optional(),zoom:q(k().positive()).optional(),disableCameraDoF:Je().optional()}).strict(),DI=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),ib=de({kind:nt("light"),id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),hidden:Je().optional(),transform:Ro,transform3D:Io,lightType:rt(["ambient","point","spot","parallel"]),intensity:q(k().min(0)),color:q(DI),falloff:q(k().min(0)).optional(),coneAngle:q(k().min(0).max(180)).optional(),coneFeather:q(k().min(0).max(100)).optional(),castsShadows:Je().optional()}).strict(),ob=rt(["square","ramp-up","ramp-down","triangle","round","smooth"]),sb=rt(["chars","words","lines"]),ab=de({start:q(k()),end:q(k()),offset:q(k()).optional(),basedOn:sb.optional(),shape:ob.optional(),smoothness:q(k()).optional(),easeHigh:q(k()).optional(),easeLow:q(k()).optional()}).strict(),cb=de({range:ab,amount:q(k()).optional(),positionOffset:q(We([k(),k()])).optional(),scaleOffset:q(We([k(),k()])).optional(),rotationOffset:q(k()).optional(),opacityOffset:q(k()).optional(),fillOffset:le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional()}).strict(),FI=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),lb=de({from:k().int().min(0),to:k().int().min(1),font:le().optional(),size:q(k().min(0)).optional(),fill:q(FI).optional(),weight:pt([k(),le()]).optional(),italic:Je().optional(),tracking:q(k()).optional(),baselineShift:q(k()).optional()}).strict().refine(t=>t.to>t.from,{message:"to must exceed from",path:["to"]}),ub=["left","center","right","justify-full","justify-last-left","justify-last-center","justify-last-right"],fb=rt(ub);function cf(t){if(t==null||typeof t!="object")return t;const e=t,n=e.layers;if(!Array.isArray(n))return t;const r={...e,layers:[...n]};for(let i=0;i<n.length;i++){const o=n[i];if(!o||typeof o!="object"||o.kind!=="text")continue;const s=o.style;if(s&&s.align==="justify"){const a={...s,align:"justify-last-left"};r.layers[i]={...o,style:a}}}return r}class db extends Error{constructor(e){super(`text runs overlap: ${e.map(([n,r,i,o])=>`[${n},${r}) ∩ [${i},${o})`).join(", ")}`),this.ranges=e,this.name="TextRunsOverlapError"}ranges}function hb(t,e){const n=[];if(e<=0)return{runs:[],warnings:n};const r=[...t].sort((l,c)=>l.from-c.from),i=[];for(let l=1;l<r.length;l++){const c=r[l-1],u=r[l];u.from<c.to&&i.push([c.from,c.to,u.from,u.to])}if(i.length>0)throw new db(i);const o=[];for(const l of r)l.from>=e||l.to<=0||(l.to>e?(n.push(`run [${l.from},${l.to}) clipped to source length ${e}`),o.push({...l,to:e})):o.push(l));const s=[];let a=0;for(const l of o)l.from>a&&s.push({from:a,to:l.from}),s.push(l),a=l.to;return a<e&&s.push({from:a,to:e}),{runs:s,warnings:n}}const lf=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),pb=de({themeKey:le().min(1),default:lf}).strict(),mb=pt([lf,pb]),uf=q(mb),gb=rn(le(),lf);function ff(t,e){return typeof t=="string"?t:e?.[t.themeKey]??t.default}function Yn(t,e){if(t!==void 0)return typeof t=="string"?t:Array.isArray(t)?t.map(n=>({t:n.t,v:ff(n.v,e),easeIn:n.easeIn,easeOut:n.easeOut,hold:n.hold})):ff(t,e)}const BI=pt([k(),Je(),Qe(k())]),yb=de({id:le().min(1),kind:rt(["element","scene"]),name:le().min(1),from:pt([le().min(1),Qe(le().min(1)).min(1)]),to:pt([le().min(1),Qe(le().min(1)).min(1)]),startFrame:k().finite().min(0),durationFrames:k().finite().positive(),ease:pt([We([k(),k(),k(),k()]),le()]).optional(),params:rn(le(),BI).optional(),region:de({x:k().finite(),y:k().finite(),width:k().positive(),height:k().positive()}).strict().optional(),includeShared:Je().optional()}).strict().superRefine((t,e)=>{t.kind==="element"&&(Array.isArray(t.from)||Array.isArray(t.to))&&e.addIssue({code:U.custom,message:"element transitions require one from and one to layer id",path:[Array.isArray(t.from)?"from":"to"]})}),df=t=>Array.isArray(t)?t:[t],di=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),UI=rt(["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","add"]),GI=de({kind:nt("rect"),size:q(We([k(),k()])),position:q(We([k(),k()])).optional(),roundness:q(k()).optional()}).strict(),jI=de({kind:nt("ellipse"),size:q(We([k(),k()])),position:q(We([k(),k()])).optional()}).strict(),HI=de({kind:nt("polystar"),starType:rt(["star","polygon"]),points:q(k()),innerRadius:q(k()).optional(),outerRadius:q(k()),innerRoundness:q(k()).optional(),outerRoundness:q(k()).optional(),rotation:q(k()).optional(),position:q(We([k(),k()])).optional()}).strict(),YI=de({kind:nt("bezier"),path:pt([fi,Qe(de({t:k(),v:fi,easeIn:We([k(),k(),k(),k()]).optional(),easeOut:We([k(),k(),k(),k()]).optional(),hold:Je().optional()}).strict()).min(1)])}).strict(),_b=ef("kind",[GI,jI,HI,YI]),bb=de({color:q(di),width:q(k().min(0)),dashes:Qe(k()).optional(),lineCap:rt(["butt","round","square"]).optional(),lineJoin:rt(["miter","round","bevel"]).optional()}).strict(),XI=de({start:q(k().min(0).max(1)),end:q(k().min(0).max(1)),offset:q(k()).optional()}).strict(),xb=de({font:le(),size:q(k().min(0)),fill:uf.optional(),stroke:bb.optional(),weight:pt([k(),le()]).optional(),italic:Je().optional(),letterSpacing:q(k()).optional(),lineHeight:q(k()).optional(),tracking:q(k()).optional(),leading:q(k()).optional(),boxWidth:k().positive().optional(),align:fb.optional(),runs:Qe(lb).optional(),tagStyles:rn(le(),de({fill:di.optional(),weight:pt([k(),le()]).optional(),italic:Je().optional()}).strict()).optional()}).strict(),WI=de({sourceId:le().min(1),mode:rt(["alpha","alpha-inverted","luma","luma-inverted"])}).strict(),Ct={id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),blendMode:UI.optional(),hidden:Je().optional(),transform:Ro,masks:Qe(nb).optional(),effects:Qe(Q_).optional(),trackMatte:WI.optional(),is3D:Je().optional(),transform3D:Io.optional()},on=le().min(1),zI=de({...Ct,kind:nt("image"),assetId:on}).strict(),qI=de({...Ct,kind:nt("video"),assetId:on,timeRemap:q(k()).optional(),muted:Je().optional()}).strict(),VI=de({...Ct,kind:nt("audio"),assetId:on,level:q(k().min(0)).optional(),pan:q(k().min(-1).max(1)).optional()}).strict(),KI=de({...Ct,kind:nt("gif"),assetId:on}).strict(),ZI=de({...Ct,kind:nt("lottie"),assetId:on,speed:k().optional()}).strict(),$I=de({...Ct,kind:nt("svg"),assetId:on}).strict(),JI=de({...Ct,kind:nt("text"),source:q(le()),style:xb,animators:Qe(cb).optional(),splitMode:rt(["single","chars","words","lines"]).optional(),extrusion:V_(()=>vb).optional()}).strict(),vb=de({depth:q(k().min(0)),bevelEnabled:Je().optional(),bevelThickness:q(k().min(0)).optional(),bevelSize:q(k().min(0)).optional(),bevelSegments:k().int().min(0).optional(),curveSegments:k().int().min(1).optional(),sideMaterial:de({color:di.optional(),metalness:k().min(0).max(1).optional(),roughness:k().min(0).max(1).optional()}).strict().optional()}).strict(),QI=de({...Ct,kind:nt("shape"),path:_b,fill:uf.optional(),stroke:bb.optional(),trimPath:XI.optional(),extrusion:vb.optional()}).strict(),eM=de({...Ct,kind:nt("null")}).strict(),tM=de({...Ct,kind:nt("precomp"),compId:le().min(1),width:k().positive(),height:k().positive()}).strict(),nM=de({width:k().positive(),height:k().positive(),depth:k().positive().optional()}).strict(),rM=de({type:nt("primitive"),shape:rt(["can","bottle","box","jar","tube","pouch"]),proportions:nM.optional()}).strict(),iM=de({type:nt("extrude"),contour:Qe(We([k(),k()])).min(3).max(2e3),depth:q(k().min(0)),bevel:k().min(0).optional()}).strict(),oM=de({type:nt("gltf"),assetId:on}).strict(),sM=ef("type",[rM,iM,oM]),aM=de({label:on.optional(),front:on.optional(),side:di.optional()}).strict(),cM=de({roughness:q(k().min(0).max(1)).optional(),metalness:q(k().min(0).max(1)).optional(),clearcoat:k().min(0).max(1).optional()}).strict(),lM=de({rotation:q(We([k(),k(),k()])).optional(),position:q(We([k(),k(),k()])).optional(),scale:q(k().positive()).optional()}).strict(),uM=de({azimuth:q(k()).optional(),elevation:q(k()).optional(),intensity:q(k().min(0)).optional(),color:di.optional()}).strict(),fM=de({preset:rt(["studio","window","golden","night"]).optional(),key:uM.optional(),fill:de({intensity:q(k().min(0)).optional()}).strict().optional(),rim:de({intensity:q(k().min(0)).optional()}).strict().optional(),environment:rt(["room","none"]).optional()}).strict(),dM=de({opacity:q(k().min(0).max(1)),softness:k().min(0).max(1).optional(),offsetY:k().optional()}).strict(),hM=de({width:k().int().min(16).max(4096),height:k().int().min(16).max(4096)}).strict(),pM=de({center:We([k(),k(),k()]).optional(),size:We([k().positive(),k().positive(),k().positive()])}).strict(),mM=de({...Ct,kind:nt("model3d"),viewport:hM,source:sM,textures:aM.optional(),material:cM.optional(),view:lM.optional(),lighting:fM.optional(),shadow:dM.optional(),bounds:pM.optional(),camera:de({fov:k().min(10).max(90).optional(),fit:k().min(.5).max(3).optional()}).strict().optional()}).strict(),Tb=ef("kind",[zI,qI,VI,KI,ZI,$I,JI,QI,eM,tM,mM,rb,ib]).superRefine((t,e)=>{t.kind==="camera"||t.kind==="light"||t.is3D===!0&&!t.transform3D&&e.addIssue({code:U.custom,message:"is3D: true requires a `transform3D` field",path:["transform3D"]})}),gM="1.10.0",hf=1,Eb="1.4.0",pf="1.10.0";function Sb(t,e){const n=t.split(".").map(i=>Number.parseInt(i,10)),r=e.split(".").map(i=>Number.parseInt(i,10));for(let i=0;i<3;i++){const o=n[i]??0,s=r[i]??0;if(o>s)return!0;if(o<s)return!1}return!0}const yM=le().regex(/^\d+\.\d+\.\d+$/,"expected semver string like '1.0.0'").refine(t=>Number.parseInt(t.split(".")[0]??"",10)===hf,`unsupported schema major; this build expects major ${hf}`),_M=de({family:le(),src:le().optional(),weight:pt([k(),le()]).optional(),style:rt(["normal","italic","oblique"]).optional()}).strict(),bM=de({src:le().optional(),msdf:de({json:le(),png:le()}).strict().optional()}).strict().refine(t=>t.src!=null||t.msdf!=null,{message:"fonts3D entry must declare at least one of `src` or `msdf`"}),Mo=de({version:yM,id:le().min(1),name:le().optional(),width:k().positive(),height:k().positive(),fps:k().positive(),durationInFrames:k().positive(),bgColor:le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional(),layers:Qe(Tb),assets:$_,fonts:Qe(_M).optional(),fonts3D:rn(le(),bM).optional(),precomps:rn(le(),V_(()=>Mo)).optional(),postFx:Qe(of).optional(),theme:gb.optional(),transitions:Qe(yb).optional(),meta:rn(le(),NI()).optional()}).strict().superRefine((t,e)=>{const n=new Set;for(const u of t.layers)n.has(u.id)&&e.addIssue({code:U.custom,message:`duplicate layer id: ${u.id}`,path:["layers"]}),n.add(u.id);const r=new Set(t.layers.map(u=>u.id));for(let u=0;u<t.layers.length;u++){const f=t.layers[u].parent;f&&!r.has(f)&&e.addIssue({code:U.custom,message:`parent '${f}' is not a layer in this composition`,path:["layers",u,"parent"]})}const i=new Map(t.layers.map(u=>[u.id,u]));for(let u=0;u<t.layers.length;u++){const f=t.layers[u],d=new Set;let h=f;for(;h?.parent;){if(d.has(h.id)){e.addIssue({code:U.custom,message:`cyclic parent chain detected at layer '${f.id}'`,path:["layers",u,"parent"]});break}d.add(h.id),h=i.get(h.parent)}}for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(f.kind!=="precomp")continue;const d=t.assets[f.compId],h=t.precomps?.[f.compId];if(!d&&!h){e.addIssue({code:U.custom,message:`precomp layer '${f.id}' references unknown compId '${f.compId}'`,path:["layers",u,"compId"]});continue}d&&d.type!=="composition"&&e.addIssue({code:U.custom,message:`asset '${f.compId}' is not a composition (got '${d.type}')`,path:["layers",u,"compId"]})}const o=new Set(["image","video","audio","gif","lottie","svg"]);for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(!o.has(f.kind))continue;const d=f.assetId;t.assets[d]||e.addIssue({code:U.custom,message:`layer '${f.id}' references unknown assetId '${d}'`,path:["layers",u,"assetId"]})}for(let u=0;u<t.layers.length;u++){const d=t.layers[u].trackMatte;d&&!r.has(d.sourceId)&&e.addIssue({code:U.custom,message:`trackMatte source '${d.sourceId}' is not a layer in this composition`,path:["layers",u,"trackMatte","sourceId"]})}t.layers.some(u=>u.kind==="model3d")&&!Sb(t.version,Eb)&&e.addIssue({code:U.custom,message:`model3d layers require schema >= ${Eb} (got ${t.version})`,path:["version"]});const a=t.transitions??[];t.transitions!==void 0&&!Sb(t.version,pf)&&e.addIssue({code:U.custom,message:`transitions require schema >= ${pf} (got ${t.version})`,path:["version"]});const l=new Set,c=new Map;for(let u=0;u<a.length;u+=1){const f=a[u];l.has(f.id)&&e.addIssue({code:U.custom,message:`duplicate transition id: ${f.id}`,path:["transitions",u,"id"]}),l.add(f.id);const d=df(f.from),h=df(f.to),p=new Set(d),m=[...new Set([...d,...h])];for(const g of h)p.has(g)&&e.addIssue({code:U.custom,message:`transition '${f.id}' uses layer '${g}' as both from and to`,path:["transitions",u]});for(const g of m){const y=i.get(g);if(!y){e.addIssue({code:U.custom,message:`transition '${f.id}' references unknown layer '${g}'`,path:["transitions",u]});continue}(y.kind==="camera"||y.kind==="light"||y.kind==="audio"||"is3D"in y&&y.is3D===!0)&&e.addIssue({code:U.custom,message:`transition '${f.id}' endpoint '${g}' must be a 2D visual layer`,path:["transitions",u]});const b=c.get(g)??[],x=f.startFrame,v=x+f.durationFrames;for(const T of b)x<T.end&&T.start<v&&e.addIssue({code:U.custom,message:`transition '${f.id}' overlaps '${T.id}' on layer '${g}'`,path:["transitions",u]});b.push({start:x,end:v,id:f.id}),c.set(g,b)}f.startFrame+f.durationFrames>t.durationInFrames&&e.addIssue({code:U.custom,message:`transition '${f.id}' extends past composition duration`,path:["transitions",u,"durationFrames"]})}for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(f.kind==="model3d"){f.source.type==="gltf"&&(t.assets[f.source.assetId]||e.addIssue({code:U.custom,message:`model3d layer '${f.id}' references unknown assetId '${f.source.assetId}'`,path:["layers",u,"source","assetId"]}));for(const d of["label","front"]){const h=f.textures?.[d];h&&(t.assets[h]||e.addIssue({code:U.custom,message:`model3d layer '${f.id}' references unknown texture assetId '${h}'`,path:["layers",u,"textures",d]}))}}}});function Lo(t){return Mo.parse(cf(t))}function xM(t){const e=Mo.safeParse(cf(t));return e.success?{success:!0,data:e.data}:{success:!1,error:e.error}}function vM(t){return t?t.startsWith("http://")||t.startsWith("https://"):!1}const TM={NONE:"none",FADE:"fade",DISSOLVE:"dissolve",WIPE:"wipe",WIPE_LEFT:"wipeLeft",WIPE_RIGHT:"wipeRight",WIPE_UP:"wipeUp",WIPE_DOWN:"wipeDown",DIRECTIONAL:"directional",DIRECTIONAL_EASING:"directional-easing",DIRECTIONAL_SCALED:"directionalScaled",DIRECTIONAL_WARP:"directionalwarp",DIRECTIONAL_WIPE:"directionalwipe",LEFT_RIGHT:"leftRight",TOP_BOTTOM:"topBottom",CROSS_ZOOM:"crossZoom",SIMPLE_ZOOM:"simpleZoom",SIMPLE_ZOOM_OUT:"simpleZoomOut",ZOOM_IN_CIRCLES:"zoomInCircles",ZOOM_LEFT_WIPE:"zoomLeftWipe",ZOOM_RIGHT_WIPE:"zoomRigthWipe",SCALE_IN:"scale-in",CIRCLE:"circle",CIRCLE_OPEN:"circleopen",CIRCLE_CROP:"circleCrop",RECTANGLE:"rectangle",RECTANGLE_CROP:"rectangleCrop",HEART:"heart",HEXAGONALIZE:"hexagonalize",POLKA_DOTS_CURTAIN:"polkaDotsCurtain",RANDOM_SQUARES:"randomsquares",SQUARES_WIRE:"squareswire",ANGULAR:"angular",CUBE:"cube",ROTATE_SCALE_FADE:"rotate_scale_fade",ROTATE_SCALE_VANISH:"rotateScaleVanish",ROTATE_TRANSITION:"rotateTransition",BOOK_FLIP:"bookFlip",PAGE_CURL:"pageCurl",INVERTED_PAGE_CURL:"invertedPageCurl",BOW_TIE_HORIZONTAL:"bowTieHorizontal",BOW_TIE_VERTICAL:"bowTieVertical",BOW_TIE_WITH_PARAMETER:"bowTieWithParameter",HORIZONTAL_OPEN:"horizontalOpen",HORIZONTAL_CLOSE:"horizontalClose",VERTICAL_OPEN:"verticalOpen",VERTICAL_CLOSE:"verticalClose",LINEAR_BLUR:"linearBlur",DREAMY:"dreamy",DREAMY_ZOOM:"dreamyZoom",SWIRL:"swirl",RIPPLE:"ripple",WIND:"wind",WATER_DROP:"waterDrop",DISPLACEMENT:"displacement",SQUEEZE:"squeeze",GLITCH_DISPLACE:"glitchDisplace",GLITCH_MEMORIES:"glitchMemories",TV_STATIC:"tvStatic",STATIC_FADE:"staticFade",STATIC_WIPE:"static_wipe",PARAMETRIC_GLITCH:"parametric_glitch",BURN:"burn",FILM_BURN:"filmBurn",UNDULATING_BURN_OUT:"undulatingBurnOut",DOOM_SCREEN_TRANSITION:"doomScreenTransition",OVEREXPOSURE:"overexposure",FADE_COLOR:"fadecolor",FADE_GRAYSCALE:"fadegrayscale",COLOR_PHASE:"colorphase",COLOUR_DISTANCE:"colourDistance",MULTIPLY_BLEND:"multiply_blend",GRID_FLIP:"gridFlip",MOSAIC:"mosaic",MOSAIC_TRANSITION:"mosaic_transition",PIXELIZE:"pixelize",CROSSHATCH:"crosshatch",WINDOW_BLINDS:"windowblinds",WINDOW_SLICE:"windowslice",MORPH:"morph",SWAP:"swap",CROSSWARP:"crosswarp",POLAR_FUNCTION:"polar_function",COORD_FROM_IN:"coord-from-in",KALEIDOSCOPE:"kaleidoscope",POWER_KALEIDO:"powerKaleido",PINWHEEL:"pinwheel",FLYEYE:"flyeye",STEREO_VIEWER:"stereoViewer",PERLIN:"perlin",RANDOM_NOISEX:"randomNoisex",TANGENT_MOTION_BLUR:"tangentMotionBlur",LUMA:"luma",LUMINANCE_MELT:"luminance_melt",BOUNCE:"bounce",BUTTERFLY_WAVE_SCRAWLER:"butterflyWaveScrawler",CRAZY_PARAMETRIC_FUN:"crazyParametricFun",CANNABIS_LEAF:"cannabisleaf",RADIAL:"radial",ROLLS:"rolls",SLIDES:"slides",DOORWAY:"doorway",EDGE_TRANSITION:"edgeTransition",X_AXIS_TRANSLATION:"x_axis_translation",SIMPLE_FLIP:"simpleFlip",HSV_FADE:"hsvfade",FOLD:"fold",BLOCK_DISSOLVE:"blockDissolve",ADVANCED_MOSAIC:"advancedMosaic",DEFOCUS_BLUR:"defocusBlur",PUZZLE_RIGHT:"puzzleRight",TILES_WAVE:"tilesWave",STAR_WIPE:"starWipe",CHESSBOARD:"chessboard",BURN_EFFECT:"burn0",FRAGMENT:"fragment",ZOOM_IN_OUT:"zoomInOut"},EM={fade:"fade",dissolve:"fade",wipe:"wipeLeft",wipeLeft:"wipeLeft",wipeRight:"wipeRight",wipeUp:"wipeUp",wipeDown:"wipeDown",directional:"Directional","directional-easing":"Directional",directionalScaled:"Directional",directionalwarp:"directionalwarp",directionalwipe:"directionalwipe",leftRight:"Directional",topBottom:"Directional",crossZoom:"CrossZoom",simpleZoom:"SimpleZoom",simpleZoomOut:"SimpleZoomOut",zoomInCircles:"ZoomInCircles",zoomLeftWipe:"ZoomLeftWipe",zoomRigthWipe:"ZoomRigthWipe",zoomInOut:"zoomInOut","scale-in":"scale-in",simpleFlip:"SimpleFlip",hsvfade:"HSVfade",fold:"Fold",blockDissolve:"BlockDissolve",advancedMosaic:"AdvancedMosaic",defocusBlur:"DefocusBlur",puzzleRight:"PuzzleRight",tilesWave:"TilesWave",starWipe:"StarWipe",chessboard:"chessboard",burn0:"burn0",fragment:"fragment",circle:"circle",circleopen:"circleopen",circleCrop:"CircleCrop",heart:"heart",hexagonalize:"hexagonalize",randomsquares:"randomsquares",squareswire:"squareswire",bowTieHorizontal:"BowTieHorizontal",bowTieVertical:"BowTieVertical",bowTieWithParameter:"BowTieVertical",BowTieHorizontal:"BowTieHorizontal",BowTieVertical:"BowTieVertical",linearBlur:"LinearBlur",dreamy:"dreamy",swirl:"Swirl",mosaic:"Mosaic",Mosaic:"Mosaic",windowslice:"windowslice",WindowSlice:"windowslice",windowblinds:"windowblinds",WindowBlinds:"windowblinds",stereoviewer:"StereoViewer",StereoViewer:"StereoViewer",doorway:"doorway",Doorway:"doorway"},wb=new Set,Ab=t=>t.toLowerCase().replace(/[^a-z0-9]/g,""),Po=t=>{if(!t)return null;const e=EM[t];if(e){const i=os.find(o=>o.name.toLowerCase()===e.toLowerCase());if(i)return i}const n=t.toLowerCase(),r=Ab(t);return os.find(i=>i.name.toLowerCase()===n||Ab(i.name)===r)??null},Ob=t=>Po(t)!==null,Cb=()=>os.map(t=>t.name),SM=Po,wM=Cb,AM=t=>{wb.has(t)||(wb.add(t),console.warn(`[reacthub-pixitweenjs] Unknown GL transition "${t}"; using crossfade fallback.`))},OM=`in vec2 aPosition;
|
|
1426
1426
|
in vec2 aUV;
|
|
1427
1427
|
out vec2 vTextureCoord;
|
|
1428
1428
|
|
|
@@ -1503,14 +1503,14 @@ void main() {
|
|
|
1503
1503
|
if (opacity < 0.001) discard;
|
|
1504
1504
|
gl_FragColor = vec4(vColor.rgb, vColor.a * opacity);
|
|
1505
1505
|
}
|
|
1506
|
-
`,jb=new V.Quaternion,Hb=new V.Euler,Yb=new V.Vector3,Xb=new V.Vector3;function Wb(t,e,n,r,i){const o=n.bounds.width/2,s=n.bounds.height/2,[a,l,c,u]=e.planeBounds,f=(a+c)/2*r,d=(l+u)/2*r,h=(c-a)*r,p=(u-l)*r;return Xb.set(n.x+f+i.position[0]-o,-(n.y-d)+i.position[1]+s,0),Hb.set(0,0,-i.rotation*Math.PI/180),jb.setFromEuler(Hb),Yb.set(h*(1+i.scale[0]),p*(1+i.scale[1]),1),t.compose(Xb,jb,Yb),t}function KM(t,e,n){const r=e*4;t[r]=n[0],t[r+1]=n[1],t[r+2]=n[2],t[r+3]=n[3]}function zb(t,e){const n=t.replace(/^#/,"");if(n.length!==6&&n.length!==8)return[1,1,1,e??1];const r=parseInt(n.slice(0,2),16)/255,i=parseInt(n.slice(2,4),16)/255,o=parseInt(n.slice(4,6),16)/255,s=n.length===8?parseInt(n.slice(6,8),16)/255:1;return[r,i,o,e??s]}const qb=.28,Vb=0,Kb=1.2,Zb=(t,e)=>t>1?t:e*qb,_f=(t,e)=>{const n=typeof t=="string"?Number(t):t;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:e*Vb},No=t=>t==="pop"||t==="punch"?1.08:t==="glow"?1.05:1,xr=(t,e)=>e==="uppercase"?t.toUpperCase():e==="lowercase"?t.toLowerCase():t,$b=(t,e,n=4)=>{if(!t.length||e<0)return[];if(t.length<=n)return t;const r=Math.max(0,e-n+1);return t.slice(r,e+1)},xn=(t,e)=>{if(e<=0)return 1;const n=Math.max(0,Math.min(1,t/e));return 1-Math.pow(1-n,3)};function Jb(t,e){const{fontSize:n,maxLineWidth:r}=e,i=Zb(e.spaceWidth,n)+_f(e.wordSpacing,n),o=Math.max(1,e.activeScale??1),s=[],a=[];let l=0,c=0,u=0,f=0;for(let d=0;d<t.length;d++){const h=t[d].width*o;u=Math.max(u,t[d].height),l>0&&l+h>r&&(a.push({start:f,end:d,width:l-i,height:u}),l=0,c+=u*Kb,u=t[d].height,f=d),s.push({x:l,y:c,width:h,height:t[d].height}),l+=h+i}t.length&&a.push({start:f,end:t.length,width:l-i,height:u});for(const d of a){const h=(r-d.width)/2;for(let p=d.start;p<d.end;p++)s[p].x+=h,s[p].height=d.height}return{positions:s,lines:a,totalWidth:r,totalHeight:c+u}}const Qb=t=>{const e=typeof t=="string"?t:"";return e==="none"?"none":e==="social-neon"||e.startsWith("glow-")||e==="retro-terminal"?"glow":e==="social-glass"||e==="business-clean"||e==="business-boxed"?"boxed":e==="retro-vhs"?"vhs":e==="capcut-highlight"?"wordbox":e==="capcut-pop"?"punch":e==="capcut-word"?"slam":e==="capcut-glow-pop"?"glowpop":e==="capcut-spring-pop"?"springpop":"pop"},ZM=t=>t==="slam"||t==="glowpop"||t==="springpop",ex=(t,e,n)=>n==="slam"?t.reduce((r,i,o)=>e>=i.start?o:r,-1):t.findIndex(r=>e>=r.start&&e<r.end),tx=100,nx=100,rx=350,ix=.12,bf=.6,ox=.3,sx=.8,ax=2,cx=.55,xf=1.5,vf=1.35,lx=t=>{const n=Math.max(0,Math.min(1,t))-1;return 1+(1.70158+1)*n*n*n+1.70158*n*n},ux=(t,e,n)=>{const r=xn(t,tx),i=xn(e,nx),o=Math.min(r,i);return{alpha:bf+(1-bf)*o,blur:(1-r+(1-i))*n*ix,scale:.92+.08*o,emojiScale:(.6+.4*lx(t/rx))*(.6+.4*i)}},fx=5,dx=.12,hx=.2,px=150,mx=.1,Tf=.75,gx=.22,yx=.7,_x=(t,e)=>{const n=Math.max(0,t)/1e3,r=2*Math.PI*fx,i=-hx*e*Math.exp(-dx*r*n)*Math.cos(r*n),o=1-xn(t,px);return{alpha:Tf+(1-Tf)*(1-o),dy:i,blur:o*e*mx,scaleY:1+.12*o}},bx=150,xx=.072,Ef=.029,vx="#5AA9FF",Tx="#FFA14A",Ex=.75,Sx=(t,e)=>{const n=1-xn(t,bx);return e*(Ef+(xx-Ef)*n)},Sf=(t,e)=>t==="punch"?.8+.28*xn(e,160):t==="slam"?.55+.45*xn(e,220):1,wx="https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@v2.047/png/128",Ax=t=>{const e=Array.from(t).map(n=>n.codePointAt(0)??0).filter(n=>n!==65039&&n>0);return e.length?`emoji_u${e.map(n=>n.toString(16)).join("_")}.png`:null},wf=t=>{if(t.emojiSrc)return t.emojiSrc;if(!t.emoji)return null;const e=Ax(t.emoji);return e?`${wx}/${e}`:null},Ox=/^#[0-9a-fA-F]{6}$/,Cx=de({text:le().min(1),start:k().finite().nonnegative(),end:k().finite().nonnegative(),emoji:le().min(1).optional(),emojiSrc:le().min(1).optional(),color:le().regex(Ox,"expected #RRGGBB").optional(),confidence:k().min(0).max(1).optional()}).refine(t=>t.end>=t.start,{message:"word end must be >= start",path:["end"]}),Rx=de({id:le().min(1),start:k().finite().nonnegative(),end:k().finite().nonnegative(),text:le(),words:
|
|
1506
|
+
`,jb=new V.Quaternion,Hb=new V.Euler,Yb=new V.Vector3,Xb=new V.Vector3;function Wb(t,e,n,r,i){const o=n.bounds.width/2,s=n.bounds.height/2,[a,l,c,u]=e.planeBounds,f=(a+c)/2*r,d=(l+u)/2*r,h=(c-a)*r,p=(u-l)*r;return Xb.set(n.x+f+i.position[0]-o,-(n.y-d)+i.position[1]+s,0),Hb.set(0,0,-i.rotation*Math.PI/180),jb.setFromEuler(Hb),Yb.set(h*(1+i.scale[0]),p*(1+i.scale[1]),1),t.compose(Xb,jb,Yb),t}function KM(t,e,n){const r=e*4;t[r]=n[0],t[r+1]=n[1],t[r+2]=n[2],t[r+3]=n[3]}function zb(t,e){const n=t.replace(/^#/,"");if(n.length!==6&&n.length!==8)return[1,1,1,e??1];const r=parseInt(n.slice(0,2),16)/255,i=parseInt(n.slice(2,4),16)/255,o=parseInt(n.slice(4,6),16)/255,s=n.length===8?parseInt(n.slice(6,8),16)/255:1;return[r,i,o,e??s]}const qb=.28,Vb=0,Kb=1.2,Zb=(t,e)=>t>1?t:e*qb,_f=(t,e)=>{const n=typeof t=="string"?Number(t):t;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:e*Vb},No=t=>t==="pop"||t==="punch"?1.08:t==="glow"?1.05:1,xr=(t,e)=>e==="uppercase"?t.toUpperCase():e==="lowercase"?t.toLowerCase():t,$b=(t,e,n=4)=>{if(!t.length||e<0)return[];if(t.length<=n)return t;const r=Math.max(0,e-n+1);return t.slice(r,e+1)},xn=(t,e)=>{if(e<=0)return 1;const n=Math.max(0,Math.min(1,t/e));return 1-Math.pow(1-n,3)};function Jb(t,e){const{fontSize:n,maxLineWidth:r}=e,i=Zb(e.spaceWidth,n)+_f(e.wordSpacing,n),o=Math.max(1,e.activeScale??1),s=[],a=[];let l=0,c=0,u=0,f=0;for(let d=0;d<t.length;d++){const h=t[d].width*o;u=Math.max(u,t[d].height),l>0&&l+h>r&&(a.push({start:f,end:d,width:l-i,height:u}),l=0,c+=u*Kb,u=t[d].height,f=d),s.push({x:l,y:c,width:h,height:t[d].height}),l+=h+i}t.length&&a.push({start:f,end:t.length,width:l-i,height:u});for(const d of a){const h=(r-d.width)/2;for(let p=d.start;p<d.end;p++)s[p].x+=h,s[p].height=d.height}return{positions:s,lines:a,totalWidth:r,totalHeight:c+u}}const Qb=t=>{const e=typeof t=="string"?t:"";return e==="none"?"none":e==="social-neon"||e.startsWith("glow-")||e==="retro-terminal"?"glow":e==="social-glass"||e==="business-clean"||e==="business-boxed"?"boxed":e==="retro-vhs"?"vhs":e==="capcut-highlight"?"wordbox":e==="capcut-pop"?"punch":e==="capcut-word"?"slam":e==="capcut-glow-pop"?"glowpop":e==="capcut-spring-pop"?"springpop":"pop"},ZM=t=>t==="slam"||t==="glowpop"||t==="springpop",ex=(t,e,n)=>n==="slam"?t.reduce((r,i,o)=>e>=i.start?o:r,-1):t.findIndex(r=>e>=r.start&&e<r.end),tx=100,nx=100,rx=350,ix=.12,bf=.6,ox=.3,sx=.8,ax=2,cx=.55,xf=1.5,vf=1.35,lx=t=>{const n=Math.max(0,Math.min(1,t))-1;return 1+(1.70158+1)*n*n*n+1.70158*n*n},ux=(t,e,n)=>{const r=xn(t,tx),i=xn(e,nx),o=Math.min(r,i);return{alpha:bf+(1-bf)*o,blur:(1-r+(1-i))*n*ix,scale:.92+.08*o,emojiScale:(.6+.4*lx(t/rx))*(.6+.4*i)}},fx=5,dx=.12,hx=.2,px=150,mx=.1,Tf=.75,gx=.22,yx=.7,_x=(t,e)=>{const n=Math.max(0,t)/1e3,r=2*Math.PI*fx,i=-hx*e*Math.exp(-dx*r*n)*Math.cos(r*n),o=1-xn(t,px);return{alpha:Tf+(1-Tf)*(1-o),dy:i,blur:o*e*mx,scaleY:1+.12*o}},bx=150,xx=.072,Ef=.029,vx="#5AA9FF",Tx="#FFA14A",Ex=.75,Sx=(t,e)=>{const n=1-xn(t,bx);return e*(Ef+(xx-Ef)*n)},Sf=(t,e)=>t==="punch"?.8+.28*xn(e,160):t==="slam"?.55+.45*xn(e,220):1,wx="https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@v2.047/png/128",Ax=t=>{const e=Array.from(t).map(n=>n.codePointAt(0)??0).filter(n=>n!==65039&&n>0);return e.length?`emoji_u${e.map(n=>n.toString(16)).join("_")}.png`:null},wf=t=>{if(t.emojiSrc)return t.emojiSrc;if(!t.emoji)return null;const e=Ax(t.emoji);return e?`${wx}/${e}`:null},Ox=/^#[0-9a-fA-F]{6}$/,Cx=de({text:le().min(1),start:k().finite().nonnegative(),end:k().finite().nonnegative(),emoji:le().min(1).optional(),emojiSrc:le().min(1).optional(),color:le().regex(Ox,"expected #RRGGBB").optional(),confidence:k().min(0).max(1).optional()}).refine(t=>t.end>=t.start,{message:"word end must be >= start",path:["end"]}),Rx=de({id:le().min(1),start:k().finite().nonnegative(),end:k().finite().nonnegative(),text:le(),words:Qe(Cx).optional()}).refine(t=>t.end>=t.start,{message:"segment end must be >= start",path:["end"]}),Ix=Qe(Rx);function $M(t){return Ix.parse(t)}const JM=t=>t.text??t.word??"",Af=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),hi=t=>{if(typeof t=="number")return Number.isFinite(t)?t:void 0;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)?e:void 0}},vr=t=>typeof t=="string"&&t.trim()!==""?t:void 0;function QM(t){if(!Af(t))return null;const e=(vr(t.text)??vr(t.word))?.trim(),n=hi(t.start??t.startTime),r=hi(t.end??t.endTime);if(!e||n===void 0||r===void 0)return null;const i=Math.max(0,n),o=Math.max(0,r);if(o<i)return null;const s={text:e,start:i,end:o},a=vr(t.emoji);a&&(s.emoji=a);const l=vr(t.emojiSrc);l&&(s.emojiSrc=l),typeof t.color=="string"&&Ox.test(t.color)&&(s.color=t.color);const c=hi(t.confidence);return c!==void 0&&c>=0&&c<=1&&(s.confidence=c),s}function eL(t,e){if(!Af(t))return null;const n=Array.isArray(t.words)?t.words.map(QM).filter(l=>l!==null).sort((l,c)=>l.start-c.start):[];let r=hi(t.start??t.startTime),i=hi(t.end??t.endTime);if(r===void 0&&n.length&&(r=n[0].start),i===void 0&&n.length&&(i=n.reduce((l,c)=>Math.max(l,c.end),0)),r===void 0||i===void 0||(r=Math.max(0,r),i=Math.max(0,i),i<r))return null;const o=vr(t.text)?.trim()??n.map(l=>l.text).join(" ").trim();if(!o&&!n.length)return null;const a={id:(vr(t.id)??(typeof t.id=="number"?String(t.id):""))||`caption_${e}`,start:r,end:i,text:o};return n.length&&(a.words=n),a}function tL(t){return(Array.isArray(t)?t:Af(t)&&Array.isArray(t.segments)?t.segments:[]).map((n,r)=>eL(n,r)).filter(n=>n!==null).sort((n,r)=>n.start-r.start)}const Mx=.35,Lx=1e-6;function nL(t,e={}){const n=e.segmentGapSec??Mx,r=e.maxWords&&e.maxWords>0?Math.floor(e.maxWords):1/0,i=e.maxDurationSec&&e.maxDurationSec>0?e.maxDurationSec:1/0,o=e.idPrefix??"caption",s=[...t].sort((u,f)=>u.start-f.start),a=[];let l=[];const c=()=>{l.length&&(a.push({id:`${o}_${a.length}`,start:l[0].start,end:l.reduce((u,f)=>Math.max(u,f.end),l[0].end),text:l.map(u=>u.text).join(" "),words:l}),l=[])};for(const u of s){if(l.length){const f=l.reduce((p,m)=>Math.max(p,m.end),0),d=u.start-f,h=u.end-l[0].start;(d>=n-Lx||l.length>=r||h>i+Lx)&&c()}l.push(u)}return c(),a}const rL=/^(?:(\d+):)?(\d{1,2}):(\d{2})[.,](\d{1,3})$/,Px=/^\s*(\S+)\s+-->\s+(\S+)/,Nx=/<((?:\d+:)?\d{1,2}:\d{2}[.,]\d{1,3})>/g;function ko(t){const e=rL.exec(t.trim());if(!e)return null;const n=e[1]?Number(e[1]):0,r=Number(e[2]),i=Number(e[3]),o=Number(e[4].padEnd(3,"0"));return r>59||i>59?null:n*3600+r*60+i+o/1e3}const iL={"&":"&","<":"<",">":">"," ":" ",""":'"',"'":"'"};function kx(t){return t.replace(/<[^>]*>/g,"").replace(/&(?:amp|lt|gt|nbsp|quot|#39);/g,e=>iL[e]??e).replace(/\s+/g," ").trim()}function Of(t,e,n){const r=t.split(/\s+/).filter(Boolean);if(!r.length)return[];const i=Math.max(0,e),o=Math.max(i,n),s=r.reduce((u,f)=>u+f.length,0),a=o-i,l=[];let c=i;return r.forEach((u,f)=>{const h=f===r.length-1?o:c+a*u.length/s;l.push({text:u,start:c,end:h}),c=h}),l}function oL(t,e,n){const r=t.replace(/\r?\n/g," "),i=[];let o=0,s=e,a;for(Nx.lastIndex=0;a=Nx.exec(r);)i.push({start:s,raw:r.slice(o,a.index)}),s=ko(a[1])??s,o=a.index+a[0].length;if(!i.length)return null;i.push({start:s,raw:r.slice(o)});const l=[];return i.forEach((c,u)=>{const f=kx(c.raw);if(!f)return;const d=i[u+1],h=d?d.start:n;l.push(...Of(f,c.start,h))}),l.length?l:null}function Dx(t,e,n){const i=t.replace(/^\uFEFF/,"").replace(/\r\n?/g,`
|
|
1507
1507
|
`).trim().split(/\n{2,}/),o=n.idPrefix??"caption",s=[];for(const a of i){const l=a.split(`
|
|
1508
1508
|
`),c=l[0]?.trim()??"";if(e&&/^(WEBVTT|NOTE|STYLE|REGION)\b/.test(c))continue;const u=l.findIndex(b=>Px.test(b));if(u===-1)continue;const f=Px.exec(l[u]);if(!f)continue;const d=ko(f[1]),h=ko(f[2]);if(d===null||h===null||h<d)continue;const p=l.slice(u+1).join(`
|
|
1509
|
-
`);let m=e?oL(p,d,h):null;const g=m?m.map(b=>b.text).join(" "):kx(p);if(!g)continue;!m&&n.estimateWords&&(m=Of(g,d,h));const y={id:`${o}_${s.length}`,start:d,end:h,text:g};m&&m.length&&(y.words=m),s.push(y)}return s}function Fx(t,e={}){return Dx(t,!1,e)}function Bx(t,e={}){return Dx(t,!0,e)}function Ux(t){const e=t.replace(/^\uFEFF/,"").trim();if(e.startsWith("WEBVTT"))return"vtt";if(/^\d+\s*\n\s*(?:\d+:)?\d{1,2}:\d{2}[,.]\d{1,3}\s+-->/.test(e))return"srt";const n=/(\S+)\s+-->\s+(\S+)/.exec(e);return n?/\d,\d{1,3}$/.test(n[1])?"srt":"vtt":"unknown"}function sL(t,e={}){const n=Ux(t);if(n==="unknown")throw new Error("parseSubtitles: unrecognised subtitle format");return n==="vtt"?Bx(t,e):Fx(t,e)}const Cf=.5,aL=t=>t.reduce((e,n)=>Math.max(e,n.end),0);function Gx(t,e){const n=e.end-e.start;return!Number.isFinite(n)||n<=0?!1:aL(t)<=n+Cf}function cL(t,e){return e?Gx(t,e)?e.start:e.start-(e.sourceStart??0):0}function lL(t,e){return e===0?t.map(n=>({...n})):t.map(n=>({...n,start:n.start+e,end:n.end+e,...n.words&&{words:n.words.map(r=>({...r,start:r.start+e,end:r.end+e}))}}))}function uL(t,e,n){const r=[];for(const i of t){if(i.end<=e||i.start>=n)continue;const o={...i,start:Math.max(i.start,e),end:Math.min(i.end,n)};if(i.words){const s=i.words.filter(a=>a.end>e&&a.start<n).map(a=>({...a,start:Math.max(a.start,e),end:Math.min(a.end,n)}));s.length?o.words=s:delete o.words}r.push(o)}return r}const Rf={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function If(t,e,n){const r=t.find(s=>e>=s.start&&e<=s.end);if(!r)return Rf;if(!r.words?.length||n==="none")return{...Rf,segment:r};const i=ex(r.words,e,n);if(i<0)return{...Rf,segment:r};const o=r.words[i];return{segment:r,wordIndex:i,word:o,elapsedMs:Math.max(0,(e-o.start)*1e3),remainingMs:Math.max(0,(o.end-e)*1e3)}}function jx(t,e=0,n){if(!t.length)return!1;const r=typeof n=="number"&&n>e?n-e:null;return r==null?e>0:t.reduce((o,s)=>Math.max(o,Number(s.end)||0),0)<=r+Cf}const Mf=(t,e,n=0)=>e?t-(Number(n)||0):t,Lf=.5,vn=(t,e,n)=>({styleKind:t,alpha:e,scale:n,dy:0,blurX:0,blurY:0});function Hx(t,e,n,r,i){const o=e?"active":"inactive";switch(t){case"wordbox":return vn("base",1,1);case"punch":return vn(o,1,e?Sf("punch",n):1);case"slam":return vn("base",1,e?Sf("slam",n):1);case"glowpop":{const s=ux(n,r,i);return{...vn("base",s.alpha,s.scale),blurX:s.blur,glowPop:s}}case"springpop":{const s=_x(n,i);return{styleKind:"base",alpha:s.alpha,scale:{x:1,y:s.scaleY},dy:s.dy,blurX:0,blurY:s.blur,springPop:s,split:Sx(n,i)}}case"glow":return vn(o,e?1:.5,e?No("glow"):1);case"boxed":return vn(o,e?1:.7,1);case"vhs":return vn(o,e?1:.6,1);default:return vn(o,e?1:.55,e?No("pop"):1)}}const Yx=t=>t==="wordbox"||t==="punch"||t==="slam"||t==="glowpop"||t==="springpop";function Xx(t,e,n){const r=e;if(t==="wordbox"||t==="punch"){const i=$b(r,n),o=n>=0?Math.max(0,n-i.length+1):0;return{words:i,offset:o}}if(t==="slam"||t==="glowpop"||t==="springpop"){const i=n>=0?r[n]:void 0;return{words:i?[i]:[],offset:n}}return{words:r,offset:0}}const Pf=t=>Math.max(0,Math.min(255,Math.round(t))),Wx=(t,e,n)=>Pf(t)<<16|Pf(e)<<8|Pf(n);function zx(t){if(!t)return null;const e=t.trim().toLowerCase();if(e==="transparent")return{color:0,alpha:0};const n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(e);if(n){let i=n[1];i.length<=4&&(i=[...i].map(c=>c+c).join(""));const o=parseInt(i.slice(0,2),16),s=parseInt(i.slice(2,4),16),a=parseInt(i.slice(4,6),16),l=i.length===8?parseInt(i.slice(6,8),16)/255:1;return{color:Wx(o,s,a),alpha:l}}const r=/^rgba?\(\s*([^)]+)\)$/.exec(e);if(r){const i=r[1].split(/[\s,/]+/).filter(Boolean);if(i.length<3)return null;const o=u=>u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u),[s,a,l]=[o(i[0]),o(i[1]),o(i[2])];if([s,a,l].some(u=>!Number.isFinite(u)))return null;let c=1;return i[3]!==void 0&&(c=i[3].endsWith("%")?parseFloat(i[3])/100:parseFloat(i[3]),!Number.isFinite(c))?null:{color:Wx(s,a,l),alpha:Math.max(0,Math.min(1,c))}}return null}const pi=12,qx={color:0,alpha:.75},Vx=t=>t==="social-glass"?12:t==="business-boxed"?4:6;function Kx(t,e,n,r){const i=zx(n),o=i&&i.alpha>0?i:qx;return{x:-t/2-pi,y:-e/2-pi,width:t+pi*2,height:e+pi*2,radius:Vx(r),color:o.color,alpha:o.alpha}}const Zx=120;function $x(t,e,n,r,i){const o=xn(r,Zx),s=t.width*o,a=t.height*o,l=-e/2+t.x+(t.width-s)/2,c=-n/2+t.y+(t.height-a)/2;return{x:l-i*.16,y:c-i*.12,width:s+i*.32,height:a+i*.24,radius:i*.16}}const Jx=.001;function Qx(t){const e=lr(typeof t=="object"?t?.name??"NONE":t??"NONE")||"NONE";if(e==="NONE"||$r.has(e)||typeof E>"u"||!E.effects?.[e])return null;const n=(typeof t=="object"?t?.duration:void 0)??
|
|
1509
|
+
`);let m=e?oL(p,d,h):null;const g=m?m.map(b=>b.text).join(" "):kx(p);if(!g)continue;!m&&n.estimateWords&&(m=Of(g,d,h));const y={id:`${o}_${s.length}`,start:d,end:h,text:g};m&&m.length&&(y.words=m),s.push(y)}return s}function Fx(t,e={}){return Dx(t,!1,e)}function Bx(t,e={}){return Dx(t,!0,e)}function Ux(t){const e=t.replace(/^\uFEFF/,"").trim();if(e.startsWith("WEBVTT"))return"vtt";if(/^\d+\s*\n\s*(?:\d+:)?\d{1,2}:\d{2}[,.]\d{1,3}\s+-->/.test(e))return"srt";const n=/(\S+)\s+-->\s+(\S+)/.exec(e);return n?/\d,\d{1,3}$/.test(n[1])?"srt":"vtt":"unknown"}function sL(t,e={}){const n=Ux(t);if(n==="unknown")throw new Error("parseSubtitles: unrecognised subtitle format");return n==="vtt"?Bx(t,e):Fx(t,e)}const Cf=.5,aL=t=>t.reduce((e,n)=>Math.max(e,n.end),0);function Gx(t,e){const n=e.end-e.start;return!Number.isFinite(n)||n<=0?!1:aL(t)<=n+Cf}function cL(t,e){return e?Gx(t,e)?e.start:e.start-(e.sourceStart??0):0}function lL(t,e){return e===0?t.map(n=>({...n})):t.map(n=>({...n,start:n.start+e,end:n.end+e,...n.words&&{words:n.words.map(r=>({...r,start:r.start+e,end:r.end+e}))}}))}function uL(t,e,n){const r=[];for(const i of t){if(i.end<=e||i.start>=n)continue;const o={...i,start:Math.max(i.start,e),end:Math.min(i.end,n)};if(i.words){const s=i.words.filter(a=>a.end>e&&a.start<n).map(a=>({...a,start:Math.max(a.start,e),end:Math.min(a.end,n)}));s.length?o.words=s:delete o.words}r.push(o)}return r}const Rf={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function If(t,e,n){const r=t.find(s=>e>=s.start&&e<=s.end);if(!r)return Rf;if(!r.words?.length||n==="none")return{...Rf,segment:r};const i=ex(r.words,e,n);if(i<0)return{...Rf,segment:r};const o=r.words[i];return{segment:r,wordIndex:i,word:o,elapsedMs:Math.max(0,(e-o.start)*1e3),remainingMs:Math.max(0,(o.end-e)*1e3)}}function jx(t,e=0,n){if(!t.length)return!1;const r=typeof n=="number"&&n>e?n-e:null;return r==null?e>0:t.reduce((o,s)=>Math.max(o,Number(s.end)||0),0)<=r+Cf}const Mf=(t,e,n=0)=>e?t-(Number(n)||0):t,Lf=.5,vn=(t,e,n)=>({styleKind:t,alpha:e,scale:n,dy:0,blurX:0,blurY:0});function Hx(t,e,n,r,i){const o=e?"active":"inactive";switch(t){case"wordbox":return vn("base",1,1);case"punch":return vn(o,1,e?Sf("punch",n):1);case"slam":return vn("base",1,e?Sf("slam",n):1);case"glowpop":{const s=ux(n,r,i);return{...vn("base",s.alpha,s.scale),blurX:s.blur,glowPop:s}}case"springpop":{const s=_x(n,i);return{styleKind:"base",alpha:s.alpha,scale:{x:1,y:s.scaleY},dy:s.dy,blurX:0,blurY:s.blur,springPop:s,split:Sx(n,i)}}case"glow":return vn(o,e?1:.5,e?No("glow"):1);case"boxed":return vn(o,e?1:.7,1);case"vhs":return vn(o,e?1:.6,1);default:return vn(o,e?1:.55,e?No("pop"):1)}}const Yx=t=>t==="wordbox"||t==="punch"||t==="slam"||t==="glowpop"||t==="springpop";function Xx(t,e,n){const r=e;if(t==="wordbox"||t==="punch"){const i=$b(r,n),o=n>=0?Math.max(0,n-i.length+1):0;return{words:i,offset:o}}if(t==="slam"||t==="glowpop"||t==="springpop"){const i=n>=0?r[n]:void 0;return{words:i?[i]:[],offset:n}}return{words:r,offset:0}}const Pf=t=>Math.max(0,Math.min(255,Math.round(t))),Wx=(t,e,n)=>Pf(t)<<16|Pf(e)<<8|Pf(n);function zx(t){if(!t)return null;const e=t.trim().toLowerCase();if(e==="transparent")return{color:0,alpha:0};const n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(e);if(n){let i=n[1];i.length<=4&&(i=[...i].map(c=>c+c).join(""));const o=parseInt(i.slice(0,2),16),s=parseInt(i.slice(2,4),16),a=parseInt(i.slice(4,6),16),l=i.length===8?parseInt(i.slice(6,8),16)/255:1;return{color:Wx(o,s,a),alpha:l}}const r=/^rgba?\(\s*([^)]+)\)$/.exec(e);if(r){const i=r[1].split(/[\s,/]+/).filter(Boolean);if(i.length<3)return null;const o=u=>u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u),[s,a,l]=[o(i[0]),o(i[1]),o(i[2])];if([s,a,l].some(u=>!Number.isFinite(u)))return null;let c=1;return i[3]!==void 0&&(c=i[3].endsWith("%")?parseFloat(i[3])/100:parseFloat(i[3]),!Number.isFinite(c))?null:{color:Wx(s,a,l),alpha:Math.max(0,Math.min(1,c))}}return null}const pi=12,qx={color:0,alpha:.75},Vx=t=>t==="social-glass"?12:t==="business-boxed"?4:6;function Kx(t,e,n,r){const i=zx(n),o=i&&i.alpha>0?i:qx;return{x:-t/2-pi,y:-e/2-pi,width:t+pi*2,height:e+pi*2,radius:Vx(r),color:o.color,alpha:o.alpha}}const Zx=120;function $x(t,e,n,r,i){const o=xn(r,Zx),s=t.width*o,a=t.height*o,l=-e/2+t.x+(t.width-s)/2,c=-n/2+t.y+(t.height-a)/2;return{x:l-i*.16,y:c-i*.12,width:s+i*.32,height:a+i*.24,radius:i*.16}}const Jx=.001;function Qx(t){const e=lr(typeof t=="object"?t?.name??"NONE":t??"NONE")||"NONE";if(e==="NONE"||$r.has(e)||typeof E>"u"||!E.effects?.[e])return null;const n=(typeof t=="object"?t?.duration:void 0)??Dt.DEFAULT_DURATION_MS;return Math.max(n/1e3,0)}function fL(t){return!Array.isArray(t)||t.length===0?t:t.map(e=>{if(e==null||typeof e.start!="number")return e;let n=null;for(const s of t)s===e||s==null||typeof s.end!="number"||s.end<=e.start+Jx&&(n==null||s.end>(n.end??-1/0))&&(n=s);if(n==null||Math.abs((n.end??0)-e.start)>Jx||Qx(n.transformation?.animationOut)==null)return e;const r=Qx(e.transformation?.animationIn);if(r==null||r<=0)return e;const i=Math.max((e.end??e.start)-e.start,0),o=Math.min(Dt.ENTRANCE_OVERLAP_SEC,r,i);return o<=0?e:{...e,transformation:{...e.transformation,entranceOverlapSec:o}}})}let Rt={pending:new Set,ready:new Set};const Nf=new Set,Do=t=>{Rt=t,Nf.forEach(e=>e())},dL=5e3,mi=new Map;function Fo(t){const e=mi.get(t);e&&(clearTimeout(e),mi.delete(t))}function hL(t){Fo(t),mi.set(t,setTimeout(()=>{mi.delete(t),Rt.pending.has(t)&&(console.warn(`[videoReadiness] timed out waiting for ${t} — releasing play gate`),Bo(t))},dL))}function ev(t){if(!t)return;const e=new Set(Rt.pending),n=new Set(Rt.ready);n.delete(t),e.add(t),Do({pending:e,ready:n}),hL(t)}function Bo(t){if(!t||(Fo(t),!Rt.pending.has(t)&&Rt.ready.has(t)))return;const e=new Set(Rt.pending);e.delete(t),Do({pending:e,ready:new Set([...Rt.ready,t])})}function tv(t){if(!t)return;Fo(t);const e=new Set(Rt.pending),n=new Set(Rt.ready);e.delete(t),n.delete(t),Do({pending:e,ready:n})}function pL(){for(const t of[...mi.keys()])Fo(t);Do({pending:new Set,ready:new Set})}const mL=t=>(Nf.add(t),()=>Nf.delete(t)),gL=()=>Rt.pending.size===0;function yL(){return S.useSyncExternalStore(mL,gL,()=>!0)}const nv=Ja(),rv=nv.acquire,iv=nv.release,kf=t=>(t??"").split(":")[0].trim().toLowerCase(),gi=t=>{const e=(t??"").trim();return e?e.includes(":")?e.replace(/\s*([:,])\s*/g,"$1"):`${e}:400,700`:"Inter:400,700"},yi=t=>(gi(t).split(":")[1]??"").split(",").map(n=>n.trim()).filter(Boolean),ov=(t,e)=>{const n=kf(t),r=yi(t),i=new Set(e.filter(o=>kf(o)===n).flatMap(yi));return r.every(o=>i.has(o))},sv=t=>(t??"").split(":")[0].trim(),av=t=>`https://fonts.googleapis.com/css2?${t.map(n=>{const r=sv(gi(n)).replace(/ /g,"+"),i=yi(n).map(Number).filter(o=>Number.isFinite(o)).sort((o,s)=>o-s);return`family=${r}:wght@${[...new Set(i)].join(";")}`}).join("&")}&display=swap`,cv={SANS_SERIF:["Roboto","Open Sans","Lato","Montserrat","Poppins","Inter","Raleway","Nunito","Ubuntu","Work Sans","Outfit","DM Sans","Plus Jakarta Sans","Manrope","Space Grotesk"],SERIF:["Playfair Display","Merriweather","Lora","PT Serif","Crimson Text","Libre Baskerville","Cormorant","EB Garamond","Spectral"],DISPLAY:["Bebas Neue","Anton","Righteous","Abril Fatface","Fredoka One","Pacifico","Bungee","Alfa Slab One","Passion One"],MONOSPACE:["Roboto Mono","Fira Code","JetBrains Mono","Source Code Pro","IBM Plex Mono","Space Mono"],HANDWRITING:["Dancing Script","Pacifico","Indie Flower","Caveat","Permanent Marker","Satisfy"]},_L=Object.values(cv).flat(),bL=["Poppins:400,500,600,700","Inter:400,500,600,700","Roboto:400,500,700","Montserrat:400,500,600,700,800,900","Playfair Display:400,700","Bebas Neue:400","Roboto Mono:400"],lv=5e3;let Uo=[];const Df=new Map,xL=()=>Uo,vL=t=>{Uo=[...new Set([...Uo,...t.map(gi)])]},TL=()=>typeof document<"u",EL=t=>new Promise(e=>{if(document.querySelector(`link[data-reacthub-font="${t}"]`)){e();return}const r=document.createElement("link");r.rel="stylesheet",r.href=t,r.dataset.reacthubFont=t,r.onload=()=>e(),r.onerror=()=>e(),document.head.appendChild(r)}),SL=async t=>{const e=document.fonts;if(!e?.load)return;const n=t.flatMap(r=>{const i=sv(r);return yi(r).map(o=>e.load(`${o} 16px "${i}"`))});await Promise.all(n)};async function wL(t,e={}){const r=[...new Set(t.filter(Boolean).map(gi))].filter(h=>!ov(h,Uo));if(r.length===0||!TL())return{families:[]};const i=r.join("|"),o=Df.get(i);if(o)return await o,{families:r};const s=e.timeoutMs??lv;let a=!1;const c=(async()=>{await EL(av(r)),await SL(r)})(),u=new Promise(h=>setTimeout(()=>{a=!0,h()},s)),f=Promise.race([c,u]);Df.set(i,f);try{await f}finally{Df.delete(i)}vL(r);const d=a?{families:r,inactive:!0}:{families:r};return e.emit!==!1&&Ln(ke.FONTS_LOADED,d),d}const uv=2e3,AL=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF]/g,OL=t=>{let e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r>=0&&r<=8||r===11||r===12||r>=14&&r<=31||r>=127&&r<=159||(e+=t[n])}return e},CL=(t,e=uv)=>{if(t==null)return"";let n=String(t);try{n=n.normalize("NFC")}catch{}return n=OL(n.replace(AL,"")),n=n.replace(/\r\n/g,`
|
|
1510
1510
|
`).replace(/\r/g,`
|
|
1511
1511
|
`).replace(/[^\S\n]+/g," ").replace(/\n{3,}/g,`
|
|
1512
1512
|
|
|
1513
|
-
`).trim(),n.length>e&&(n=n.slice(0,e).trimEnd()),n};function Ff(t,e,n){if(n<=0)return Xn(t);if(n>=1)return Xn(e);const r=Math.min(t.vertices.length,e.vertices.length,t.inTangents.length,e.inTangents.length,t.outTangents.length,e.outTangents.length),i=new Array(r),o=new Array(r),s=new Array(r);for(let a=0;a<r;a++)i[a]=Bf(t.vertices[a],e.vertices[a],n),o[a]=Bf(t.inTangents[a],e.inTangents[a],n),s[a]=Bf(t.outTangents[a],e.outTangents[a],n);return{vertices:i,inTangents:o,outTangents:s,closed:n<.5?t.closed:e.closed}}function Bf(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Xn(t){return{vertices:t.vertices.map(e=>[e[0],e[1]]),inTangents:t.inTangents.map(e=>[e[0],e[1]]),outTangents:t.outTangents.map(e=>[e[0],e[1]]),closed:t.closed}}function Wn(t){let e=t.replace(/^#/,"");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const n=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,i=parseInt(e.substring(4,6),16)/255,o=e.length===8?parseInt(e.substring(6,8),16)/255:1;return{r:n,g:r,b:i,a:o}}function _i(t){const e=r=>Math.max(0,Math.min(255,Math.round(r*255))).toString(16).padStart(2,"0"),n=`#${e(t.r)}${e(t.g)}${e(t.b)}`;return t.a<1?`${n}${e(t.a)}`:n}function RL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&typeof e.v=="string"}function fv(t,e,n){const r=E.timeline({paused:!0}),i={r:0,g:0,b:0,a:1};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!RL(t))return Object.assign(i,Wn(t)),{timeline:r,hasAnimation:!1,target:i};const o=t,s=a=>(a-n)/e;Object.assign(i,Wn(o[0].v)),r.set(i,Wn(o[0].v),s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u,d=Wn(c.v);if(l.hold){r.set(i,d,s(c.t));continue}r.to(i,{r:d.r,g:d.g,b:d.b,a:d.a,duration:f,ease:Bn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function IL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function dv(t,e){if(e<=0)return 0;if(e>=1)return 1;const[n,r,i,o]=t;let s=e;for(let l=0;l<8;l++){const c=1-s,u=3*c*c*s*n+3*c*s*s*i+s*s*s,f=3*c*c*n+6*c*s*(i-n)+3*s*s*(1-i);if(Math.abs(f)<1e-9)break;s-=(u-e)/f,s<0&&(s=0),s>1&&(s=1)}const a=1-s;return 3*a*a*s*r+3*a*s*s*o+s*s*s}function Tr(t,e,n,r){if(t===void 0)return e;if(!IL(t))return t;const i=t;if(i.length===0)return e;if(n<=i[0].t)return i[0].v;if(n>=i[i.length-1].t)return i[i.length-1].v;for(let o=0;o<i.length-1;o++){const s=i[o],a=i[o+1];if(n>=s.t&&n<=a.t){if(s.hold)return s.v;const l=a.t-s.t,c=l>0?(n-s.t)/l:0,u=s.easeOut?dv(s.easeOut,c):c;return r(s.v,a.v,u)}}return i[i.length-1].v}const hv=(t,e,n)=>t+(e-t)*n,pv=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n],ML=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ye(t,e,n){return Tr(t,e,n,hv)}function sn(t,e,n){return Tr(t,e,n,pv)}function Go(t,e,n){return Tr(t,e,n,ML)}const mv=(t,e,n)=>{const r=Wn(t),i=Wn(e);return _i({r:r.r+(i.r-r.r)*n,g:r.g+(i.g-r.g)*n,b:r.b+(i.b-r.b)*n,a:r.a+(i.a-r.a)*n})};function xt(t,e,n){return Tr(t,e,n,mv)}function Uf(t,e,n){return Tr(t,e,n,Ff)}function LL(t,e){const n=t.source;if(typeof n=="string")return n;if(!Array.isArray(n)||n.length===0)return"";let r=n[0].v;for(const i of n)if(i.t<=e)r=i.v;else break;return r}function PL(t,e,n,r,i,o){return{text:t,font:e.font??n.style.font,size:e.size!=null?ye(e.size,i,r):i,weight:e.weight??n.style.weight,italic:e.italic??n.style.italic,fill:e.fill!=null?xt(e.fill,o,r):o,tracking:e.tracking!=null?ye(e.tracking,0,r):void 0,baselineShift:e.baselineShift!=null?ye(e.baselineShift,0,r):void 0}}function jo(t,e,n={}){const r=oi(),i=yf(t),o=LL(t,e),s=ye(t.style.size,24,e),a=t.style.fill?xt(Yn(t.style.fill,n.theme),"#ffffff",e):"#ffffff",l=t.style.tracking?ye(t.style.tracking,0,e):t.style.letterSpacing?ye(t.style.letterSpacing,0,e):void 0,c=t.style.leading?ye(t.style.leading,0,e):t.style.lineHeight?ye(t.style.lineHeight,0,e):void 0,u=t.style.align??"left",f=n.boxWidth,d=n.metrics,h=I.useMemo(()=>{const m=Array.from(o),g=[];for(const y of i){const b=m.slice(y.from,y.to).join("");g.push(PL(b,y,t,e,s,a))}return{runs:g,align:u,tracking:l,leading:c,box:f!=null?{width:f}:void 0,metrics:d}},[t,i,o,s,a,u,l,c,f,d,e]),p=I.useMemo(()=>JSON.stringify({runs:h.runs,align:h.align,tracking:h.tracking,leading:h.leading,box:h.box,fontEpoch:r}),[h,r]);return I.useMemo(()=>x_(h),[p])}const gv=new Map,yv=new Map;function _v(t){if(!t)return;const e=gv.get(t);if(e)return e;let n=yv.get(t);throw n||(n=fetch(t).then(r=>{if(!r.ok)throw new Error(`useTypefaceMetrics: ${t} returned ${r.status}`);return r.json()}).then(r=>{const i=$R(r);return gv.set(t,i),i}),yv.set(t,n)),n}function Fe(t,e,n){const r=t[e];return r==null?n:Array.isArray(r)&&r.length>0&&typeof r[0]=="object"?r[0].v??n:r}function bv(t){return Math.max(0,Fe(t,"blurriness",0))}const Gf={name:"gaussian-blur",build(t){return new W.BlurFilter({strength:bv(t)})},apply(t,e){t.strength=bv(e)}};function xv(t){const e=Fe(t,"distance",4),n=Fe(t,"direction",135),r=Fe(t,"softness",4),i=Fe(t,"opacity",.5),o=NL(Fe(t,"color","#000000")),s=(n-90)*Math.PI/180;return{offset:{x:e*Math.cos(s),y:e*Math.sin(s)},blur:r,color:o,alpha:i}}function NL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():0}const jf={name:"drop-shadow",build(t){return new Zn.DropShadowFilter(xv(t))},apply(t,e){const n=t,r=xv(e);n.offset=r.offset,n.blur=r.blur,n.color=r.color,n.alpha=r.alpha}};function vv(t){const e=Fe(t,"radius",10),n=Fe(t,"intensity",4),r=Fe(t,"inner-intensity",0),i=Fe(t,"opacity",1),o=kL(Fe(t,"color","#ffffff"));return{distance:e,outerStrength:n,innerStrength:r,color:o,alpha:i}}function kL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():16777215}const Hf={name:"glow",build(t){return new Zn.GlowFilter(vv(t))},apply(t,e){const n=t,r=vv(e);n.distance=r.distance,n.outerStrength=r.outerStrength,n.innerStrength=r.innerStrength,n.color=r.color,n.alpha=r.alpha}};function Tv(t){return{hue:Fe(t,"master-hue",0),saturation:Fe(t,"master-saturation",0)/100,lightness:Fe(t,"master-lightness",0)/100,colorize:!!Fe(t,"colorize",!1),alpha:1}}const Yf={name:"hue-saturation",build(t){return new Zn.HslAdjustmentFilter(Tv(t))},apply(t,e){const n=t,r=Tv(e);n.hue=r.hue,n.saturation=r.saturation,n.lightness=r.lightness,n.colorize=r.colorize}};function DL(t){const e=Fe(t,"input-black",0)/255,n=Fe(t,"input-white",255)/255,r=Fe(t,"output-black",0)/255,i=Fe(t,"output-white",255)/255,o=Math.max(1e-6,n-e),a=(i-r)/o;return{brightness:r-e*a,contrast:a}}const Xf={name:"levels",build(t){const e=new W.ColorMatrixFilter;return Ev(e,t),e},apply(t,e){Ev(t,e)}};function Ev(t,e){const{brightness:n,contrast:r}=DL(e);t.reset(),t.brightness(n,!1),t.contrast(r,!0)}function FL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():16777215}function Sv(t,e){const n=FL(Fe(e,"white-tint","#ffffff")),r=Math.max(0,Math.min(1,Fe(e,"amount-to-tint",100)/100));t.reset(),t.tint(n,!0),r<1&&(t.alpha=r)}const Wf={name:"tint",build(t){const e=new W.ColorMatrixFilter;return Sv(e,t),e},apply(t,e){Sv(t,e)}};function wv(t){const e=Fe(t,"brightness",0),n=Fe(t,"contrast",0);return{brightness:1+e/100,contrast:1+n/100}}const zf={name:"brightness-contrast",build(t){return new Zn.AdjustmentFilter(wv(t))},apply(t,e){const n=t,r=wv(e);n.brightness=r.brightness,n.contrast=r.contrast}};function Av(t){return Math.max(0,Fe(t,"blur-radius",0))}const qf={name:"fast-box-blur",build(t){return new Zn.KawaseBlurFilter({strength:Av(t),quality:3})},apply(t,e){t.strength=Av(e)}},Vf=new Map([[Gf.name,Gf],[jf.name,jf],[Hf.name,Hf],[Yf.name,Yf],[Xf.name,Xf],[Wf.name,Wf],[zf.name,zf],[qf.name,qf]]),Ov=new Set;function Kf(t){const e=Vf.get(t);return!e&&!Ov.has(t)&&(Ov.add(t),console.warn(`AEP: no handler for effect '${t}' — pass-through (no filter).`)),e}function BL(t){Vf.set(t.name,t)}function UL(){return Array.from(Vf.keys())}function Cv(t){return I.useMemo(()=>{if(!("effects"in t)||!t.effects?.length)return[];const e=[];for(const n of t.effects){if(n.enabled===!1)continue;const r=Kf(n.name);r&&e.push(r.build(n.params))}return e},[t])}function Rv(t,e){const r=_t().currentFrame;return I.useEffect(()=>{if(!("effects"in t)||!t.effects?.length)return;const i=t.effects;let o=0;for(const s of i){if(s.enabled===!1)continue;const a=e[o];if(o++,!a)continue;const l=Kf(s.name);if(!l)continue;const c={};for(const[u,f]of Object.entries(s.params))c[u]=jL(f,r);l.apply(a,c)}},[t,e,r]),null}function GL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function jL(t,e){if(!GL(t))return t;const n=t[0].v;return typeof n=="number"?ye(t,0,e):typeof n=="string"?xt(t,"#000000",e):Array.isArray(n)&&n.length===2&&typeof n[0]=="number"?sn(t,[0,0],e):n}function HL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e}function Zf(t,e,n,r,i){const o=E.timeline({paused:!0});if(t===void 0)return{timeline:o,hasAnimation:!1};if(!HL(t))return r[i]=t,o.set(r,{[i]:t},0),{timeline:o,hasAnimation:!1};const s=t,a=l=>(l-n)/e;o.set(r,{[i]:s[0].v},a(s[0].t));for(let l=0;l<s.length-1;l++){const c=s[l],u=s[l+1],f=a(c.t),d=a(u.t)-f;if(c.hold){o.set(r,{[i]:u.v},a(u.t));continue}o.to(r,{[i]:u.v,duration:d,ease:Bn(c.easeOut)},f)}return{timeline:o,hasAnimation:!0}}function YL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const l={v:0},{timeline:c,hasAnimation:u}=Zf(t,e,n,l,"v");if(!u){s.current(l.v);return}c.eventCallback("onUpdate",()=>{s.current(l.v)}),s.current(l.v);const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(c,f);const h=a.time()-f;c.seek(Math.max(0,Math.min(c.duration(),h)),!1)});return()=>{a.remove(c),c.kill(),d.revert()}},[t,e,n,o])}function XL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=fv(t,e,n);if(!c){s.current(_i(u));return}l.eventCallback("onUpdate",()=>{s.current(_i(u))}),s.current(_i(u));const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function WL(t){if(!t||!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e&&typeof e.v?.vertices<"u"}function Iv(t,e,n,r){const i=E.timeline({paused:!0});if(!t)return{timeline:i,hasAnimation:!1,initial:{vertices:[],inTangents:[],outTangents:[],closed:!1}};if(!WL(t)){const l=Xn(t);return{timeline:i,hasAnimation:!1,initial:l}}const o=t,s=l=>(l-n)/e,a=Xn(o[0].v);i.call(()=>r(Xn(o[0].v)),[],s(o[0].t));for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){i.call(()=>r(Xn(u.v)),[],s(u.t));continue}const h={t:0};i.to(h,{t:1,duration:d,ease:Bn(c.easeOut),onUpdate:()=>{r(Ff(c.v,u.v,h.t))}},f)}return{timeline:i,hasAnimation:!0,initial:a}}function zL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,initial:u}=Iv(t,e,n,h=>s.current(h));if(s.current(u),!c)return;const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function qL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&Array.isArray(e.v)}function Mv(t,e,n){const r=E.timeline({paused:!0}),i={x:0,y:0};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!qL(t)){const[a,l]=t;return i.x=a,i.y=l,{timeline:r,hasAnimation:!1,target:i}}const o=t,s=a=>(a-n)/e;i.x=o[0].v[0],i.y=o[0].v[1],r.set(i,{x:o[0].v[0],y:o[0].v[1]},s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u;if(l.hold){r.set(i,{x:c.v[0],y:c.v[1]},s(c.t));continue}r.to(i,{x:c.v[0],y:c.v[1],duration:f,ease:Bn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function VL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=Mv(t,e,n);if(!c){s.current(u.x,u.y);return}l.eventCallback("onUpdate",()=>{s.current(u.x,u.y)}),s.current(u.x,u.y);const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function KL(t,e,n,r){return Zf(t,e,n,r,"level")}const Lv=I.createContext(void 0),$f=({value:t,children:e})=>M.jsx(Lv.Provider,{value:t,children:e});function zn(){return I.useContext(Lv)}function Jf(t,e){if(!(!t&&!e))return{...t??{},...e??{}}}const Pv=I.createContext(void 0),Nv=({value:t,children:e})=>M.jsx(Pv.Provider,{value:t,children:e});function bi(t){return I.useContext(Pv)?.[t]}function ZL(t,e,n){return n?.[t]??e}function It(t,e){return t===void 0?e:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:t}function Qf(t,e){switch(t){case"square":return e>=0&&e<=1?1:0;case"ramp-up":return an(e);case"ramp-down":return an(1-e);case"triangle":return an(1-Math.abs(2*e-1));case"round":return Math.sin(Math.PI*an(e));case"smooth":{const n=an(e);return n*n*(3-2*n)}}}const an=t=>t<0?0:t>1?1:t;function ed(t,e,n){if(n===0)return[];const r=an(It(t.start,0)),i=an(It(t.end,1)),o=It(t.offset,0),s=t.shape??"ramp-up",a=Math.min(r,i),c=Math.max(r,i)-a,u=new Array(n);for(let f=0;f<n;f++){const d=(f+.5)/n+o;let h;c<=0?h=d===a?1:0:h=(d-a)/c;const m=h>=0&&h<=1?Qf(s,h):0;u[f]=m*e}return u}function $L(t,e,n){if(n.length===0)return[];const r=t.basedOn??"chars";if(r==="chars")return ed(t,e,n.length);const i=g=>r==="words"?g.wordIndex:g.lineIndex,o=new Map;for(const g of n){const y=i(g);o.has(y)||o.set(y,o.size)}const s=o.size;if(s===0)return new Array(n.length).fill(0);const a=an(It(t.start,0)),l=an(It(t.end,1)),c=It(t.offset,0),u=t.shape??"ramp-up",f=Math.min(a,l),h=Math.max(a,l)-f,p=new Array(s);for(let g=0;g<s;g++){const y=(g+.5)/s+c;let b;h<=0?b=y===f?1:0:b=(y-f)/h;const x=b>=0&&b<=1;p[g]=(x?Qf(u,b):0)*e}const m=new Array(n.length);for(let g=0;g<n.length;g++){const y=o.get(i(n[g]))??0;m[g]=p[y]}return m}function Ho(t,e,n){const r=typeof e=="number"?e:e.length,i=Array.from({length:r},()=>({position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null}));if(r===0)return i;for(let o=0;o<t.length;o++){const s=t[o],a=n&&n[o]!==void 0?n[o]:It(s.amount,1),l=typeof e=="number"?ed(s.range,a,r):$L(s.range,a,e),c=It(s.positionOffset,[0,0]),u=It(s.scaleOffset,[0,0]),f=It(s.rotationOffset,0),d=It(s.opacityOffset,0);for(let h=0;h<r;h++){const p=l[h];p!==0&&(i[h].position[0]+=c[0]*p,i[h].position[1]+=c[1]*p,i[h].scale[0]+=u[0]*p,i[h].scale[1]+=u[1]*p,i[h].rotation+=f*p,i[h].opacity+=d*p,s.fillOffset&&(i[h].fillMix={color:s.fillOffset,amount:p}))}}return i}function kv(t,e,n,r="#ffffff"){const i=t.style.fill,o=i==null?void 0:xt(Yn(i,e),r,n),s=t.style.runs,a=s==null||s.length===0?[]:s.map(l=>l.fill===void 0?void 0:xt(l.fill,r,n));return{layerHex:o,runHexes:a}}const JL=500;class QL{constructor(e=64){this.capacity=e}capacity;map=new Map;hits=0;misses=0;get(e,n){const r=this.map.get(e);if(r)return this.hits++,this.map.delete(e),this.map.set(e,r),r;this.misses++;const i=n();if(this.map.size>=this.capacity){const o=this.map.keys().next().value;o!==void 0&&this.map.delete(o)}return this.map.set(e,i),i}get hitRate(){const e=this.hits+this.misses;return e===0?0:this.hits/e}}function eP(t,e,n=""){return[t.runIndex,t.ascent|0,e,n].join("|")}function tP(t,e,n){if(n<=0)return t;if(n>=1)return e;const r=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16),s=parseInt(e.slice(1,3),16),a=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16),c=Math.round(r+(s-r)*n),u=Math.round(i+(a-i)*n),f=Math.round(o+(l-o)*n);return`#${c.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`}const td=I.memo(({layer:t,animators:e,x:n,y:r,maxGlyphs:i=JL})=>{const s=Jt()?.currentFrame??0,a=zn(),l=oi(),c=bi(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=jo(u,s,{boxWidth:t.style.boxWidth,theme:a}),d=e??t.animators??[],h=I.useMemo(()=>d.map(v=>ye(v.amount,1,s)),[d,s]),p=I.useMemo(()=>Ho(d,f.glyphs,h),[d,f.glyphs.length,h]);I.useEffect(()=>{f.glyphs.length>i&&console.warn(`PixiTextSplit: ${f.glyphs.length} glyphs exceeds ${i} cap. Animator perf will degrade.`)},[f.glyphs.length,i]);const m=I.useRef(null);m.current===null&&(m.current=new QL);const g=m.current,{layerHex:y,runHexes:b}=I.useMemo(()=>kv(t,a,s),[t,a,s]),x=f.glyphs.slice(0,i).map((v,T)=>{const w=p[T]??p[0]??{position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null};if(v.isWhitespace)return null;const C=b[v.runIndex]??y??"#ffffff",R=w.fillMix?tP(C,w.fillMix.color,w.fillMix.amount):C,A=t.style.runs?.[v.runIndex],L=A?.font??t.style.font,N=A?.size!=null?typeof A.size=="number"?A.size:A.size[0]?.v??24:typeof t.style.size=="number"?t.style.size:t.style.size[0]?.v??24,D=Gu(A?.weight??t.style.weight),F=A?.italic??t.style.italic,G=`${L}|${N}|${D??""}|${F?1:0}|${l}`,z=g.get(eP(v,R,G),()=>new W.TextStyle({fontFamily:L,fontSize:N,fill:R,fontWeight:D,fontStyle:F?"italic":"normal"})),K=1+w.opacity,ae=Math.max(0,Math.min(1,K));return M.jsx("pixiText",{text:v.char,style:z,x:v.x+w.position[0],y:v.y+w.position[1],scale:{x:1+w.scale[0],y:1+w.scale[1]},rotation:w.rotation*Math.PI/180,alpha:ae},v.charIndex)});return M.jsx("pixiContainer",{x:n,y:r,children:x})});td.displayName="PixiTextSplit";const xi={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function Dv({containerRef:t,segments:e,mode:n,disabled:r=!1,itemStartSec:i=0,itemEndSec:o,currentTime:s}){const{playerTimeRef:a}=S.useContext(Ye),l=typeof s=="number"&&Number.isFinite(s),[c,u]=S.useState(xi),f=S.useRef(xi),d=S.useMemo(()=>jx(e,i,o),[e,i,o]),h=S.useMemo(()=>l&&!r&&e.length?If(e,Mf(s,d,i),n):xi,[l,r,e,s,d,i,n]);return S.useEffect(()=>{const p=t.current;if(l||!p)return;if(f.current=xi,r||!e.length){u(xi),p.onRender=void 0;return}const m=Yx(n);return p.onRender=()=>{const g=a?.current??0,y=If(e,Mf(g,d,i),n),b=f.current;y.segment===b.segment&&y.wordIndex===b.wordIndex&&(!m||y.elapsedMs===b.elapsedMs&&y.remainingMs===b.remainingMs)||(f.current=y,u(y))},()=>{p.onRender=void 0}},[t,l,r,e,n,d,i,a]),l?h:c}const Fv=()=>new W.BlurFilter({strengthX:0,strengthY:0,quality:2}),nd=t=>()=>{try{t.destroy()}catch{}};function Bv(t,e,n){const r=oi(),{fontFamily:i,fontWeight:o,fontSize:s,fill:a,align:l,wordWrapWidth:c,padding:u,stroke:f,strokeWidth:d,dropShadow:h,dropShadowColor:p,dropShadowBlur:m,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b,highlightColor:x}=t,v=S.useMemo(()=>new W.TextStyle(Hu({fontFamily:i,fontSize:s,fontWeight:o,fill:a,align:l,padding:u||10,wordWrapWidth:c||500,stroke:f,strokeWidth:f!=null&&d>0?d:0,dropShadow:h,dropShadowColor:p,dropShadowBlur:m,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b})),[r,i,s,o,a,l,c,u,f,d,h,p,m,g,y,b]),T=S.useMemo(()=>{const L=v.clone();switch(e){case"glow":L.fill=x||a||"#00FFFF",L.dropShadow={color:x||"#00FFFF",alpha:.9,angle:0,blur:12,distance:0};break;case"vhs":L.fill="#FFFFFF",L.dropShadow=void 0;break;case"boxed":L.fill=x||a||"#FFD700",L.dropShadow=void 0;break;default:L.fill=x||a||"#FFD700"}return L},[v,a,x,e]),w=S.useMemo(()=>{const L=v.clone();return L.fill=a||"#FFFFFF",L.dropShadow=e==="glow"?{color:a||"#FFFFFF",alpha:.3,angle:0,blur:3,distance:0}:void 0,L},[v,a,e]),O=S.useMemo(()=>{const L={};if(e!=="springpop")return L;for(const N of n)for(const D of N.words??[]){const F=D.color;if(F&&!L[F]){const G=v.clone();G.fill=F,L[F]=G}}return L},[n,e,v]),C=S.useMemo(()=>{if(e!=="vhs")return null;const L=N=>{const D=v.clone();return D.fill=N,D.dropShadow=void 0,D.stroke=void 0,D};return{cyan:L("#00FFFF"),magenta:L("#FF00FF")}},[v,e]),R=S.useMemo(Fv,[]),P=S.useMemo(Fv,[]),A=S.useMemo(()=>{const L=s*(e==="springpop"?gx:ox),N=new W.BlurFilter({strength:L,quality:4});return N.padding=L*6,N},[s,e]);return S.useEffect(()=>nd(R),[R]),S.useEffect(()=>nd(P),[P]),S.useEffect(()=>nd(A),[A]),{base:v,active:T,inactive:w,colour:O,vhs:C,glowPopBlur:R,springPopBlur:P,bloomBlur:A}}function Uv(t,e){const n=S.useMemo(()=>{if(!e)return[];const o=t.flatMap(s=>(s.words??[]).map(a=>wf(a)));return[...new Set(o.filter(s=>!!s))]},[t,e]),[r,i]=S.useState({});return S.useEffect(()=>{let o=!1;for(const s of n)W.Assets.load(s).then(a=>{o||i(l=>l[s]?l:{...l,[s]:a})}).catch(a=>{console.warn("[PixiCaptionsTrack] emoji load failed",s,a)});return()=>{o=!0}},[n]),r}const nP=Array.from({length:ax},(t,e)=>`bloom-${e}`),Gv=(t,e)=>xr(t.text??"",e),jv=t=>{const{segments:e,uniqueId:n,transformation:r={},style:i,visible:o=!0,disabled:s=!1,startAt:a=0,endAt:l,currentTime:c,onContainerRefReady:u,onClick:f,mouseOverSpriteRef:d}=t,{x:h=0,y:p=0,fontFamily:m="Arial",fontWeight:g="bold",fontSize:y=48,fill:b="#FFFFFF",stroke:x="#000000",strokeWidth:v=2,dropShadow:T=!0,dropShadowColor:w="#000000",dropShadowBlur:O=4,dropShadowAlpha:C=.8,dropShadowAngle:R=Math.PI/4,dropShadowDistance:P=3,wordWrapWidth:A=1536,align:L="center",padding:N=10,highlightColor:D="#FFD700",wordSpacing:F,captionStyleId:G=null,captionBgColor:z="transparent",textTransform:K="none",captionActiveWordBg:ae="#FFE45E"}=r,pe=G??i??"default",X=S.useMemo(()=>Qb(pe),[pe]),he=S.useRef(null),j=Dv({containerRef:he,segments:e,mode:X,disabled:s,itemStartSec:a,itemEndSec:l,currentTime:c}),{segment:$,wordIndex:H,elapsedMs:ce,remainingMs:Z}=j,se=Bv({fontFamily:m,fontWeight:g,fontSize:y,fill:b,align:L,wordWrapWidth:A,padding:N,stroke:x,strokeWidth:v,dropShadow:T,dropShadowColor:w,dropShadowBlur:O,dropShadowAlpha:C,dropShadowAngle:R,dropShadowDistance:P,highlightColor:D},X,e),J=Uv(e,X==="glowpop");S.useEffect(()=>{he.current&&u&&u(n,he)},[n,u]);const{words:ie,offset:xe}=S.useMemo(()=>Xx(X,$?.words??[],H),[X,$?.words,H]),Y=S.useMemo(()=>{if(!ie.length||X==="none")return null;const Se=W.CanvasTextMetrics.measureText(" ",se.base,void 0,!1),De=ie.map(Ie=>{const Ge=W.CanvasTextMetrics.measureText(Gv(Ie,K),se.base);return{width:Ge.width,height:Ge.height}});return Jb(De,{spaceWidth:Se.width,fontSize:y,maxLineWidth:A||1536,wordSpacing:_f(F,y),activeScale:No(X)})},[ie,se.base,A,X,y,F,K]),Oe=$?.text??"",ge=o&&!!$&&!!Oe,re=X!=="none"&&!!$?.words?.length&&!!Y,we=S.useMemo(()=>{if(Y)return{width:Y.totalWidth+40,height:Y.totalHeight+20};if(!Oe)return{width:200,height:60};try{const Se=W.CanvasTextMetrics.measureText(xr(Oe,K),se.base);return{width:Se.width+40,height:Se.height+20}}catch{return{width:200,height:60}}},[Y,Oe,se.base,K]),me=S.useCallback(Se=>{Se.clear(),ge&&Se.rect(-we.width/2,-we.height/2,we.width,we.height).fill({color:16777215,alpha:.001})},[we,ge]),Ue=S.useCallback(Se=>{if(Se.clear(),!ge||X!=="boxed")return;const De=Y?Y.totalWidth:we.width-40,Ie=Y?Y.totalHeight:we.height-20,Ge=Kx(De,Ie,z,pe);Se.roundRect(Ge.x,Ge.y,Ge.width,Ge.height,Ge.radius).fill({color:Ge.color,alpha:Ge.alpha})},[ge,X,Y,we,z,pe]),qe=S.useCallback(Se=>{if(Se.clear(),!ge||X!=="wordbox"||!Y||H<xe)return;const De=Y.positions[H-xe];if(!De)return;const Ie=$x(De,Y.totalWidth,Y.totalHeight,ce,y);Se.roundRect(Ie.x,Ie.y,Ie.width,Ie.height,Ie.radius).fill({color:ae,alpha:1})},[ge,X,Y,H,xe,ce,y,ae]),pt=S.useCallback(Se=>f?.(n,Se),[f,n]),Mt=S.useCallback(()=>{d&&(d.current=!0)},[d]),ve=S.useCallback(()=>{d&&(d.current=!1)},[d]);S.useEffect(()=>()=>{d&&(d.current=!1)},[d]);const Me=Y?-Y.totalWidth/2:0,ct=Y?-Y.totalHeight/2:0,ze=(Se,De)=>X==="springpop"&&De.color&&se.colour[De.color]?se.colour[De.color]:Se==="active"?se.active:Se==="inactive"?se.inactive:se.base;return M.jsxs("pixiContainer",{ref:he,label:n,x:h,y:p,children:[M.jsx("pixiGraphics",{draw:me,eventMode:ge?"static":"none",cursor:"pointer",onPointerTap:pt,onPointerOver:Mt,onPointerOut:ve}),M.jsx("pixiGraphics",{draw:Ue,eventMode:"none"}),M.jsx("pixiGraphics",{draw:qe,eventMode:"none"}),ge&&re&&Y&&$&&ie.map((Se,De)=>{const Ie=Y.positions[De];if(!Ie)return null;const Ge=De+xe===H,je=Hx(X,Ge,ce,Z,y),Le=Me+Ie.x+Ie.width/2,lt=ct+Ie.y+Ie.height/2+je.dy,Ve=ze(je.styleKind,Se),ot=Gv(Se,K),Lt=je.blurX>Lf?(se.glowPopBlur.strengthX=je.blurX,[se.glowPopBlur]):je.blurY>Lf?(se.springPopBlur.strengthY=je.blurY,[se.springPopBlur]):void 0,Pt=X==="glowpop"?wf(Se):null,Ri=Pt?J[Pt]:void 0,Ii=je.glowPop;return M.jsxs(I.Fragment,{children:[X==="vhs"&&Ge&&se.vhs&&M.jsxs(M.Fragment,{children:[M.jsx("pixiText",{text:ot,style:se.vhs.cyan,x:Le+2,y:lt,anchor:.5,alpha:.7,eventMode:"none"}),M.jsx("pixiText",{text:ot,style:se.vhs.magenta,x:Le-2,y:lt,anchor:.5,alpha:.7,eventMode:"none"})]}),(X==="glowpop"||X==="springpop")&&nP.map(rs=>M.jsx("pixiText",{text:ot,style:X==="springpop"?Ve:se.base,x:Le,y:lt,anchor:.5,alpha:je.alpha*(X==="springpop"?yx:sx),scale:je.scale,filters:[se.bloomBlur],eventMode:"none"},rs)),X==="springpop"&&je.split!==void 0&&[[vx,-.5],[Tx,.5]].map(([rs,rD])=>M.jsx("pixiText",{text:ot,style:Ve,tint:rs,x:Le,y:lt+rD*je.split,anchor:.5,alpha:je.alpha*Ex,scale:je.scale,filters:Lt,eventMode:"none"},rs)),M.jsx("pixiText",{text:ot,style:Ve,x:Le,y:lt,anchor:.5,alpha:je.alpha,scale:je.scale,filters:Lt,eventMode:"none"}),Ri&&Ii&&M.jsxs(M.Fragment,{children:[M.jsx("pixiSprite",{texture:Ri,x:Le,y:lt-y*vf,anchor:.5,alpha:Ii.alpha*cx,scale:Ii.emojiScale*y*xf*1.1/(Ri.width||1),filters:[se.bloomBlur],eventMode:"none"}),M.jsx("pixiSprite",{texture:Ri,x:Le,y:lt-y*vf,anchor:.5,alpha:Ii.alpha,scale:Ii.emojiScale*y*xf/(Ri.width||1),eventMode:"none"})]})]},`${$.id}-word-${De}`)}),ge&&!re&&M.jsxs(M.Fragment,{children:[X==="vhs"&&se.vhs&&M.jsxs(M.Fragment,{children:[M.jsx("pixiText",{text:xr(Oe,K),style:se.vhs.cyan,x:2,y:0,anchor:.5,alpha:.7,eventMode:"none"}),M.jsx("pixiText",{text:xr(Oe,K),style:se.vhs.magenta,x:-2,y:0,anchor:.5,alpha:.7,eventMode:"none"})]}),M.jsx("pixiText",{text:xr(Oe,K),style:X!=="none"?se.active:se.base,x:0,y:0,anchor:.5,eventMode:"none"})]})]})};jv.displayName="PixiCaptionsTrack";const rP=I.memo(jv,(t,e)=>tt(t,e));var rd,Hv;function iP(){if(Hv)return rd;Hv=1;var t=St(),e=function(){return t.Date.now()};return rd=e,rd}var id,Yv;function oP(){if(Yv)return id;Yv=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return id=e,id}var od,Xv;function sP(){if(Xv)return od;Xv=1;var t=oP(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return od=n,od}var sd,Wv;function aP(){if(Wv)return sd;Wv=1;var t=sP(),e=Pn(),n=co(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var f=o.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):i.test(c)?r:+c}return sd=l,sd}var ad,zv;function cP(){if(zv)return ad;zv=1;var t=Pn(),e=iP(),n=aP(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,c){var u,f,d,h,p,m,g=0,y=!1,b=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,t(c)&&(y=!!c.leading,b="maxWait"in c,d=b?i(n(c.maxWait)||0,l):d,x="trailing"in c?!!c.trailing:x);function v(N){var D=u,F=f;return u=f=void 0,g=N,h=a.apply(F,D),h}function T(N){return g=N,p=setTimeout(C,l),y?v(N):h}function w(N){var D=N-m,F=N-g,G=l-D;return b?o(G,d-F):G}function O(N){var D=N-m,F=N-g;return m===void 0||D>=l||D<0||b&&F>=d}function C(){var N=e();if(O(N))return R(N);p=setTimeout(C,w(N))}function R(N){return p=void 0,x&&u?v(N):(u=f=void 0,h)}function P(){p!==void 0&&clearTimeout(p),g=0,u=m=f=p=void 0}function A(){return p===void 0?h:R(e())}function L(){var N=e(),D=O(N);if(u=arguments,f=this,m=N,D){if(p===void 0)return T(m);if(b)return clearTimeout(p),p=setTimeout(C,l),v(m)}return p===void 0&&(p=setTimeout(C,l)),h}return L.cancel=P,L.flush=A,L}return ad=s,ad}var lP=cP();const cd=Jn(lP),Yo=(t,e,n,r)=>{const i=S.useCallback(cd(t,r),[t,r]),o=S.useCallback(cd(e,r),[e,r]),s=S.useCallback(cd(n,r),[n,r]),a=S.useCallback(()=>{i()},[i]),l=S.useCallback(()=>{o()},[o]),c=S.useCallback(()=>{s()},[s]);return{onPointerOver:a,onPointerDown:l,onPointerOut:c}},uP=new Set(["mp4","m4v","webm","ogg","ogv"]);function fP(t){const e=t.split("?")[0].split("#")[0],n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()}function qv({src:t,uniqueId:e,frameStartAt:n,fps:r=0,isRemotion:i=!1}){const[o,s]=S.useState(!1),[a,l]=S.useState(null),[c,u]=S.useState(null),[f,d]=S.useState(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(!1),g=S.useRef(!1),y=S.useMemo(()=>t||"",[t]),b=S.useRef(n);return b.current=n,S.useEffect(()=>{if(m.current=!1,l(null),s(!1),u(null),d(null),!y){s(!0);return}const x=b.current===0?.001:b.current;let v=!1;const T=5e3;let w=null;const O=()=>{w&&(clearTimeout(w),w=null)},C=(P,A)=>{const L=()=>{if(!m.current)try{P.update?.()}catch{}};A.addEventListener("seeked",L,{once:!0}),A.addEventListener("loadeddata",L,{once:!0}),L(),A.readyState>=HTMLMediaElement.HAVE_METADATA&&A.play().then(()=>{if(!m.current){try{A.pause(),A.currentTime=x}catch{}L()}}).catch(()=>{L()})},R=(P,A)=>{P.autoUpdate=!1,A.muted=!0,A.loop=!1,A.playsInline=!0,A.id=e;try{A.pause()}catch{}try{A.currentTime=x}catch{}p.current=A,d(A),C(P,A)};if(uP.has(fP(y))){g.current=!1,rv(y),v=!0;let P=!1;w=setTimeout(()=>{m.current||(P=!0,console.warn("[useVideoTexture] Assets.load timed out",y),l(new Error(`Video load timed out: ${y}`)))},T),W.Assets.load({src:y,data:{autoPlay:!1,autoUpdate:!1,muted:!0,loop:!1,playsinline:!0,crossorigin:"anonymous"}}).then(A=>{if(O(),m.current||P||!A)return;const L=A.source,N=L.resource;N&&R(L,N),h.current=A,u(A),s(!0)}).catch(A=>{O(),!(m.current||P)&&(console.error("[useVideoTexture] Assets.load failed",y,A),l(A))})}else{g.current=!0;let P=!1;w=setTimeout(()=>{m.current||(P=!0,console.warn("[useVideoTexture] direct video load timed out",y),l(new Error(`Video load timed out: ${y}`)))},T);const A=document.createElement("video");A.crossOrigin="anonymous",A.preload="auto",A.src=y;const L=()=>{if(m.current||P)return;O(),D();let F;try{F=new W.VideoSource({resource:A,autoPlay:!1,autoLoad:!1,crossorigin:"anonymous",alphaMode:"no-premultiply-alpha"})}catch(z){l(z);return}const G=new W.Texture({source:F});h.current=G,u(G),R(F,A),s(!0)},N=()=>{m.current||P||(O(),D(),console.error("[useVideoTexture] direct video load failed",y,A.error),l(new Error(A.error?.message||`Browser could not decode video: ${y}`)))},D=()=>{A.removeEventListener("loadeddata",L),A.removeEventListener("error",N)};A.addEventListener("loadeddata",L,{once:!0}),A.addEventListener("error",N,{once:!0}),A.load()}return()=>{if(m.current=!0,O(),p.current){try{p.current.pause()}catch{}p.current=null}if(v&&iv(y),h.current){try{g.current&&h.current.destroy(!0)}catch{}h.current=null}u(null),d(null)}},[y,e]),{texture:c,videoElement:f,isLoaded:o,error:a}}function Vv({getVideo:t,ready:e,muted:n,playbackRate:r}){const i=S.useRef({isPlaying:!1,progress:0,isMuted:!1,isWaiting:!1,isStalled:!1});return S.useEffect(()=>{const o=t();if(!o)return;const s=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},a=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},l=()=>{i.current.isWaiting=!0,i.current.isStalled=!1},c=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},u=()=>{i.current.isWaiting=!1,i.current.isStalled=!0};return o.addEventListener("loadedmetadata",s),o.addEventListener("ended",a),o.addEventListener("loadstart",l),o.addEventListener("canplaythrough",c),o.addEventListener("stalled",u),()=>{o.removeEventListener("loadedmetadata",s),o.removeEventListener("ended",a),o.removeEventListener("loadstart",l),o.removeEventListener("canplaythrough",c),o.removeEventListener("stalled",u)}},[t,e]),S.useEffect(()=>{const o=t();o&&(o.muted=n,i.current.isMuted=n)},[t,n,e]),S.useEffect(()=>{const o=t();o&&(o.playbackRate=r||1)},[t,r,e]),i}function Kv({textureRef:t,stateRef:e,ready:n,start:r,end:i,frameStartAt:o,uniqueId:s}){const a=S.useRef(null),{tl:l}=S.useContext(Ye),c=S.useCallback(()=>t.current?.source?.resource,[t]),u=S.useCallback(()=>t.current?.source,[t]);return $e(ke.RESUME,()=>{e.current.isPlaying=!0;const f=c();f&&a.current?.isActive()&&f.play().catch(()=>{})},[c,e]),$e(ke.PAUSE,()=>{e.current.isPlaying=!1;try{c()?.pause()}catch{}},[c,e]),S.useEffect(()=>{if(!l?.current||!n||!t.current)return;a.current&&(a.current.kill(),a.current=null);const f=()=>{const g=c();if(g){try{g.currentTime=Number(o),u()?.update?.()}catch{}e.current.progress=0,(e.current.isPlaying||l?.current?.isActive())&&g.play().catch(()=>{})}},d=()=>{const g=c(),y=u(),b=a.current;if(!g||!y||!b)return;e.current.progress=b.progress();let x=o+b.time();const v=g.duration;Number.isFinite(v)&&v>0&&(x=Math.min(x,v-.05)),x<0&&(x=0);try{const T=g.paused?.01:.25;Math.abs(g.currentTime-x)>T&&(g.currentTime=x),y.update?.()}catch{}},h=()=>{const g=c();if(g)try{g.pause()}catch{}e.current.isPlaying=!1,a.current&&(e.current.progress=a.current.progress())},p=Number(i)-Number(r);if(p<=0||!l.current)return;const m=E.context(()=>{a.current=E.to({progress:0},{duration:p,onStart:f,onUpdate:d,onComplete:h}),l.current.add(a.current,r);const g=Math.max(l.current.time(),.01);l.current.time(g,!1)});return()=>{a.current&&(a.current.kill(),E.killTweensOf(a.current),a.current=null),m.revert()}},[l,n,r,i,o,s,t,e]),a}const dP=({ref:t,...e})=>{const{uniqueId:n,mute:r=!1,volume:i=1,speed:o=1,src:s,startAt:a,endAt:l,frameStartAt:c,visible:u,disabled:f,transformation:{x:d,y:h,width:p,height:m,colorCorrection:g={},blendMode:y,border:b,roundedCorners:x,maskShape:v,effect:T,anchor:w=.5},pointerdown:O=()=>{},pointerout:C=()=>{},pointerover:R=()=>{},fps:P=0}=e,{isRemotion:A}=S.useContext(Ye),L=S.useRef(null),N=S.useRef(null),{onPointerDown:D,onPointerOut:F,onPointerOver:G}=Yo(R,O,C,1),z=ut({colorCorrection:g,effects:{name:T}}),K=s||"",{texture:ae,videoElement:pe,isLoaded:X,error:he}=qv({src:K,uniqueId:n,frameStartAt:c,fps:P,isRemotion:A});S.useEffect(()=>{N.current=ae},[ae]);const j=S.useCallback(()=>pe??void 0,[pe]),$=Vv({getVideo:j,ready:X,muted:r,playbackRate:o}),H=Math.max(0,Math.min(1,Number(i)||0));S.useEffect(()=>{const Z=j();Z&&(Z.volume=H)},[j,H,X]),Kv({textureRef:N,stateRef:$,ready:X,start:a,end:l,frameStartAt:c,uniqueId:n}),S.useEffect(()=>{if(n){if(!K){Bo(n);return}return ev(n),(X||he)&&Bo(n),()=>tv(n)}},[n,K,X,he]);const ce=S.useCallback(()=>{const Z=j();Z&&(Z.pause(),$.current.isPlaying=!1)},[j,$]);return $e(ke.PAUSE,ce,[ce]),$e(ke.SCRUBBER_CLICKED,ce,[ce]),$e(ke.REVERSE_MODE_END,ce,[ce]),M.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:D,pointerover:G,pointerout:F,children:X&&ae&&M.jsx(Ot,{x:d,y:h,width:p,height:m,border:b,roundedCorners:x,maskShape:v,spriteRef:L,children:M.jsx("pixiSprite",{label:`sprite-${n}`,texture:ae,width:p,height:m,anchor:w,x:d,y:h,ref:L,alpha:u?1:0,...y!=null&&{blendMode:y},...!f&&u&&{interactive:!0,pointerdown:O},filters:z})})})},ld=I.memo(dP,tt);ld.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const hP=({ref:t,...e})=>{const[n,r]=I.useState(),i=S.useRef(null),o=S.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h,blendMode:p},pointerdown:m=()=>{},pointerout:g=()=>{},pointerover:y=()=>{},canvasImageRef:b}=e,x=b&&b?.getCanvas(),{onPointerDown:v,onPointerOut:T,onPointerOver:w}=Yo(y,m,g,1),O=ut({colorCorrection:d,effects:{name:h},blendMode:p});return at.useTick(()=>{if(i.current&&i.current.texture){const C=i.current.texture.source;C&&typeof C.update=="function"&&C.update()}}),I.useEffect(()=>{if(!ya(x)){const C=Array.isArray(x)?x[0]:x,R=W.Texture.from(C);r(R)}},[x]),M.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:v,pointerover:w,pointerout:T,children:M.jsx("pixiContainer",{ref:o,children:n&&M.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:m},filters:O})})})},pP=({isPlaying:t,forwardRef:e,...n})=>{const r=I.useRef(null);return I.useImperativeHandle(e,()=>r.current,[r]),I.useEffect(()=>{if(r.current===null)return;const i=r.current;i[t?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[t]),M.jsx("pixiAnimatedSprite",{ref:r,...n})},mP=I.memo(pP,tt),Zv=S.createContext(null),ud=()=>S.useContext(Zv),$v=({children:t,startAt:e=0,endAt:n=0,uniqueId:r,hideOnExit:i,hideOnEntry:o,hideStart:s,hideEnd:a,zIndex:l=0,entranceOverlapSec:c=0,transitionIn:u,transitionOut:f,onSequenceContainerReady:d})=>{const h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),[y,b]=S.useState("static"),x=ud(),{tl:v,totalDuration:T=0,playerTimeRef:w,registerTimeUpdateListener:O,unregisterTimeUpdateListener:C}=S.useContext(Ye);S.useLayoutEffect(()=>{if(!v?.current||!h.current)return;const D=v.current,F=h.current,G=Number.isFinite(e)?Number(e):0,z=Number.isFinite(n)?Number(n):G,K=Number.isFinite(c)&&c>0?Math.min(c,Math.max(z-G,0)):0,ae=Math.max(G-K,0),pe=Number.isFinite(T)?Number(T):0,X=pe>0?Math.max(ae,Math.min(z,pe)):Math.max(ae,z),he=Math.max(X-ae,0),j=(i||o)&&s!==void 0&&a!==void 0;let $=null,H=null,ce=!1;j&&($=Math.max(ae,Math.min(X,s)),H=Math.max(ae,Math.min(X,a)),ce=$<H),g.current&&(g.current.kill(),D.remove(g.current),g.current=null);const Z=typeof w?.current=="number"?w.current:0,se=Z>=ae-.001&&Z<=X+.001?1:0;if(g.current=E.timeline(),g.current.set(F,{alpha:se}),ce){const ie=$-ae,xe=H-ae;if(xe<=0)g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:he,ease:"none"});else{ie>0?(g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:ie,ease:"none"})):g.current.set(F,{alpha:0},0),g.current.to(F,{alpha:0,duration:xe-ie,ease:"none"});const Y=he-xe;Y>0?(g.current.set(F,{alpha:1},xe),g.current.to(F,{alpha:1,duration:Y,ease:"none"})):g.current.set(F,{alpha:1},xe)}}else g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:he,ease:"none"});g.current.set(F,{alpha:0}),D.add(g.current,ae);const J=D.time();return D.time(J,!1),()=>{g.current&&(D.remove(g.current),g.current.progress(0).kill(),g.current=null),F&&(F.alpha=0)}},[e,n,T,r,i,o,s,a,c,v,w]),S.useEffect(()=>{if(!O||!C)return;const D=Number.isFinite(e)?Number(e):0,F=Number.isFinite(n)?Number(n):D,G=K=>{const pe=K>=D-1&&K<=F+1?"static":"none";b(X=>X===pe?X:(h.current&&(h.current.eventMode=pe),pe))};O(G);const z=w?.current;return typeof z=="number"&&G(z),()=>C(G)},[e,n,r,w,O,C]),S.useEffect(()=>{if(!(!d||!h.current))return d(h.current),()=>d(null)},[d]);const R=x?.registerSequence;S.useEffect(()=>{if(!(!r||!h.current||!R))return R({id:r,startAt:e,endAt:n,zIndex:l,container:h.current,transitionIn:u,transitionOut:f},r),()=>R(null,r)},[r,e,n,l,u,f,R]);const P=Number.isFinite(c)&&c>0?c:0,A=typeof w?.current=="number"?w.current:0,L=A>=e-P-.001&&A<=n+.001?1:0;return M.jsx("pixiContainer",{ref:h,alpha:L,eventMode:"static",zIndex:l,children:M.jsx("pixiContainer",{ref:m,children:M.jsx("pixiContainer",{ref:p,alpha:1,children:t})})})},gP=t=>{const{startAt:e,endAt:n}=t,{setTotalDuration:r}=S.useContext(Ye);return I.useEffect(()=>{r&&r(Number(n)+.2)},[e,n]),t.children};let Jv=!1;const yP=()=>{Jv||(Jv=!0,console.warn("[reacthub-pixitweenjs] GL transitions need the WebGL renderer; skipping transition."))},_P=90,fd=({transitionPair:t,width:e,height:n,clock:r,resolveEndpoints:i,getLayerSets:o,hideEndpointsInWindow:s=!1,getRegion:a,fullCanvas:l=!1,maxRegionPixels:c=mf})=>{const{app:u}=at.useApplication(),f=S.useRef(null),d=S.useRef(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),y=S.useRef(null),b=S.useRef(null),x=S.useRef(null),v=S.useRef(null),[T,w]=S.useState(!1),O=t?.config,C=O?.name||O?.type,R=r?.start??t?.timing.start??0,P=r?.end??t?.timing.end??R,A=r?.duration??t?.timing.duration??P-R,L=JSON.stringify(O?.params??{}),N=S.useMemo(()=>{if(!C)return null;const F=Ib(C,{width:e,height:n,params:O?.params??{}});return F.setProgress(0),F},[C,L,e,n]);S.useEffect(()=>{p.current=N},[N]);const D=()=>{const F=x.current;if(F){for(const G of F)G.container.visible=G.visible;x.current=null}};return S.useEffect(()=>{if(!N||!t)return;let F=!1,G;const z=()=>{const K=f.current;if(F||!K||!u?.renderer)return!1;if(!BM(u.renderer))return yP(),!0;const ae=h.current;ae&&(ae.parent?.removeChild(ae),ae.destroy({children:!0}),h.current=null),m.current&&m.current!==N&&(m.current.clearTextures(),m.current.destroy()),d.current||(d.current=HM());const pe=new B.Mesh({geometry:d.current,shader:N.shader});return pe.width=e,pe.height=n,pe.position.set(e/2,n/2),pe.visible=!1,K.addChild(pe),h.current=pe,m.current=N,(!y.current||!b.current)&&(y.current?.destroy(!0),b.current?.destroy(!0),y.current=B.RenderTexture.create({width:e,height:n}),b.current=B.RenderTexture.create({width:e,height:n})),w(!0),!0};return z()||(G=setTimeout(()=>{G=void 0,z()},150)),()=>{F=!0,G!==void 0&&clearTimeout(G)}},[N,t,u,e,n]),S.useEffect(()=>()=>{D(),v.current=null,p.current?.clearTextures(),m.current?.clearTextures(),y.current?.destroy(!0),b.current?.destroy(!0),y.current=null,b.current=null;const F=h.current;F&&(F.parent?.removeChild(F),F.destroy({children:!0}),h.current=null);const G=m.current;G&&(G.destroy(),m.current=null),p.current&&p.current!==G&&p.current.destroy(),p.current=null,d.current?.destroy(),d.current=null,g.current?.destroy({children:!0}),g.current=null},[t?.pairId]),S.useEffect(()=>{if(!T||!r)return;const F=X=>{const he=p.current,j=h.current,$=u?.renderer;if(!he||!j||!$)return;const H=i();if(!(X>=R&&X<P)||!H.from||!H.to||!y.current||!b.current){j.visible=!1,D(),v.current=null;return}const{fromLayers:Z,toLayers:se}=o(X,H);if(!v.current){const Y=l?null:a?.(H)??Pb([Lb(H.from),Lb(H.to)]);v.current=Y&&Y.width>1&&Y.height>1?{x:Y.x,y:Y.y,width:Math.ceil(Y.width),height:Math.ceil(Y.height)}:{x:0,y:0,width:e,height:n}}const J=v.current,ie=UM(J,c);for(const Y of[y.current,b.current])(Y.width!==J.width||Y.height!==J.height||Y.source.resolution!==ie)&&Y.source.resize(J.width,J.height,ie);Mb($,g,Z,y.current,-J.x,-J.y),Mb($,g,se,b.current,-J.x,-J.y),j.width=J.width,j.height=J.height,j.position.set(J.x+J.width/2,J.y+J.height/2),he.setTextures(y.current,b.current);const xe=Math.max(0,Math.min(1,(X-R)/A));he.setProgress(r.ease?r.ease(xe):xe),j.visible=!0,s&&!x.current&&(x.current=[H.from,H.to].map(Y=>({container:Y,visible:Y.visible})),H.from.visible=!1,H.to.visible=!1)};let G=null,z=0;const K=X=>{G=X,z=_P,F(X)},ae=()=>{G===null||z<=0||(z-=1,F(G))};u?.ticker?.add(ae);const pe=r.subscribe(K);return()=>{u?.ticker?.remove(ae),pe()}},[T,r,R,P,A,i,o,a,s,l,c,u,e,n]),f},Qv=t=>!!t&&Number.isFinite(t.duration)&&t.duration>0&&!!t.name,e1=t=>{const e=[...t].sort((i,o)=>i.startAt-o.startAt||i.endAt-o.endAt||i.id.localeCompare(o.id)),n=[];for(const i of e){const o=e.filter(a=>a.id!==i.id&&a.endAt<=i.startAt).sort((a,l)=>l.endAt-a.endAt||l.startAt-a.startAt)[0],s=e.filter(a=>a.id!==i.id&&a.startAt>=i.endAt).sort((a,l)=>a.startAt-l.startAt||a.endAt-l.endAt)[0];if(Qv(i.transitionIn)&&(o||i.transitionIn.from)){const a=i.transitionIn;n.push({id:`${i.id}:transition-in`,from:a.from??o.id,to:a.to??i.id,name:a.name,startAt:i.startAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}if(Qv(i.transitionOut)&&(s||i.transitionOut.to)){const a=i.transitionOut;n.push({id:`${i.id}:transition-out`,from:a.from??i.id,to:a.to??s.id,name:a.name,startAt:i.endAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}}const r=new Map;for(const i of n){const o=[i.from,i.to,i.startAt,i.duration,i.name].join(":");r.has(o)||r.set(o,i)}return[...r.values()]},bP=({children:t})=>{const[e]=S.useState(()=>new Map),[n]=S.useState(()=>new Map),[r,i]=S.useState(0),o=S.useCallback((l,c)=>{const u=n.get(c);u&&u.container!==l?.container&&e.delete(c),l?(n.set(c,l),e.set(c,l.container)):n.delete(c),i(f=>f+1)},[e,n]),s=S.useMemo(()=>({containers:e,sequences:n,revision:r,registerSequence:o}),[e,n,r,o]),a=S.useMemo(()=>e1(n.values()),[n,r]);return M.jsxs(Zv.Provider,{value:s,children:[t,a.map(l=>M.jsx(Xo,{name:l.name,startAt:l.startAt,duration:l.duration,ease:l.ease,params:l.params,from:l.from,to:l.to,zIndex:l.zIndex},l.id))]})},xP=(t,e,n="none")=>{const r=S.useContext(Ye),{playerTimeRef:i,registerTimeUpdateListener:o,unregisterTimeUpdateListener:s}=r,a=S.useCallback(l=>{const c=f=>l(f);o?.(c);const u=i?.current;return typeof u=="number"&&c(u),()=>s?.(c)},[i,o,s]);return S.useMemo(()=>({subscribe:a,start:t,end:t+e,duration:e,ease:E.parseEase(n)??E.parseEase("none")}),[a,t,e,n])},t1=(t,e)=>typeof t=="string"?e.get(t)??null:typeof t=="function"?t():t&&"current"in t?t.current:t,vP=(t,e)=>{const r=ud()?.containers;return S.useCallback(()=>{const i=r??new Map;return{from:t1(t,i),to:t1(e,i)}},[t,e,r])},TP=[],EP=({name:t,startAt:e,duration:n,ease:r="none",params:i,from:o,to:s,region:a,width:l=1920,height:c=1080,scope:u,zIndex:f=1,fromGroup:d,toGroup:h,sharedLayers:p=TP})=>{const g=ud()?.containers,y=xP(e,n,r),b=vP(o,s),x=S.useMemo(()=>({pairId:`${u}:${typeof o=="string"?o:"from"}:${typeof s=="string"?s:"to"}:${e}:${t}`,config:{type:t,name:t,duration:n,ease:r,params:i??{}},timing:{start:e,end:e+n,duration:n}}),[u,o,s,e,t,n,r,i]),v=S.useCallback((O,C)=>{const R=d??(typeof o=="string"?[o]:[]),P=h??(typeof s=="string"?[s]:[]),A=L=>[...new Set(L)].flatMap((D,F)=>{const G=g?.get(D);return G?[{container:G,zIndex:F}]:[]});if(u==="scene"){const L=A(R),N=A(P),D=A(p);return{fromLayers:[...L,...D],toLayers:[...N,...D]}}return{fromLayers:C.from?[{container:C.from,zIndex:0}]:[],toLayers:C.to?[{container:C.to,zIndex:0}]:[]}},[g,u,o,s,d,h,p]),T=S.useCallback(()=>a??null,[a]),w=fd({transitionPair:x,width:l,height:c,clock:y,resolveEndpoints:b,getLayerSets:v,hideEndpointsInWindow:u==="element",getRegion:a?T:void 0,fullCanvas:u==="scene"});return M.jsx("pixiContainer",{ref:w,zIndex:f,sortableChildren:!0})},dd=S.memo(EP);dd.displayName="TransitionMeshLayer";const SP=t=>M.jsx(dd,{...t,scope:"element"}),Xo=S.memo(SP);Xo.displayName="PixiElementTransition";const wP=t=>M.jsx(dd,{...t,scope:"scene"}),hd=S.memo(wP);hd.displayName="PixiSceneTransition";const AP=t=>t.scope==="element"?M.jsx(Xo,{...t}):M.jsx(hd,{...t}),n1=S.memo(AP);n1.displayName="PixiGlTransition";const OP=({ref:t,...e})=>{const[n,r]=I.useState(),i=S.useRef(null),o=S.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h},pointerdown:p=()=>{},pointerout:m=()=>{},pointerover:g=()=>{},canvasImageRef:y}=e,b=y&&y?.getCanvas(),{app:x}=at.useApplication(),{onPointerDown:v,onPointerOut:T,onPointerOver:w}=Yo(g,p,m,1),O=ut({colorCorrection:d,effects:{name:h}});return at.useTick(()=>{if(i.current&&i.current.texture){const C=i.current.texture.source;C&&typeof C.update=="function"&&C.update(),o.current&&x&&x.renderer.render(o.current)}}),I.useEffect(()=>{if(!ya(b)){const C=Array.isArray(b)?b[0]:b,R=W.Texture.from(C);r(R)}},[b]),M.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:v,pointerover:w,pointerout:T,children:M.jsx("pixiContainer",{ref:o,children:n&&M.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:p},filters:O})})})},CP=I.memo(OP,tt),RP=({ref:t,...e})=>{const n=S.useRef(null),r=S.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c,height:u,colorCorrection:f={},effect:d,border:h,roundedCorners:p,maskShape:m}=o,g=ut({colorCorrection:f,effects:{name:d}});return at.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const b=W.Texture.from(y);r.current=b,n.current&&(n.current.texture=b)}}n.current?.texture&&n.current.texture.source?.update?.()}),M.jsx(Je,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:h,roundedCorners:p,maskShape:m,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r.current||W.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},IP=I.memo(RP,tt),MP=({ref:t,...e})=>{const n=S.useRef(null),r=S.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c=100,height:u=100,colorCorrection:f={},effect:d,border:h,roundedCorners:p,maskShape:m}=o,g=ut({colorCorrection:f,effects:{name:d}});return at.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const b=W.Texture.from(y);r.current=b,n.current&&(n.current.texture=b)}}n.current?.texture&&n.current.texture.source?.update?.()}),M.jsx(Je,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:h,roundedCorners:p,maskShape:m,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r.current||W.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},LP=I.memo(MP,tt),PP=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),{src:s,visible:a=!0,transformation:l,loop:c=!0,remotionFrame:u,fps:f=30}=e,{x:d,y:h,width:p=0,height:m=0,colorCorrection:g={},effect:y,border:b,roundedCorners:x,maskShape:v}=l,T=ut({colorCorrection:g,effects:{name:y}});S.useEffect(()=>{let O=!1;return W.Assets.load(s).then(C=>{O||r(C)}).catch(C=>{console.error("[PixiRemotionGifSprite] load failed",s,C)}),()=>{O=!0}},[s]),S.useEffect(()=>{const O=o.current;if(!O||u==null)return;const C=O.totalFrames;if(!C)return;const R=u/f,P=O.duration??0;if(P>0){const A=R*1e3%(c?P:P+1),L=Math.min(1,A/P);O.currentFrame=Math.min(C-1,Math.floor(L*C))}else{const A=Math.floor(R*f)%(c?C:C+1);O.currentFrame=Math.min(C-1,A)}},[u,f,c]);const w=u!=null;return M.jsx(Je,{...e,ref:t,isGif:!0,children:M.jsx("pixiContainer",{ref:i,children:n&&M.jsx(Ot,{x:d,y:h,width:p,height:m,border:b,roundedCorners:x,maskShape:v,spriteRef:o,children:M.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!w,autoUpdate:!w,loop:c,width:p,height:m,anchor:.5,x:d,y:h,alpha:a?1:0,filters:T})})})})},NP=I.memo(PP,tt),kP={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0},DP=({ref:t,...e})=>{const[n,r]=I.useState(0),[i,o]=I.useState(!1),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(void 0),u=S.useRef(void 0),f=S.useRef(kP),d=I.useRef(void 0),h=S.useRef(document.body),{uniqueId:p,src:m,startAt:g,endAt:y,frameStartAt:b,frameEndAt:x,visible:v,disabled:T,loop:w=!1,transformation:{x:O,y:C,width:R,height:P,colorCorrection:A={},effect:L,anchor:N=.5},pointerdown:D=()=>{},pointerout:F=()=>{},pointerover:G=()=>{}}=e,{tl:z}=S.useContext(Ye);$e(ke.PAUSE,()=>{c.current&&c.current.pause()});const{onPointerDown:K,onPointerOut:ae,onPointerOver:pe}=Yo(G,D,F,1),X=ut({colorCorrection:A,effects:{name:L}});I.useLayoutEffect(()=>{l.current=document.createElement("canvas"),l.current.setAttribute("id","lottieContainersvg"),l.current.setAttribute("id",`${p}lottieContainer`),l.current.setAttribute("width",`${R}`),l.current.setAttribute("height",`${P}`);const j=h.current;return j.appendChild(l.current),()=>{l.current&&j.removeChild(l.current)}},[]),I.useEffect(()=>{async function j(){c.current&&c.current.destroy(),l.current.removeAttribute("style"),c.current=tE.loadAnimation({container:l.current||document.getElementById("lottieroot"),renderer:"canvas",loop:!1,autoplay:!1,path:m,rendererSettings:{context:l.current.getContext("2d"),clearCanvas:!0,progressiveLoad:!1,preserveAspectRatio:"xMaxYMax meet"}}),c.current.addEventListener("data_ready",()=>{if(l.current&&l.current.setAttribute("style","display:none"),c.current&&c.current.renderer.canvasContext){const $=c.current.totalFrames;f.current.totalFrames=$;const H=c.current.getDuration();f.current.totalDuration=H;const ce=c.current.renderer.canvasContext.canvas,Z=W.Texture.from(ce);d.current=Z,o(!0),r(H)}}),c.current.addEventListener("loaded_images",()=>{}),c.current.addEventListener("complete",()=>{}),c.current.addEventListener("loopComplete",()=>{}),c.current.addEventListener("enterFrame",()=>{}),c.current.addEventListener("config_ready",()=>{console.log("config_ready",c.current)}),c.current.addEventListener("error",$=>{console.log("error",$)})}return j(),()=>{c.current&&(c.current.removeEventListener("complete"),c.current.removeEventListener("config_ready"),c.current.removeEventListener("enterFrame"),c.current.removeEventListener("loaded_images"),c.current.removeEventListener("loopComplete"),c.current.removeEventListener("data_ready"),c.current.removeEventListener("error"),c.current.destroy())}},[m,p]),I.useEffect(()=>(d.current&&d.current.source?.update?.(),()=>{}),[i]);const he=j=>{if(c.current&&s.current&&u.current){const H=j(u.current.time())/u.current.duration()*f.current.totalFrames,ce=f.current.totalFrames;let Z=H;Z=Math.round(Math.floor(Z)),Z>=ce?(c.current.goToAndStop(0,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!1):(c.current.goToAndStop(Z,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!0)}};return I.useEffect(()=>{let j=E.context(()=>{});if(a.current&&z.current&&n>0){const $=Number(y)-Number(g);u.current&&(u.current.kill(),z.current.remove(u.current)),j=E.context(()=>{const H=E.utils.wrap(g,n);u.current=E.timeline({}).to(a.current,{duration:Number($),onUpdate:he,onUpdateParams:[H,b,x]},b),z.current.add(u.current,g)})}return()=>{u.current&&(u.current.kill(),E.killTweensOf(u.current)),j.revert()}},[g,y,b,x,p,n,w]),M.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:K,pointerover:pe,pointerout:ae,children:M.jsx("pixiContainer",{ref:a,children:d.current&&M.jsx("pixiSprite",{texture:d.current,width:R,height:P,anchor:N,x:O,y:C,ref:s,alpha:v?1:0,...!T&&v&&{interactive:!0,pointerdown:D},filters:X})})})},pd=I.memo(DP,tt);pd.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiLottieSprite"};class Wo{currentID;dirtyID;_x;_y;_width;_height;_hull;constructor(e=0,n=0,r=0,i=0){this._x=Number(e),this._y=Number(n),this._width=Number(r),this._height=Number(i),this._hull=[new B.Point,new B.Point,new B.Point,new B.Point],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(e){this._x=e,this.dirtyID++}get y(){return this._y}set y(e){this._y=e,this.dirtyID++}get width(){return this._width}set width(e){this._width=e,this.dirtyID++}get height(){return this._height}set height(e){this._height=e,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[e,n,r,i]=this._hull;e.set(this._x,this._y),n.set(this._x+this._width,this._y),r.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new Wo(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}equals(e){return e?e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height:!1}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}}const r1=new B.Point;class zo{innerBounds;currentID;dirtyID;_rotation;_center;_hull;_matrix;constructor(e=0,n=0,r=0,i=0,o=0){e instanceof Wo&&(o=n||0,n=e.y,r=e.width,i=e.height,e=e.x),this.innerBounds=new Wo(e,n,r,i),this._rotation=o,this._center=new B.ObservablePoint({_onUpdate:()=>this.updateCenter()},0,0),this._hull=[new B.Point,new B.Point,new B.Point,new B.Point],this._matrix=new B.Matrix,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(e){this.center.copyFrom(e)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(e){return e?this.innerBounds.equals(e.innerBounds)&&this.rotation===e.rotation:!1}contains(e,n){typeof e=="number"&&(e=r1.set(e,n));const r=this._matrix.applyInverse(e,r1);return this.innerBounds.contains(r.x,r.y)}copyFrom(e){return this.innerBounds.copyFrom(e.innerBounds),this.rotation=e.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const e=this.innerBounds,n=this._rotation,r=this._center,[i,o,s,a]=this._hull,l=this._matrix;r._x=e.x+e.width/2,r._y=e.y+e.height/2,l.identity().translate(-r.x,-r.y).rotate(n).translate(r.x,r.y),l.apply(e.topLeft,i),l.apply(e.topRight,o),l.apply(e.bottomRight,s),l.apply(e.bottomLeft,a),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const e=this.center,n=this.innerBounds;n.x=e.x-n.width/2,n.y=e.y-n.height/2}}class i1{_history;_decayRatio;_currentIndex;_average=0;constructor(e,n){this._history=new Array(e),this._decayRatio=n,this._currentIndex=0;for(let r=0;r<e;r++)this._history[r]=0}next(e){const{_history:n,_decayRatio:r}=this,i=n.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,n[this._currentIndex]=e;let o=0,s=0;for(let a=this._currentIndex+1;a<i;a++)o=(o+n[a])*r,s=(s+1)*r;for(let a=0;a<=this._currentIndex;a++)o=(o+n[a])*r,s=(s+1)*r;return this._average=o/s,this._average}absDev(){let e=0;for(let n=0,r=this._history.length;n<r;n++)e+=Math.abs(this._history[n]-this._average);return e/this._history.length}}class o1{_freeList;_freeCount;_reserveCount;_borrowRate;_returnRate;_flowRate;_borrowRateAverage;_marginAverage;_capacityRatio;_decayRatio;_borrowRateAverageProvider;_marginAverageProvider;constructor(e={}){this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=e.reserve||0,this._capacityRatio=e.capacityRatio||1.2,this._decayRatio=e.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new i1(128,this._decayRatio),this._marginAverageProvider=new i1(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(e){this._freeList.length=Math.ceil(e)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(e){let n,r;Array.isArray(e)?(n=e,r=e.length):(r=e,n=new Array(r)),this._borrowRate+=r,this._flowRate+=r;let i=0;if(this._freeCount>0){const o=this._freeList,s=Math.min(this._freeCount,r);let a=this._freeCount;for(let l=0;l<s;l++)n[i]=o[a-1],++i,--a;this._freeCount=a}for(;i<r;)n[i]=this.create(),++i;return n}release(e){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=e,++this._freeCount}releaseArray(e){this._returnRate+=e.length,this._flowRate-=e.length,this._freeCount+e.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+e.length));for(let n=0,r=e.length;n<r;n++)this._freeList[this._freeCount]=e[n],++this._freeCount}reserve(e){if(this._reserveCount=e,this._freeCount<e){const n=this._freeCount-e;for(let r=0;r<n;r++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(e){if(this._freeCount>e){this.capacity>e*this._capacityRatio&&(this.capacity=e*this._capacityRatio);const r=Math.min(this._freeCount,this.capacity);for(let i=e;i<r;i++)this._freeList[i]=null}}startGC(e=B.Ticker.shared){e.add(this._gcTick,null,B.UPDATE_PRIORITY.UTILITY)}stopGC(e=B.Ticker.shared){e.remove(this._gcTick)}_gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const e=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const n=this._freeCount,r=this._freeList.length;if(n<128&&this._borrowRateAverage<128&&r<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+e){const o=i+e;this.capacity=Math.min(this._freeList.length,Math.ceil(o)),this._freeCount=this._freeList.length}}}const s1=new Map;class a1{static build(e){let n=s1.get(e);return n||(n=new class extends o1{create(){return new e}},s1.set(e,n),n)}static buildFunctional(e){return new class extends o1{create=e}}}const c1={color:16777215,outlineColor:6514417,outlineThickness:2.5,radius:7,shape:"circle",glowColor:6514417,glowIntensity:.15};function l1(t,e,n){const r=Math.max(1,n/28),i=Math.round(24*r);return`data:image/svg+xml;base64,${btoa(`
|
|
1513
|
+
`).trim(),n.length>e&&(n=n.slice(0,e).trimEnd()),n};function Ff(t,e,n){if(n<=0)return Xn(t);if(n>=1)return Xn(e);const r=Math.min(t.vertices.length,e.vertices.length,t.inTangents.length,e.inTangents.length,t.outTangents.length,e.outTangents.length),i=new Array(r),o=new Array(r),s=new Array(r);for(let a=0;a<r;a++)i[a]=Bf(t.vertices[a],e.vertices[a],n),o[a]=Bf(t.inTangents[a],e.inTangents[a],n),s[a]=Bf(t.outTangents[a],e.outTangents[a],n);return{vertices:i,inTangents:o,outTangents:s,closed:n<.5?t.closed:e.closed}}function Bf(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Xn(t){return{vertices:t.vertices.map(e=>[e[0],e[1]]),inTangents:t.inTangents.map(e=>[e[0],e[1]]),outTangents:t.outTangents.map(e=>[e[0],e[1]]),closed:t.closed}}function Wn(t){let e=t.replace(/^#/,"");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const n=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,i=parseInt(e.substring(4,6),16)/255,o=e.length===8?parseInt(e.substring(6,8),16)/255:1;return{r:n,g:r,b:i,a:o}}function _i(t){const e=r=>Math.max(0,Math.min(255,Math.round(r*255))).toString(16).padStart(2,"0"),n=`#${e(t.r)}${e(t.g)}${e(t.b)}`;return t.a<1?`${n}${e(t.a)}`:n}function RL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&typeof e.v=="string"}function fv(t,e,n){const r=E.timeline({paused:!0}),i={r:0,g:0,b:0,a:1};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!RL(t))return Object.assign(i,Wn(t)),{timeline:r,hasAnimation:!1,target:i};const o=t,s=a=>(a-n)/e;Object.assign(i,Wn(o[0].v)),r.set(i,Wn(o[0].v),s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u,d=Wn(c.v);if(l.hold){r.set(i,d,s(c.t));continue}r.to(i,{r:d.r,g:d.g,b:d.b,a:d.a,duration:f,ease:Bn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function IL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function dv(t,e){if(e<=0)return 0;if(e>=1)return 1;const[n,r,i,o]=t;let s=e;for(let l=0;l<8;l++){const c=1-s,u=3*c*c*s*n+3*c*s*s*i+s*s*s,f=3*c*c*n+6*c*s*(i-n)+3*s*s*(1-i);if(Math.abs(f)<1e-9)break;s-=(u-e)/f,s<0&&(s=0),s>1&&(s=1)}const a=1-s;return 3*a*a*s*r+3*a*s*s*o+s*s*s}function Tr(t,e,n,r){if(t===void 0)return e;if(!IL(t))return t;const i=t;if(i.length===0)return e;if(n<=i[0].t)return i[0].v;if(n>=i[i.length-1].t)return i[i.length-1].v;for(let o=0;o<i.length-1;o++){const s=i[o],a=i[o+1];if(n>=s.t&&n<=a.t){if(s.hold)return s.v;const l=a.t-s.t,c=l>0?(n-s.t)/l:0,u=s.easeOut?dv(s.easeOut,c):c;return r(s.v,a.v,u)}}return i[i.length-1].v}const hv=(t,e,n)=>t+(e-t)*n,pv=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n],ML=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ge(t,e,n){return Tr(t,e,n,hv)}function sn(t,e,n){return Tr(t,e,n,pv)}function Go(t,e,n){return Tr(t,e,n,ML)}const mv=(t,e,n)=>{const r=Wn(t),i=Wn(e);return _i({r:r.r+(i.r-r.r)*n,g:r.g+(i.g-r.g)*n,b:r.b+(i.b-r.b)*n,a:r.a+(i.a-r.a)*n})};function xt(t,e,n){return Tr(t,e,n,mv)}function Uf(t,e,n){return Tr(t,e,n,Ff)}function LL(t,e){const n=t.source;if(typeof n=="string")return n;if(!Array.isArray(n)||n.length===0)return"";let r=n[0].v;for(const i of n)if(i.t<=e)r=i.v;else break;return r}function PL(t,e,n,r,i,o){return{text:t,font:e.font??n.style.font,size:e.size!=null?ge(e.size,i,r):i,weight:e.weight??n.style.weight,italic:e.italic??n.style.italic,fill:e.fill!=null?xt(e.fill,o,r):o,tracking:e.tracking!=null?ge(e.tracking,0,r):void 0,baselineShift:e.baselineShift!=null?ge(e.baselineShift,0,r):void 0}}function jo(t,e,n={}){const r=oi(),i=yf(t),o=LL(t,e),s=ge(t.style.size,24,e),a=t.style.fill?xt(Yn(t.style.fill,n.theme),"#ffffff",e):"#ffffff",l=t.style.tracking?ge(t.style.tracking,0,e):t.style.letterSpacing?ge(t.style.letterSpacing,0,e):void 0,c=t.style.leading?ge(t.style.leading,0,e):t.style.lineHeight?ge(t.style.lineHeight,0,e):void 0,u=t.style.align??"left",f=n.boxWidth,d=n.metrics,h=I.useMemo(()=>{const m=Array.from(o),g=[];for(const y of i){const b=m.slice(y.from,y.to).join("");g.push(PL(b,y,t,e,s,a))}return{runs:g,align:u,tracking:l,leading:c,box:f!=null?{width:f}:void 0,metrics:d}},[t,i,o,s,a,u,l,c,f,d,e]),p=I.useMemo(()=>JSON.stringify({runs:h.runs,align:h.align,tracking:h.tracking,leading:h.leading,box:h.box,fontEpoch:r}),[h,r]);return I.useMemo(()=>x_(h),[p])}const gv=new Map,yv=new Map;function _v(t){if(!t)return;const e=gv.get(t);if(e)return e;let n=yv.get(t);throw n||(n=fetch(t).then(r=>{if(!r.ok)throw new Error(`useTypefaceMetrics: ${t} returned ${r.status}`);return r.json()}).then(r=>{const i=$R(r);return gv.set(t,i),i}),yv.set(t,n)),n}function Fe(t,e,n){const r=t[e];return r==null?n:Array.isArray(r)&&r.length>0&&typeof r[0]=="object"?r[0].v??n:r}function bv(t){return Math.max(0,Fe(t,"blurriness",0))}const Gf={name:"gaussian-blur",build(t){return new W.BlurFilter({strength:bv(t)})},apply(t,e){t.strength=bv(e)}};function xv(t){const e=Fe(t,"distance",4),n=Fe(t,"direction",135),r=Fe(t,"softness",4),i=Fe(t,"opacity",.5),o=NL(Fe(t,"color","#000000")),s=(n-90)*Math.PI/180;return{offset:{x:e*Math.cos(s),y:e*Math.sin(s)},blur:r,color:o,alpha:i}}function NL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():0}const jf={name:"drop-shadow",build(t){return new Zn.DropShadowFilter(xv(t))},apply(t,e){const n=t,r=xv(e);n.offset=r.offset,n.blur=r.blur,n.color=r.color,n.alpha=r.alpha}};function vv(t){const e=Fe(t,"radius",10),n=Fe(t,"intensity",4),r=Fe(t,"inner-intensity",0),i=Fe(t,"opacity",1),o=kL(Fe(t,"color","#ffffff"));return{distance:e,outerStrength:n,innerStrength:r,color:o,alpha:i}}function kL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():16777215}const Hf={name:"glow",build(t){return new Zn.GlowFilter(vv(t))},apply(t,e){const n=t,r=vv(e);n.distance=r.distance,n.outerStrength=r.outerStrength,n.innerStrength=r.innerStrength,n.color=r.color,n.alpha=r.alpha}};function Tv(t){return{hue:Fe(t,"master-hue",0),saturation:Fe(t,"master-saturation",0)/100,lightness:Fe(t,"master-lightness",0)/100,colorize:!!Fe(t,"colorize",!1),alpha:1}}const Yf={name:"hue-saturation",build(t){return new Zn.HslAdjustmentFilter(Tv(t))},apply(t,e){const n=t,r=Tv(e);n.hue=r.hue,n.saturation=r.saturation,n.lightness=r.lightness,n.colorize=r.colorize}};function DL(t){const e=Fe(t,"input-black",0)/255,n=Fe(t,"input-white",255)/255,r=Fe(t,"output-black",0)/255,i=Fe(t,"output-white",255)/255,o=Math.max(1e-6,n-e),a=(i-r)/o;return{brightness:r-e*a,contrast:a}}const Xf={name:"levels",build(t){const e=new W.ColorMatrixFilter;return Ev(e,t),e},apply(t,e){Ev(t,e)}};function Ev(t,e){const{brightness:n,contrast:r}=DL(e);t.reset(),t.brightness(n,!1),t.contrast(r,!0)}function FL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():16777215}function Sv(t,e){const n=FL(Fe(e,"white-tint","#ffffff")),r=Math.max(0,Math.min(1,Fe(e,"amount-to-tint",100)/100));t.reset(),t.tint(n,!0),r<1&&(t.alpha=r)}const Wf={name:"tint",build(t){const e=new W.ColorMatrixFilter;return Sv(e,t),e},apply(t,e){Sv(t,e)}};function wv(t){const e=Fe(t,"brightness",0),n=Fe(t,"contrast",0);return{brightness:1+e/100,contrast:1+n/100}}const zf={name:"brightness-contrast",build(t){return new Zn.AdjustmentFilter(wv(t))},apply(t,e){const n=t,r=wv(e);n.brightness=r.brightness,n.contrast=r.contrast}};function Av(t){return Math.max(0,Fe(t,"blur-radius",0))}const qf={name:"fast-box-blur",build(t){return new Zn.KawaseBlurFilter({strength:Av(t),quality:3})},apply(t,e){t.strength=Av(e)}},Vf=new Map([[Gf.name,Gf],[jf.name,jf],[Hf.name,Hf],[Yf.name,Yf],[Xf.name,Xf],[Wf.name,Wf],[zf.name,zf],[qf.name,qf]]),Ov=new Set;function Kf(t){const e=Vf.get(t);return!e&&!Ov.has(t)&&(Ov.add(t),console.warn(`AEP: no handler for effect '${t}' — pass-through (no filter).`)),e}function BL(t){Vf.set(t.name,t)}function UL(){return Array.from(Vf.keys())}function Cv(t){return I.useMemo(()=>{if(!("effects"in t)||!t.effects?.length)return[];const e=[];for(const n of t.effects){if(n.enabled===!1)continue;const r=Kf(n.name);r&&e.push(r.build(n.params))}return e},[t])}function Rv(t,e){const r=_t().currentFrame;return I.useEffect(()=>{if(!("effects"in t)||!t.effects?.length)return;const i=t.effects;let o=0;for(const s of i){if(s.enabled===!1)continue;const a=e[o];if(o++,!a)continue;const l=Kf(s.name);if(!l)continue;const c={};for(const[u,f]of Object.entries(s.params))c[u]=jL(f,r);l.apply(a,c)}},[t,e,r]),null}function GL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function jL(t,e){if(!GL(t))return t;const n=t[0].v;return typeof n=="number"?ge(t,0,e):typeof n=="string"?xt(t,"#000000",e):Array.isArray(n)&&n.length===2&&typeof n[0]=="number"?sn(t,[0,0],e):n}function HL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e}function Zf(t,e,n,r,i){const o=E.timeline({paused:!0});if(t===void 0)return{timeline:o,hasAnimation:!1};if(!HL(t))return r[i]=t,o.set(r,{[i]:t},0),{timeline:o,hasAnimation:!1};const s=t,a=l=>(l-n)/e;o.set(r,{[i]:s[0].v},a(s[0].t));for(let l=0;l<s.length-1;l++){const c=s[l],u=s[l+1],f=a(c.t),d=a(u.t)-f;if(c.hold){o.set(r,{[i]:u.v},a(u.t));continue}o.to(r,{[i]:u.v,duration:d,ease:Bn(c.easeOut)},f)}return{timeline:o,hasAnimation:!0}}function YL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const l={v:0},{timeline:c,hasAnimation:u}=Zf(t,e,n,l,"v");if(!u){s.current(l.v);return}c.eventCallback("onUpdate",()=>{s.current(l.v)}),s.current(l.v);const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(c,f);const h=a.time()-f;c.seek(Math.max(0,Math.min(c.duration(),h)),!1)});return()=>{a.remove(c),c.kill(),d.revert()}},[t,e,n,o])}function XL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=fv(t,e,n);if(!c){s.current(_i(u));return}l.eventCallback("onUpdate",()=>{s.current(_i(u))}),s.current(_i(u));const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function WL(t){if(!t||!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e&&typeof e.v?.vertices<"u"}function Iv(t,e,n,r){const i=E.timeline({paused:!0});if(!t)return{timeline:i,hasAnimation:!1,initial:{vertices:[],inTangents:[],outTangents:[],closed:!1}};if(!WL(t)){const l=Xn(t);return{timeline:i,hasAnimation:!1,initial:l}}const o=t,s=l=>(l-n)/e,a=Xn(o[0].v);i.call(()=>r(Xn(o[0].v)),[],s(o[0].t));for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){i.call(()=>r(Xn(u.v)),[],s(u.t));continue}const h={t:0};i.to(h,{t:1,duration:d,ease:Bn(c.easeOut),onUpdate:()=>{r(Ff(c.v,u.v,h.t))}},f)}return{timeline:i,hasAnimation:!0,initial:a}}function zL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,initial:u}=Iv(t,e,n,h=>s.current(h));if(s.current(u),!c)return;const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function qL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&Array.isArray(e.v)}function Mv(t,e,n){const r=E.timeline({paused:!0}),i={x:0,y:0};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!qL(t)){const[a,l]=t;return i.x=a,i.y=l,{timeline:r,hasAnimation:!1,target:i}}const o=t,s=a=>(a-n)/e;i.x=o[0].v[0],i.y=o[0].v[1],r.set(i,{x:o[0].v[0],y:o[0].v[1]},s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u;if(l.hold){r.set(i,{x:c.v[0],y:c.v[1]},s(c.t));continue}r.to(i,{x:c.v[0],y:c.v[1],duration:f,ease:Bn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function VL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=Mv(t,e,n);if(!c){s.current(u.x,u.y);return}l.eventCallback("onUpdate",()=>{s.current(u.x,u.y)}),s.current(u.x,u.y);const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function KL(t,e,n,r){return Zf(t,e,n,r,"level")}const Lv=I.createContext(void 0),$f=({value:t,children:e})=>M.jsx(Lv.Provider,{value:t,children:e});function zn(){return I.useContext(Lv)}function Jf(t,e){if(!(!t&&!e))return{...t??{},...e??{}}}const Pv=I.createContext(void 0),Nv=({value:t,children:e})=>M.jsx(Pv.Provider,{value:t,children:e});function bi(t){return I.useContext(Pv)?.[t]}function ZL(t,e,n){return n?.[t]??e}function It(t,e){return t===void 0?e:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:t}function Qf(t,e){switch(t){case"square":return e>=0&&e<=1?1:0;case"ramp-up":return an(e);case"ramp-down":return an(1-e);case"triangle":return an(1-Math.abs(2*e-1));case"round":return Math.sin(Math.PI*an(e));case"smooth":{const n=an(e);return n*n*(3-2*n)}}}const an=t=>t<0?0:t>1?1:t;function ed(t,e,n){if(n===0)return[];const r=an(It(t.start,0)),i=an(It(t.end,1)),o=It(t.offset,0),s=t.shape??"ramp-up",a=Math.min(r,i),c=Math.max(r,i)-a,u=new Array(n);for(let f=0;f<n;f++){const d=(f+.5)/n+o;let h;c<=0?h=d===a?1:0:h=(d-a)/c;const m=h>=0&&h<=1?Qf(s,h):0;u[f]=m*e}return u}function $L(t,e,n){if(n.length===0)return[];const r=t.basedOn??"chars";if(r==="chars")return ed(t,e,n.length);const i=g=>r==="words"?g.wordIndex:g.lineIndex,o=new Map;for(const g of n){const y=i(g);o.has(y)||o.set(y,o.size)}const s=o.size;if(s===0)return new Array(n.length).fill(0);const a=an(It(t.start,0)),l=an(It(t.end,1)),c=It(t.offset,0),u=t.shape??"ramp-up",f=Math.min(a,l),h=Math.max(a,l)-f,p=new Array(s);for(let g=0;g<s;g++){const y=(g+.5)/s+c;let b;h<=0?b=y===f?1:0:b=(y-f)/h;const x=b>=0&&b<=1;p[g]=(x?Qf(u,b):0)*e}const m=new Array(n.length);for(let g=0;g<n.length;g++){const y=o.get(i(n[g]))??0;m[g]=p[y]}return m}function Ho(t,e,n){const r=typeof e=="number"?e:e.length,i=Array.from({length:r},()=>({position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null}));if(r===0)return i;for(let o=0;o<t.length;o++){const s=t[o],a=n&&n[o]!==void 0?n[o]:It(s.amount,1),l=typeof e=="number"?ed(s.range,a,r):$L(s.range,a,e),c=It(s.positionOffset,[0,0]),u=It(s.scaleOffset,[0,0]),f=It(s.rotationOffset,0),d=It(s.opacityOffset,0);for(let h=0;h<r;h++){const p=l[h];p!==0&&(i[h].position[0]+=c[0]*p,i[h].position[1]+=c[1]*p,i[h].scale[0]+=u[0]*p,i[h].scale[1]+=u[1]*p,i[h].rotation+=f*p,i[h].opacity+=d*p,s.fillOffset&&(i[h].fillMix={color:s.fillOffset,amount:p}))}}return i}function kv(t,e,n,r="#ffffff"){const i=t.style.fill,o=i==null?void 0:xt(Yn(i,e),r,n),s=t.style.runs,a=s==null||s.length===0?[]:s.map(l=>l.fill===void 0?void 0:xt(l.fill,r,n));return{layerHex:o,runHexes:a}}const JL=500;class QL{constructor(e=64){this.capacity=e}capacity;map=new Map;hits=0;misses=0;get(e,n){const r=this.map.get(e);if(r)return this.hits++,this.map.delete(e),this.map.set(e,r),r;this.misses++;const i=n();if(this.map.size>=this.capacity){const o=this.map.keys().next().value;o!==void 0&&this.map.delete(o)}return this.map.set(e,i),i}get hitRate(){const e=this.hits+this.misses;return e===0?0:this.hits/e}}function eP(t,e,n=""){return[t.runIndex,t.ascent|0,e,n].join("|")}function tP(t,e,n){if(n<=0)return t;if(n>=1)return e;const r=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16),s=parseInt(e.slice(1,3),16),a=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16),c=Math.round(r+(s-r)*n),u=Math.round(i+(a-i)*n),f=Math.round(o+(l-o)*n);return`#${c.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`}const td=I.memo(({layer:t,animators:e,x:n,y:r,maxGlyphs:i=JL})=>{const s=Jt()?.currentFrame??0,a=zn(),l=oi(),c=bi(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=jo(u,s,{boxWidth:t.style.boxWidth,theme:a}),d=e??t.animators??[],h=I.useMemo(()=>d.map(v=>ge(v.amount,1,s)),[d,s]),p=I.useMemo(()=>Ho(d,f.glyphs,h),[d,f.glyphs.length,h]);I.useEffect(()=>{f.glyphs.length>i&&console.warn(`PixiTextSplit: ${f.glyphs.length} glyphs exceeds ${i} cap. Animator perf will degrade.`)},[f.glyphs.length,i]);const m=I.useRef(null);m.current===null&&(m.current=new QL);const g=m.current,{layerHex:y,runHexes:b}=I.useMemo(()=>kv(t,a,s),[t,a,s]),x=f.glyphs.slice(0,i).map((v,T)=>{const w=p[T]??p[0]??{position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null};if(v.isWhitespace)return null;const C=b[v.runIndex]??y??"#ffffff",R=w.fillMix?tP(C,w.fillMix.color,w.fillMix.amount):C,A=t.style.runs?.[v.runIndex],L=A?.font??t.style.font,N=A?.size!=null?typeof A.size=="number"?A.size:A.size[0]?.v??24:typeof t.style.size=="number"?t.style.size:t.style.size[0]?.v??24,D=Gu(A?.weight??t.style.weight),F=A?.italic??t.style.italic,G=`${L}|${N}|${D??""}|${F?1:0}|${l}`,z=g.get(eP(v,R,G),()=>new W.TextStyle({fontFamily:L,fontSize:N,fill:R,fontWeight:D,fontStyle:F?"italic":"normal"})),K=1+w.opacity,se=Math.max(0,Math.min(1,K));return M.jsx("pixiText",{text:v.char,style:z,x:v.x+w.position[0],y:v.y+w.position[1],scale:{x:1+w.scale[0],y:1+w.scale[1]},rotation:w.rotation*Math.PI/180,alpha:se},v.charIndex)});return M.jsx("pixiContainer",{x:n,y:r,children:x})});td.displayName="PixiTextSplit";const xi={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function Dv({containerRef:t,segments:e,mode:n,disabled:r=!1,itemStartSec:i=0,itemEndSec:o,currentTime:s}){const{playerTimeRef:a}=S.useContext(Ye),l=typeof s=="number"&&Number.isFinite(s),[c,u]=S.useState(xi),f=S.useRef(xi),d=S.useMemo(()=>jx(e,i,o),[e,i,o]),h=S.useMemo(()=>l&&!r&&e.length?If(e,Mf(s,d,i),n):xi,[l,r,e,s,d,i,n]);return S.useEffect(()=>{const p=t.current;if(l||!p)return;if(f.current=xi,r||!e.length){u(xi),p.onRender=void 0;return}const m=Yx(n);return p.onRender=()=>{const g=a?.current??0,y=If(e,Mf(g,d,i),n),b=f.current;y.segment===b.segment&&y.wordIndex===b.wordIndex&&(!m||y.elapsedMs===b.elapsedMs&&y.remainingMs===b.remainingMs)||(f.current=y,u(y))},()=>{p.onRender=void 0}},[t,l,r,e,n,d,i,a]),l?h:c}const Fv=()=>new W.BlurFilter({strengthX:0,strengthY:0,quality:2}),nd=t=>()=>{try{t.destroy()}catch{}};function Bv(t,e,n){const r=oi(),{fontFamily:i,fontWeight:o,fontSize:s,fill:a,align:l,wordWrapWidth:c,padding:u,stroke:f,strokeWidth:d,dropShadow:h,dropShadowColor:p,dropShadowBlur:m,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b,highlightColor:x}=t,v=S.useMemo(()=>new W.TextStyle(Hu({fontFamily:i,fontSize:s,fontWeight:o,fill:a,align:l,padding:u||10,wordWrapWidth:c||500,stroke:f,strokeWidth:f!=null&&d>0?d:0,dropShadow:h,dropShadowColor:p,dropShadowBlur:m,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b})),[r,i,s,o,a,l,c,u,f,d,h,p,m,g,y,b]),T=S.useMemo(()=>{const L=v.clone();switch(e){case"glow":L.fill=x||a||"#00FFFF",L.dropShadow={color:x||"#00FFFF",alpha:.9,angle:0,blur:12,distance:0};break;case"vhs":L.fill="#FFFFFF",L.dropShadow=void 0;break;case"boxed":L.fill=x||a||"#FFD700",L.dropShadow=void 0;break;default:L.fill=x||a||"#FFD700"}return L},[v,a,x,e]),w=S.useMemo(()=>{const L=v.clone();return L.fill=a||"#FFFFFF",L.dropShadow=e==="glow"?{color:a||"#FFFFFF",alpha:.3,angle:0,blur:3,distance:0}:void 0,L},[v,a,e]),O=S.useMemo(()=>{const L={};if(e!=="springpop")return L;for(const N of n)for(const D of N.words??[]){const F=D.color;if(F&&!L[F]){const G=v.clone();G.fill=F,L[F]=G}}return L},[n,e,v]),C=S.useMemo(()=>{if(e!=="vhs")return null;const L=N=>{const D=v.clone();return D.fill=N,D.dropShadow=void 0,D.stroke=void 0,D};return{cyan:L("#00FFFF"),magenta:L("#FF00FF")}},[v,e]),R=S.useMemo(Fv,[]),P=S.useMemo(Fv,[]),A=S.useMemo(()=>{const L=s*(e==="springpop"?gx:ox),N=new W.BlurFilter({strength:L,quality:4});return N.padding=L*6,N},[s,e]);return S.useEffect(()=>nd(R),[R]),S.useEffect(()=>nd(P),[P]),S.useEffect(()=>nd(A),[A]),{base:v,active:T,inactive:w,colour:O,vhs:C,glowPopBlur:R,springPopBlur:P,bloomBlur:A}}function Uv(t,e){const n=S.useMemo(()=>{if(!e)return[];const o=t.flatMap(s=>(s.words??[]).map(a=>wf(a)));return[...new Set(o.filter(s=>!!s))]},[t,e]),[r,i]=S.useState({});return S.useEffect(()=>{let o=!1;for(const s of n)W.Assets.load(s).then(a=>{o||i(l=>l[s]?l:{...l,[s]:a})}).catch(a=>{console.warn("[PixiCaptionsTrack] emoji load failed",s,a)});return()=>{o=!0}},[n]),r}const nP=Array.from({length:ax},(t,e)=>`bloom-${e}`),Gv=(t,e)=>xr(t.text??"",e),jv=t=>{const{segments:e,uniqueId:n,transformation:r={},style:i,visible:o=!0,disabled:s=!1,startAt:a=0,endAt:l,currentTime:c,onContainerRefReady:u,onClick:f,mouseOverSpriteRef:d}=t,{x:h=0,y:p=0,fontFamily:m="Arial",fontWeight:g="bold",fontSize:y=48,fill:b="#FFFFFF",stroke:x="#000000",strokeWidth:v=2,dropShadow:T=!0,dropShadowColor:w="#000000",dropShadowBlur:O=4,dropShadowAlpha:C=.8,dropShadowAngle:R=Math.PI/4,dropShadowDistance:P=3,wordWrapWidth:A=1536,align:L="center",padding:N=10,highlightColor:D="#FFD700",wordSpacing:F,captionStyleId:G=null,captionBgColor:z="transparent",textTransform:K="none",captionActiveWordBg:se="#FFE45E"}=r,pe=G??i??"default",X=S.useMemo(()=>Qb(pe),[pe]),he=S.useRef(null),j=Dv({containerRef:he,segments:e,mode:X,disabled:s,itemStartSec:a,itemEndSec:l,currentTime:c}),{segment:te,wordIndex:H,elapsedMs:ae,remainingMs:Z}=j,ce=Bv({fontFamily:m,fontWeight:g,fontSize:y,fill:b,align:L,wordWrapWidth:A,padding:N,stroke:x,strokeWidth:v,dropShadow:T,dropShadowColor:w,dropShadowBlur:O,dropShadowAlpha:C,dropShadowAngle:R,dropShadowDistance:P,highlightColor:D},X,e),J=Uv(e,X==="glowpop");S.useEffect(()=>{he.current&&u&&u(n,he)},[n,u]);const{words:ie,offset:xe}=S.useMemo(()=>Xx(X,te?.words??[],H),[X,te?.words,H]),Y=S.useMemo(()=>{if(!ie.length||X==="none")return null;const Me=W.CanvasTextMetrics.measureText(" ",ce.base,void 0,!1),Re=ie.map(Se=>{const Ge=W.CanvasTextMetrics.measureText(Gv(Se,K),ce.base);return{width:Ge.width,height:Ge.height}});return Jb(Re,{spaceWidth:Me.width,fontSize:y,maxLineWidth:A||1536,wordSpacing:_f(F,y),activeScale:No(X)})},[ie,ce.base,A,X,y,F,K]),De=te?.text??"",ye=o&&!!te&&!!De,$=X!=="none"&&!!te?.words?.length&&!!Y,we=S.useMemo(()=>{if(Y)return{width:Y.totalWidth+40,height:Y.totalHeight+20};if(!De)return{width:200,height:60};try{const Me=W.CanvasTextMetrics.measureText(xr(De,K),ce.base);return{width:Me.width+40,height:Me.height+20}}catch{return{width:200,height:60}}},[Y,De,ce.base,K]),me=S.useCallback(Me=>{Me.clear(),ye&&Me.rect(-we.width/2,-we.height/2,we.width,we.height).fill({color:16777215,alpha:.001})},[we,ye]),Ue=S.useCallback(Me=>{if(Me.clear(),!ye||X!=="boxed")return;const Re=Y?Y.totalWidth:we.width-40,Se=Y?Y.totalHeight:we.height-20,Ge=Kx(Re,Se,z,pe);Me.roundRect(Ge.x,Ge.y,Ge.width,Ge.height,Ge.radius).fill({color:Ge.color,alpha:Ge.alpha})},[ye,X,Y,we,z,pe]),ze=S.useCallback(Me=>{if(Me.clear(),!ye||X!=="wordbox"||!Y||H<xe)return;const Re=Y.positions[H-xe];if(!Re)return;const Se=$x(Re,Y.totalWidth,Y.totalHeight,ae,y);Me.roundRect(Se.x,Se.y,Se.width,Se.height,Se.radius).fill({color:se,alpha:1})},[ye,X,Y,H,xe,ae,y,se]),ht=S.useCallback(Me=>f?.(n,Me),[f,n]),zt=S.useCallback(()=>{d&&(d.current=!0)},[d]),ve=S.useCallback(()=>{d&&(d.current=!1)},[d]);S.useEffect(()=>()=>{d&&(d.current=!1)},[d]);const Ie=Y?-Y.totalWidth/2:0,ct=Y?-Y.totalHeight/2:0,ut=(Me,Re)=>X==="springpop"&&Re.color&&ce.colour[Re.color]?ce.colour[Re.color]:Me==="active"?ce.active:Me==="inactive"?ce.inactive:ce.base;return M.jsxs("pixiContainer",{ref:he,label:n,x:h,y:p,children:[M.jsx("pixiGraphics",{draw:me,eventMode:ye?"static":"none",cursor:"pointer",onPointerTap:ht,onPointerOver:zt,onPointerOut:ve}),M.jsx("pixiGraphics",{draw:Ue,eventMode:"none"}),M.jsx("pixiGraphics",{draw:ze,eventMode:"none"}),ye&&$&&Y&&te&&ie.map((Me,Re)=>{const Se=Y.positions[Re];if(!Se)return null;const Ge=Re+xe===H,je=Hx(X,Ge,ae,Z,y),qe=Ie+Se.x+Se.width/2,it=ct+Se.y+Se.height/2+je.dy,Le=ut(je.styleKind,Me),ot=Gv(Me,K),Mt=je.blurX>Lf?(ce.glowPopBlur.strengthX=je.blurX,[ce.glowPopBlur]):je.blurY>Lf?(ce.springPopBlur.strengthY=je.blurY,[ce.springPopBlur]):void 0,Lt=X==="glowpop"?wf(Me):null,Ri=Lt?J[Lt]:void 0,Ii=je.glowPop;return M.jsxs(I.Fragment,{children:[X==="vhs"&&Ge&&ce.vhs&&M.jsxs(M.Fragment,{children:[M.jsx("pixiText",{text:ot,style:ce.vhs.cyan,x:qe+2,y:it,anchor:.5,alpha:.7,eventMode:"none"}),M.jsx("pixiText",{text:ot,style:ce.vhs.magenta,x:qe-2,y:it,anchor:.5,alpha:.7,eventMode:"none"})]}),(X==="glowpop"||X==="springpop")&&nP.map(rs=>M.jsx("pixiText",{text:ot,style:X==="springpop"?Le:ce.base,x:qe,y:it,anchor:.5,alpha:je.alpha*(X==="springpop"?yx:sx),scale:je.scale,filters:[ce.bloomBlur],eventMode:"none"},rs)),X==="springpop"&&je.split!==void 0&&[[vx,-.5],[Tx,.5]].map(([rs,rD])=>M.jsx("pixiText",{text:ot,style:Le,tint:rs,x:qe,y:it+rD*je.split,anchor:.5,alpha:je.alpha*Ex,scale:je.scale,filters:Mt,eventMode:"none"},rs)),M.jsx("pixiText",{text:ot,style:Le,x:qe,y:it,anchor:.5,alpha:je.alpha,scale:je.scale,filters:Mt,eventMode:"none"}),Ri&&Ii&&M.jsxs(M.Fragment,{children:[M.jsx("pixiSprite",{texture:Ri,x:qe,y:it-y*vf,anchor:.5,alpha:Ii.alpha*cx,scale:Ii.emojiScale*y*xf*1.1/(Ri.width||1),filters:[ce.bloomBlur],eventMode:"none"}),M.jsx("pixiSprite",{texture:Ri,x:qe,y:it-y*vf,anchor:.5,alpha:Ii.alpha,scale:Ii.emojiScale*y*xf/(Ri.width||1),eventMode:"none"})]})]},`${te.id}-word-${Re}`)}),ye&&!$&&M.jsxs(M.Fragment,{children:[X==="vhs"&&ce.vhs&&M.jsxs(M.Fragment,{children:[M.jsx("pixiText",{text:xr(De,K),style:ce.vhs.cyan,x:2,y:0,anchor:.5,alpha:.7,eventMode:"none"}),M.jsx("pixiText",{text:xr(De,K),style:ce.vhs.magenta,x:-2,y:0,anchor:.5,alpha:.7,eventMode:"none"})]}),M.jsx("pixiText",{text:xr(De,K),style:X!=="none"?ce.active:ce.base,x:0,y:0,anchor:.5,eventMode:"none"})]})]})};jv.displayName="PixiCaptionsTrack";const rP=I.memo(jv,(t,e)=>et(t,e));var rd,Hv;function iP(){if(Hv)return rd;Hv=1;var t=St(),e=function(){return t.Date.now()};return rd=e,rd}var id,Yv;function oP(){if(Yv)return id;Yv=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return id=e,id}var od,Xv;function sP(){if(Xv)return od;Xv=1;var t=oP(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return od=n,od}var sd,Wv;function aP(){if(Wv)return sd;Wv=1;var t=sP(),e=Pn(),n=co(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var f=o.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):i.test(c)?r:+c}return sd=l,sd}var ad,zv;function cP(){if(zv)return ad;zv=1;var t=Pn(),e=iP(),n=aP(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,c){var u,f,d,h,p,m,g=0,y=!1,b=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,t(c)&&(y=!!c.leading,b="maxWait"in c,d=b?i(n(c.maxWait)||0,l):d,x="trailing"in c?!!c.trailing:x);function v(N){var D=u,F=f;return u=f=void 0,g=N,h=a.apply(F,D),h}function T(N){return g=N,p=setTimeout(C,l),y?v(N):h}function w(N){var D=N-m,F=N-g,G=l-D;return b?o(G,d-F):G}function O(N){var D=N-m,F=N-g;return m===void 0||D>=l||D<0||b&&F>=d}function C(){var N=e();if(O(N))return R(N);p=setTimeout(C,w(N))}function R(N){return p=void 0,x&&u?v(N):(u=f=void 0,h)}function P(){p!==void 0&&clearTimeout(p),g=0,u=m=f=p=void 0}function A(){return p===void 0?h:R(e())}function L(){var N=e(),D=O(N);if(u=arguments,f=this,m=N,D){if(p===void 0)return T(m);if(b)return clearTimeout(p),p=setTimeout(C,l),v(m)}return p===void 0&&(p=setTimeout(C,l)),h}return L.cancel=P,L.flush=A,L}return ad=s,ad}var lP=cP();const cd=Jn(lP),Yo=(t,e,n,r)=>{const i=S.useCallback(cd(t,r),[t,r]),o=S.useCallback(cd(e,r),[e,r]),s=S.useCallback(cd(n,r),[n,r]),a=S.useCallback(()=>{i()},[i]),l=S.useCallback(()=>{o()},[o]),c=S.useCallback(()=>{s()},[s]);return{onPointerOver:a,onPointerDown:l,onPointerOut:c}},uP=new Set(["mp4","m4v","webm","ogg","ogv"]);function fP(t){const e=t.split("?")[0].split("#")[0],n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()}function qv({src:t,uniqueId:e,frameStartAt:n,fps:r=0,isRemotion:i=!1}){const[o,s]=S.useState(!1),[a,l]=S.useState(null),[c,u]=S.useState(null),[f,d]=S.useState(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(!1),g=S.useRef(!1),y=S.useMemo(()=>t||"",[t]),b=S.useRef(n);return b.current=n,S.useEffect(()=>{if(m.current=!1,l(null),s(!1),u(null),d(null),!y){s(!0);return}const x=b.current===0?.001:b.current;let v=!1;const T=5e3;let w=null;const O=()=>{w&&(clearTimeout(w),w=null)},C=(P,A)=>{const L=()=>{if(!m.current)try{P.update?.()}catch{}};A.addEventListener("seeked",L,{once:!0}),A.addEventListener("loadeddata",L,{once:!0}),L(),A.readyState>=HTMLMediaElement.HAVE_METADATA&&A.play().then(()=>{if(!m.current){try{A.pause(),A.currentTime=x}catch{}L()}}).catch(()=>{L()})},R=(P,A)=>{P.autoUpdate=!1,A.muted=!0,A.loop=!1,A.playsInline=!0,A.id=e;try{A.pause()}catch{}try{A.currentTime=x}catch{}p.current=A,d(A),C(P,A)};if(uP.has(fP(y))){g.current=!1,rv(y),v=!0;let P=!1;w=setTimeout(()=>{m.current||(P=!0,console.warn("[useVideoTexture] Assets.load timed out",y),l(new Error(`Video load timed out: ${y}`)))},T),W.Assets.load({src:y,data:{autoPlay:!1,autoUpdate:!1,muted:!0,loop:!1,playsinline:!0,crossorigin:"anonymous"}}).then(A=>{if(O(),m.current||P||!A)return;const L=A.source,N=L.resource;N&&R(L,N),h.current=A,u(A),s(!0)}).catch(A=>{O(),!(m.current||P)&&(console.error("[useVideoTexture] Assets.load failed",y,A),l(A))})}else{g.current=!0;let P=!1;w=setTimeout(()=>{m.current||(P=!0,console.warn("[useVideoTexture] direct video load timed out",y),l(new Error(`Video load timed out: ${y}`)))},T);const A=document.createElement("video");A.crossOrigin="anonymous",A.preload="auto",A.src=y;const L=()=>{if(m.current||P)return;O(),D();let F;try{F=new W.VideoSource({resource:A,autoPlay:!1,autoLoad:!1,crossorigin:"anonymous",alphaMode:"no-premultiply-alpha"})}catch(z){l(z);return}const G=new W.Texture({source:F});h.current=G,u(G),R(F,A),s(!0)},N=()=>{m.current||P||(O(),D(),console.error("[useVideoTexture] direct video load failed",y,A.error),l(new Error(A.error?.message||`Browser could not decode video: ${y}`)))},D=()=>{A.removeEventListener("loadeddata",L),A.removeEventListener("error",N)};A.addEventListener("loadeddata",L,{once:!0}),A.addEventListener("error",N,{once:!0}),A.load()}return()=>{if(m.current=!0,O(),p.current){try{p.current.pause()}catch{}p.current=null}if(v&&iv(y),h.current){try{g.current&&h.current.destroy(!0)}catch{}h.current=null}u(null),d(null)}},[y,e]),{texture:c,videoElement:f,isLoaded:o,error:a}}function Vv({getVideo:t,ready:e,muted:n,playbackRate:r}){const i=S.useRef({isPlaying:!1,progress:0,isMuted:!1,isWaiting:!1,isStalled:!1});return S.useEffect(()=>{const o=t();if(!o)return;const s=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},a=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},l=()=>{i.current.isWaiting=!0,i.current.isStalled=!1},c=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},u=()=>{i.current.isWaiting=!1,i.current.isStalled=!0};return o.addEventListener("loadedmetadata",s),o.addEventListener("ended",a),o.addEventListener("loadstart",l),o.addEventListener("canplaythrough",c),o.addEventListener("stalled",u),()=>{o.removeEventListener("loadedmetadata",s),o.removeEventListener("ended",a),o.removeEventListener("loadstart",l),o.removeEventListener("canplaythrough",c),o.removeEventListener("stalled",u)}},[t,e]),S.useEffect(()=>{const o=t();o&&(o.muted=n,i.current.isMuted=n)},[t,n,e]),S.useEffect(()=>{const o=t();o&&(o.playbackRate=r||1)},[t,r,e]),i}function Kv({textureRef:t,stateRef:e,ready:n,start:r,end:i,frameStartAt:o,uniqueId:s}){const a=S.useRef(null),{tl:l}=S.useContext(Ye),c=S.useCallback(()=>t.current?.source?.resource,[t]),u=S.useCallback(()=>t.current?.source,[t]);return Ze(ke.RESUME,()=>{e.current.isPlaying=!0;const f=c();f&&a.current?.isActive()&&f.play().catch(()=>{})},[c,e]),Ze(ke.PAUSE,()=>{e.current.isPlaying=!1;try{c()?.pause()}catch{}},[c,e]),S.useEffect(()=>{if(!l?.current||!n||!t.current)return;a.current&&(a.current.kill(),a.current=null);const f=()=>{const g=c();if(g){try{g.currentTime=Number(o),u()?.update?.()}catch{}e.current.progress=0,(e.current.isPlaying||l?.current?.isActive())&&g.play().catch(()=>{})}},d=()=>{const g=c(),y=u(),b=a.current;if(!g||!y||!b)return;e.current.progress=b.progress();let x=o+b.time();const v=g.duration;Number.isFinite(v)&&v>0&&(x=Math.min(x,v-.05)),x<0&&(x=0);try{const T=g.paused?.01:.25;Math.abs(g.currentTime-x)>T&&(g.currentTime=x),y.update?.()}catch{}},h=()=>{const g=c();if(g)try{g.pause()}catch{}e.current.isPlaying=!1,a.current&&(e.current.progress=a.current.progress())},p=Number(i)-Number(r);if(p<=0||!l.current)return;const m=E.context(()=>{a.current=E.to({progress:0},{duration:p,onStart:f,onUpdate:d,onComplete:h}),l.current.add(a.current,r);const g=Math.max(l.current.time(),.01);l.current.time(g,!1)});return()=>{a.current&&(a.current.kill(),E.killTweensOf(a.current),a.current=null),m.revert()}},[l,n,r,i,o,s,t,e]),a}const dP=({ref:t,...e})=>{const{uniqueId:n,mute:r=!1,volume:i=1,speed:o=1,src:s,startAt:a,endAt:l,frameStartAt:c,visible:u,disabled:f,transformation:{x:d,y:h,width:p,height:m,colorCorrection:g={},blendMode:y,border:b,roundedCorners:x,maskShape:v,effect:T,anchor:w=.5},pointerdown:O=()=>{},pointerout:C=()=>{},pointerover:R=()=>{},fps:P=0}=e,{isRemotion:A}=S.useContext(Ye),L=S.useRef(null),N=S.useRef(null),{onPointerDown:D,onPointerOut:F,onPointerOver:G}=Yo(R,O,C,1),z=lt({colorCorrection:g,effects:{name:T}}),K=s||"",{texture:se,videoElement:pe,isLoaded:X,error:he}=qv({src:K,uniqueId:n,frameStartAt:c,fps:P,isRemotion:A});S.useEffect(()=>{N.current=se},[se]);const j=S.useCallback(()=>pe??void 0,[pe]),te=Vv({getVideo:j,ready:X,muted:r,playbackRate:o}),H=Math.max(0,Math.min(1,Number(i)||0));S.useEffect(()=>{const Z=j();Z&&(Z.volume=H)},[j,H,X]),Kv({textureRef:N,stateRef:te,ready:X,start:a,end:l,frameStartAt:c,uniqueId:n}),S.useEffect(()=>{if(n){if(!K){Bo(n);return}return ev(n),(X||he)&&Bo(n),()=>tv(n)}},[n,K,X,he]);const ae=S.useCallback(()=>{const Z=j();Z&&(Z.pause(),te.current.isPlaying=!1)},[j,te]);return Ze(ke.PAUSE,ae,[ae]),Ze(ke.SCRUBBER_CLICKED,ae,[ae]),Ze(ke.REVERSE_MODE_END,ae,[ae]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:D,pointerover:G,pointerout:F,children:X&&se&&M.jsx(Ot,{x:d,y:h,width:p,height:m,border:b,roundedCorners:x,maskShape:v,spriteRef:L,children:M.jsx("pixiSprite",{label:`sprite-${n}`,texture:se,width:p,height:m,anchor:w,x:d,y:h,ref:L,alpha:u?1:0,...y!=null&&{blendMode:y},...!f&&u&&{interactive:!0,pointerdown:O},filters:z})})})},ld=I.memo(dP,et);ld.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const hP=({ref:t,...e})=>{const[n,r]=I.useState(),i=S.useRef(null),o=S.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h,blendMode:p},pointerdown:m=()=>{},pointerout:g=()=>{},pointerover:y=()=>{},canvasImageRef:b}=e,x=b&&b?.getCanvas(),{onPointerDown:v,onPointerOut:T,onPointerOver:w}=Yo(y,m,g,1),O=lt({colorCorrection:d,effects:{name:h},blendMode:p});return at.useTick(()=>{if(i.current&&i.current.texture){const C=i.current.texture.source;C&&typeof C.update=="function"&&C.update()}}),I.useEffect(()=>{if(!ya(x)){const C=Array.isArray(x)?x[0]:x,R=W.Texture.from(C);r(R)}},[x]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:v,pointerover:w,pointerout:T,children:M.jsx("pixiContainer",{ref:o,children:n&&M.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:m},filters:O})})})},pP=({isPlaying:t,forwardRef:e,...n})=>{const r=I.useRef(null);return I.useImperativeHandle(e,()=>r.current,[r]),I.useEffect(()=>{if(r.current===null)return;const i=r.current;i[t?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[t]),M.jsx("pixiAnimatedSprite",{ref:r,...n})},mP=I.memo(pP,et),Zv=S.createContext(null),ud=()=>S.useContext(Zv),$v=({children:t,startAt:e=0,endAt:n=0,uniqueId:r,hideOnExit:i,hideOnEntry:o,hideStart:s,hideEnd:a,zIndex:l=0,entranceOverlapSec:c=0,transitionIn:u,transitionOut:f,onSequenceContainerReady:d})=>{const h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),[y,b]=S.useState("static"),x=ud(),{tl:v,totalDuration:T=0,playerTimeRef:w,registerTimeUpdateListener:O,unregisterTimeUpdateListener:C}=S.useContext(Ye);S.useLayoutEffect(()=>{if(!v?.current||!h.current)return;const D=v.current,F=h.current,G=Number.isFinite(e)?Number(e):0,z=Number.isFinite(n)?Number(n):G,K=Number.isFinite(c)&&c>0?Math.min(c,Math.max(z-G,0)):0,se=Math.max(G-K,0),pe=Number.isFinite(T)?Number(T):0,X=pe>0?Math.max(se,Math.min(z,pe)):Math.max(se,z),he=Math.max(X-se,0),j=(i||o)&&s!==void 0&&a!==void 0;let te=null,H=null,ae=!1;j&&(te=Math.max(se,Math.min(X,s)),H=Math.max(se,Math.min(X,a)),ae=te<H),g.current&&(g.current.kill(),D.remove(g.current),g.current=null);const Z=typeof w?.current=="number"?w.current:0,ce=Z>=se-.001&&Z<=X+.001?1:0;if(g.current=E.timeline(),g.current.set(F,{alpha:ce}),ae){const ie=te-se,xe=H-se;if(xe<=0)g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:he,ease:"none"});else{ie>0?(g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:ie,ease:"none"})):g.current.set(F,{alpha:0},0),g.current.to(F,{alpha:0,duration:xe-ie,ease:"none"});const Y=he-xe;Y>0?(g.current.set(F,{alpha:1},xe),g.current.to(F,{alpha:1,duration:Y,ease:"none"})):g.current.set(F,{alpha:1},xe)}}else g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:he,ease:"none"});g.current.set(F,{alpha:0}),D.add(g.current,se);const J=D.time();return D.time(J,!1),()=>{g.current&&(D.remove(g.current),g.current.progress(0).kill(),g.current=null),F&&(F.alpha=0)}},[e,n,T,r,i,o,s,a,c,v,w]),S.useEffect(()=>{if(!O||!C)return;const D=Number.isFinite(e)?Number(e):0,F=Number.isFinite(n)?Number(n):D,G=K=>{const pe=K>=D-1&&K<=F+1?"static":"none";b(X=>X===pe?X:(h.current&&(h.current.eventMode=pe),pe))};O(G);const z=w?.current;return typeof z=="number"&&G(z),()=>C(G)},[e,n,r,w,O,C]),S.useEffect(()=>{if(!(!d||!h.current))return d(h.current),()=>d(null)},[d]);const R=x?.registerSequence;S.useEffect(()=>{if(!(!r||!h.current||!R))return R({id:r,startAt:e,endAt:n,zIndex:l,container:h.current,transitionIn:u,transitionOut:f},r),()=>R(null,r)},[r,e,n,l,u,f,R]);const P=Number.isFinite(c)&&c>0?c:0,A=typeof w?.current=="number"?w.current:0,L=A>=e-P-.001&&A<=n+.001?1:0;return M.jsx("pixiContainer",{ref:h,alpha:L,eventMode:"static",zIndex:l,children:M.jsx("pixiContainer",{ref:m,children:M.jsx("pixiContainer",{ref:p,alpha:1,children:t})})})},gP=t=>{const{startAt:e,endAt:n}=t,{setTotalDuration:r}=S.useContext(Ye);return I.useEffect(()=>{r&&r(Number(n)+.2)},[e,n]),t.children};let Jv=!1;const yP=()=>{Jv||(Jv=!0,console.warn("[reacthub-pixitweenjs] GL transitions need the WebGL renderer; skipping transition."))},_P=90,fd=({transitionPair:t,width:e,height:n,clock:r,resolveEndpoints:i,getLayerSets:o,hideEndpointsInWindow:s=!1,getRegion:a,fullCanvas:l=!1,maxRegionPixels:c=mf})=>{const{app:u}=at.useApplication(),f=S.useRef(null),d=S.useRef(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),y=S.useRef(null),b=S.useRef(null),x=S.useRef(null),v=S.useRef(null),[T,w]=S.useState(!1),O=t?.config,C=O?.name||O?.type,R=r?.start??t?.timing.start??0,P=r?.end??t?.timing.end??R,A=r?.duration??t?.timing.duration??P-R,L=JSON.stringify(O?.params??{}),N=S.useMemo(()=>{if(!C)return null;const F=Ib(C,{width:e,height:n,params:O?.params??{}});return F.setProgress(0),F},[C,L,e,n]);S.useEffect(()=>{p.current=N},[N]);const D=()=>{const F=x.current;if(F){for(const G of F)G.container.visible=G.visible;x.current=null}};return S.useEffect(()=>{if(!N||!t)return;let F=!1,G;const z=()=>{const K=f.current;if(F||!K||!u?.renderer)return!1;if(!BM(u.renderer))return yP(),!0;const se=h.current;se&&(se.parent?.removeChild(se),se.destroy({children:!0}),h.current=null),m.current&&m.current!==N&&(m.current.clearTextures(),m.current.destroy()),d.current||(d.current=HM());const pe=new B.Mesh({geometry:d.current,shader:N.shader});return pe.width=e,pe.height=n,pe.position.set(e/2,n/2),pe.visible=!1,K.addChild(pe),h.current=pe,m.current=N,(!y.current||!b.current)&&(y.current?.destroy(!0),b.current?.destroy(!0),y.current=B.RenderTexture.create({width:e,height:n}),b.current=B.RenderTexture.create({width:e,height:n})),w(!0),!0};return z()||(G=setTimeout(()=>{G=void 0,z()},150)),()=>{F=!0,G!==void 0&&clearTimeout(G)}},[N,t,u,e,n]),S.useEffect(()=>()=>{D(),v.current=null,p.current?.clearTextures(),m.current?.clearTextures(),y.current?.destroy(!0),b.current?.destroy(!0),y.current=null,b.current=null;const F=h.current;F&&(F.parent?.removeChild(F),F.destroy({children:!0}),h.current=null);const G=m.current;G&&(G.destroy(),m.current=null),p.current&&p.current!==G&&p.current.destroy(),p.current=null,d.current?.destroy(),d.current=null,g.current?.destroy({children:!0}),g.current=null},[t?.pairId]),S.useEffect(()=>{if(!T||!r)return;const F=X=>{const he=p.current,j=h.current,te=u?.renderer;if(!he||!j||!te)return;const H=i();if(!(X>=R&&X<P)||!H.from||!H.to||!y.current||!b.current){j.visible=!1,D(),v.current=null;return}const{fromLayers:Z,toLayers:ce}=o(X,H);if(!v.current){const Y=l?null:a?.(H)??Pb([Lb(H.from),Lb(H.to)]);v.current=Y&&Y.width>1&&Y.height>1?{x:Y.x,y:Y.y,width:Math.ceil(Y.width),height:Math.ceil(Y.height)}:{x:0,y:0,width:e,height:n}}const J=v.current,ie=UM(J,c);for(const Y of[y.current,b.current])(Y.width!==J.width||Y.height!==J.height||Y.source.resolution!==ie)&&Y.source.resize(J.width,J.height,ie);Mb(te,g,Z,y.current,-J.x,-J.y),Mb(te,g,ce,b.current,-J.x,-J.y),j.width=J.width,j.height=J.height,j.position.set(J.x+J.width/2,J.y+J.height/2),he.setTextures(y.current,b.current);const xe=Math.max(0,Math.min(1,(X-R)/A));he.setProgress(r.ease?r.ease(xe):xe),j.visible=!0,s&&!x.current&&(x.current=[H.from,H.to].map(Y=>({container:Y,visible:Y.visible})),H.from.visible=!1,H.to.visible=!1)};let G=null,z=0;const K=X=>{G=X,z=_P,F(X)},se=()=>{G===null||z<=0||(z-=1,F(G))};u?.ticker?.add(se);const pe=r.subscribe(K);return()=>{u?.ticker?.remove(se),pe()}},[T,r,R,P,A,i,o,a,s,l,c,u,e,n]),f},Qv=t=>!!t&&Number.isFinite(t.duration)&&t.duration>0&&!!t.name,e1=t=>{const e=[...t].sort((i,o)=>i.startAt-o.startAt||i.endAt-o.endAt||i.id.localeCompare(o.id)),n=[];for(const i of e){const o=e.filter(a=>a.id!==i.id&&a.endAt<=i.startAt).sort((a,l)=>l.endAt-a.endAt||l.startAt-a.startAt)[0],s=e.filter(a=>a.id!==i.id&&a.startAt>=i.endAt).sort((a,l)=>a.startAt-l.startAt||a.endAt-l.endAt)[0];if(Qv(i.transitionIn)&&(o||i.transitionIn.from)){const a=i.transitionIn;n.push({id:`${i.id}:transition-in`,from:a.from??o.id,to:a.to??i.id,name:a.name,startAt:i.startAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}if(Qv(i.transitionOut)&&(s||i.transitionOut.to)){const a=i.transitionOut;n.push({id:`${i.id}:transition-out`,from:a.from??i.id,to:a.to??s.id,name:a.name,startAt:i.endAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}}const r=new Map;for(const i of n){const o=[i.from,i.to,i.startAt,i.duration,i.name].join(":");r.has(o)||r.set(o,i)}return[...r.values()]},bP=({children:t})=>{const[e]=S.useState(()=>new Map),[n]=S.useState(()=>new Map),[r,i]=S.useState(0),o=S.useCallback((l,c)=>{const u=n.get(c);u&&u.container!==l?.container&&e.delete(c),l?(n.set(c,l),e.set(c,l.container)):n.delete(c),i(f=>f+1)},[e,n]),s=S.useMemo(()=>({containers:e,sequences:n,revision:r,registerSequence:o}),[e,n,r,o]),a=S.useMemo(()=>e1(n.values()),[n,r]);return M.jsxs(Zv.Provider,{value:s,children:[t,a.map(l=>M.jsx(Xo,{name:l.name,startAt:l.startAt,duration:l.duration,ease:l.ease,params:l.params,from:l.from,to:l.to,zIndex:l.zIndex},l.id))]})},xP=(t,e,n="none")=>{const r=S.useContext(Ye),{playerTimeRef:i,registerTimeUpdateListener:o,unregisterTimeUpdateListener:s}=r,a=S.useCallback(l=>{const c=f=>l(f);o?.(c);const u=i?.current;return typeof u=="number"&&c(u),()=>s?.(c)},[i,o,s]);return S.useMemo(()=>({subscribe:a,start:t,end:t+e,duration:e,ease:E.parseEase(n)??E.parseEase("none")}),[a,t,e,n])},t1=(t,e)=>typeof t=="string"?e.get(t)??null:typeof t=="function"?t():t&&"current"in t?t.current:t,vP=(t,e)=>{const r=ud()?.containers;return S.useCallback(()=>{const i=r??new Map;return{from:t1(t,i),to:t1(e,i)}},[t,e,r])},TP=[],EP=({name:t,startAt:e,duration:n,ease:r="none",params:i,from:o,to:s,region:a,width:l=1920,height:c=1080,scope:u,zIndex:f=1,fromGroup:d,toGroup:h,sharedLayers:p=TP})=>{const g=ud()?.containers,y=xP(e,n,r),b=vP(o,s),x=S.useMemo(()=>({pairId:`${u}:${typeof o=="string"?o:"from"}:${typeof s=="string"?s:"to"}:${e}:${t}`,config:{type:t,name:t,duration:n,ease:r,params:i??{}},timing:{start:e,end:e+n,duration:n}}),[u,o,s,e,t,n,r,i]),v=S.useCallback((O,C)=>{const R=d??(typeof o=="string"?[o]:[]),P=h??(typeof s=="string"?[s]:[]),A=L=>[...new Set(L)].flatMap((D,F)=>{const G=g?.get(D);return G?[{container:G,zIndex:F}]:[]});if(u==="scene"){const L=A(R),N=A(P),D=A(p);return{fromLayers:[...L,...D],toLayers:[...N,...D]}}return{fromLayers:C.from?[{container:C.from,zIndex:0}]:[],toLayers:C.to?[{container:C.to,zIndex:0}]:[]}},[g,u,o,s,d,h,p]),T=S.useCallback(()=>a??null,[a]),w=fd({transitionPair:x,width:l,height:c,clock:y,resolveEndpoints:b,getLayerSets:v,hideEndpointsInWindow:u==="element",getRegion:a?T:void 0,fullCanvas:u==="scene"});return M.jsx("pixiContainer",{ref:w,zIndex:f,sortableChildren:!0})},dd=S.memo(EP);dd.displayName="TransitionMeshLayer";const SP=t=>M.jsx(dd,{...t,scope:"element"}),Xo=S.memo(SP);Xo.displayName="PixiElementTransition";const wP=t=>M.jsx(dd,{...t,scope:"scene"}),hd=S.memo(wP);hd.displayName="PixiSceneTransition";const AP=t=>t.scope==="element"?M.jsx(Xo,{...t}):M.jsx(hd,{...t}),n1=S.memo(AP);n1.displayName="PixiGlTransition";const OP=({ref:t,...e})=>{const[n,r]=I.useState(),i=S.useRef(null),o=S.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h},pointerdown:p=()=>{},pointerout:m=()=>{},pointerover:g=()=>{},canvasImageRef:y}=e,b=y&&y?.getCanvas(),{app:x}=at.useApplication(),{onPointerDown:v,onPointerOut:T,onPointerOver:w}=Yo(g,p,m,1),O=lt({colorCorrection:d,effects:{name:h}});return at.useTick(()=>{if(i.current&&i.current.texture){const C=i.current.texture.source;C&&typeof C.update=="function"&&C.update(),o.current&&x&&x.renderer.render(o.current)}}),I.useEffect(()=>{if(!ya(b)){const C=Array.isArray(b)?b[0]:b,R=W.Texture.from(C);r(R)}},[b]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:v,pointerover:w,pointerout:T,children:M.jsx("pixiContainer",{ref:o,children:n&&M.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:p},filters:O})})})},CP=I.memo(OP,et),RP=({ref:t,...e})=>{const n=S.useRef(null),r=S.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c,height:u,colorCorrection:f={},effect:d,border:h,roundedCorners:p,maskShape:m}=o,g=lt({colorCorrection:f,effects:{name:d}});return at.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const b=W.Texture.from(y);r.current=b,n.current&&(n.current.texture=b)}}n.current?.texture&&n.current.texture.source?.update?.()}),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:h,roundedCorners:p,maskShape:m,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r.current||W.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},IP=I.memo(RP,et),MP=({ref:t,...e})=>{const n=S.useRef(null),r=S.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c=100,height:u=100,colorCorrection:f={},effect:d,border:h,roundedCorners:p,maskShape:m}=o,g=lt({colorCorrection:f,effects:{name:d}});return at.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const b=W.Texture.from(y);r.current=b,n.current&&(n.current.texture=b)}}n.current?.texture&&n.current.texture.source?.update?.()}),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:h,roundedCorners:p,maskShape:m,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r.current||W.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},LP=I.memo(MP,et),PP=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),{src:s,visible:a=!0,transformation:l,loop:c=!0,remotionFrame:u,fps:f=30}=e,{x:d,y:h,width:p=0,height:m=0,colorCorrection:g={},effect:y,border:b,roundedCorners:x,maskShape:v}=l,T=lt({colorCorrection:g,effects:{name:y}});S.useEffect(()=>{let O=!1;return W.Assets.load(s).then(C=>{O||r(C)}).catch(C=>{console.error("[PixiRemotionGifSprite] load failed",s,C)}),()=>{O=!0}},[s]),S.useEffect(()=>{const O=o.current;if(!O||u==null)return;const C=O.totalFrames;if(!C)return;const R=u/f,P=O.duration??0;if(P>0){const A=R*1e3%(c?P:P+1),L=Math.min(1,A/P);O.currentFrame=Math.min(C-1,Math.floor(L*C))}else{const A=Math.floor(R*f)%(c?C:C+1);O.currentFrame=Math.min(C-1,A)}},[u,f,c]);const w=u!=null;return M.jsx($e,{...e,ref:t,isGif:!0,children:M.jsx("pixiContainer",{ref:i,children:n&&M.jsx(Ot,{x:d,y:h,width:p,height:m,border:b,roundedCorners:x,maskShape:v,spriteRef:o,children:M.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!w,autoUpdate:!w,loop:c,width:p,height:m,anchor:.5,x:d,y:h,alpha:a?1:0,filters:T})})})})},NP=I.memo(PP,et),kP={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0},DP=({ref:t,...e})=>{const[n,r]=I.useState(0),[i,o]=I.useState(!1),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(void 0),u=S.useRef(void 0),f=S.useRef(kP),d=I.useRef(void 0),h=S.useRef(document.body),{uniqueId:p,src:m,startAt:g,endAt:y,frameStartAt:b,frameEndAt:x,visible:v,disabled:T,loop:w=!1,transformation:{x:O,y:C,width:R,height:P,colorCorrection:A={},effect:L,anchor:N=.5},pointerdown:D=()=>{},pointerout:F=()=>{},pointerover:G=()=>{}}=e,{tl:z}=S.useContext(Ye);Ze(ke.PAUSE,()=>{c.current&&c.current.pause()});const{onPointerDown:K,onPointerOut:se,onPointerOver:pe}=Yo(G,D,F,1),X=lt({colorCorrection:A,effects:{name:L}});I.useLayoutEffect(()=>{l.current=document.createElement("canvas"),l.current.setAttribute("id","lottieContainersvg"),l.current.setAttribute("id",`${p}lottieContainer`),l.current.setAttribute("width",`${R}`),l.current.setAttribute("height",`${P}`);const j=h.current;return j.appendChild(l.current),()=>{l.current&&j.removeChild(l.current)}},[]),I.useEffect(()=>{async function j(){c.current&&c.current.destroy(),l.current.removeAttribute("style"),c.current=tE.loadAnimation({container:l.current||document.getElementById("lottieroot"),renderer:"canvas",loop:!1,autoplay:!1,path:m,rendererSettings:{context:l.current.getContext("2d"),clearCanvas:!0,progressiveLoad:!1,preserveAspectRatio:"xMaxYMax meet"}}),c.current.addEventListener("data_ready",()=>{if(l.current&&l.current.setAttribute("style","display:none"),c.current&&c.current.renderer.canvasContext){const te=c.current.totalFrames;f.current.totalFrames=te;const H=c.current.getDuration();f.current.totalDuration=H;const ae=c.current.renderer.canvasContext.canvas,Z=W.Texture.from(ae);d.current=Z,o(!0),r(H)}}),c.current.addEventListener("loaded_images",()=>{}),c.current.addEventListener("complete",()=>{}),c.current.addEventListener("loopComplete",()=>{}),c.current.addEventListener("enterFrame",()=>{}),c.current.addEventListener("config_ready",()=>{console.log("config_ready",c.current)}),c.current.addEventListener("error",te=>{console.log("error",te)})}return j(),()=>{c.current&&(c.current.removeEventListener("complete"),c.current.removeEventListener("config_ready"),c.current.removeEventListener("enterFrame"),c.current.removeEventListener("loaded_images"),c.current.removeEventListener("loopComplete"),c.current.removeEventListener("data_ready"),c.current.removeEventListener("error"),c.current.destroy())}},[m,p]),I.useEffect(()=>(d.current&&d.current.source?.update?.(),()=>{}),[i]);const he=j=>{if(c.current&&s.current&&u.current){const H=j(u.current.time())/u.current.duration()*f.current.totalFrames,ae=f.current.totalFrames;let Z=H;Z=Math.round(Math.floor(Z)),Z>=ae?(c.current.goToAndStop(0,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!1):(c.current.goToAndStop(Z,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!0)}};return I.useEffect(()=>{let j=E.context(()=>{});if(a.current&&z.current&&n>0){const te=Number(y)-Number(g);u.current&&(u.current.kill(),z.current.remove(u.current)),j=E.context(()=>{const H=E.utils.wrap(g,n);u.current=E.timeline({}).to(a.current,{duration:Number(te),onUpdate:he,onUpdateParams:[H,b,x]},b),z.current.add(u.current,g)})}return()=>{u.current&&(u.current.kill(),E.killTweensOf(u.current)),j.revert()}},[g,y,b,x,p,n,w]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:K,pointerover:pe,pointerout:se,children:M.jsx("pixiContainer",{ref:a,children:d.current&&M.jsx("pixiSprite",{texture:d.current,width:R,height:P,anchor:N,x:O,y:C,ref:s,alpha:v?1:0,...!T&&v&&{interactive:!0,pointerdown:D},filters:X})})})},pd=I.memo(DP,et);pd.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiLottieSprite"};class Wo{currentID;dirtyID;_x;_y;_width;_height;_hull;constructor(e=0,n=0,r=0,i=0){this._x=Number(e),this._y=Number(n),this._width=Number(r),this._height=Number(i),this._hull=[new B.Point,new B.Point,new B.Point,new B.Point],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(e){this._x=e,this.dirtyID++}get y(){return this._y}set y(e){this._y=e,this.dirtyID++}get width(){return this._width}set width(e){this._width=e,this.dirtyID++}get height(){return this._height}set height(e){this._height=e,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[e,n,r,i]=this._hull;e.set(this._x,this._y),n.set(this._x+this._width,this._y),r.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new Wo(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}equals(e){return e?e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height:!1}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}}const r1=new B.Point;class zo{innerBounds;currentID;dirtyID;_rotation;_center;_hull;_matrix;constructor(e=0,n=0,r=0,i=0,o=0){e instanceof Wo&&(o=n||0,n=e.y,r=e.width,i=e.height,e=e.x),this.innerBounds=new Wo(e,n,r,i),this._rotation=o,this._center=new B.ObservablePoint({_onUpdate:()=>this.updateCenter()},0,0),this._hull=[new B.Point,new B.Point,new B.Point,new B.Point],this._matrix=new B.Matrix,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(e){this.center.copyFrom(e)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(e){return e?this.innerBounds.equals(e.innerBounds)&&this.rotation===e.rotation:!1}contains(e,n){typeof e=="number"&&(e=r1.set(e,n));const r=this._matrix.applyInverse(e,r1);return this.innerBounds.contains(r.x,r.y)}copyFrom(e){return this.innerBounds.copyFrom(e.innerBounds),this.rotation=e.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const e=this.innerBounds,n=this._rotation,r=this._center,[i,o,s,a]=this._hull,l=this._matrix;r._x=e.x+e.width/2,r._y=e.y+e.height/2,l.identity().translate(-r.x,-r.y).rotate(n).translate(r.x,r.y),l.apply(e.topLeft,i),l.apply(e.topRight,o),l.apply(e.bottomRight,s),l.apply(e.bottomLeft,a),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const e=this.center,n=this.innerBounds;n.x=e.x-n.width/2,n.y=e.y-n.height/2}}class i1{_history;_decayRatio;_currentIndex;_average=0;constructor(e,n){this._history=new Array(e),this._decayRatio=n,this._currentIndex=0;for(let r=0;r<e;r++)this._history[r]=0}next(e){const{_history:n,_decayRatio:r}=this,i=n.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,n[this._currentIndex]=e;let o=0,s=0;for(let a=this._currentIndex+1;a<i;a++)o=(o+n[a])*r,s=(s+1)*r;for(let a=0;a<=this._currentIndex;a++)o=(o+n[a])*r,s=(s+1)*r;return this._average=o/s,this._average}absDev(){let e=0;for(let n=0,r=this._history.length;n<r;n++)e+=Math.abs(this._history[n]-this._average);return e/this._history.length}}class o1{_freeList;_freeCount;_reserveCount;_borrowRate;_returnRate;_flowRate;_borrowRateAverage;_marginAverage;_capacityRatio;_decayRatio;_borrowRateAverageProvider;_marginAverageProvider;constructor(e={}){this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=e.reserve||0,this._capacityRatio=e.capacityRatio||1.2,this._decayRatio=e.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new i1(128,this._decayRatio),this._marginAverageProvider=new i1(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(e){this._freeList.length=Math.ceil(e)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(e){let n,r;Array.isArray(e)?(n=e,r=e.length):(r=e,n=new Array(r)),this._borrowRate+=r,this._flowRate+=r;let i=0;if(this._freeCount>0){const o=this._freeList,s=Math.min(this._freeCount,r);let a=this._freeCount;for(let l=0;l<s;l++)n[i]=o[a-1],++i,--a;this._freeCount=a}for(;i<r;)n[i]=this.create(),++i;return n}release(e){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=e,++this._freeCount}releaseArray(e){this._returnRate+=e.length,this._flowRate-=e.length,this._freeCount+e.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+e.length));for(let n=0,r=e.length;n<r;n++)this._freeList[this._freeCount]=e[n],++this._freeCount}reserve(e){if(this._reserveCount=e,this._freeCount<e){const n=this._freeCount-e;for(let r=0;r<n;r++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(e){if(this._freeCount>e){this.capacity>e*this._capacityRatio&&(this.capacity=e*this._capacityRatio);const r=Math.min(this._freeCount,this.capacity);for(let i=e;i<r;i++)this._freeList[i]=null}}startGC(e=B.Ticker.shared){e.add(this._gcTick,null,B.UPDATE_PRIORITY.UTILITY)}stopGC(e=B.Ticker.shared){e.remove(this._gcTick)}_gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const e=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const n=this._freeCount,r=this._freeList.length;if(n<128&&this._borrowRateAverage<128&&r<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+e){const o=i+e;this.capacity=Math.min(this._freeList.length,Math.ceil(o)),this._freeCount=this._freeList.length}}}const s1=new Map;class a1{static build(e){let n=s1.get(e);return n||(n=new class extends o1{create(){return new e}},s1.set(e,n),n)}static buildFunctional(e){return new class extends o1{create=e}}}const c1={color:16777215,outlineColor:6514417,outlineThickness:2.5,radius:7,shape:"circle",glowColor:6514417,glowIntensity:.15};function l1(t,e,n){const r=Math.max(1,n/28),i=Math.round(24*r);return`data:image/svg+xml;base64,${btoa(`
|
|
1514
1514
|
<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 24 24" fill="none">
|
|
1515
1515
|
<circle cx="12" cy="12" r="10" fill="${t}"/>
|
|
1516
1516
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
@@ -1520,4 +1520,4 @@ void main() {
|
|
|
1520
1520
|
d="M18.3617 10.4693C18.0689 10.1769 17.5946 10.1769 17.3018 10.4693L16.1335 11.636C15.9188 11.8504 15.8545 12.1731 15.9705 12.4534C16.0865 12.7338 16.3601 12.9167 16.6635 12.9167H17.0267C16.6636 15.3678 14.5479 17.25 11.9905 17.25C10.3464 17.25 8.88484 16.4729 7.9529 15.2638C7.70002 14.9358 7.22908 14.8748 6.90101 15.1277C6.57295 15.3806 6.512 15.8515 6.76487 16.1796C7.96886 17.7416 9.86205 18.75 11.9905 18.75C15.376 18.75 18.1667 16.2001 18.5395 12.9167H19C19.3035 12.9167 19.577 12.7338 19.693 12.4534C19.8091 12.1731 19.7447 11.8504 19.53 11.636L18.3617 10.4693Z"
|
|
1521
1521
|
fill="${e}"/>
|
|
1522
1522
|
</svg>
|
|
1523
|
-
`.trim())}`}class Xt extends B.Graphics{constructor(e,n,r={},i,o,s){super(),this.transformer=e;const a=Object.assign({},c1,r);this._handle=n,this._style=a,this.onHandleDelta=i,this.onHandleCommit=o,this._dirty=!0,this.eventMode="static",this.cursor=s||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new B.Point,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp,this.draw()}transformer;onHandleDelta;onHandleCommit;_handle;_style;_dirty;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_rotatorSprite=null;_rotatorKey=null;static _rotatorTextureCache=new Map;static async loadTextures(e=[{bgColor:"#6366f1",arrowColor:"#ffffff",size:28}]){await Promise.all(e.map(({bgColor:n="#6366f1",arrowColor:r="#ffffff",size:i=28})=>{const o=`${n}:${r}:${i}`;if(Xt._rotatorTextureCache.has(o)){const l=Xt._rotatorTextureCache.get(o);return l instanceof Promise?l:Promise.resolve(l)}const s=l1(n,r,i),a=B.Assets.load(s).then(l=>(Xt._rotatorTextureCache.set(o,l),l));return Xt._rotatorTextureCache.set(o,a),a}))}get handle(){return this._handle}set handle(e){this._handle=e,this._dirty=!0,this.draw()}get style(){return this._style}set style(e){this._style=Object.assign({},c1,e),this._dirty=!0,this.draw()}draw(){const e=this._handle,n=this._style;this.clear();const r=e==="middleLeft"||e==="middleRight",i=e==="topCenter"||e==="bottomCenter",o=e==="rotator";n.glowColor&&n.glowIntensity&&n.glowIntensity>0&&!o&&this.drawGlowEffect(n,r||i),o?this.drawRotatorHandle(n):r||i?this.drawPillHandle(e,n):this.drawCornerHandle(n),this._dirty=!1}drawGlowEffect(e,n){const i=e.radius||7,o=i/7;if(n){const s=10*o,a=20*o,l=5*o,c=2*o;for(let u=0;u<3;u++){const f=(e.glowIntensity||.15)*(1-u/3)*.3,d=u*c;this.roundRect(-s/2-d,-a/2-d,s+d*2,a+d*2,l+d).fill({color:e.glowColor||6514417,alpha:f})}}else{const s=i*1.5;for(let a=0;a<3;a++){const l=(e.glowIntensity||.15)*(1-a/3)*.3,c=i+(s-i)*(a/3);this.circle(0,0,c).fill({color:e.glowColor||6514417,alpha:l})}}}drawCornerHandle(e){const n=e.radius||7;this.circle(0,0,n).fill({color:16777215}).stroke({width:e.outlineThickness||2.5,color:e.outlineColor||6514417})}drawPillHandle(e,n){const i=(n.radius||7)/7,o=e==="topCenter"||e==="bottomCenter",s=(o?20:10)*i,a=(o?10:20)*i,l=5*i;this.roundRect(-s/2,-a/2,s,a,l).fill({color:n.color||16777215}).stroke({width:n.outlineThickness||2.5,color:n.outlineColor||6514417})}drawRotatorHandle(e){const n=e.outlineColor??6514417,r=e.rotatorIconColor??16777215,i="#"+n.toString(16).padStart(6,"0"),o="#"+r.toString(16).padStart(6,"0"),a=(e.radius||7)/7,l=Math.round(28*a),c=`${i}:${o}:${l}`,u=Xt._rotatorTextureCache.get(c);if(this._rotatorSprite&&this._rotatorKey!==c&&(this.removeChild(this._rotatorSprite),this._rotatorSprite.destroy(),this._rotatorSprite=null,this._rotatorKey=null),u instanceof B.Texture){if(!this._rotatorSprite){const b=new B.Sprite(u);b.anchor.set(.5,.5);const x=u.width||l,v=u.height||l;b.scale.set(l/x,l/v),this.addChild(b),this._rotatorSprite=b,this._rotatorKey=c}return}if(u)u.then(()=>{this._dirty=!0,this.draw()});else{const b=l1(i,o,l),x=B.Assets.load(b).then(v=>(Xt._rotatorTextureCache.set(c,v),this._dirty=!0,this.draw(),v));Xt._rotatorTextureCache.set(c,x)}const f=Math.round(10*a),d=f*.55,h=Math.max(1.5,1.8*a);this.circle(0,0,f).fill({color:n});const p=-Math.PI*.85,m=-Math.PI*.15;this.arc(0,0,d,p,m,!1).stroke({width:h,color:r});const g=Math.PI*.15,y=Math.PI*.85;this.arc(0,0,d,g,y,!1).stroke({width:h,color:r})}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(e){this._pointerDown&&(this._pointerDragging?this.onDrag(e):this.onDragStart(e),e.stopPropagation())}onPointerUp(e){this._pointerDragging&&this.onDragEnd(e),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(e){this._pointerPosition.copyFrom(e.global),this._pointerDragging=!0}onDrag(e){const n=e.global;this.onHandleDelta&&this.onHandleDelta(n),this._pointerPosition.copyFrom(n)}onDragEnd(e){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function qo(t,e,n,r){const{x:i,y:o}=n,{x:s,y:a}=r;if(Math.abs(s-i)<.01)return Math.abs(t-i);if(Math.abs(a-o)<.01)return Math.abs(e-o);const l=(a-o)/(s-i);return Math.abs((l*t-e+(a-l*s))/Math.sqrt(l*l+1))}const u1=a1.build(B.Point),FP=[new B.Point,new B.Point,new B.Point,new B.Point],BP=new B.Matrix,Er=new B.Point,UP=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],GP=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],jP=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],HP=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],md=new Array(12),YP=[UP,GP,jP,HP];class XP extends B.Graphics{transformer;boxScalingHandles;constructor(e){super(),this.transformer=e,this.boxScalingHandles=[this.addChild(new B.Graphics),this.addChild(new B.Graphics),this.addChild(new B.Graphics),this.addChild(new B.Graphics)],this.boxScalingHandles.forEach(n=>{n.eventMode="static"}),this.boxScalingHandles[0].cursor=vi.topCenter,this.boxScalingHandles[1].cursor=vi.middleRight,this.boxScalingHandles[2].cursor=vi.bottomCenter,this.boxScalingHandles[3].cursor=vi.middleLeft}hitHandleType(e,n,r){const{boxRotationEnabled:i,boxRotationTolerance:o,boxScalingEnabled:s,boxScalingTolerance:a}=this.transformer,[l,c,u,f]=e.hull,{x:d,y:h}=n.applyInverse(r,Er);if(s){const p=qo(d,h,l,c)*n.d,m=qo(d,h,l,f)*n.a,g=qo(d,h,c,u)*n.a,y=qo(d,h,f,u)*n.d,b=Math.min(p,m,g,y);if(b<a)switch(b){case p:return"topCenter";case m:return"middleLeft";case g:return"middleRight";case y:return"bottomCenter"}}if(i&&!e.contains(d,h)){const p=Math.sqrt((l.x-d)**2+(l.y-h)**2),m=Math.sqrt((c.x-d)**2+(c.y-h)**2),g=Math.sqrt((f.x-d)**2+(f.y-h)**2),y=Math.sqrt((u.x-d)**2+(u.y-h)**2),b=Math.min(p,m,g,y);if(b<o*1.45)switch(b){case p:return"boxRotateTopLeft";case m:return"boxRotateTopRight";case g:return"boxRotateBottomLeft";case y:return"boxRotateBottomRight"}}return null}drawBounds(e){const n=FP;for(let r=0;r<4;r++)this.transformer.projectToLocal(e.hull[r],n[r]);this.poly(n)}drawBoxScalingTolerance(e,n=this.transformer.boxScalingTolerance){e.innerBounds.pad(-n);const r=u1.allocateArray(4);r.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(2.5*n);const i=u1.allocateArray(4);i.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let o=0;o<4;o++){const s=r[o],a=r[(o+1)%4],l=i[o],c=i[(o+1)%4];this.boxScalingHandles[o].clear().poly([s,l,c,a]).fill({color:16777215,alpha:1e-4})}}drawBoxRotationTolerance(){const{boxRotateTopLeft:e,boxRotateTopRight:n,boxRotateBottomLeft:r,boxRotateBottomRight:i}=this.transformer.handleAnchors,o=this.transformer.boxRotationTolerance*2,s=BP.identity().scale(o,o).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=YP[a];let c;switch(a){case 0:c=e;break;case 1:c=n;break;case 2:c=r;break;case 3:c=i;break}for(let u=0;u<l.length;u+=2){const f=l[u],d=l[u+1];Er.set(f,d),s.apply(Er,Er),md[u]=Er.x+c.x,md[u+1]=Er.y+c.y}this.poly(md.slice())}}projectToLocal(e,n){return this.transformer.projectToLocal(e,n)}}const f1=new B.Matrix;function d1(t){const e=f1.identity();return e.c=Math.tan(t),e}function h1(t){const e=f1.identity();return e.b=Math.tan(t),e}function p1(t,e,n,r=t.pivot){const i=e.a,o=e.b,s=e.c,a=e.d,l=-Math.atan2(-s,a),c=Math.atan2(o,i);return n=n??c,t.pivot.set(r.x,r.y),t.rotation=n,t.skew.x=n+l,t.skew.y=-n+c,t.scale.x=Math.sqrt(i*i+o*o),t.scale.y=Math.sqrt(s*s+a*a),t.position.x=e.tx+(r.x*e.a+r.y*e.c),t.position.y=e.ty+(r.x*e.b+r.y*e.d),t}const Vo=new B.Matrix,WP=new B.Matrix,Wt=new B.Transform;function zP(t,e,n){t.updateLocalTransform();const r=t.worldTransform,i=t.parent?WP.copyFrom(t.parent.worldTransform):B.Matrix.IDENTITY;Vo.copyFrom(r),Vo.prepend(e),Vo.prepend(i.clone().invert()),p1(Wt,Vo),t.position.set(Wt.position.x,Wt.position.y),t.scale.set(Wt.scale.x,Wt.scale.y),t.pivot.set(Wt.pivot.x,Wt.pivot.y),t.rotation=Wt.rotation,t.skew.set(Wt.skew.x,Wt.skew.y)}const gd=new B.Transform,qP=[new B.Point,new B.Point,new B.Point,new B.Point],Sr=new B.Matrix,cn=new B.Point,Ko=new zo,m1=[new B.Point,new B.Point,new B.Point,new B.Point],g1=new B.Point,y1=new B.Matrix,Zo=a1.build(B.Point),vi={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},$o=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],_1={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},VP=[...$o,"rotator","skewHorizontal","skewVertical"],KP=4,ZP=16,$P=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],JP=Math.PI/90,QP=[Math.PI/4,-Math.PI/4],eN=Math.PI/90,Tn={color:6514417,thickness:2};let tN=class fn extends B.Container{_group;get group(){return this._group}set group(e){this._group=e?[...e]:[],this._focusedElementIndex=this._group.length>0?0:-1,this.updateElementIndexMap(),this.lazyDirty=!0}boundingBoxes;boxRotationEnabled;boxRotationTolerance;boxScalingEnabled;boxScalingTolerance;centeredScaling;cursors;individualBorderColor;individualBorderThickness;individualBorderAlpha;individualBorderStyle;individualBorderDashPattern;nestedSelectionEnabled;focusedElementBorderColor;focusedElementBorderThickness;focusedElementBorderStyle;focusedElementBorderDashPattern;showNonFocusedBorders;lazyMode=!1;lazyDirty=!1;lockAspectRatio;projectionTransform;rotationSnaps;rotationSnapTolerance;skewRadius;skewSnaps;skewSnapTolerance;stage;translateEnabled;transientGroupTilt;groupBounds;handles;handleAnchors;wireframe;_enabledHandles=void 0;_rotateEnabled;_scaleEnabled;_skewEnabled;_skewX;_skewY;_transformHandle=null;_transformType;_handleStyle;_wireframeStyle;_colorTheme;_rotatorAnchorConfig;_focusedElementIndex;_elementIndexMap;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_transformStarted;_clickThreshold;_clickStartPosition;_elementClickCandidate;constructor(e={}){super(),this.eventMode="static",this.cursors=Object.assign({default:"move"},e.cursors),this.cursor=this.cursors.default,this.boundingBoxes=e.boundingBoxes||"all",this._group=e.group||[],this.boxRotationTolerance=e.boxRotationTolerance||ZP,this.boxScalingTolerance=e.boxScalingTolerance||KP,this.centeredScaling=!!e.centeredScaling,this.projectionTransform=new B.Matrix,this.lockAspectRatio=e.lockAspectRatio===!0,this.rotationSnaps=e.rotationSnaps||$P,this.rotationSnapTolerance=e.rotationSnapTolerance!==void 0?e.rotationSnapTolerance:JP,this.skewRadius=e.skewRadius||64,this.skewSnaps=e.skewSnaps||QP,this.skewSnapTolerance=e.skewSnapTolerance!==void 0?e.skewSnapTolerance:eN,this.boxRotationEnabled=e.boxRotationEnabled===!0,this.boxScalingEnabled=e.boxScalingEnabled===!0,this._rotateEnabled=e.rotateEnabled!==!1,this._scaleEnabled=e.scaleEnabled!==!1,this._skewEnabled=e.skewEnabled===!0,this.translateEnabled=e.translateEnabled!==!1,this.transientGroupTilt=e.transientGroupTilt!==void 0?e.transientGroupTilt:!0,this.wireframe=this.addChild(new XP(this)),this.wireframe.cursor="none",this.stage=e.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e.colorTheme},this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e.rotatorAnchor},this.individualBorderColor=e.individualBorderColor!==void 0?e.individualBorderColor:54527,this.individualBorderThickness=e.individualBorderThickness,this.individualBorderAlpha=e.individualBorderAlpha!==void 0?e.individualBorderAlpha:1,this.individualBorderStyle=e.individualBorderStyle||"solid",this.individualBorderDashPattern=e.individualBorderDashPattern||[8,4],this.nestedSelectionEnabled=e.nestedSelectionEnabled!==void 0?e.nestedSelectionEnabled:!0,this.focusedElementBorderColor=e.focusedElementBorderColor!==void 0?e.focusedElementBorderColor:9133302,this.focusedElementBorderThickness=e.focusedElementBorderThickness,this.focusedElementBorderStyle=e.focusedElementBorderStyle||"dashed",this.focusedElementBorderDashPattern=e.focusedElementBorderDashPattern||[8,4],this.showNonFocusedBorders=e.showNonFocusedBorders!==void 0?e.showNonFocusedBorders:!1,this._focusedElementIndex=this._group.length>0?0:-1,this._elementIndexMap=new WeakMap,this.updateElementIndexMap(),this._wireframeStyle=Object.assign({},Tn,{color:this._colorTheme.primary},e.wireframeStyle||{});const n=e.handleConstructor||Xt,r={outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity,...e.handleStyle};this._handleStyle=r;const i="#"+(r.outlineColor??6514417).toString(16).padStart(6,"0"),o="#"+(r.rotatorIconColor??16777215).toString(16).padStart(6,"0"),s=Math.round(28*((r.radius??7)/7));Xt.loadTextures([{bgColor:i,arrowColor:o,size:s}]).catch(()=>{});const a={rotator:this.addChild(new n(this,"rotator",r,u=>{this.rotateGroup("rotator",u)},this.commitGroup))},l=$o.reduce((u,f)=>{const d=new n(this,f,r,()=>{},this.commitGroup,vi[f]);return d.onHandleDelta=h=>{this.scaleGroup(d.handle,h)},d.visible=this._scaleEnabled,u[f]=d,this.addChild(u[f]),u},{}),c={skewHorizontal:this.addChild(new n(this,"skewHorizontal",r,u=>{this.skewGroup("skewHorizontal",u)},this.commitGroup,"pointer")),skewVertical:this.addChild(new n(this,"skewVertical",r,u=>{this.skewGroup("skewVertical",u)},this.commitGroup,"pointer"))};this.handles=Object.assign({},l,a,c),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new B.Point,boxRotateTopLeft:new B.Point,boxRotateTopRight:new B.Point,boxRotateBottomLeft:new B.Point,boxRotateBottomRight:new B.Point,topLeft:new B.Point,topCenter:new B.Point,topRight:new B.Point,middleLeft:new B.Point,middleCenter:new B.Point,middleRight:new B.Point,bottomLeft:new B.Point,bottomCenter:new B.Point,bottomRight:new B.Point,skewHorizontal:new B.Point,skewVertical:new B.Point},this.groupBounds=new zo,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new B.Point,this._pointerMoveTarget=null,this._transformStarted=!1,this._clickThreshold=e.clickThreshold||5,this._clickStartPosition=new B.Point,this._elementClickCandidate=-1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.on("pointerdown",this.onPointerDown),this.on("pointerup",this.onPointerUp),this.on("pointerupoutside",this.onPointerUp),this.onRender=()=>{this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw()}}get enabledHandles(){return this._enabledHandles}get clickThreshold(){return this._clickThreshold}set clickThreshold(e){this._clickThreshold=e}set enabledHandles(e){const n=!!e&&e.length>0;!(this._enabledHandles&&this._enabledHandles.length>0)&&!n||(this._enabledHandles=n?e:void 0,VP.forEach(i=>{const o=this.handles[i];o&&(o.visible=!1)}),n?e.forEach(i=>{const o=this.handles[i];o&&(o.visible=!0)}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,$o.forEach(i=>{i!=="middleCenter"&&(this.handles[i].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(e){const n=this.handles;for(const r in n){const i=n[r];i&&(i.style=e)}this._handleStyle=e}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(e){if(this._rotateEnabled!==e){if(this._rotateEnabled=e,this._enabledHandles)return;this.handles.rotator.visible=e}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(e){if(this._scaleEnabled!==e){if(this._scaleEnabled=e,this._enabledHandles)return;$o.forEach(n=>{n!=="middleCenter"&&(this.handles[n].visible=e)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(e){if(this._skewEnabled!==e){if(this._skewEnabled=e,this._enabledHandles)return;this.handles.skewHorizontal.visible=e,this.handles.skewVertical.visible=e}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(e){this._wireframeStyle=Object.assign({},Tn,e)}get colorTheme(){return this._colorTheme}set colorTheme(e){this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e},this._handleStyle={...this._handleStyle,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity},this._wireframeStyle={...this._wireframeStyle,color:this._colorTheme.primary},this.redrawAllHandles()}get rotatorAnchor(){return this._rotatorAnchorConfig}set rotatorAnchor(e){this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e}}get focusedElement(){return this._focusedElementIndex>=0&&this._focusedElementIndex<this._group.length?this._group[this._focusedElementIndex]:null}set focusedElementIndex(e){if(e>=-1&&e<this._group.length){const n=this._focusedElementIndex;this._focusedElementIndex=e,this.lazyDirty=!0,n!==e&&(e>=0&&e<this._group.length?this.emit("elementfocused",this._group[e],e):this.emit("elementfocuscleared"))}}get focusedElementIndex(){return this._focusedElementIndex}focusElement(e){const n=this._elementIndexMap.get(e);n!==void 0&&(this._focusedElementIndex=n,this.lazyDirty=!0,this.emit("elementfocused",e,n))}clearElementFocus(){this._focusedElementIndex=-1,this.lazyDirty=!0,this.emit("elementfocuscleared")}focusNextElement(){this._group.length!==0&&(this._focusedElementIndex=(this._focusedElementIndex+1)%this._group.length,this.lazyDirty=!0,this.emit("elementfocused",this.focusedElement,this._focusedElementIndex))}updateElementIndexMap(){this._elementIndexMap=new WeakMap,this._group.forEach((e,n)=>{this._elementIndexMap.set(e,n),this.setupElementInteraction(e,n)})}setupElementInteraction(e,n){"eventMode"in e&&(e.eventMode="none"),"interactive"in e&&(e.interactive=!1),"interactiveChildren"in e&&(e.interactiveChildren=!0)}redrawAllHandles(){Object.values(this.handles).forEach(e=>{e&&(e.style={...e.style,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity})})}drawRotatorAnchorDot(e,n,r,i,o,s){const a=this._rotatorAnchorConfig;if(!a.enabled)return;const l=r-e,c=i-n,u=Math.sqrt(l*l+c*c),f=l/u,d=c/u,p=(this._handleStyle.radius||7)/7,m=a.startPosition||.45,g=Math.min(.8,m+(p-1)*.1),y=u*(a.segmentLength||.005),b=u*g,x=a.color||s,v=a.thickness||o,T=e+f*b,w=n+d*b,O=T+f*y,C=w+d*y;switch(a.style){case"dashed":this.drawDashedLine(T,w,O,C,v,x);break;case"dotted":this.drawDottedLine(T,w,O,C,v,x);break;default:this.wireframe.moveTo(T,w).lineTo(O,C).stroke({width:v,color:x});break}}drawDashedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dashPattern||[8,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),p=u/d,m=f/d;for(let g=0;g<h;g++){const y=e+p*g*(l+c),b=n+m*g*(l+c),x=y+p*l,v=b+m*l;this.wireframe.moveTo(y,b).lineTo(x,v).stroke({width:o,color:s})}}drawDottedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dotPattern||[2,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),p=u/d,m=f/d;for(let g=0;g<h;g++){const y=e+p*g*(l+c),b=n+m*g*(l+c);this.wireframe.circle(y,b,l).fill({color:s})}}drawDashedBounds(e,n,r,i,o,s=1){const{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=e;this.drawDashedLineSegment(a.x,a.y,l.x,l.y,n,r,i,o,s),this.drawDashedLineSegment(l.x,l.y,u.x,u.y,n,r,i,o,s),this.drawDashedLineSegment(u.x,u.y,c.x,c.y,n,r,i,o,s),this.drawDashedLineSegment(c.x,c.y,a.x,a.y,n,r,i,o,s)}drawDottedBounds(e,n,r,i,o=1){const{topLeft:s,topRight:a,bottomLeft:l,bottomRight:c}=e;this.drawDottedLineSegment(s.x,s.y,a.x,a.y,n,r,i,o),this.drawDottedLineSegment(a.x,a.y,c.x,c.y,n,r,i,o),this.drawDottedLineSegment(c.x,c.y,l.x,l.y,n,r,i,o),this.drawDottedLineSegment(l.x,l.y,s.x,s.y,n,r,i,o)}drawDashedLineSegment(e,n,r,i,o,s,a,l,c=1){const u=r-e,f=i-n,d=Math.sqrt(u*u+f*f);if(d===0)return;const h=u/d,p=f/d,m=Math.floor(d/(o+s));for(let y=0;y<m;y++){const b=e+h*y*(o+s),x=n+p*y*(o+s),v=Math.min(r,b+h*o),T=Math.min(i,x+p*o);this.wireframe.moveTo(b,x).lineTo(v,T).stroke({width:l,color:a,alpha:c})}const g=d-m*(o+s);if(g>0){const y=e+h*m*(o+s),b=n+p*m*(o+s),x=Math.min(o,g),v=y+h*x,T=b+p*x;this.wireframe.moveTo(y,b).lineTo(v,T).stroke({width:l,color:a,alpha:c})}}drawDottedLineSegment(e,n,r,i,o,s,a,l=1){const c=r-e,u=i-n,f=Math.sqrt(c*c+u*u);if(f===0)return;const d=c/f,h=u/f,p=o*2+s,m=Math.max(1,Math.floor(f/p)+1),g=m>1?f/(m-1):0;for(let y=0;y<m;y++){const b=g*y,x=e+d*b,v=n+h*b;this.wireframe.circle(x,v,o).fill({color:a,alpha:l})}}getGroupBounds(e=!1){return e&&this.updateGroupBounds(),this.groupBounds}translateGroup=e=>{this._transformHandle=null,this._transformType="translate";const n=Sr.identity().translate(e.x,e.y);this.emitTransformStart(),this.prependTransform(n)};rotateGroup=(e,n)=>{this._transformHandle=e,this._transformType="rotate";const r=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[e],cn);this.projectionTransform.applyInverse(i,i),n=this.projectionTransform.applyInverse(n,g1);const o=r.center,s=Math.atan2(i.y-o.y,i.x-o.x);let l=Math.atan2(n.y-o.y,n.x-o.x)-s,c=this.groupBounds.rotation+l;c=this.snapAngle(c,this.rotationSnapTolerance,this.rotationSnaps),l=c-this.groupBounds.rotation;const u=Sr.identity().translate(-o.x,-o.y).rotate(l).translate(o.x,o.y);this.emitTransformStart(),this.prependTransform(u,!0),this.updateGroupBounds(c),this._skewX+=l,this._skewY+=l};scaleGroup=(e,n)=>{this._transformHandle=e,this._transformType="scale";const r=_1[e].x,i=_1[e].y,o=this.handles,s=this.groupBounds,a=s.rotation,l=s.innerBounds,c=this.worldTransform.apply(this.handleAnchors[e],cn);this.projectionTransform.applyInverse(c,c),n=this.projectionTransform.applyInverse(n,g1);const u=n.x-c.x,f=n.y-c.y,d=(s.topRight.x-s.topLeft.x)/l.width,h=(s.topRight.y-s.topLeft.y)/l.width,p=(s.bottomLeft.x-s.topLeft.x)/l.height,m=(s.bottomLeft.y-s.topLeft.y)/l.height,g=u*d+f*h,y=u*p+f*m;let b=1,x=1;r!==0&&(b=1+g*r/l.width),i!==0&&(x=1+y*i/l.height);const v=this.lockAspectRatio&&(e==="topLeft"||e==="topRight"||e==="bottomLeft"||e==="bottomRight"),T=.01;if(b<T&&(b=T),x<T&&(x=T),v){const C=Math.abs(b),R=Math.abs(x),P=.001;if(C>R+P)x=b;else if(R>C+P)b=x;else{const A=(b+x)/2;b=A,x=A}}let w;this.centeredScaling?w=s.center:r===1&&i===1?w=s.topLeft:r===-1&&i===1?w=s.topRight:r===1&&i===-1?w=s.bottomLeft:r===-1&&i===-1?w=s.bottomRight:i===1?w=new B.Point((s.topLeft.x+s.topRight.x)/2,(s.topLeft.y+s.topRight.y)/2):i===-1?w=new B.Point((s.bottomLeft.x+s.bottomRight.x)/2,(s.bottomLeft.y+s.bottomRight.y)/2):r===1?w=new B.Point((s.topLeft.x+s.bottomLeft.x)/2,(s.topLeft.y+s.bottomLeft.y)/2):r===-1?w=new B.Point((s.topRight.x+s.bottomRight.x)/2,(s.topRight.y+s.bottomRight.y)/2):w=s.center;const O=Sr.identity().translate(-w.x,-w.y).rotate(-a).scale(b,x).rotate(a).translate(w.x,w.y);if(this.emitTransformStart(),(x<0||b<0)&&!(x<0&&b<0))switch(e){case"topLeft":case"bottomLeft":this.swapHandles(o.topLeft,o.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(o.topCenter,o.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(o.topRight,o.bottomRight);break}this.prependTransform(O)};skewGroup=(e,n)=>{this._transformHandle=e,this._transformType="skew";const r=this.groupBounds,i=cn.copyFrom(n);this.projectionTransform.applyInverse(i,i);const o=r.center,s=Sr.identity().translate(-o.x,-o.y);let a=this.groupBounds.rotation;if(e==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-o.y,i.x-o.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),s.prepend(h1(-l)),s.prepend(h1(this._skewX))}else{const l=this._skewY,c=Math.atan2(i.y-o.y,i.x-o.x)-Math.PI/2;this._skewY=c,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),s.prepend(d1(l)),s.prepend(d1(-this._skewY)),a-=this._skewY-l}s.translate(o.x,o.y),this.emitTransformStart(),this.prependTransform(s,!0),this.updateGroupBounds(a)};commitGroup=()=>{const e=this._transformHandle,n=this._transformType;this._transformHandle=null,this._transformType="none",this._transformStarted=!1,this.transientGroupTilt!==!1&&this._group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit",this.buildCommitPayload(e,n))};buildCommitPayload(e,n){const r=this.groupBounds,i=r.innerBounds;return{groupBounds:{x:i.x,y:i.y,width:i.width,height:i.height,rotation:r.rotation,centerX:r.center.x,centerY:r.center.y},elements:this._group.map(o=>({x:o.position.x,y:o.position.y,width:o.width??0,height:o.height??0,rotation:o.rotation,scaleX:o.scale.x,scaleY:o.scale.y,skewX:o.skew.x,skewY:o.skew.y,pivotX:o.pivot.x,pivotY:o.pivot.y})),handle:e,transformType:n}}draw(){const e=this._group,n=this._wireframeStyle.color??Tn.color,r=this._wireframeStyle.thickness??Tn.thickness;if(this.wireframe.clear(),e.length>1&&this.boundingBoxes==="all"){const a=this.individualBorderThickness||r,l=this.focusedElementBorderThickness||r;for(let c=0,u=e.length;c<u;c++){const f=this.nestedSelectionEnabled&&this._focusedElementIndex===c;if(!this.nestedSelectionEnabled||f||this.showNonFocusedBorders&&this._focusedElementIndex===-1){const h=fn.calculateOrientedBounds(e[c],Ko);if(f){const[p,m]=this.focusedElementBorderDashPattern;this.focusedElementBorderStyle==="dashed"?this.drawDashedBounds(h,p,m,this.focusedElementBorderColor,l,1):this.focusedElementBorderStyle==="dotted"?this.drawDottedBounds(h,p,m,this.focusedElementBorderColor,1):(this.wireframe.drawBounds(h),this.wireframe.stroke({width:l,color:this.focusedElementBorderColor,alpha:1}))}else{const[p,m]=this.individualBorderDashPattern;if(this.individualBorderStyle==="dashed")this.drawDashedBounds(h,p,m,this.individualBorderColor,a,this.individualBorderAlpha);else if(this.individualBorderStyle==="dotted")this.drawDottedBounds(h,p,m,this.individualBorderColor,this.individualBorderAlpha);else{const g=h.innerBounds;this.wireframe.rect(g.x,g.y,g.width,g.height).stroke({width:a,color:this.individualBorderColor,alpha:this.individualBorderAlpha})}}}}}const s=e.length!==1?fn.calculateGroupOrientedBounds(e,this.groupBounds.rotation,Ko,!0):fn.calculateOrientedBounds(e[0],Ko);this.wireframe.drawBounds(s),this.translateEnabled&&this.wireframe.fill({color:16777215,alpha:1e-4}),this.boundingBoxes!=="none"&&this.wireframe.stroke({width:r,color:n}),this.drawHandles(s),this.groupBounds.copyFrom(s),this.boxRotationEnabled&&(this.wireframe.drawBoxRotationTolerance(),this.wireframe.fill({color:16777215,alpha:1e-4})),this.boxScalingEnabled&&this.wireframe.drawBoxScalingTolerance(s),this.lazyDirty=!1}drawHandles(e){const n=this.handles,r=this.handleAnchors,{topLeft:i,topRight:o,bottomLeft:s,bottomRight:a,center:l}=e,[c,u,f,d]=m1,h=cn;if(this.projectToLocal(i,c),this.projectToLocal(o,u),this.projectToLocal(s,f),this.projectToLocal(a,d),this.projectToLocal(l,h),r.topLeft.copyFrom(c),r.topCenter.set((c.x+u.x)/2,(c.y+u.y)/2),r.topRight.copyFrom(u),r.middleLeft.set((c.x+f.x)/2,(c.y+f.y)/2),r.middleCenter.set((c.x+d.x)/2,(c.y+d.y)/2),r.middleRight.set((u.x+d.x)/2,(u.y+d.y)/2),r.bottomLeft.copyFrom(f),r.bottomCenter.set((f.x+d.x)/2,(f.y+d.y)/2),r.bottomRight.copyFrom(d),this.boxRotationEnabled&&(r.boxRotateTopLeft.copyFrom(r.topLeft),r.boxRotateTopRight.copyFrom(r.topRight),r.boxRotateBottomLeft.copyFrom(r.bottomLeft),r.boxRotateBottomRight.copyFrom(r.bottomRight)),this._rotateEnabled){const p=(c.x+u.x)/2,m=(c.y+u.y)/2;let g=-(c.y-u.y),y=c.x-u.x;const b=this._handleStyle.radius||7,x=32,v=b/7,T=x*v,w=Math.sqrt(g*g+y*y);g*=T/w,y*=T/w;const O=n.rotator;O.position.x=p+g,O.position.y=m+y;const C=this._wireframeStyle.color??Tn.color,R=this._wireframeStyle.thickness??Tn.thickness;this.drawRotatorAnchorDot(p,m,O.position.x,O.position.y,R,C),this.handleAnchors.rotator.copyFrom(O.position)}if(this._skewEnabled){const p=h.x,m=h.y;this.worldTransform.apply(h,h),r.skewHorizontal.set(h.x+Math.cos(this._skewX)*this.skewRadius,h.y+Math.sin(this._skewX)*this.skewRadius),r.skewVertical.set(h.x+-Math.sin(this._skewY)*this.skewRadius,h.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(r.skewHorizontal,r.skewHorizontal),this.worldTransform.applyInverse(r.skewVertical,r.skewVertical),h.set(p,m);const g=this._wireframeStyle.color??Tn.color,y=this._wireframeStyle.thickness??Tn.thickness,b=n.skewHorizontal,x=n.skewVertical;this.wireframe.circle(h.x,h.y,y*2).fill({color:g}),this.wireframe.moveTo(h.x,h.y).lineTo(b.x,b.y).moveTo(h.x,h.y).lineTo(x.x,x.y).stroke({width:y,color:g})}for(const p in n){let m=this.groupBounds.rotation;p==="skewHorizontal"?m=this._skewX:p==="skewVertical"&&(m=this._skewY);const g=n[p];g&&(g.rotation=m,g.position.copyFrom(r[p]),g.getBounds())}}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,this._clickStartPosition.copyFrom(e.global),this._pointerPosition.copyFrom(e.global),this._transformStarted=!1;const n=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,e.global);if(n)this._transformHandle=n,this._elementClickCandidate=-1;else if(this.nestedSelectionEnabled&&this._group.length>1){const r=e.global;this.projectionTransform.applyInverse(r,cn),this._elementClickCandidate=-1;const i=[];for(let o=0;o<this._group.length;o++)fn.calculateOrientedBounds(this._group[o],Ko).contains(cn.x,cn.y)&&i.push(o);if(i.length>0){let o=i[0];for(let s=1;s<i.length;s++){const a=this._group[o],l=this._group[i[s]];fn.isAboveInDisplayOrder(l,a)&&(o=i[s])}this._elementClickCandidate=o}}e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}static isAboveInDisplayOrder(e,n){if(e===n)return!1;const r=[],i=[];let o=e;for(;o;)r.push(o),o=o.parent;for(o=n;o;)i.push(o),o=o.parent;r.reverse(),i.reverse();const s=Math.min(r.length,i.length);for(let a=0;a<s;a++)if(r[a]!==i[a]){const l=r[a-1];if(!l||!l.children)return!1;const c=l.children.indexOf(r[a]),u=l.children.indexOf(i[a]);return c>u}return r.length>i.length}onPointerMove(e){const n=this._pointerPosition,r=Zo.allocate().copyFrom(e.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,r);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const o=Math.sqrt(Math.pow(r.x-this._clickStartPosition.x,2)+Math.pow(r.y-this._clickStartPosition.y,2));if(!this._pointerDragging&&o>this._clickThreshold&&(this._pointerDragging=!0,this._elementClickCandidate=-1),this._pointerDragging){switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,r);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,r);break;default:if(this.translateEnabled){const[s,a,l]=m1;s.set(0,0),a.set(r.x-n.x,r.y-n.y),this.projectionTransform.applyInverse(s,s),this.projectionTransform.applyInverse(a,a),l.set(a.x-s.x,a.y-s.y),this.translateGroup(l)}}this.emitTransformStart(),e.stopPropagation()}this._pointerPosition.x=r.x,this._pointerPosition.y=r.y}Zo.release(r)}emitTransformStart(){this._transformStarted||(this._transformStarted=!0,this.emit("transformstart",{handle:this._transformHandle,transformType:this._transformType}))}onPointerUp(e){if(!this._pointerDragging&&this.nestedSelectionEnabled&&this._group.length>1&&this._elementClickCandidate>=0){const r=this._elementClickCandidate;this._focusedElementIndex===r?this.lazyDirty=!0:(this._focusedElementIndex=r,this.lazyDirty=!0,this.emit("elementfocused",this._group[r],r))}this._pointerDragging=!1,this._pointerDown=!1,this._elementClickCandidate=-1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._transformStarted=!1,this.commitGroup(),e.stopPropagation()}prependTransform(e,n=!1){const r=this._group;for(let i=0,o=r.length;i<o;i++)zP(r[i],e);y1.copyFrom(e),n||this.updateGroupBounds(),this.emit("transformchange",y1)}updateGroupBounds(e=this.groupBounds.rotation){fn.calculateGroupOrientedBounds(this._group,e,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(e,n,r){if(e=e%(Math.PI*2),!r||r.length===1||!n)return e;for(let i=0,o=r.length;i<o;i++)if(Math.abs(e-r[i])<=n)return r[i];return e}swapHandles(e,n){const r=e.handle,i=n.handle,o=e.cursor,s=n.cursor,a=e.x,l=n.x,c=e.y,u=n.y;e.handle=i,n.handle=r,e.position.set(l,u),n.position.set(a,c),e.cursor=s,n.cursor=o,this.handles[r]=n,this.handles[i]=e,this._transformHandle===r?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=r)}setCursorFromHoveredHandle(e){if(e&&e.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(e)switch(e){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(e,n){return n||(n=new B.Point),this.projectionTransform.apply(e,n),this.worldTransform.applyInverse(n,n),n}static calculateTransformedCorners(e,n=e.worldTransform,r,i=0){const o=e.getLocalBounds();return e.getBounds(),r=r||[new B.Point,new B.Point,new B.Point,new B.Point],r[i].set(o.x,o.y),r[i+1].set(o.x+o.width,o.y),r[i+2].set(o.x+o.width,o.y+o.height),r[i+3].set(o.x,o.y+o.height),n.apply(r[i],r[i]),n.apply(r[i+1],r[i+1]),n.apply(r[i+2],r[i+2]),n.apply(r[i+3],r[i+3]),r}static calculateOrientedBounds(e,n){e.updateLocalTransform(),p1(gd,e.worldTransform);const r=gd.rotation,i=fn.calculateTransformedCorners(e,e.worldTransform,qP),o=(i[0].x+i[1].x+i[2].x+i[3].x)/4,s=(i[0].y+i[1].y+i[2].y+i[3].y)/4,a=Sr.identity().translate(-o,-s).rotate(-gd.rotation).translate(o,s);return a.apply(i[0],i[0]),a.apply(i[1],i[1]),a.apply(i[2],i[2]),a.apply(i[3],i[3]),n=n||new zo,n.rotation=r,n.innerBounds.x=Math.min(i[0].x,i[1].x,i[2].x,i[3].x),n.innerBounds.y=Math.min(i[0].y,i[1].y,i[2].y,i[3].y),n.innerBounds.width=Math.max(i[0].x,i[1].x,i[2].x,i[3].x)-n.innerBounds.x,n.innerBounds.height=Math.max(i[0].y,i[1].y,i[2].y,i[3].y)-n.innerBounds.y,n}static calculateGroupOrientedBounds(e,n,r,i=!1){const o=e.length,s=Zo.allocateArray(o*4);for(let d=0;d<o;d++){const h=e[d];i||h.updateLocalTransform(),fn.calculateTransformedCorners(h,h.worldTransform,s,d*4)}const a=Sr.identity().rotate(-n);let l=Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let d=0,h=s.length;d<h;d++){const p=s[d];a.apply(p,p);const m=p.x,g=p.y;l=m<l?m:l,c=g<c?g:c,u=m>u?m:u,f=g>f?g:f}return Zo.releaseArray(s),r=r||new zo,r.innerBounds.x=l,r.innerBounds.y=c,r.innerBounds.width=u-l,r.innerBounds.height=f-c,r.rotation=n,a.applyInverse(r.center,cn),r.center.copyFrom(cn),r}};function nN(t,e,n,r){for(const i in e){const o=n[i],s=r[i],a=e[i];o!==s&&(o&&t.off(a,o),s&&t.on(a,s))}}const En={},rN=B.Matrix.IDENTITY,iN={transformstart:"transformstart",transformchange:"transformchange",transformcommit:"transformcommit",elementfocused:"elementfocused",elementfocuscleared:"elementfocuscleared"};function b1(t,e,n){if(nN(t,iN,e,n),n.cursors&&Object.assign(t.cursors,n.cursors),t.group=n.group||[],t.boundingBoxes=n.boundingBoxes||"all",t.boxScalingEnabled=n.boxScalingEnabled===!0,t.boxScalingTolerance=n.boxScalingTolerance!==void 0?n.boxScalingTolerance:t.boxScalingTolerance,t.boxRotationEnabled=n.boxRotationEnabled===!0,t.boxRotationTolerance=n.boxRotationTolerance!==void 0?n.boxRotationTolerance:t.boxRotationTolerance,t.centeredScaling=n.centeredScaling??!1,t.enabledHandles=n.enabledHandles,t.lockAspectRatio=n.lockAspectRatio??!1,t.projectionTransform.copyFrom(n.projectionTransform||rN),t.skewRadius=n.skewRadius||t.skewRadius,t.rotateEnabled=n.rotateEnabled!==!1,t.scaleEnabled=n.scaleEnabled!==!1,t.skewEnabled=n.skewEnabled===!0,t.translateEnabled=n.translateEnabled!==!1,t.transientGroupTilt=n.transientGroupTilt??!0,e.clickThreshold!==n.clickThreshold&&n.clickThreshold!==void 0&&(t.clickThreshold=n.clickThreshold),e.handleConstructor!==n.handleConstructor&&e.handleConstructor!==void 0)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");e.rotationSnaps!==n.rotationSnaps&&(t.rotationSnaps=n.rotationSnaps??t.rotationSnaps),e.rotationSnapTolerance!==n.rotationSnapTolerance&&(t.rotationSnapTolerance=n.rotationSnapTolerance??t.rotationSnapTolerance),e.skewSnaps!==n.skewSnaps&&(t.skewSnaps=n.skewSnaps??t.skewSnaps),e.skewSnapTolerance!==n.skewSnapTolerance&&(t.skewSnapTolerance=n.skewSnapTolerance??t.skewSnapTolerance);const r=e.colorTheme||En,i=n.colorTheme||En;(r.primary!==i.primary||r.secondary!==i.secondary||r.background!==i.background||r.glow!==i.glow||r.glowIntensity!==i.glowIntensity)&&(t.colorTheme=i);const o=e.handleStyle||En,s=n.handleStyle||En;(o.color!==s.color||o.outlineColor!==s.outlineColor||o.outlineThickness!==s.outlineThickness||o.radius!==s.radius||o.shape!==s.shape||o.rotatorIconColor!==s.rotatorIconColor)&&(t.handleStyle=s);const a=e.wireframeStyle||En,l=n.wireframeStyle||En;(a.color!==l.color||a.thickness!==l.thickness)&&(t.wireframeStyle=l);const c=e.rotatorAnchor||En,u=n.rotatorAnchor||En;if((c.enabled!==u.enabled||c.startPosition!==u.startPosition||c.segmentLength!==u.segmentLength||c.thickness!==u.thickness||c.color!==u.color||c.style!==u.style||JSON.stringify(c.dashPattern)!==JSON.stringify(u.dashPattern)||JSON.stringify(c.dotPattern)!==JSON.stringify(u.dotPattern))&&(t.rotatorAnchor=u),e.nestedSelectionEnabled!==n.nestedSelectionEnabled&&(t.nestedSelectionEnabled=n.nestedSelectionEnabled!==void 0?n.nestedSelectionEnabled:!0),e.focusedElementBorderColor!==n.focusedElementBorderColor&&(t.focusedElementBorderColor=n.focusedElementBorderColor!==void 0?n.focusedElementBorderColor:9133302),e.focusedElementBorderThickness!==n.focusedElementBorderThickness&&(t.focusedElementBorderThickness=n.focusedElementBorderThickness),e.focusedElementBorderStyle!==n.focusedElementBorderStyle&&(t.focusedElementBorderStyle=n.focusedElementBorderStyle||"dashed"),e.focusedElementBorderDashPattern!==n.focusedElementBorderDashPattern&&(t.focusedElementBorderDashPattern=n.focusedElementBorderDashPattern||[8,4]),e.showNonFocusedBorders!==n.showNonFocusedBorders&&(t.showNonFocusedBorders=n.showNonFocusedBorders!==void 0?n.showNonFocusedBorders:!1),e.individualBorderColor!==n.individualBorderColor&&(t.individualBorderColor=n.individualBorderColor!==void 0?n.individualBorderColor:54527),e.individualBorderThickness!==n.individualBorderThickness&&(t.individualBorderThickness=n.individualBorderThickness),e.individualBorderAlpha!==n.individualBorderAlpha&&(t.individualBorderAlpha=n.individualBorderAlpha!==void 0?n.individualBorderAlpha:1),e.individualBorderStyle!==n.individualBorderStyle&&(t.individualBorderStyle=n.individualBorderStyle||"solid"),e.individualBorderDashPattern!==n.individualBorderDashPattern&&(t.individualBorderDashPattern=n.individualBorderDashPattern||[8,4]),n.focusedElementIndex!==void 0&&(t.focusedElementIndex=n.focusedElementIndex),e.onFocusChange!==n.onFocusChange){const f="__transformerFocusListeners",d=t[f];if(d&&(t.off("elementfocused",d.focused),t.off("elementfocuscleared",d.cleared)),n.onFocusChange){const h=(m,g)=>n.onFocusChange(g,m),p=()=>n.onFocusChange(-1,null);t.on("elementfocused",h),t.on("elementfocuscleared",p),t[f]={focused:h,cleared:p}}else t[f]=void 0}}const oN=S.forwardRef(function(e,n){const r=S.useRef(null),i=S.useRef(null),o=S.useRef({});return S.useEffect(()=>{const s=r.current;if(!s)return;const a=new tN({...e,stage:s});return s.addChild(a),i.current=a,b1(a,{},e),o.current=e,typeof n=="function"?n(a):n&&(n.current=a),()=>{s.removeChild(a),a.destroy({children:!0}),i.current=null,typeof n=="function"?n(null):n&&(n.current=null)}},[]),S.useEffect(()=>{const s=i.current;s&&(b1(s,o.current,e),o.current=e)}),I.createElement("pixiContainer",{ref:r})}),sN=300,aN=({selectedElementIds:t=[],containerRefsMap:e,mouseOverTransformerRef:n,isMultiSelect:r,rotateEnabled:i=!0,scaleEnabled:o=!0,translateEnabled:s=!0,skewEnabled:a=!1,boxScalingEnabled:l=!0,boxRotationEnabled:c=!0,showNonFocusedBorders:u,focusedElementIndex:f,individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:p,onDoubleClickElement:m,onTransformChange:g,onTransformCommit:y})=>{const b=S.useMemo(()=>{const P=[];for(const A of t){const L=e[A]?.current;L&&P.push(L)}return P},[t,e]),x=S.useRef(null),v=S.useRef(0),T=S.useRef(null),w=t[0],O=S.useCallback(P=>{n?.current&&(n.current.isDragging=!0,n.current.dragType=P.transformType)},[n]),C=S.useCallback(()=>{w&&g?.(w)},[w,g]),R=S.useCallback(P=>{if(n?.current&&(n.current.isDragging=!1,n.current.dragType=null),!w)return;const A=P.elements[0],L=A?{...A,groupBounds:P.groupBounds,handle:P.handle,transformType:P.transformType,elements:P.elements}:P;y?.(w,L)},[w,n,y]);return S.useEffect(()=>{const P=t.map(L=>({id:L,c:e[L]?.current})).filter(L=>!!L.c);if(!m||P.length===0)return;const A=[];for(const{id:L,c:N}of P){const D=N.eventMode;N.eventMode="static";const F=G=>{const z=performance.now();T.current===L&&z-v.current<sN?(m(L),v.current=0,T.current=null):(v.current=z,T.current=L)};N.on("pointerdown",F),A.push({c:N,fn:F}),N.__prevEventMode=D}return()=>{for(const{c:L,fn:N}of A){L.off("pointerdown",N);const D=L.__prevEventMode;D!==void 0&&(L.eventMode=D)}}},[t,e,m]),b.length===0?null:M.jsx(oN,{ref:x,group:b,rotateEnabled:i,scaleEnabled:o,translateEnabled:s,skewEnabled:a,boxScalingEnabled:l,boxRotationEnabled:c,boundingBoxes:r?"all":"groupOnly",nestedSelectionEnabled:!!r,showNonFocusedBorders:u??!!r,focusedElementIndex:f??(r?-1:void 0),individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:p,transformstart:O,transformchange:C,transformcommit:R})},x1=(t,e,n,r,i)=>{const o=1-i;return o*o*o*t+3*o*o*i*e+3*o*i*i*n+i*i*i*r};function v1(t,e=24){const{vertices:n,outTangents:r,inTangents:i,closed:o}=t;if(n.length===0)return[];const s=[],a=o?n.length:n.length-1;for(let l=0;l<a;l++){const c=n[l],u=n[(l+1)%n.length],f=r[l],d=i[(l+1)%n.length],h=[c[0]+f[0],c[1]+f[1]],p=[u[0]+d[0],u[1]+d[1]];for(let m=0;m<e;m++){const g=m/e;s.push([x1(c[0],h[0],p[0],u[0],g),x1(c[1],h[1],p[1],u[1],g)])}}return o||s.push(n[n.length-1]),s}function yd(t,e=96){switch(t.kind){case"rect":{const[n,r]=Ti(t.size),[i,o]=t.position?Ti(t.position):[0,0],s=i-n/2,a=o-r/2;return[[s,a],[s+n,a],[s+n,a+r],[s,a+r],[s,a]]}case"ellipse":{const[n,r]=Ti(t.size),[i,o]=t.position?Ti(t.position):[0,0],s=[],a=n/2,l=r/2;for(let c=0;c<=e;c++){const u=c/e*Math.PI*2;s.push([i+Math.cos(u)*a,o+Math.sin(u)*l])}return s}case"polystar":return cN(t,e);case"bezier":return v1(uN(t.path))}}function cN(t,e){const n=Math.max(3,Math.floor(Jo(t.points))),r=Jo(t.outerRadius),i=t.innerRadius!==void 0?Jo(t.innerRadius):r,o=t.rotation!==void 0?Jo(t.rotation):0,[s,a]=t.position?Ti(t.position):[0,0],l=t.starType==="star",c=l?n*2:n,u=o*Math.PI/180,f=[];for(let d=0;d<=c;d++){const p=!l||d%2===0?r:i,m=d/c*Math.PI*2-Math.PI/2+u;f.push([s+Math.cos(m)*p,a+Math.sin(m)*p])}return f.length>e?lN(f,e):f}function lN(t,e){if(t.length<=2||e<=2)return t.slice();const n=[];let r=0;for(let a=0;a<t.length-1;a++){const l=t[a+1][0]-t[a][0],c=t[a+1][1]-t[a][1],u=Math.hypot(l,c);n.push(u),r+=u}if(r===0)return[t[0],t[t.length-1]];const i=[];let o=0,s=0;for(let a=0;a<e;a++){const l=a/(e-1)*r;for(;o<n.length-1&&s+n[o]<l;)s+=n[o],o++;const c=n[o]||1,u=(l-s)/c;i.push([t[o][0]+(t[o+1][0]-t[o][0])*u,t[o][1]+(t[o+1][1]-t[o][1])*u])}return i}function T1(t,e,n,r=0){if(t.length<2)return t;const i=d=>{const h=d%1;return h<0?h+1:h},o=i(e+r),s=i(n+r);if(o===s)return[];const a=[];let l=0;for(let d=0;d<t.length-1;d++){const h=Math.hypot(t[d+1][0]-t[d][0],t[d+1][1]-t[d][1]);a.push(h),l+=h}if(l===0)return[];const c=d=>{let h=d*l;for(let p=0;p<a.length;p++){if(h<=a[p])return{idx:p,t:a[p]===0?0:h/a[p]};h-=a[p]}return{idx:a.length-1,t:1}},u=(d,h,p)=>[d[0]+(h[0]-d[0])*p,d[1]+(h[1]-d[1])*p],f=(d,h)=>{const p=c(d),m=c(h),g=[u(t[p.idx],t[p.idx+1],p.t)];for(let y=p.idx+1;y<=m.idx;y++)g.push(t[y]);return g.push(u(t[m.idx],t[m.idx+1],m.t)),g};return o<s?f(o,s):[...f(o,1),...f(0,s)]}function Ti(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function Jo(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function uN(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const E1=t=>new W.Color(t).toNumber(),S1=t=>t.length===9?parseInt(t.slice(7,9),16)/255:1;function w1(t,e){const{path:n,fill:r,stroke:i,trim:o}=e;if(o){hN(t,n,o,r,i);return}fN(t,n),O1(t,r,i)}function fN(t,e){switch(e.kind){case"rect":{const[n,r]=Qo(e.size),[i,o]=e.position?Qo(e.position):[0,0],s=e.roundness?pN(e.roundness):0,a=i-n/2,l=o-r/2;s>0?t.roundRect(a,l,n,r,s):t.rect(a,l,n,r);return}case"ellipse":{const[n,r]=Qo(e.size),[i,o]=e.position?Qo(e.position):[0,0];t.ellipse(i,o,n/2,r/2);return}case"polystar":{const n=yd(e);A1(t,n,!0);return}case"bezier":dN(t,mN(e.path));return}}function dN(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function A1(t,e,n){if(!(e.length<2)){t.moveTo(e[0][0],e[0][1]);for(let r=1;r<e.length;r++)t.lineTo(e[r][0],e[r][1]);n&&t.closePath()}}function hN(t,e,n,r,i){const o=yd(e),s=T1(o,C1(n.start),C1(n.end),n.offset??0);A1(t,s,n.start===0&&n.end===1),O1(t,r,i)}function O1(t,e,n){e&&t.fill({color:E1(e),alpha:S1(e)}),n&&t.stroke({color:E1(n.color),width:n.width,alpha:S1(n.color),cap:n.cap??"butt",join:n.join??"miter"})}const C1=t=>Math.max(0,Math.min(1,t));function Qo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function pN(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function mN(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const gN={vertices:[],inTangents:[],outTangents:[],closed:!1},yN=({ref:t,...e})=>{const n=I.useRef(null),r=I.useRef(null),{path:i,fill:o,stroke:s,trimPath:a,transformation:l,visible:c}=e,{x:u,y:f}=l,h=Jt()?.currentFrame??0,p=zn(),m=I.useMemo(()=>({fill:o!==void 0?xt(Yn(o,p),"#000000",h):void 0,stroke:s&&{color:xt(s.color,"#000000",h),width:ye(s.width,1,h),cap:s.cap,join:s.join},trim:a&&{start:ye(a.start,0,h),end:ye(a.end,1,h),offset:a.offset!==void 0?ye(a.offset,0,h):void 0}}),[o,s,a,h,p]),g=I.useMemo(()=>i.kind!=="bezier"?i:{kind:"bezier",path:Uf(i.path,gN,h)},[i,h]),y=I.useCallback(b=>{b.clear(),w1(b,{path:g,fill:m.fill,stroke:m.stroke,trim:m.trim})},[g,m]);return M.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:r,x:u,y:f,children:M.jsx("pixiGraphics",{ref:n,draw:y,alpha:c?1:0})})})},R1=I.memo(yN,tt),_N=({ref:t,...e})=>{const n=I.useRef(null),{transformation:r}=e;return M.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:n,x:r.x,y:r.y})})},I1=I.memo(_N,tt),M1=(t,e,n,r)=>n+(t-e)*r,L1=I.memo(({uniqueId:t,src:e,startAt:n,endAt:r,inPointFrames:i,level:o,pan:s,muted:a,visible:l=!0,trimStart:c=0,speed:u=1,transformation:f,onContainerRefReady:d})=>{const h=_t(),{tl:p,registerTimeUpdateListener:m,unregisterTimeUpdateListener:g}=I.useContext(Ye),y=h.framesToSeconds(i),b=h.fps,[x,v]=I.useState(null),T=I.useRef(null),w=I.useRef(s);w.current=s;const O=I.useCallback((P,A)=>{v(A)},[]),C=I.useCallback(P=>Math.max(0,Math.min(1,ye(o,1,M1(P,y,i,b)))),[o,y,i,b]),R=I.useCallback(P=>{const A=T.current;if(!A)return;const L=ye(w.current,0,M1(P,y,i,b));A.pan.value=Math.max(-1,Math.min(1,L))},[y,i,b]);return I.useEffect(()=>{if(s===void 0||!x)return;const P=hr.getContext(),A=hr.getOrCreateSourceNode(t);if(!P||!A||typeof P.createStereoPanner!="function")return;const L=P.createStereoPanner();try{A.disconnect(P.destination)}catch{}return A.connect(L).connect(P.destination),T.current=L,()=>{T.current=null;try{A.disconnect(L),L.disconnect(),A.connect(P.destination)}catch{}}},[x,s!==void 0,t]),I.useEffect(()=>{if(!(s===void 0||!m||!g))return m(R),()=>g(R)},[s!==void 0,R,m,g]),I.useEffect(()=>{s!==void 0&&R(p?.current?.time()??y)},[x,s,R,y,p]),M.jsx(t_,{uniqueId:t,src:e,startAt:n,endAt:r,audioStartAt:c,mute:!!a,speed:u,visible:l,getVolume:C,transformation:f,onAudioElementReady:O,onContainerRefReady:d})});L1.displayName="AepAudioLayer";function P1(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}function N1(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function k1(t,e){if(e.length!==0){for(const n of e)if(n.mode==="subtract"){const r=bN(P1(n.path));N1(t,r)}else N1(t,P1(n.path));t.fill({color:16777215,alpha:1})}}function bN(t){const e=t.vertices.length;return{vertices:t.vertices.slice().reverse(),outTangents:Array.from({length:e},(n,r)=>t.inTangents[e-1-r]),inTangents:Array.from({length:e},(n,r)=>t.outTangents[e-1-r]),closed:t.closed}}const xN={vertices:[],inTangents:[],outTangents:[],closed:!1},D1=({masks:t,children:e})=>{const n=I.useRef(null),r=I.useRef(null),o=Jt()?.currentFrame??0;I.useEffect(()=>{const l=n.current,c=r.current;if(!(!l||!c))return l.mask=c,()=>{l.mask=null}},[]);const s=I.useMemo(()=>t.map(l=>({...l,path:Uf(l.path,xN,o)})),[t,o]),a=I.useCallback(l=>{l.clear(),k1(l,s)},[s]);return M.jsxs("pixiContainer",{ref:n,children:[e,M.jsx("pixiGraphics",{ref:r,draw:a})]})},F1=({source:t,matted:e,mode:n,width:r,height:i})=>{const{app:o}=at.useApplication(),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(null);I.useEffect(()=>{if(o?.renderer)return c.current&&(c.current.width!==r||c.current.height!==i)&&(c.current.destroy(!0),c.current=null),c.current||(c.current=W.RenderTexture.create({width:Math.max(1,Math.round(r)),height:Math.max(1,Math.round(i))})),()=>{c.current?.destroy(!0),c.current=null}},[o,r,i]),I.useEffect(()=>{const h=o?.renderer;if(!h)return;const p=()=>{const m=c.current,g=s.current;!m||!g||(h.render({container:g,target:m}),l.current&&(l.current.texture=m))};return o.ticker.add(p),()=>{o.ticker.remove(p)}},[o]),I.useEffect(()=>{const h=a.current,p=l.current;if(!(!h||!p))return h.mask=p,()=>{h.mask=null}},[]);const u=n==="alpha-inverted"||n==="luma-inverted",f=n==="luma"||n==="luma-inverted",d=I.useMemo(()=>{if(!f)return;const h=new W.ColorMatrixFilter;return h.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,.2126,.7152,.0722,0,0],[h]},[f]);return M.jsxs("pixiContainer",{children:[M.jsx("pixiContainer",{ref:s,renderable:!0,alpha:0,children:t}),M.jsx("pixiContainer",{ref:a,children:e}),M.jsx("pixiSprite",{ref:l,width:r,height:i,alpha:1,filters:d,renderable:!1})]})};function _d(t,e){if(!e)throw new Error(`AEP: unknown assetId '${t}' (no entry in comp.assets)`);return{url:e.src,mime:vN(e.type)}}function vN(t){switch(t){case"image":return"image/*";case"video":return"video/*";case"audio":return"audio/*";case"lottie":return"application/json";case"svg":return"image/svg+xml";case"model":return"model/gltf-binary";default:return}}const B1=I.createContext(null),U1=({resolver:t,children:e})=>M.jsx(B1.Provider,{value:t,children:e});function G1(){return I.useContext(B1)??_d}const j1=new WeakMap;function TN(t){let e=j1.get(t);return e||(e=new Map,j1.set(t,e)),e}function Ei(t){const e=G1(),n=_t(),[r,i]=I.useState(()=>t?{url:"",state:"loading"}:{url:"",state:"idle"});return I.useEffect(()=>{if(!t){i({url:"",state:"idle"});return}const o=n.assets[t],s=TN(n.assets);let a=!1;const l=async()=>{const c=s.get(t);if(c)return c;const u=Promise.resolve(e(t,o));s.set(t,u);try{return await u}catch(f){throw s.delete(t),f}};return i({url:"",state:"loading"}),l().then(c=>{a||i({url:c.url,mime:c.mime,state:"ready"})}).catch(c=>{a||(console.error(`AEP asset resolver failed for '${t}':`,c),i({url:"",state:"error",error:c}))}),()=>{a=!0}},[t,e,n.assets]),r}function H1(t,e){const n=[],r=new Set;let i=t;for(;i;){if(r.has(i.id))throw new Error(`cyclic parent chain detected at layer '${t.id}' via '${i.id}'`);r.add(i.id),n.push(i),i=i.parent?e.get(i.parent):void 0}return n}function EN(t,e){const n=Math.cos(t.rotation*Math.PI/180),r=Math.sin(t.rotation*Math.PI/180),i=e.x*t.scaleX,o=e.y*t.scaleY;return{x:t.x+(n*i-r*o),y:t.y+(r*i+n*o),scaleX:t.scaleX*e.scaleX,scaleY:t.scaleY*e.scaleY,rotation:t.rotation+e.rotation,alpha:t.alpha*e.alpha}}function Y1(t,e){const{layersById:n,currentFrame:r}=_t();return I.useMemo(()=>{const i=H1(t,n);let o={x:0,y:0,scaleX:1,scaleY:1,rotation:0,alpha:1};for(let u=i.length-1;u>=0;u--){const f=i[u].transform,[d,h]=sn(f.position,[0,0],r),[p,m]=sn(f.scale,[1,1],r);o=EN(o,{x:d,y:h,scaleX:p,scaleY:m,rotation:ye(f.rotation,0,r),alpha:ye(f.opacity,1,r)})}const[s,a]=sn(t.transform.anchor,[0,0],r),l=e.width>0?s/e.width:.5,c=e.height>0?a/e.height:.5;return{x:o.x,y:o.y,width:e.width,height:e.height,scale:[o.scaleX,o.scaleY],rotation:o.rotation,alpha:o.alpha,anchor:{x:l,y:c}}},[t,n,e.width,e.height,r])}function X1(t){return!!(t.splitMode&&t.splitMode!=="single"||t.animators&&t.animators.length>0||(t.style.runs?.length??0)>0||typeof t.style.align=="string"&&t.style.align.startsWith("justify")||Array.isArray(t.style.fill))}const es=()=>{},bd=I.createContext({ready:!0,readyCount:0,total:0,register:()=>es,markReady:es,reset:es,reportError:es});function W1(){return I.useContext(bd).ready}function z1(){return I.useContext(bd)}const q1=({children:t,onLayerError:e})=>{const[n,r]=I.useState(()=>new Map),[i,o]=I.useState(!1);I.useEffect(()=>{o(!0)},[]);const s=I.useRef(e);s.current=e;const a=I.useCallback(m=>(r(g=>{if(g.has(m))return g;const y=new Map(g);return y.set(m,!1),y}),()=>{r(g=>{if(!g.has(m))return g;const y=new Map(g);return y.delete(m),y})}),[]),l=I.useCallback(m=>{r(g=>{if(g.get(m)===!0||!g.has(m))return g;const y=new Map(g);return y.set(m,!0),y})},[]),c=I.useCallback(m=>{r(g=>{if(g.get(m)===!1||!g.has(m))return g;const y=new Map(g);return y.set(m,!1),y})},[]),u=I.useCallback((m,g)=>{console.error(`[model3d] layer '${m}' failed:`,g),s.current?.(m,g)},[]),f=n.size;let d=0;for(const m of n.values())m&&(d+=1);const h=i&&d===f,p=I.useMemo(()=>({ready:h,readyCount:d,total:f,register:a,markReady:l,reset:c,reportError:u}),[h,d,f,a,l,c,u]);return M.jsx(bd.Provider,{value:p,children:t})},SN={can:[[0,0],[.5,0],[.5,.04],[.5,.9],[.48,.95],[.4,.99],[.4,1],[0,1]],bottle:[[0,0],[.3,0],[.4,.05],[.42,.2],[.4,.55],[.34,.68],[.18,.78],[.14,.86],[.14,.96],[.18,1],[0,1]],jar:[[0,0],[.46,0],[.5,.04],[.5,.82],[.46,.9],[.4,.94],[.4,1],[0,1]],tube:[[0,0],[.34,0],[.34,.08],[.34,.88],[.3,.94],[.3,1],[0,1]],pouch:[[0,0],[.22,0],[.38,.05],[.46,.2],[.44,.6],[.38,.82],[.24,.94],[.18,1],[0,1]]};function xd(t,e={}){const n=e.width??1,r=e.height??1;if(t==="box"){const l=e.depth??n;return new V.BoxGeometry(n,r,l)}const i=SN[t],o=i.map(([l,c])=>new V.Vector2(Math.max(0,l*n),(c-.5)*r)),s=new V.LatheGeometry(o,64),a=s.getAttribute("uv");for(let l=0;l<a.count;l++)a.setY(l,i[l%i.length][1]);return a.needsUpdate=!0,s}function vd(t,e,n=0){const r=t.map(b=>b[0]),i=t.map(b=>b[1]),o=Math.min(...r),s=Math.max(...r),a=Math.min(...i),l=Math.max(...i),c=(o+s)/2,u=(a+l)/2,f=Math.max(s-o,1e-6),d=Math.max(l-a,1e-6),h=new V.Shape;t.forEach(([b,x],v)=>{const T=b-c,w=u-x;v===0?h.moveTo(T,w):h.lineTo(T,w)}),h.closePath();const p=Math.max(e,1e-6),m=Math.max(0,n),g={generateTopUV(b,x,v,T,w){const O=C=>new V.Vector2((x[C*3]+f/2)/f,(x[C*3+1]+d/2)/d);return[O(v),O(T),O(w)]},generateSideWallUV(b,x,v,T,w,O){const C=R=>{const P=x[R*3],A=x[R*3+1],L=x[R*3+2];return new V.Vector2((P+f/2)/f,(A+d/2)/d+L/p)};return[C(v),C(T),C(w),C(O)]}},y=new V.ExtrudeGeometry(h,{depth:p,bevelEnabled:m>0,bevelThickness:m,bevelSize:m,bevelSegments:m>0?2:0,curveSegments:16,UVGenerator:g});return y.translate(0,0,-p/2),y.computeVertexNormals(),{geometry:y,width:f,height:d}}function wN(t,e){if(t.type==="primitive")return{geometry:xd(t.shape,t.proportions),materialGroups:t.shape==="box"?"box":"single"};if(t.type==="extrude")return{geometry:vd(t.contour,e,t.bevel).geometry,materialGroups:"extrude"};throw new Error("buildSourceGeometry does not handle gltf sources")}const Td={studio:{preset:"studio",keyAzimuth:-35,keyElevation:38,keyIntensity:3.2,keyColor:"#fff7ec",fillIntensity:1.1,rimIntensity:1.6,ambientIntensity:.22,environmentIntensity:.75,environment:"room"},window:{preset:"window",keyAzimuth:-70,keyElevation:55,keyIntensity:2.4,keyColor:"#eef4ff",fillIntensity:1.5,rimIntensity:.6,ambientIntensity:.35,environmentIntensity:.85,environment:"room"},golden:{preset:"golden",keyAzimuth:-58,keyElevation:14,keyIntensity:3.6,keyColor:"#ffd29a",fillIntensity:.8,rimIntensity:1.2,ambientIntensity:.18,environmentIntensity:.55,environment:"room"},night:{preset:"night",keyAzimuth:28,keyElevation:30,keyIntensity:.85,keyColor:"#9fb6ff",fillIntensity:.35,rimIntensity:2.8,ambientIntensity:.12,environmentIntensity:.45,environment:"room"}},Ed="studio";function Sd(t=Ed,e={},n){const r=Td[t];return{...r,keyAzimuth:e.keyAzimuth??r.keyAzimuth,keyElevation:e.keyElevation??r.keyElevation,keyIntensity:e.keyIntensity??r.keyIntensity,keyColor:e.keyColor??r.keyColor,fillIntensity:e.fillIntensity??r.fillIntensity,rimIntensity:e.rimIntensity??r.rimIntensity,environment:n??r.environment}}function V1(t,e){const n=t*Math.PI/180,r=e*Math.PI/180,i=Math.cos(r);return[Math.sin(n)*i,Math.sin(r),Math.cos(n)*i]}const wd=12;function AN(t){const e=new V.AmbientLight(16777215,t.ambientIntensity),n=new V.DirectionalLight(new V.Color(t.keyColor),t.keyIntensity);n.castShadow=!0,n.shadow.mapSize.set(1024,1024),n.shadow.bias=-5e-4;const r=new V.DirectionalLight(16777215,t.fillIntensity),i=new V.DirectionalLight(16777215,t.rimIntensity),o=new V.Group;o.add(e,n,n.target,r,i);const s={group:o,ambient:e,key:n,fill:r,rim:i};return K1(s,t),s}function K1(t,e){t.ambient.intensity=e.ambientIntensity,t.key.intensity=e.keyIntensity,t.key.color.set(e.keyColor),Ad(t.key,e.keyAzimuth,e.keyElevation),Ad(t.fill,e.keyAzimuth+140,Math.max(5,e.keyElevation-20)),Ad(t.rim,e.keyAzimuth+180,Math.max(10,e.keyElevation+5))}function Ad(t,e,n){const[r,i,o]=V1(e,n);t.position.set(r*wd,i*wd,o*wd),t.target.position.set(0,0,0),t.target.updateMatrixWorld()}function Z1(t){t.group.removeFromParent(),t.key.dispose(),t.fill.dispose(),t.rim.dispose(),t.ambient.dispose()}const $1=new WeakMap;function ON(t){const e=$1.get(t);if(e)return e;const n=new V.PMREMGenerator(t),r=new nE.RoomEnvironment,i=n.fromScene(r,.04);return r.traverse(o=>{const s=o;if(!s.isMesh)return;s.geometry?.dispose();const a=Array.isArray(s.material)?s.material:[s.material];for(const l of a)l?.dispose()}),n.dispose(),$1.set(t,i.texture),i.texture}function CN(t,e,n){t.environment=e.environment==="room"?ON(n):null,t.environmentIntensity=e.environmentIntensity}const vt={rotation:[0,0,0],position:[0,0,0],scale:1,roughness:.35,metalness:.05,clearcoat:0,shadowOpacity:.35,shadowSoftness:.6,shadowOffsetY:0,fov:35,fit:1.35};function Od(t,e){const n=t.lighting?.preset??Ed,r=Td[n],i=t.source.type==="extrude"?ye(t.source.depth,100,e):1,o=t.shadow;return{rotation:Go(t.view?.rotation,vt.rotation,e),position:Go(t.view?.position,vt.position,e),scale:ye(t.view?.scale,vt.scale,e),extrudeDepth:Math.max(i,1e-6),roughness:ye(t.material?.roughness,vt.roughness,e),metalness:ye(t.material?.metalness,vt.metalness,e),clearcoat:t.material?.clearcoat??vt.clearcoat,preset:n,keyAzimuth:ye(t.lighting?.key?.azimuth,r.keyAzimuth,e),keyElevation:ye(t.lighting?.key?.elevation,r.keyElevation,e),keyIntensity:ye(t.lighting?.key?.intensity,r.keyIntensity,e),keyColor:t.lighting?.key?.color??r.keyColor,fillIntensity:ye(t.lighting?.fill?.intensity,r.fillIntensity,e),rimIntensity:ye(t.lighting?.rim?.intensity,r.rimIntensity,e),environment:t.lighting?.environment??r.environment,shadowOpacity:o?ye(o.opacity,vt.shadowOpacity,e):0,shadowSoftness:o?.softness??vt.shadowSoftness,shadowOffsetY:o?.offsetY??vt.shadowOffsetY,fov:t.camera?.fov??vt.fov,fit:t.camera?.fit??vt.fit}}function J1(t){return JSON.stringify(t)}function RN(){const t=new V.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});return t.setPixelRatio(1),t.outputColorSpace=V.SRGBColorSpace,t.toneMapping=V.ACESFilmicToneMapping,t.toneMappingExposure=1,t.shadowMap.enabled=!0,t.shadowMap.type=V.PCFShadowMap,t.setClearColor(0,0),t}class Q1{renderer;gl;width=0;height=0;constructor(e){this.gl=e??RN(),this.renderer=this.gl}render({canvas:e,scene:n,camera:r,width:i,height:o}){const{gl:s}=this;(i!==this.width||o!==this.height)&&(s.setSize(i,o,!1),this.width=i,this.height=o),s.setViewport(0,0,i,o),s.render(n,r);const a=e.getContext("2d");if(!a)throw new Error("model3d: 2D canvas context unavailable");a.clearRect(0,0,i,o),a.drawImage(s.domElement,0,0,i,o)}dispose(){this.gl.dispose(),this.gl.forceContextLoss()}}function eT(t,e=2e3){const n=new Map;return{acquire(r){let i=n.get(r);return i||(i={value:t(),users:0,timer:null},n.set(r,i)),i.timer&&(clearTimeout(i.timer),i.timer=null),i.users+=1,i.value},release(r){const i=n.get(r);i&&(i.users=Math.max(0,i.users-1),!(i.users>0||i.timer)&&(i.timer=setTimeout(()=>{if(!(i.users>0)){n.delete(r);try{i.value.dispose()}catch{}}},e)))},size:()=>n.size}}const tT={},nT=eT(()=>new Q1);function Cd(t){return nT.acquire(t??tT)}function rT(t){nT.release(t??tT)}function IN(t){return Cd(t)}function iT(t,e,n,r){const i=Du(e,n,r);return{position:[t[0],t[1],t[2]+i],target:[t[0],t[1],t[2]]}}function oT(t,e,n){return n>0?Math.max(0,t-e)/n:0}function sT(t,e,n){return t>=e&&t<n}function MN(t,e){return e?{center:e.center?[e.center[0],e.center[1],e.center[2]]:t.center,maxDim:Math.max(e.size[0],e.size[1],e.size[2],1e-4)}:t}const LN=({ref:t,layer:e,...n})=>{const r=_t(),i=r.currentFrame,o=I.useRef(i);o.current=i;const{register:s,markReady:a,reset:l,reportError:c}=z1(),{app:u}=at.useApplication(),[f,d]=I.useState(null),[h,p]=I.useState(null),[m,g]=I.useState(null),[y,b]=I.useState(0),[x,v]=I.useState(!1),T=I.useRef(null),w=I.useRef(null),O=I.useRef("");I.useEffect(()=>{let J=!1;try{d(Cd(u)),J=!0}catch(ie){c(e.id,ie)}return()=>{J&&(d(null),rT(u))}},[u,e.id,c]),I.useEffect(()=>s(e.id),[s,e.id]);const C=e.viewport.width,R=e.viewport.height;I.useEffect(()=>{const J=document.createElement("canvas");J.width=C,J.height=R;const ie=W.Texture.from(J);return w.current=ie,p(J),g(ie),()=>{w.current=null,g(null),p(null),ie.destroy(!0)}},[C,R]);const P=e.source.type==="gltf"?e.source.assetId:void 0,A=e.textures?.label,L=e.textures?.front,N=Ei(P),D=Ei(A),F=Ei(L),G=(!P||N.state==="ready")&&(!A||D.state==="ready")&&(!L||F.state==="ready"),z=(P&&N.state==="error"?N.error:void 0)??(A&&D.state==="error"?D.error:void 0)??(L&&F.state==="error"?F.error:void 0),K=I.useMemo(()=>JSON.stringify(e.source),[e.source]),ae=I.useMemo(()=>JSON.stringify(e.textures??{}),[e.textures]),pe=e.material?.clearcoat??0;I.useEffect(()=>{if(!h||!f||!G)return;if(z){const ve=String(z);O.current!==ve&&(O.current=ve,c(e.id,z));return}let J=!1;l(e.id),Z.current=!1,v(!1);const ie=Od(e,o.current),xe=Sd(ie.preset,{keyAzimuth:ie.keyAzimuth,keyElevation:ie.keyElevation,keyIntensity:ie.keyIntensity,keyColor:ie.keyColor,fillIntensity:ie.fillIntensity,rimIntensity:ie.rimIntensity},ie.environment),Y=new V.Scene,Oe=new V.PerspectiveCamera(ie.fov,C/R,.1,1e3),ge=new V.Group;Y.add(ge);const re=AN(xe);Y.add(re.group),CN(Y,xe,f.renderer);const we=NN();Y.add(we);const me=[],Ue=()=>{T.current=null,Y.clear(),Z1(re),we&&(we.geometry.dispose(),we.material.dispose());for(const ve of me)ve.dispose()},qe=ve=>{if(J)return;J=!0;const Me=String(ve);O.current!==Me&&(O.current=Me,c(e.id,ve)),Ue()},pt=(ve,Me,ct,ze)=>{if(J){Id(ve);return}ge.add(ve),kN(ve,re);const Se=new V.Box3().setFromObject(ve),De=new V.Vector3,Ie=new V.Vector3;Se.getSize(De),Se.getCenter(Ie);const Ge=MN({center:[Ie.x,Ie.y,Ie.z],maxDim:Math.max(De.x,De.y,De.z,1e-4)},e.bounds);Ie.set(...Ge.center);const je=Ge.maxDim,Le={scene:Y,camera:Oe,root:ge,content:ve,materials:Me,lighting:re,shadow:we,mixer:ct,clipDuration:ze,isExtrude:e.source.type==="extrude",baseExtrudeDepth:Math.max(ie.extrudeDepth,1e-6),maxDim:je,center:Ie,boundsOverride:e.bounds??null};T.current=Le,v(ct!=null),b(lt=>lt+1)};return(async()=>{const ve=D.url?await aT(D.url):null;if(ve&&(me.push(ve),J))return;const Me=F.url?await aT(F.url):null;if(Me&&(me.push(Me),J))return;if(e.source.type==="gltf"){const Le=await new Vd.GLTFLoader().loadAsync(N.url);if(J){Id(Le.scene);return}const lt=PN(Le.scene),Ve=e.material?.clearcoat??0;for(const Pt of lt)"clearcoat"in Pt&&(Pt.clearcoat=Ve,Ve>0&&(Pt.needsUpdate=!0));let ot=null,Lt=0;if(Le.animations.length>0){const Pt=Le.animations[0];ot=new V.AnimationMixer(Le.scene),ot.clipAction(Pt).play(),Lt=Pt.duration}pt(Le.scene,lt,ot,Lt);return}const ct=e.textures?.side??"#d8d8d8",ze=e.material?.clearcoat??0;if(e.source.type==="primitive"){const Le=xd(e.source.shape,e.source.proportions),lt=e.source.shape==="box";let Ve;if(lt){const Lt=Si(ct,null,ze),Pt=Si(ct,Me??ve,ze);Ve=[Lt,Lt,Lt,Lt,Pt,Lt]}else Ve=[Si(ct,ve??Me,ze,!0)];const ot=new V.Mesh(Le,Ve.length===1?Ve[0]:Ve);pt(ot,Ve,null,0);return}const{geometry:Se}=vd(e.source.contour,ie.extrudeDepth,e.source.bevel),De=Si(ct,Me,ze),Ie=Si(ct,null,ze),Ge=[De,Ie],je=new V.Mesh(Se,Ge);pt(je,Ge,null,0)})().catch(qe),()=>{J=!0;const ve=T.current;if(ve){ve.mixer?.stopAllAction(),Id(ve.content),ve.scene.clear(),Z1(ve.lighting),ve.shadow&&(ve.shadow.geometry.dispose(),ve.shadow.material.dispose());for(const Me of me)Me.dispose();T.current=null}else Ue();b(0)}},[h,f,G,z,K,ae,pe,C,R,D.url,F.url,N.url,e.id,l,c]);const X=I.useMemo(()=>Od(e,i),[e,i]),he=J1(X),j=x?i:0,$=sT(i,e.inPoint,e.outPoint),H=I.useRef(X);H.current=X;const ce=I.useRef(i);ce.current=i;const Z=I.useRef(!1);I.useEffect(()=>{const J=T.current,ie=h,xe=w.current;if(!J||!ie||!xe||!f||!$&&Z.current)return;const Y=H.current,Oe=ce.current;DN(J,Y),FN(J,Y),BN(J,Y);const ge=Sd(Y.preset,{keyAzimuth:Y.keyAzimuth,keyElevation:Y.keyElevation,keyIntensity:Y.keyIntensity,keyColor:Y.keyColor,fillIntensity:Y.fillIntensity,rimIntensity:Y.rimIntensity},Y.environment);K1(J.lighting,ge),UN(J,Y,ge),J.mixer&&J.clipDuration>0&&J.mixer.setTime(oT(Oe,e.inPoint,r.fps));try{f.render({canvas:ie,scene:J.scene,camera:J.camera,width:C,height:R}),xe.source.update(),Z.current=!0,a(e.id)}catch(re){const we=String(re);O.current!==we&&(O.current=we,c(e.id,re))}},[he,j,$,y,f,h,r.fps,e.id,e.inPoint,C,R,a,c]);const{transformation:se}=n;return M.jsx(Je,{...n,ref:t,children:M.jsx("pixiContainer",{children:m&&M.jsx("pixiSprite",{texture:m,width:C,height:R,anchor:se.anchor,x:se.x,y:se.y,alpha:n.visible?1:0})})})},Rd=I.memo(LN);Rd.displayName="Pixi3DModelLayer";function Si(t,e,n,r=!1){e&&e.wrapS!==V.RepeatWrapping&&(e.wrapS=V.RepeatWrapping,e.wrapT=V.ClampToEdgeWrapping,e.colorSpace=V.SRGBColorSpace,r&&(e.offset.x=.5),e.needsUpdate=!0);const i=new V.MeshPhysicalMaterial({color:new V.Color(e?"#ffffff":t),map:e,roughness:.35,metalness:.05,clearcoat:n,clearcoatRoughness:.2});return i.shadowSide=V.FrontSide,i}async function aT(t){const e=await new V.TextureLoader().loadAsync(t);return e.colorSpace=V.SRGBColorSpace,e.anisotropy=4,e}function PN(t){const e=new Set;return t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;s?.isMeshStandardMaterial&&e.add(s)}}),[...e]}function NN(){const t=new V.PlaneGeometry(1,1),e=new V.ShadowMaterial({opacity:0,transparent:!0}),n=new V.Mesh(t,e);return n.rotation.x=-Math.PI/2,n.position.y=-.5,n.receiveShadow=!0,n.castShadow=!1,n}function kN(t,e){t.traverse(i=>{const o=i;o.isMesh&&(o.castShadow=!0,o.receiveShadow=!0)});const n=6,r=e.key.shadow.camera;r.left=-n,r.right=n,r.top=n,r.bottom=-n,r.near=.1,r.far=60,r.updateProjectionMatrix()}function DN(t,e){const n=Math.PI/180;t.root.position.set(...e.position),t.root.rotation.set(e.rotation[0]*n,e.rotation[1]*n,e.rotation[2]*n),t.root.scale.setScalar(e.scale),t.isExtrude&&(t.content.scale.z=e.extrudeDepth/t.baseExtrudeDepth)}function FN(t,e){for(const n of t.materials)n.roughness=e.roughness,n.metalness=e.metalness}function BN(t,e){const{position:n,target:r}=iT([t.center.x,t.center.y,t.center.z],t.maxDim,e.fov,e.fit);t.camera.fov=e.fov,t.camera.position.set(...n),t.camera.lookAt(...r),t.camera.updateProjectionMatrix()}const cT=new V.Box3,lT=new V.Vector3,uT=new V.Vector3;function UN(t,e,n){const r=t.shadow;if(!r)return;const i=r.material;if(i.opacity=e.shadowOpacity,r.visible=e.shadowOpacity>0&&n.keyIntensity>0,!r.visible)return;t.root.updateMatrixWorld(!0);const o=t.boundsOverride,s=o?cT.setFromCenterAndSize(uT.set(...o.center??[t.center.x,t.center.y,t.center.z]),lT.set(...o.size)).applyMatrix4(t.root.matrixWorld):cT.setFromObject(t.content);if(s.isEmpty())return;const a=s.getSize(lT),l=s.getCenter(uT),c=Math.max(a.x,a.z,.001)*2.6;r.scale.set(c,c,1),r.position.set(l.x,s.min.y-e.shadowOffsetY,l.z),t.lighting.key.shadow.radius=2+e.shadowSoftness*10}function Id(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i)){const s=o;s&&s.isTexture&&s.dispose()}i.dispose()}})}const fT=I.createContext(null),ts=({children:t,overrides:e,prefix:n=""})=>{const[r]=I.useState(()=>new Map),[i,o]=I.useState(0),s=I.useCallback((l,c)=>{c?r.set(l,c):r.delete(l),o(u=>u+1)},[r]),a=I.useMemo(()=>({containers:r,revision:i,registerContainer:s,overrides:e,prefix:n}),[r,i,s,e,n]);return M.jsx(fT.Provider,{value:a,children:t})},wr=()=>I.useContext(fT);function wi(t){return Array.isArray(t)?t[0].v:t}const Ar=I.memo(({layer:t})=>t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0?null:M.jsx(GN,{layer:t}));Ar.displayName="AepLayerRouter";const GN=({layer:t})=>{const e=_t(),n=wr(),r=zn(),i=bi(t.id),o=e.framesToSeconds(t.inPoint),s=e.framesToSeconds(t.outPoint),a="assetId"in t?t.assetId:void 0,l=a?e.assets[a]:void 0,c=Ei(a),u=t.kind==="model3d"?{width:t.viewport.width,height:t.viewport.height}:{width:l?.width??e.width,height:l?.height??e.height},f=Y1(t,u),d={x:f.x,y:f.y,width:f.width,height:f.height,anchor:f.anchor,rotation:f.rotation,alpha:f.alpha,scale:f.scale},h=I.useCallback((T,w)=>{},[]),p=I.useCallback(T=>n?.registerContainer(`${n.prefix}${t.id}`,T),[n?.registerContainer,n?.prefix,t.id]),m=Cv(t),g=Rv(t,m),y={uniqueId:t.id,startAt:o,endAt:s,visible:t.hidden!==!0,onContainerRefReady:h};function b(){switch(t.kind){case"image":return M.jsx(hu,{...y,src:c.url,transformation:d});case"video":{const T="muted"in t?!!t.muted:!1;return M.jsx(ld,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,mute:T,locked:!1})}case"audio":return M.jsx(L1,{uniqueId:t.id,src:c.url,startAt:o,endAt:s,inPointFrames:t.inPoint,level:t.level,pan:t.pan,muted:!1,visible:t.hidden!==!0,transformation:d,onContainerRefReady:h});case"gif":return M.jsx(i_,{...y,src:c.url,transformation:d});case"lottie":return M.jsx(pd,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,locked:!1,loop:!0});case"svg":return M.jsx(_y,{...y,src:c.url,transformation:d});case"text":{const T=i??wi(t.source),w=wi(t.style.size),O=t.style.fill?wi(t.style.fill):void 0,C=O==null?"#ffffff":typeof O=="string"?O:r?.[O.themeKey]??O.default;return X1(t)?M.jsx("pixiContainer",{alpha:f.alpha,children:M.jsx(td,{layer:t,animators:t.animators??[],x:f.x,y:f.y})}):M.jsx(O_,{...y,text:T,transformation:{...d,fill:C,fontFamily:t.style.font,fontSize:w,fontColor:C,fontWeight:t.style.weight!=null?String(t.style.weight):void 0,fontStyle:t.style.italic?"italic":void 0,lineHeight:t.style.lineHeight?wi(t.style.lineHeight):void 0,letterSpacing:t.style.letterSpacing?wi(t.style.letterSpacing):void 0}})}case"shape":return M.jsx(R1,{...y,path:t.path,fill:t.fill,stroke:t.stroke,trimPath:t.trimPath,transformation:d,fps:e.fps,inPointFrames:t.inPoint});case"null":return M.jsx(I1,{...y,transformation:d});case"precomp":return M.jsx(pT,{...y,compId:t.compId,layerInPointFrames:t.inPoint,precompWidth:t.width,precompHeight:t.height,transformation:d});case"model3d":return M.jsx(Rd,{...y,layer:t,transformation:d});default:return null}}const x=b();if(x===null||a&&c.state==="error")return null;let v=x;if(m.length>0&&(v=M.jsxs("pixiContainer",{filters:m,children:[g,v]})),"masks"in t&&t.masks&&t.masks.length>0&&(v=M.jsx(D1,{masks:t.masks,fps:e.fps,inPointFrames:t.inPoint,children:v})),"trackMatte"in t&&t.trackMatte){const T=e.layersById.get(t.trackMatte.sourceId);T&&(v=M.jsx(F1,{mode:t.trackMatte.mode,width:e.width,height:e.height,source:M.jsx(Ar,{layer:T}),matted:v}))}return M.jsx($v,{uniqueId:`${n?.prefix??"aep:"}${t.id}`,startAt:o,endAt:s,onSequenceContainerReady:p,children:v})},dT=(t,e,n)=>{const{currentFrame:r}=_t(),i=I.useRef(r),o=I.useRef(new Set);i.current=r;const s=I.useCallback(a=>(o.current.add(a),a(i.current),()=>o.current.delete(a)),[]);return I.useLayoutEffect(()=>{for(const a of o.current)a(r)},[r]),I.useMemo(()=>({start:t,end:t+e,duration:e,ease:n,subscribe:s}),[t,e,n,s])},hT=t=>{const e=Array.isArray(t)?Bn(t):t??"none";return E.parseEase(e)??E.parseEase("none")},jN={},Md=I.memo(({transition:t,overrides:e})=>{const n=_t(),r=wr(),i=e?.[t.id],o=i?.name??t.name,s=i?.params??t.params??jN,a=i?.durationFrames??t.durationFrames,l=I.useMemo(()=>Array.isArray(t.from)?t.from:[t.from],[t.from]),c=I.useMemo(()=>Array.isArray(t.to)?t.to:[t.to],[t.to]),u=l[0]??"",f=c[0]??"",d=I.useMemo(()=>hT(t.ease),[t.ease]),h=dT(t.startFrame,a,d),p=r?.prefix??"",m=I.useCallback(()=>({from:r?.containers.get(`${p}${u}`)??null,to:r?.containers.get(`${p}${f}`)??null}),[r?.containers,r?.revision,p,u,f]),g=I.useMemo(()=>({pairId:`aep:${t.id}`,config:{type:o,name:o,duration:a,ease:"none",params:s},timing:{start:t.startFrame,end:t.startFrame+a,duration:a}}),[t.id,u,f,o,a,s,t.startFrame]),y=I.useCallback(O=>{const C=n.layersById,R=L=>[...new Set(L)].flatMap(N=>{const D=r?.containers.get(`${p}${N}`),F=[...C.keys()].indexOf(N);return D?[{container:D,zIndex:F}]:[]});let P=R(l),A=R(c);if(t.kind==="scene"&&t.includeShared){const L=new Set([...l,...c]),N=[...C.keys()].filter(D=>!L.has(D));P=[...P,...R(N)],A=[...A,...R(N)]}return{fromLayers:P,toLayers:A}},[n.layersById,r?.containers,r?.revision,p,l,c,t.kind,t.includeShared]),b=t.region,x=I.useCallback(()=>{if(b)return b;const O=r?.containers.get(`${p}${u}`),C=r?.containers.get(`${p}${f}`),R=P=>{if(!P)return null;const A=P.getLocalBounds();return{x:A.x,y:A.y,width:A.width,height:A.height}};return Pb([R(O),R(C)])},[b,r?.containers,p,u,f]),v=Math.max(1,Math.round(n.width)),T=Math.max(1,Math.round(n.height)),w=fd({transitionPair:g,width:v,height:T,clock:h,resolveEndpoints:m,getLayerSets:y,hideEndpointsInWindow:t.kind==="element",getRegion:x,fullCanvas:t.kind==="scene"});return M.jsx("pixiContainer",{ref:w,zIndex:Number.MAX_SAFE_INTEGER,sortableChildren:!0})});Md.displayName="AepTransitionMesh";const Ai=I.memo(({transition:t,overrides:e})=>{const n=wr(),r=e??n?.overrides;return r?.[t.id]?.disabled?null:M.jsx(Md,{transition:t,overrides:r})});Ai.displayName="AepTransitionLayer";const HN=({ref:t,...e})=>{const n=_t(),r=wr(),i=P_();if(i+1>yo)throw new Error(`AEP precomp recursion depth exceeded (max ${yo})`);const o=n.precomps[e.compId],s=n.framesToSeconds(e.layerInPointFrames),a=I.useMemo(()=>{if(!o)return null;const l=new Map(o.layers.map(f=>[f.id,f])),c=o.fps||n.fps,u=Math.max(0,(n.currentFrame/n.fps-s)*c);return{fps:c,durationInFrames:o.durationInFrames,width:o.width||e.precompWidth,height:o.height||e.precompHeight,assets:ai(n.assets,o.assets),layersById:l,precomps:{...n.precomps,...o.precomps??{}},framesToSeconds:f=>s+f/c,currentFrame:u}},[o,n,s,e.precompWidth,e.precompHeight]);return!o||!a?(console.warn(`PixiPreComp: compId '${e.compId}' not found in precomps map`),null):M.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{x:e.transformation.x,y:e.transformation.y,children:M.jsx(L_,{depth:i+1,children:M.jsx(ts,{overrides:r?.overrides,prefix:`${r?.prefix??""}${e.uniqueId??e.compId}/${e.compId}:`,children:M.jsxs(si,{value:a,children:[o.layers.map(l=>M.jsx(Ar,{layer:l},l.id)),o.transitions?.map(l=>M.jsx(Ai,{transition:l,overrides:r?.overrides},l.id))]})})})})})},pT=I.memo(HN,tt);function mT(t,e=yo,n=0){if(n>e)throw new Error(`AEP precomp recursion depth exceeded (max ${e})`);const r=t.precomps??{};for(const i of Object.values(r))mT(i,e,n+1)}function YN(t){const e=new Set;for(const n of t)"trackMatte"in n&&n.trackMatte&&e.add(n.trackMatte.sourceId);return e}const gT=I.createContext(null),XN=({children:t})=>{const e=I.useMemo(()=>({entries:new Map,subscribers:new Set}),[]);return M.jsx(gT.Provider,{value:e,children:t})};function Ld(){return I.useContext(gT)}function yT(t){for(const e of t.subscribers)e()}function WN(t,e,n,r){if(!t)return null;let i=t.entries.get(e);return i?(i.width=n,i.height=r):(i={canvas:null,texture:null,width:n,height:r,rev:0},t.entries.set(e,i)),i}function zN(t,e){if(!t)return;const n=t.entries.get(e);n&&(n.texture&&n.texture.dispose(),t.entries.delete(e),yT(t))}function qN(t,e,n,r){if(!t)return;const i=t.entries.get(e);if(!i||!n?.renderer?.extract)return;const o=n.renderer.extract.canvas(r);i.canvas=o,i.texture?(i.texture.image=o,i.texture.needsUpdate=!0):(i.texture=new V.CanvasTexture(o),i.texture.flipY=!0,i.texture.minFilter=V.LinearFilter,i.texture.magFilter=V.LinearFilter),i.rev+=1,yT(t)}function _T(t){const e=Ld(),[,n]=I.useReducer(r=>r+1,0);return I.useEffect(()=>{if(e)return e.subscribers.add(n),()=>{e.subscribers.delete(n)}},[e]),e?.entries.get(t)??null}const Pd=new Map,VN=4;function KN(t,e){return`${Math.round(t)}x${Math.round(e)}`}let ZN=(t,e)=>W.RenderTexture.create({width:t,height:e});function $N(t,e){const n=KN(t,e),r=Pd.get(n)??[],i=r.find(s=>!s.inUse);if(i)return i.inUse=!0,i.texture;const o=ZN(t,e);if(r.push({texture:o,inUse:!0}),r.length>VN){const s=r.findIndex(a=>!a.inUse);if(s>=0){const[a]=r.splice(s,1);try{a.texture.destroy(!0)}catch{}}}return Pd.set(n,r),o}function JN(t){for(const e of Pd.values())for(const n of e)if(n.texture===t){n.inUse=!1;return}}function bT(t,e){const n=I.useMemo(()=>$N(t,e),[t,e]);return I.useEffect(()=>()=>JN(n),[n]),n}const Nd=({layer:t})=>{const e=_t(),n=wr(),{app:r}=at.useApplication(),i=Ld(),o=e.precomps[t.compId],s=I.useRef(null),a=bT(o?.width??t.width,o?.height??t.height),l=I.useMemo(()=>{if(!o)return null;const c=new Map(o.layers.map(h=>[h.id,h])),u=o.fps||e.fps,f=e.framesToSeconds(t.inPoint),d=Math.max(0,(e.currentFrame/e.fps-f)*u);return{fps:u,durationInFrames:o.durationInFrames,width:o.width||t.width,height:o.height||t.height,assets:ai(e.assets,o.assets),layersById:c,precomps:o.precomps??{},framesToSeconds:h=>f+h/u,currentFrame:d}},[o,e,t.inPoint,t.width,t.height]);return I.useEffect(()=>(WN(i,t.id,o?.width??t.width,o?.height??t.height),()=>{zN(i,t.id)}),[i,t.id,o?.width,o?.height,t.width,t.height]),at.useTick(()=>{!r||!s.current||!a||(r.renderer.render({container:s.current,target:a}),qN(i,t.id,r,a))}),!o||!l?null:M.jsx("pixiContainer",{ref:s,renderable:!1,children:M.jsx(ts,{overrides:n?.overrides,prefix:`${n?.prefix??""}${t.id}/${t.compId}:`,children:M.jsxs(si,{value:l,children:[o.layers.map(c=>M.jsx(Ar,{layer:c},c.id)),o.transitions?.map(c=>M.jsx(Ai,{transition:c,overrides:n?.overrides},c.id))]})})})};Nd.displayName="AepPrecompRenderer";function QN({onReady:t}){const e=W1(),n=I.useRef(!1);return I.useEffect(()=>{!e||n.current||(n.current=!0,t?.())},[e,t]),null}function ek(t,e){const[n,r]=I.useState(()=>{if(typeof t!="string")try{return Lo(t)}catch(i){return e?.(i),null}return null});return I.useEffect(()=>{if(typeof t!="string")return;let i=!1;return fetch(t).then(o=>o.json()).then(o=>{if(!i)try{r(Lo(o))}catch(s){e?.(s)}}).catch(o=>{i||e?.(o)}),()=>{i=!0}},[t,e]),n}const xT=I.memo(({src:t,assetMap:e,assetResolver:n,currentFrame:r,onReady:i,onError:o,theme:s,textOverrides:a,transitionOverrides:l,onRenderReady:c,onLayerError:u})=>{const f=ek(t,o),d=I.useMemo(()=>Jf(f?.theme,s),[f?.theme,s]);I.useEffect(()=>{f&&i?.(f)},[f,i]);const h=N_(f?.fps??30),p=r??h,m=I.useMemo(()=>{if(!f)return null;const R=new Map(f.layers.map(P=>[P.id,P]));return{fps:f.fps,durationInFrames:f.durationInFrames,width:f.width,height:f.height,assets:ai(f.assets,e),layersById:R,precomps:f.precomps??{},framesToSeconds:P=>P/f.fps,currentFrame:p}},[f,e,p]),{app:g}=at.useApplication();if(!f||!m)return null;const y=g?.screen?.width??f.width,b=g?.screen?.height??f.height,x=Math.min(y/f.width,b/f.height),v=(y-f.width*x)/2,T=(b-f.height*x)/2,w=n??_d,O=YN(f.layers),C=f.layers.filter(R=>R.kind==="precomp"&&"is3D"in R&&R.is3D===!0);return M.jsxs(q1,{onLayerError:u,children:[M.jsx(QN,{onReady:c}),M.jsx(U1,{resolver:w,children:M.jsx($f,{value:d,children:M.jsx(Nv,{value:a,children:M.jsx(si,{value:m,children:M.jsxs(ts,{overrides:l,prefix:"",children:[M.jsxs("pixiContainer",{x:v,y:T,scale:x,sortableChildren:!0,children:[f.layers.filter(R=>!O.has(R.id)).map(R=>M.jsx(Ar,{layer:R},R.id)),f.transitions?.map(R=>M.jsx(Ai,{transition:R,overrides:l},R.id))]}),C.map(R=>M.jsx(Nd,{layer:R},`rt-${R.id}`))]})})})})})]},f.id)});xT.displayName="AepComposition";const vT={x:0,y:0,z:0,rx:0,ry:0,rz:0,sx:1,sy:1,sz:1,alpha:1};function TT(t,e){const n=b=>b*Math.PI/180,r=Math.cos(n(e.rx)),i=Math.sin(n(e.rx)),o=Math.cos(n(e.ry)),s=Math.sin(n(e.ry)),a=Math.cos(n(e.rz)),l=Math.sin(n(e.rz));let c=t.x,u=t.y,f=t.z;const d=a*c-l*u,h=l*c+a*u;c=d,u=h;const p=o*c+s*f,m=-s*c+o*f;c=p,f=m;const g=r*u-i*f,y=i*u+r*f;return u=g,f=y,{x:c,y:u,z:f}}function ET(t,e){const n={x:e.x*t.sx,y:e.y*t.sy,z:e.z*t.sz},r=TT(n,t);return{x:t.x+r.x,y:t.y+r.y,z:t.z+r.z,rx:t.rx+e.rx,ry:t.ry+e.ry,rz:t.rz+e.rz,sx:t.sx*e.sx,sy:t.sy*e.sy,sz:t.sz*e.sz,alpha:t.alpha*e.alpha}}function Oi(t){const{layersById:e,currentFrame:n}=_t();return I.useMemo(()=>{const r=H1(t,e);let i={...vT};for(let o=r.length-1;o>=0;o--){const s=r[o],a=tk(s,n);i=ET(i,a)}return{position:[i.x,i.y,i.z],rotationEuler:[i.rx,i.ry,i.rz],scale:[i.sx,i.sy,i.sz],alpha:i.alpha}},[t,e,n])}function tk(t,e){return t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0&&t.transform3D?ST(t.transform3D,e):nk(t.transform,e)}function ST(t,e){const[n,r,i]=Go(t.position,[0,0,0],e),[o,s,a]=Go(t.rotation,[0,0,0],e),[l,c]=sn(t.scale,[1,1],e),u=ye(t.opacity,1,e);return{x:n,y:r,z:i,rx:o,ry:s,rz:a,sx:l,sy:c,sz:1,alpha:u}}function nk(t,e){const[n,r]=sn(t.position,[0,0],e),[i,o]=sn(t.scale,[1,1],e);return{x:n,y:r,z:0,rx:0,ry:0,rz:ye(t.rotation,0,e),sx:i,sy:o,sz:1,alpha:ye(t.opacity,1,e)}}const kd=({passes:t,currentFrame:e})=>{if(!t||t.length===0)return null;const n=t.filter(r=>r.enabled!==!1).map((r,i)=>ik(r,e,i)).filter(Boolean);return n.length===0?null:M.jsx($n.EffectComposer,{children:n})};kd.displayName="Aep3DPostFx";function ln(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:ye(i,n,r)}function rk(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:Array.isArray(i)&&i.length===2&&typeof i[0]=="number"?[i[0],i[1]]:sn(i,n,r)}function ik(t,e,n){const r=t.params;switch(t.name){case"bloom":return M.jsx($n.Bloom,{intensity:ln(r,"intensity",1,e),luminanceThreshold:ln(r,"luminanceThreshold",.9,e),radius:ln(r,"radius",.6,e)},n);case"chromaticAberration":{const[i,o]=rk(r,"offset",[.002,.002],e);return M.jsx($n.ChromaticAberration,{offset:new qd.Vector2(i,o),modulationOffset:0,radialModulation:!1},n)}case"vignette":return M.jsx($n.Vignette,{darkness:ln(r,"darkness",.5,e),offset:ln(r,"offset",.5,e)},n);case"noise":return M.jsx($n.Noise,{opacity:ln(r,"intensity",.15,e),premultiply:r.premultiply===!0},n);case"cameraLensBlur":return M.jsx($n.DepthOfField,{focusDistance:ln(r,"focusDistance",.02,e),focalLength:ln(r,"focalLength",.05,e),bokehScale:ln(r,"bokehScale",2,e)},n);default:return null}}function wT(t){const e=new V.Shape;switch(t.kind){case"rect":{const n=Or(t.size,[100,100]),[r,i]=n,o=r/2,s=i/2;return e.moveTo(-o,-s),e.lineTo(o,-s),e.lineTo(o,s),e.lineTo(-o,s),e.closePath(),e}case"ellipse":{const n=Or(t.size,[100,100]),[r,i]=n;return e.absellipse(0,0,r/2,i/2,0,Math.PI*2,!1,0),e}case"polystar":{const n=Or(t.points,5),r=Or(t.outerRadius??50,50),i=Or(t.innerRadius??20,20),o=t.starType==="star",s=o?n*2:n;for(let a=0;a<s;a++){const l=-Math.PI/2+a/s*Math.PI*2,c=o?a%2===0?r:i:r,u=c*Math.cos(l),f=c*Math.sin(l);a===0?e.moveTo(u,f):e.lineTo(u,f)}return e.closePath(),e}case"bezier":{const n=Or(t.path,ok());return sk(n,e),e}default:return e}}function ok(){return{vertices:[],inTangents:[],outTangents:[],closed:!1}}function sk(t,e){const n=t.vertices,r=t.inTangents,i=t.outTangents;if(n.length){e.moveTo(n[0][0],n[0][1]);for(let o=1;o<n.length;o++){const s=n[o-1],a=n[o],l=i[o-1]??[0,0],c=r[o]??[0,0];e.bezierCurveTo(s[0]+l[0],s[1]+l[1],a[0]+c[0],a[1]+c[1],a[0],a[1])}if(t.closed&&n.length>2){const o=n[n.length-1],s=n[0],a=i[n.length-1]??[0,0],l=r[0]??[0,0];e.bezierCurveTo(o[0]+a[0],o[1]+a[1],s[0]+l[0],s[1]+l[1],s[0],s[1]),e.closePath()}}}function Or(t,e){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]?t[0].v:t??e}function AT(t){return JSON.stringify(t)}const Dd=({path:t,fill:e="#88ccff",extrusion:n,currentFrame:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=Fd(ye(n.depth,1,r),.01),c=n.bevelThickness?Fd(ye(n.bevelThickness,0,r),.01):0,u=n.bevelSize?Fd(ye(n.bevelSize,0,r),.01):0,f=zn(),d=Yn(e,f),h=xt(d,"#88ccff",r),p=I.useMemo(()=>{const m=wT(t),g={depth:l,bevelEnabled:n.bevelEnabled!==!1&&(c>0||u>0),bevelThickness:c,bevelSize:u,bevelSegments:n.bevelSegments??2,curveSegments:n.curveSegments??12};return new V.ExtrudeGeometry(m,g)},[AT(t),l,c,u,n.bevelEnabled,n.bevelSegments,n.curveSegments]);return I.useEffect(()=>()=>{p.dispose()},[p]),M.jsxs("mesh",{position:i,rotation:o,scale:s,children:[M.jsx("primitive",{object:p,attach:"geometry"}),M.jsx("meshStandardMaterial",{color:h,transparent:a<1,opacity:a,metalness:n.sideMaterial?.metalness??.1,roughness:n.sideMaterial?.roughness??.6})]})};Dd.displayName="Aep3DShapeMesh";function Fd(t,e){return Math.round(t/e)*e}const ak={get:()=>{}},OT=I.createContext(ak),CT=({value:t,children:e})=>M.jsx(OT.Provider,{value:t,children:e});function RT(t){const e=I.useContext(OT);if(t)return e.get(t)}class IT{map=new Map;set(e,n){this.map.set(e,n)}get(e){return this.map.get(e)}has(e){return this.map.has(e)}}function ck(t){if(t<=64)return 64;let e=64;for(;e<t;)e<<=1;return e}const Cr=new V.Matrix4;function lk(t){return new V.ShaderMaterial({vertexShader:Ub,fragmentShader:Gb,uniforms:{uAtlas:{value:t.texture},uDistanceRange:{value:t.distanceRange}},transparent:!0,depthWrite:!1})}const uk=new V.PlaneGeometry(1,1),Bd=({layer:t,atlas:e,currentFrame:n,position:r,rotation:i,scale:o,opacity:s})=>{const a=zn(),l=bi(t.id),c=I.useMemo(()=>l===void 0?t:{...t,source:l},[t,l]),u=jo(c,n,{theme:a}),f=ye(t.style.size,24,n),d=t.style.fill?xt(Yn(t.style.fill,a),"#ffffff",n):"#ffffff",h=t.animators??[],p=I.useMemo(()=>h.map(w=>ye(w.amount,1,n)),[h,n]),m=I.useMemo(()=>Ho(h,u.glyphs,p),[h,u.glyphs.length,p]),g=I.useMemo(()=>u.glyphs.filter(w=>!w.isWhitespace),[u.glyphs]),y=ck(g.length),b=I.useMemo(()=>lk(e),[e]),x=I.useRef(null),v=I.useRef(null),T=I.useRef(null);return I.useEffect(()=>{const w=x.current;if(!w)return;const O=new Float32Array(y*4),C=new Float32Array(y*4),R=new V.InstancedBufferAttribute(O,4),P=new V.InstancedBufferAttribute(C,4);return R.setUsage(V.DynamicDrawUsage),P.setUsage(V.DynamicDrawUsage),w.geometry.setAttribute("aUvRect",R),w.geometry.setAttribute("aColor",P),v.current=R,T.current=P,()=>{w.geometry.deleteAttribute("aUvRect"),w.geometry.deleteAttribute("aColor"),v.current=null,T.current=null}},[y]),is.useFrame(()=>{const w=x.current,O=v.current,C=T.current;if(!w||!O||!C)return;let R=0;for(let L=0;L<m.length;L++){const N=m[L]?.opacity??0;N>R&&(R=N)}if(s+R<=.01)return;const P=u.bounds.width/2,A=u.bounds.height/2;for(let L=0;L<g.length;L++){const N=g[L],D=e.glyphs.get(N.char);if(!D){Cr.makeScale(0,0,0),w.setMatrixAt(L,Cr);continue}const F=m[N.charIndex]??{position:[0,0],scale:[0,0],rotation:0,opacity:0};Wb(Cr,D,{x:N.x,y:N.y,bounds:{width:P*2,height:A*2}},f,F),w.setMatrixAt(L,Cr);const G=L*4;O.array[G]=D.uv[0],O.array[G+1]=D.uv[1],O.array[G+2]=D.uv[2],O.array[G+3]=D.uv[3];const z=t.style.runs?.[N.runIndex]?.fill,K=(typeof z=="string"?z:void 0)??d,ae=Math.max(0,Math.min(1,s+F.opacity)),pe=zb(K,ae),X=L*4;C.array[X]=pe[0],C.array[X+1]=pe[1],C.array[X+2]=pe[2],C.array[X+3]=pe[3]}for(let L=g.length;L<y;L++)Cr.makeScale(0,0,0),w.setMatrixAt(L,Cr);w.instanceMatrix.needsUpdate=!0,O.needsUpdate=!0,C.needsUpdate=!0}),M.jsx("group",{position:r,rotation:i,scale:o,children:M.jsx("instancedMesh",{ref:x,args:[uk,b,y],frustumCulled:!1})})};Bd.displayName="AepMsdfTextMesh";const Ud=({layer:t,extrusion:e,currentFrame:n,fontUrl:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=zn(),c=bi(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=RT(t.style.font),d=e?.depth!=null&&ye(e.depth,0,n)>0,h=e?.depth?ye(e.depth,1,n):1,p=e?.bevelThickness?ye(e.bevelThickness,0,n):0,m=e?.bevelSize?ye(e.bevelSize,0,n):0,g=_v(r),y=jo(u,n,{boxWidth:t.style.boxWidth,metrics:g,theme:l});if(f&&!d)return M.jsx(Bd,{layer:u,atlas:f,currentFrame:n,position:i,rotation:o,scale:s,opacity:a});const b=ye(t.style.size,24,n),x=t.style.fill?xt(Yn(t.style.fill,l),"#ffffff",n):"#ffffff",v={font:r,size:b,height:h,bevelEnabled:p>0||m>0,bevelThickness:p,bevelSize:m,curveSegments:e?.curveSegments??12},T=t.animators??[],w=(t.style.runs?.length??0)>0;if(!(T.length>0||w||t.splitMode!=null&&t.splitMode!=="single"))return M.jsx("group",{position:i,rotation:o,scale:s,children:M.jsxs(Kd.Text3D,{...v,children:[y.glyphs.map(L=>L.char).join(""),M.jsx("meshStandardMaterial",{color:x,transparent:a<1,opacity:a})]})});const C=T.map(L=>ye(L.amount,1,n)),R=Ho(T,y.glyphs,C),P=y.bounds.width/2,A=y.bounds.height/2;return M.jsx("group",{position:i,rotation:o,scale:s,children:y.glyphs.map((L,N)=>{if(L.isWhitespace)return null;const D=R[N],F=t.style.runs?.[L.runIndex]?.fill,G=(typeof F=="string"?F:void 0)??x,z=L.x-P+D.position[0],K=-(L.y-A)+D.position[1],ae=1+D.scale[0],pe=1+D.scale[1],X=-D.rotation*Math.PI/180,he=Math.max(0,Math.min(1,a+D.opacity)),j=t.style.runs?.[L.runIndex],$=j?.size!=null?typeof j.size=="number"?j.size:ye(j.size,b,n):b;return M.jsx("group",{position:[z,K,0],scale:[ae,pe,1],rotation:[0,0,X],children:M.jsxs(Kd.Text3D,{...v,size:$,children:[L.char,M.jsx("meshStandardMaterial",{color:G,transparent:he<1,opacity:he})]})},L.charIndex)})})};Ud.displayName="Aep3DTextMesh";const fk=t=>[t[0],-t[1],-t[2]],dk=t=>{const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]},Gd=({layer:t,zOrder:e})=>{const n=Oi(t),r=_T(t.id),[i,o,s]=fk(n.position),a=s+e*.001,[l,c,u]=dk(n.rotationEuler),[f,d]=[n.scale[0],n.scale[1]],h=r?.width??t.width,p=r?.height??t.height;return M.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[M.jsx("planeGeometry",{args:[h,p]}),M.jsx("meshBasicMaterial",{map:r?.texture??null,color:r?.texture?"#ffffff":"#1a2030",transparent:!0,opacity:n.alpha})]})};Gd.displayName="Aep3DPrecompPlane";function hk(t){const e=I.useRef(null);e.current===null&&(e.current=new IT);const n=e.current,[r,i]=I.useState(0);return I.useEffect(()=>{if(!t?.fonts3D)return;let o=!1;for(const[s,a]of Object.entries(t.fonts3D))a.msdf&&(n.has(s)||Bb(a.msdf.json,{pngUrl:a.msdf.png}).then(l=>{o||(n.set(s,l),i(c=>c+1))}).catch(l=>{o||console.warn(`[useMsdfAtlasRegistry] failed to load atlas for "${s}":`,l)}));return()=>{o=!0}},[t,n]),{registry:n,ready:r}}function MT(t,e){const n=[...t??[]];if(!e||e.disableCameraDoF)return n;const r=n.some(o=>o.name==="cameraLensBlur"),i=e.focusDistance!==void 0||e.aperture!==void 0||e.blurLevel!==void 0;return!r&&i&&n.unshift({name:"cameraLensBlur",params:{focusDistance:e.focusDistance??.02,focalLength:e.aperture??.05,bokehScale:e.blurLevel??2}}),n}const LT=({comp:t,currentFrame:e,width:n,height:r,background:i="transparent",disabled:o,theme:s})=>{const a=I.useMemo(()=>Jf(t.theme,s),[t.theme,s]),{cameras:l,lights:c,threeDLayers:u,hasAny:f}=I.useMemo(()=>pk(t.layers),[t.layers]),d=l[0],h=I.useMemo(()=>MT(t.postFx,d),[t.postFx,d]),p=I.useMemo(()=>{const y=new Map(t.layers.map(b=>[b.id,b]));return{fps:t.fps,durationInFrames:t.durationInFrames,width:t.width,height:t.height,assets:ai(t.assets,void 0),layersById:y,precomps:t.precomps??{},framesToSeconds:b=>b/t.fps,currentFrame:e}},[t,e]),{registry:m,ready:g}=hk(t);return o||!f?null:M.jsx(o_,{width:n,height:r,background:i,defaultLights:c.length===0,children:M.jsx(CT,{value:m,children:M.jsx($f,{value:a,children:M.jsxs(si,{value:p,children:[d&&M.jsx(mk,{camera:d,currentFrame:e}),c.map(y=>M.jsx(gk,{light:y,currentFrame:e},y.id)),u.map((y,b)=>M.jsx(yk,{layer:y,currentFrame:e,zOrder:b},y.id)),M.jsx(kd,{passes:h,currentFrame:e})]})})},`msdf-${g}`)})};LT.displayName="Aep3DScene";function pk(t){const e=[],n=[],r=[];for(const i of t)i.kind==="camera"?e.push(i):i.kind==="light"?n.push(i):"is3D"in i&&i.is3D===!0&&r.push(i);return{cameras:e,lights:n,threeDLayers:r,hasAny:e.length+n.length+r.length>0}}function jd(t){return[t[0],-t[1],-t[2]]}function PT(t){const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]}const mk=({camera:t,currentFrame:e})=>{const{camera:n}=is.useThree(),r=Oi(t);return I.useEffect(()=>{if(!(n instanceof V.PerspectiveCamera))return;const[i,o,s]=jd(r.position);n.position.set(i,o,s);const[a,l,c]=PT(r.rotationEuler);n.rotation.set(a,l,c),n.fov=ye(t.fov,50,e),n.updateProjectionMatrix()}),null},gk=({light:t,currentFrame:e})=>{const n=Oi(t),[r,i,o]=jd(n.position),s=ye(t.intensity,1,e),a=xt(t.color,"#ffffff",e),l=new V.Color(a);switch(t.lightType){case"ambient":return M.jsx("ambientLight",{color:l,intensity:s});case"point":return M.jsx("pointLight",{color:l,intensity:s,position:[r,i,o]});case"spot":{const c=t.coneAngle?ye(t.coneAngle,90,e):90,u=t.coneFeather?ye(t.coneFeather,50,e):50;return M.jsx("spotLight",{color:l,intensity:s,position:[r,i,o],angle:c/2*(Math.PI/180),penumbra:u/100})}default:return M.jsx("directionalLight",{color:l,intensity:s,position:[r,i,o]})}},yk=({layer:t,currentFrame:e,zOrder:n})=>{const r=Oi(t),[i,o,s]=jd(r.position),a=s+n*.001,[l,c,u]=PT(r.rotationEuler),[f,d]=[r.scale[0],r.scale[1]],h=r.alpha;if(t.kind==="precomp")return M.jsx(Gd,{layer:t,zOrder:n});if(t.kind==="shape"&&"extrusion"in t&&t.extrusion)return M.jsx(Dd,{path:t.path,fill:t.fill??"#88ccff",extrusion:t.extrusion,currentFrame:e,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h});if(t.kind==="text"){const m=t.style.font,y=typeof m=="string"&&(m.endsWith(".json")||m.includes("/"))?m:"/fonts/helvetiker_regular.typeface.json",b="extrusion"in t&&t.extrusion?t.extrusion:void 0;return M.jsx(Ud,{layer:t,extrusion:b,currentFrame:e,fontUrl:y,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h})}const p=_k(t);return M.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[M.jsx("planeGeometry",{args:[1,1]}),M.jsx("meshStandardMaterial",{color:p,transparent:!0,opacity:h})]})};function _k(t){return t.kind==="shape"&&typeof t.fill=="string"?t.fill:"#88ccff"}function bk(){const t=document.createElement("canvas");t.width=1,t.height=1;const e=new V.CanvasTexture(t);return e.flipY=!1,e.minFilter=V.LinearFilter,e.magFilter=V.LinearFilter,{texture:e,refresh:(i,o)=>{if(!i?.renderer?.extract)return;const s=i.renderer.extract.canvas(o);e.image=s,e.needsUpdate=!0},dispose:()=>{e.dispose()}}}var NT=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(NT||{});const xk=[{label:"Freeform",ratio:null},{label:"1 : 1",ratio:1},{label:"16 : 9",ratio:16/9},{label:"9 : 16",ratio:9/16},{label:"4 : 3",ratio:4/3},{label:"3 : 2",ratio:3/2},{label:"2 : 3",ratio:2/3}],vk=20,ns=t=>Array.isArray(t)?t[0]:t;function kT(t,e){if(!(!t||!e))return[ns(t.x),ns(t.y),ns(e.x),ns(e.y)]}function Be(t,e){if(!t)return;if(t.a===0)return e(t.k);const n=t.k;if(n?.length)return n.map((r,i)=>{const o=n[i+1],s=o?kT(r.o,o.i):void 0;return{t:r.t,v:e(r.s),easeOut:s,hold:r.h===1?!0:void 0}})}const zt=t=>Array.isArray(t)?t[0]:t,un=t=>{const e=Array.isArray(t)?t:[t,t];return[e[0],e[1]]},DT=t=>{const[e,n]=un(t);return[e/100,n/100]},FT=t=>(Array.isArray(t)?t[0]:t)/100;function BT(t){return{vertices:(t.v??[]).map(e=>[e[0],e[1]]),inTangents:(t.i??[]).map(e=>[e[0],e[1]]),outTangents:(t.o??[]).map(e=>[e[0],e[1]]),closed:t.c===!0}}function Tk(t){if(!t)return;if(t.a===0)return BT(t.k);const e=t.k;if(e?.length)return e.map((n,r)=>{const i=e[r+1],o=i?kT(n.o,i.i):void 0,s=Array.isArray(n.s)?n.s[0]:n.s;return{t:n.t,v:BT(s??{}),easeOut:o,hold:n.h===1?!0:void 0}})}const UT=[0,0],Ek=[1,1];function qn(t){const e=Be(t?.p,un)??UT,n=Be(t?.a,un)??UT,r=Be(t?.s,DT)??Ek,i=Be(t?.r,zt)??0,o=Be(t?.o,FT)??1,s={position:e,anchor:n,scale:r,rotation:i,opacity:o},a=Be(t?.sk,zt);a!==void 0&&(s.skew=a);const l=Be(t?.sa,zt);return l!==void 0&&(s.skewAxis=l),s}function Sn(t){const e=o=>Math.max(0,Math.min(255,Math.round(o*255))).toString(16).padStart(2,"0"),n=e(t[0]??0),r=e(t[1]??0),i=e(t[2]??0);return t.length===4&&t[3]!==void 0&&t[3]<1?`#${n}${r}${i}${e(t[3])}`:`#${n}${r}${i}`}function Ci(t,e){return t?Be(t,zt)??e:e}function Hd(t,e=[0,0,0]){return t?Be(t,r=>Array.isArray(r)?[r[0]??0,r[1]??0,r[2]??0]:e)??e:e}function Sk(t,e="#ffffff"){return t?Be(t,r=>{if(!Array.isArray(r))return e;const[i,o,s]=r;return Sn([i??1,o??1,s??1])})??e:e}function wk(t,e,n,r){if(!Array.isArray(t)&&typeof e=="number"&&typeof n=="number"&&typeof r=="number"){const[o,s,a]=t;return[o+e,s+n,a+r]}return t}function Ak(t){return t.ty===13}function Ok(t){return t.ty===14}function GT(){return{position:[0,0],anchor:[0,0],scale:[1,1],rotation:0,opacity:1}}function Yd(t){const e=Hd(t?.or),n=Ci(t?.rx,0),r=Ci(t?.ry,0),i=Ci(t?.rz??t?.r,0),o=Be(t?.s??{a:0,k:[100,100,100]},a=>{const l=Array.isArray(a)?a:[100,100,100];return[(l[0]??100)/100,(l[1]??100)/100]})??[1,1],s=Be(t?.o??{a:0,k:100},a=>(Array.isArray(a)?a[0]:a)/100)??1;return{position:Hd(t?.p),anchor:Hd(t?.a),scale:o,rotation:wk(e,n,r,i),opacity:s}}function jT(t,e){return{id:e,name:t.nm,inPoint:t.ip,outPoint:t.op,...typeof t.st=="number"&&{startTime:t.st},...typeof t.parent=="number"&&{parent:`layer_${t.parent}`},...t.hd===1&&{hidden:!0}}}function Ck(t,e){const n=t.pe?Be(t.pe,r=>{const i=Array.isArray(r)?r[0]:r;return typeof i=="number"?i:50})??50:50;return{kind:"camera",...jT(t,e),transform:GT(),transform3D:Yd(t.ks),fov:n}}function Rk(t){switch(t){case 1:return"parallel";case 2:return"spot";case 3:return"point";default:return"ambient"}}function Ik(t,e){const n=Rk(t.lt),r={kind:"light",...jT(t,e),transform:GT(),transform3D:Yd(t.ks),lightType:n,intensity:Be(t.in??{a:0,k:100},i=>{const o=Array.isArray(i)?i[0]:i;return typeof o=="number"?o/100:1})??1,color:Sk(t.cl)};return n==="spot"&&(t.ca&&(r.coneAngle=Ci(t.ca,90)),t.cf&&(r.coneFeather=Ci(t.cf,50))),r}function HT(t){if(!t||typeof t!="object")return;const e=t.__aepPostFx;if(!Array.isArray(e))return;const n=[];for(const r of e){const i=of.safeParse(r);i.success?n.push(i.data):console.warn("bodymovin: dropping invalid __aepPostFx entry",i.error.issues[0]?.message)}return n.length>0?n:void 0}function YT(t){if(!t||typeof t!="object")return;const e=t.__aepExtrusion;if(!(!e||typeof e!="object"))return e}function Mk(t){if(!t||typeof t!="object")return;const e=t.runs;if(!Array.isArray(e)||e.length===0)return;const n=[];for(const r of e){if(typeof r.from!="number"||typeof r.to!="number"||r.to<=r.from)continue;const i={from:r.from,to:r.to};typeof r.font=="string"&&(i.font=r.font),typeof r.size=="number"&&(i.size=r.size),Array.isArray(r.fc)&&r.fc.length===3&&(i.fill=Sn(r.fc)),(typeof r.weight=="number"||typeof r.weight=="string")&&(i.weight=r.weight),typeof r.italic=="boolean"&&(i.italic=r.italic),typeof r.tr=="number"&&typeof r.size=="number"?i.tracking=r.tr/1e3*r.size:typeof r.tr=="number"&&(i.tracking=r.tr/1e3),typeof r.bs=="number"&&(i.baselineShift=r.bs),n.push(i)}return n.length>0?n:void 0}function Vn(t){return typeof t.ind=="number"?`layer_${t.ind}`:(t.nm??"layer").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"layer"}function Rr(t){return{id:Vn(t),name:t.nm,inPoint:t.ip,outPoint:t.op,startTime:t.st,parent:typeof t.parent=="number"?`layer_${t.parent}`:void 0,hidden:t.hd===1?!0:void 0}}function XT(t){const e=[];for(const n of t)n.ty==="gr"&&n.it?e.push(...XT(n.it)):e.push(n);return e}function Lk(t){switch(t.ty){case"rc":{const e=Be(t.s,un)??[0,0],n=Be(t.p,un),r=Be(t.r,zt);return{kind:"rect",size:e,...n!==void 0&&{position:n},...r!==void 0&&{roundness:r}}}case"el":{const e=Be(t.s,un)??[0,0],n=Be(t.p,un);return{kind:"ellipse",size:e,...n!==void 0&&{position:n}}}case"sr":{const e=Be(t.pt,zt)??5,n=Be(t.or,zt)??0,r=Be(t.ir,zt),i=Be(t.r,zt),o=Be(t.p,un);return{kind:"polystar",starType:t.sy===2?"polygon":"star",points:e,outerRadius:n,...r!==void 0&&{innerRadius:r},...i!==void 0&&{rotation:i},...o!==void 0&&{position:o}}}case"sh":{const e=Tk(t.ks);return e===void 0?null:{kind:"bezier",path:e}}default:return null}}function Pk(t){if(t?.c)return t.c.a===0?Sn(t.c.k):Sn(t.c.k[0].s)}function Nk(t,e,n){const r=Pk(t);if(r===void 0)return;const i=t?.c?.x;if(!i||!n)return r;const o=n(e,i);return o?{themeKey:o,default:r}:r}function kk(t,e){const n=XT(t.shapes),r=n.map(Lk).filter(l=>l!==null);if(r.length===0)return[];const i=Nk(n.find(l=>l.ty==="fl"),t.nm??"",e.resolveColorControl),o=Vn(t),s=Rr(t),a=qn(t.ks);return r.map((l,c)=>({kind:"shape",...s,id:c===0?s.id:`${o}_path_${c}`,...t.nm&&c>0&&{name:`${t.nm} / path ${c+1}`},transform:a,path:l,...i!==void 0&&{fill:i}}))}function Dk(t){return{kind:"shape",...Rr(t),transform:qn(t.ks),path:{kind:"rect",size:[t.sw,t.sh]},fill:t.sc}}function Fk(t){return{kind:"null",...Rr(t),transform:qn(t.ks)}}function Bk(t){return{kind:"image",...Rr(t),assetId:t.refId,transform:qn(t.ks)}}function Uk(t){return{kind:"precomp",...Rr(t),compId:t.refId,width:t.w,height:t.h,transform:qn(t.ks)}}function Gk(t){const e=t.t?.d?.k?.[0]?.s;if(!e)return null;const n=Mk(e),r={font:e.f,size:e.s,align:e.j===1?"right":e.j===2?"center":"left",...e.fc&&{fill:Sn(e.fc)},...e.lh!==void 0&&{lineHeight:e.lh},...e.tr!==void 0&&{letterSpacing:e.tr/1e3},...e.sc&&e.sw!==void 0&&{stroke:{color:Sn(e.sc),width:e.sw}},...n!==void 0&&{runs:n}};return{kind:"text",...Rr(t),transform:qn(t.ks),source:e.t,style:r}}function jk(t){switch(t.ty){case 0:return Uk(t);case 1:return Dk(t);case 2:return Bk(t);case 3:return Fk(t);case 5:return Gk(t);default:return null}}function WT(t,e={}){if(Ak(t))return[Ck(t,Vn(t))];if(Ok(t))return[Ik(t,Vn(t))];let n;if(t.ty===4)n=kk(t,e);else{const r=jk(t);n=r?[r]:[]}return n.length===0?[]:n.map(r=>{if(r.kind==="camera"||r.kind==="light")return r;let i=r;if(t.ddd===1&&(i=Yk(i,t)),e.matteSourceId&&t.tt!=null){const o=Hk(t.tt);o&&(i.trackMatte={sourceId:e.matteSourceId,mode:o})}if(i.kind==="shape"||i.kind==="text"){const o=YT(t);o&&(i.extrusion=o)}return i})}function Hk(t){switch(t){case 1:return"alpha";case 2:return"alpha-inverted";case 3:return"luma";case 4:return"luma-inverted";default:return null}}function Yk(t,e){if(t.kind==="camera"||t.kind==="light")return t;const n=e.ks;return n?{...t,is3D:!0,transform3D:Yd(n)}:t}const st={precomp:0,solid:1,image:2,null:3,shape:4,text:5,audio:6,video:9,camera:13,light:14},Xk=new Set([st.precomp,st.solid,st.image,st.null,st.shape,st.text,st.audio,st.video]),Wk=new Set([20,21,22,23,24,25,26,27,28,29,31,32,33,34]);function Tt(t){if(!t||typeof t!="object")return[];const e=t.layers;return Array.isArray(e)?e:[]}function dt(t){if(!t||typeof t!="object")return;const e=t.nm;return typeof e=="string"?e:void 0}function Xd(t,e,n=""){if(!t||typeof t!="object")return;if(Array.isArray(t)){t.forEach((i,o)=>Xd(i,e,`${n}[${o}]`));return}const r=t;("k"in r||"x"in r)&&e(r,n);for(const i of Object.keys(r))Xd(r[i],e,n?`${n}.${i}`:i)}const zk=[{id:"unsupported-layer-kind",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"unsupported-layer-kind"))return;const i=n.ty;if(typeof i!="number"){e.push({severity:"error",message:`Layer ${r} has no numeric \`ty\` — not a valid Bodymovin layer.`,layerIndex:r,layerName:dt(n)});return}i===st.camera||i===st.light||Xk.has(i)||e.push({severity:"error",message:`Layer ${r} uses unsupported Bodymovin \`ty: ${i}\`. Drop the layer or pre-render it as a video asset.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"expression",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{!n||typeof n!="object"||Et(n,"expression")||Xd(n,(i,o)=>{typeof i.x=="string"&&i.x.length>0&&e.push({severity:"error",message:`Layer ${r} property ${o} carries an expression. Run the expression baker (aep-17) before export.`,layerIndex:r,layerName:dt(n),path:o})})}),e}},{id:"3d-layer",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"3d-layer"))return;n.ddd===1&&e.push({severity:"info",message:`Layer ${r} is 3D-toggled (ddd: 1). Will render via the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)})}),e}},{id:"camera-or-light",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"camera-or-light"))return;const i=n.ty;i===st.camera?e.push({severity:"info",message:`Layer ${r} is a camera (ty: 13). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)}):i===st.light&&e.push({severity:"info",message:`Layer ${r} is a light (ty: 14). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)})}),e}},{id:"layer-style",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"layer-style"))return;const i=n.sy;Array.isArray(i)&&i.length>0&&e.push({severity:"warn",message:`Layer ${r} uses ${i.length} layer style(s). Layer styles are not parsed; re-author using shape strokes / effect filters.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"time-remap",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"time-remap"))return;const i=n.tm,o=n.sr;i!=null&&e.push({severity:"warn",message:`Layer ${r} uses time remap. Pre-bake to a flat keyframe timeline before export.`,layerIndex:r,layerName:dt(n),path:"tm"}),typeof o=="number"&&o!==1&&e.push({severity:"warn",message:`Layer ${r} has time stretch sr=${o}. Bake the stretch into keyframes or pre-render the source.`,layerIndex:r,layerName:dt(n),path:"sr"})}),e}},{id:"unsupported-effect",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"unsupported-effect"))return;const i=n.ef;Array.isArray(i)&&i.forEach((o,s)=>{if(!o||typeof o!="object")return;const a=o.ty;typeof a=="number"&&(Wk.has(a)||e.push({severity:"warn",message:`Layer ${r} effect[${s}] uses unsupported effect ty=${a}. Pre-render to footage or substitute with a supported effect.`,layerIndex:r,layerName:dt(n),path:`ef[${s}]`}))})}),e}},{id:"adjustment-layer",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"adjustment-layer"))return;const i=n.ao,o=n.ty;i===1&&o===st.solid&&e.push({severity:"warn",message:`Layer ${r} is an adjustment layer. The engine does not compose effects across sibling layers — apply effects per-layer instead.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"shape-operator",check:t=>{const e=[],n=new Set(["mm","rp","op","pb","tw","zz","rd"]);function r(i,o,s,a){if(!i)return;if(Array.isArray(i)){i.forEach((u,f)=>r(u,o,s,`${a}[${f}]`));return}if(typeof i!="object")return;const l=i,c=l.ty;typeof c=="string"&&n.has(c)&&e.push({severity:"warn",message:`Layer ${o} shape operator '${c}' (${a}) is not supported. Pre-bake the path to a single bezier before export.`,layerIndex:o,layerName:dt(s),path:a}),Array.isArray(l.it)&&r(l.it,o,s,`${a}.it`),Array.isArray(l.shapes)&&r(l.shapes,o,s,`${a}.shapes`)}return Tt(t).forEach((i,o)=>{if(!i||typeof i!="object"||Et(i,"shape-operator")||i.ty!==st.shape)return;const a=i.shapes;Array.isArray(a)&&r(a,o,i,"shapes")}),e}},{id:"text-runs-incomplete-coverage",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"text-runs-incomplete-coverage")||n.ty!==st.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=c.t;if(typeof f!="string")return;const d=f.length;if(d===0)return;const h=new Uint8Array(d);for(const m of u){if(!m||typeof m!="object")continue;const g=m.from,y=m.to;if(typeof g!="number"||typeof y!="number")continue;const b=Math.max(0,Math.floor(g)),x=Math.min(d,Math.floor(y));for(let v=b;v<x;v++)h[v]=1}let p=0;for(let m=0;m<d;m++)h[m]||p++;p>0&&e.push({severity:"warn",message:`Layer ${r} text \`runs\` cover ${d-p}/${d} chars; ${p} gap(s) filled with layer-level style at parse. Re-export with full per-letter coverage or remove \`runs\` to silence.`,layerIndex:r,layerName:dt(n),path:"t.d.k[0].s.runs"})}),e}},{id:"text-overlapping-runs",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"text-overlapping-runs")||n.ty!==st.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=u.filter(d=>!!d&&typeof d=="object"&&typeof d.from=="number"&&typeof d.to=="number").slice().sort((d,h)=>d.from-h.from);for(let d=1;d<f.length;d++){const h=f[d-1],p=f[d];p.from<h.to&&e.push({severity:"error",message:`Layer ${r} text \`runs\` overlap: [${h.from},${h.to}) ∩ [${p.from},${p.to}). Each character may be claimed by at most one run.`,layerIndex:r,layerName:dt(n),path:"t.d.k[0].s.runs"})}}),e}},{id:"extrusion-without-is3d",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"extrusion-without-is3d"))return;const i=n;(i.__aepExtrusion!==void 0||i.__aep_extrusion!==void 0)&&(i.ty!==st.shape&&i.ty!==st.text||i.ddd!==1&&e.push({severity:"warn",message:`Layer ${r} has \`extrusion\` set but is not 3D (\`ddd:0\`). Extrusion only renders in the Three sub-scene; toggle 3D in AE or remove the extrusion extension.`,layerIndex:r,layerName:dt(n),path:"__aepExtrusion"}))}),e}}];class zT extends Error{constructor(e){super(`Bodymovin lint found ${e.findings.filter(n=>n.severity==="error").length} error(s). First: ${e.findings.find(n=>n.severity==="error")?.message}`),this.report=e,this.name="LottieLintError"}report}function qT(t,e={}){const n=new Set(e.disabledRules??[]),r=zk.filter(s=>!n.has(s.id)),i=qk(t,r),o=Vk(i);return{findings:o,hasErrors:o.some(s=>s.severity==="error"),hasWarnings:o.some(s=>s.severity==="warn")}}function qk(t,e){const n=[];for(const r of e)try{const i=r.check(t);for(const o of i)n.push({...o,ruleId:r.id})}catch{}return n}function Vk(t){const e=new Set,n=[];for(const i of t){const o=`${i.ruleId}::${i.layerIndex??-1}::${i.path??""}`;e.has(o)||(e.add(o),n.push(i))}const r={error:0,warn:1,info:2};return n.sort((i,o)=>{const s=r[i.severity]-r[o.severity];return s!==0?s:(i.layerIndex??-1)-(o.layerIndex??-1)}),n}function Et(t,e){if(!t||typeof t!="object")return!1;const n=t.__aepLintSuppress;return Array.isArray(n)?n.includes(e):!1}const Kk="ADBE Color Control";function Zk(t,e){const n={},r=new Set,i=new Map;for(const o of t){if(!Array.isArray(o.ef))continue;const s=o.ef.filter(c=>c.mn===Kk);if(s.length===0)continue;r.add(e(o));const a=o.nm??"",l=new Map;for(const c of s){const u=c.nm;if(!u)continue;l.set(u,u);const d=c.ef?.find(h=>h.ty===2)?.v?.k;Array.isArray(d)&&d.length>=3&&(n[u]=Sn(d))}l.size>0&&i.set(a,l)}return{theme:n,sourceLayerIds:r,resolveToken(o,s){return i.get(o)?.get(s)}}}const $k=[/comp\([^)]+\)\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"](?:Color|"Color"|'Color')['"]\s*\)/,/thisComp\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/],Jk=/(?:^|[^.\w])effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/;function Qk(t){for(const n of $k){const r=n.exec(t);if(r)return{layerName:r[1],effectName:r[2]}}const e=Jk.exec(t);return e?{layerName:"",effectName:e[1]}:null}function eD(t,e={}){const n=t;if(!n||typeof n.fr!="number"||!Array.isArray(n.layers))throw new Error("bodymovinToAep: input does not look like a Bodymovin JSON document");const r=e.lint??"strict";if(r!=="off"){const h=qT(t,{disabledRules:e.disabledRules});if(r==="strict"&&h.hasErrors)throw new zT(h);if(r==="warn"||r==="strict"&&h.hasWarnings)for(const p of h.findings)console.warn(`[bodymovin lint:${p.severity}] ${p.ruleId} — ${p.message}`)}const i=Zk(n.layers,Vn),o=(h,p)=>{const m=Qk(p);if(!m)return;const g=m.layerName===""?h:m.layerName;return i.resolveToken(g,m.effectName)},{layers:s,assets:a,precomps:l}=VT(n.layers,o,i.sourceLayerIds),{mergedAssets:c,mergedPrecomps:u}=tD(a,l,n.assets??[]),f=HT(t),d=Object.keys(i.theme).length?i.theme:void 0;return Lo({version:"1.0.0",id:n.nm??"lottie-import",name:n.nm,width:n.w,height:n.h,fps:n.fr,durationInFrames:n.op,layers:s,assets:c,...Object.keys(u).length>0&&{precomps:u},...f&&{postFx:f},...d&&{theme:d}})}function VT(t,e,n){const r=t.map(o=>Vn(o)),i=[];for(let o=0;o<t.length;o++){const s=t[o];if(n?.has(r[o]))continue;const a=t[o-1],l=s.tt!=null&&s.tt>0&&a?.td===1?r[o-1]:void 0,c=WT(s,{matteSourceId:l,resolveColorControl:e});if(c.length===0){console.warn(`bodymovinToAep: dropping unsupported layer ty=${s.ty}`+(s.nm?` (${s.nm})`:""));continue}i.push(...c)}return{layers:i,assets:{},precomps:{}}}function tD(t,e,n){const r={...t},i={...e};for(const o of n)if("layers"in o&&Array.isArray(o.layers)){const s=VT(o.layers);r[o.id]={type:"composition",src:""},i[o.id]={version:"1.0.0",id:o.id,width:0,height:0,fps:0,durationInFrames:1,layers:s.layers,assets:s.assets}}else{const s=o,a=(s.u??"")+(s.p??"");r[o.id]={type:"image",src:a,...s.w!==void 0&&{width:s.w},...s.h!==void 0&&{height:s.h}}}return{mergedAssets:r,mergedPrecomps:i}}const KT=(t,e)=>t.flatMap((n,r)=>Ob(n.name)?[]:[{ruleId:"transition-unknown-name",severity:"warn",message:`Transition '${n.id}' uses unknown shader '${n.name}'; it will render as a crossfade.`,path:`${e}transitions.${r}.name`}]),nD=t=>{const e=[...KT(t.transitions??[],""),...Object.entries(t.precomps??{}).flatMap(([n,r])=>KT(r.transitions??[],`precomps.${n}.`))];return{findings:e,hasErrors:!1,hasWarnings:e.length>0}};_.AEP_MAX_PRECOMP_DEPTH=yo,_.AEP_SCHEMA_MAJOR=hf,_.AEP_SCHEMA_VERSION=gM,_.AEP_TEXT_ALIGN_VALUES=ub,_.ALL_GOOGLE_FONTS=_L,_.ANIMATION=Em,_.ANIMATIONS_WITHOUT_ALPHA=ja,_.ANIMATION_CONFIGS=Te,_.ANIMATION_TIMING=Ft,_.ASPECT_RATIOS=xk,_.AbstractContainer=Je,_.Aep3DPostFx=kd,_.Aep3DPrecompPlane=Gd,_.Aep3DScene=LT,_.Aep3DShapeMesh=Dd,_.Aep3DTextMesh=Ud,_.AepAssetResolverProvider=U1,_.AepComposition=xT,_.AepLayerProvider=si,_.AepLayerRouter=Ar,_.AepMaskContainer=D1,_.AepMsdfTextMesh=Bd,_.AepPrecompRenderProvider=XN,_.AepPrecompRenderer=Nd,_.AepReadinessProvider=q1,_.AepRecursionDepthProvider=L_,_.AepTextOverrideProvider=Nv,_.AepThemeProvider=$f,_.AepTransitionLayer=Ai,_.AepTransitionMesh=Md,_.AepTransitionProvider=ts,_.Animations=to,_.AudioPlaybackManager=Pu,_.BOXED_PADDING=pi,_.BlendModes=NT,_.BorderMaskContainer=Ot,_.CANVAS_DEFAULTS=Zr,_.CANVAS_TEXT_MAX_LENGTH=uv,_.CLIP_LOCAL_TOLERANCE_SEC=Cf,_.DEFAULT_BOXED_COLOR=qx,_.DEFAULT_DUCK_FADE_SEC=po,_.DEFAULT_DUCK_TO=Iu,_.DEFAULT_LIGHTING_PRESET=Ed,_.DEFAULT_MAX_REGION_PIXELS=mf,_.DEFAULT_SEGMENT_GAP_SEC=Mx,_.DEFAULT_WORD_SPACING_EM=Vb,_.DRIFT_TOLERANCE_SEC=Vy,_.EMOJI_CDN_BASE=wx,_.Events=ke,_.FALLBACK_SPACE_EM=qb,_.FONT_LOAD_TIMEOUT_MS=lv,_.GLOW_POP_BLOOM_ALPHA=sx,_.GLOW_POP_BLOOM_BLUR_EM=ox,_.GLOW_POP_BLOOM_PASSES=ax,_.GLOW_POP_BLUR_EM=ix,_.GLOW_POP_EMOJI_BLOOM_ALPHA=cx,_.GLOW_POP_EMOJI_MS=rx,_.GLOW_POP_EMOJI_OFFSET_EM=vf,_.GLOW_POP_EMOJI_SIZE_EM=xf,_.GLOW_POP_ENTER_MS=tx,_.GLOW_POP_EXIT_MS=nx,_.GLOW_POP_STREAK_ALPHA=bf,_.GOOGLE_FONTS=cv,_.GlTransitionRegistryProvider=bP,_.GsapPixieContext=Ye,_.GsapPixieContextProvider=$E,_.IDENTITY_TRANSFORM_3D=vT,_.LIGHTING_PRESETS=Td,_.LINE_PITCH=Kb,_.LOOP_ANIMATIONS=vm,_.LottieLintError=zT,_.MIN_CROP_SIZE=vk,_.MIN_VISIBLE_BLUR=Lf,_.MODEL3D_DEFAULTS=vt,_.MSDF_FRAGMENT_SHADER=Gb,_.MSDF_VERTEX_SHADER=Ub,_.MUSIC_BED_DEFAULT_VOLUME=vR,_.MaskTypes=Ut,_.MetricsCache=__,_.MsdfAtlasProvider=CT,_.MsdfAtlasRegistry=IT,_.OverlayTilingSpriteTypes=Np,_.OverlayTypes=Gr,_.PIXITEXT_HITAREA_PREFIX=w_,_.PIXITEXT_TEXT_LABEL=A_,_.PRELOAD_FONTS=bL,_.Pixi3DModelLayer=Rd,_.PixiAnimatedSprite=mP,_.PixiAudioSprite=t_,_.PixiCaptionsTrack=rP,_.PixiElementTransition=Xo,_.PixiGifSprite=i_,_.PixiGlTransition=n1,_.PixiImageSprite=hu,_.PixiLottieSprite=pd,_.PixiMorphSvgSprite=bR,_.PixiNullObject=I1,_.PixiOverlayTilingSprite=kp,_.PixiPreComp=pT,_.PixiRemotionGifSprite=NP,_.PixiRemotionImageSprite=IP,_.PixiRemotionSprite=CP,_.PixiRemotionVideoCanvaSprite=LP,_.PixiSceneTransition=hd,_.PixiSequence=$v,_.PixiSequenceWrapper=gP,_.PixiShapeLayer=R1,_.PixiSvgImageSprite=oR,_.PixiSvgPathSprite=_y,_.PixiSvgRawSprite=yy,_.PixiTextSplit=td,_.PixiTextSprite=O_,_.PixiThreeModelSprite=LR,_.PixiThreeSprite=o_,_.PixiTrackMatte=F1,_.PixiUnifiedTransformer=aN,_.PixiVideoCanvasSyncSprite=hP,_.PixiVideoSprite=ld,_.SPECIAL_ANIMATIONS=$r,_.SPRING_POP_AMPLITUDE_EM=hx,_.SPRING_POP_BLOOM_ALPHA=yx,_.SPRING_POP_BLOOM_BLUR_EM=gx,_.SPRING_POP_BLUR_ALPHA=Tf,_.SPRING_POP_BLUR_EM=mx,_.SPRING_POP_BLUR_MS=px,_.SPRING_POP_DAMPING=dx,_.SPRING_POP_FREQUENCY_HZ=fx,_.SPRING_POP_SPLIT_ALPHA=Ex,_.SPRING_POP_SPLIT_BOTTOM=Tx,_.SPRING_POP_SPLIT_EM=xx,_.SPRING_POP_SPLIT_MS=bx,_.SPRING_POP_SPLIT_SETTLED_EM=Ef,_.SPRING_POP_SPLIT_TOP=vx,_.SPRITE_REF_PROP_NAMES=ny,_.THREE_DEFAULTS=jt,_.TRANSITIONS_MIN_VERSION=pf,_.TextRunsOverlapError=db,_.ThreeOffscreenRenderer=Q1,_.Transitions=TM,_.VOICE_TRACK_ROLES=Hy,_.WORDBOX_GROW_MS=Zx,_._listEffectHandlers=UL,_.acquireOffscreenRenderer=Cd,_.acquireVideoAsset=rv,_.activeScaleFor=No,_.activeWordIndexAt=ex,_.activeWordScaleFor=Sf,_.activeWordWindow=$b,_.aepAnimatableOf=q,_.aepAssetKindSchema=K_,_.aepAssetMapSchema=$_,_.aepAssetSchema=Z_,_.aepBezierPathSchema=fi,_.aepCameraLayerSchema=rb,_.aepCompositionSchema=Mo,_.aepEaseHandleSchema=tf,_.aepEffectNameSchema=J_,_.aepEffectSchema=Q_,_.aepKeyframeOf=nf,_.aepLayerSchema=Tb,_.aepLightLayerSchema=ib,_.aepMaskModeSchema=tb,_.aepMaskSchema=nb,_.aepPostFxNameSchema=eb,_.aepPostFxSchema=of,_.aepRangeBasedOnSchema=sb,_.aepRangeShapeSchema=ob,_.aepShapePathSchema=_b,_.aepTextAlignSchema=fb,_.aepTextAnimatorSchema=cb,_.aepTextRangeSelectorSchema=ab,_.aepTextStyleRunSchema=lb,_.aepTextStyleSchema=xb,_.aepThemableColorSchema=uf,_.aepThemableColorValueSchema=mb,_.aepThemeMapSchema=gb,_.aepThemeRefSchema=pb,_.aepTransform3DSchema=Io,_.aepTransformSchema=Ro,_.aepTransitionSchema=yb,_.animationAffectsAlpha=dw,_.applyAudioDecision=Lu,_.applyEntranceOverlaps=fL,_.applyMaterialOverrides=l_,_.areSpritePropsEqual=tt,_.asNumber=zt,_.asOpacity=FT,_.asScale=DT,_.asVec2=un,_.audioRegistry=hr,_.bodymovinToAep=eD,_.boxedBackgroundSpec=Kx,_.boxedRadiusFor=Vx,_.brightnessContrastHandler=zf,_.buildAudioLevelTimeline=KL,_.buildBezierPathTimeline=Iv,_.buildColorValueTimeline=fv,_.buildExtrudeGeometry=vd,_.buildGainSpec=SR,_.buildLayerTimeline=I_,_.buildPrimitiveGeometry=xd,_.buildRasterSvg=py,_.buildResourceUrlModifier=f_,_.buildScalarValueTimeline=Zf,_.buildSourceGeometry=wN,_.buildTextStyleOptions=Hu,_.buildV8FillGradient=E_,_.buildVec2ValueTimeline=Mv,_.camelToUpperSnake=lr,_.captionModeFor=Qb,_.captionSegmentSchema=Rx,_.captionSegmentsSchema=Ix,_.captionTimeAt=Mf,_.captionWordSchema=Cx,_.captionWordText=JM,_.clipFileTime=Ky,_.clipSegmentsToRange=uL,_.clipTimeAt=a_,_.clipTimeSeconds=oT,_.clipVolumeAt=Zy,_.clonePath=Xn,_.coerceLegacyTextAlign=cf,_.composeAnimators=Ho,_.composeTransform3D=ET,_.computeInstanceMatrix=Wb,_.computeModelPose=s_,_.convertLayer=WT,_.convertProperty=Be,_.convertTransform=qn,_.createAssetRefCounter=Ja,_.createAudioRegistry=jy,_.createCanvasMetricsProvider=b_,_.createGLTransitionShader=Ib,_.createPixiSelector=rO,_.createRendererPool=eT,_.cubicBezierEase=dv,_.dbToLinear=TR,_.decideAudioSync=Mu,_.defaultAssetResolver=_d,_.deriveDuckWindows=qy,_.detectOutlineIcon=hy,_.detectSubtitleFormat=Ux,_.directionFromAzimuthElevation=V1,_.displayedWordsFor=Xx,_.disposeObject=Fu,_.drawAepMaskComposite=k1,_.drawMaskShape=$a,_.drawShape=w1,_.dropShadowHandler=jf,_.duckGainAt=Xy,_.duckWindowsFromEnvelope=zy,_.easeCaptionProgress=xn,_.easeNameFor=Bn,_.easeOutBack=lx,_.emitCustomEvent=Ln,_.estimateWordTimings=Of,_.fadeGainAt=Yy,_.fastBoxBlurHandler=qf,_.findAllByPattern=Za,_.findByName=Ka,_.fitCameraToObject=u_,_.fitDistance=Du,_.flattenThemableColor=Yn,_.fontFamilyKey=kf,_.fontWeightsOf=yi,_.formatGoogleFamily=gi,_.frameCamera=iT,_.fromMultiplierColorCorrection=QA,_.gainAt=Wy,_.gaussianBlurHandler=Gf,_.getAepTransitionEase=hT,_.getAvailableTransitions=Cb,_.getEffectFilter=Pm,_.getEffectHandler=Kf,_.getElementName=Va,_.getLoadedFonts=xL,_.getOffscreenRenderer=IN,_.getPixiTextHitAreaName=nI,_.getTransitionInfo=SM,_.getTransitionShader=Po,_.getUniqueIdFromName=tO,_.gifFrameAt=r_,_.glowHandler=Hf,_.glowPopMotion=ux,_.googleFontsHref=av,_.groupWordsIntoSegments=nL,_.hasMaterialOverrides=c_,_.hexToRgba=zb,_.hueSaturationHandler=Yf,_.hydrateMsdfAtlas=VM,_.interpolateBezierPath=Ff,_.isClipLocal=Gx,_.isExternalUrl=vM,_.isFontSpecCovered=ov,_.isFrameInRange=sT,_.isLoopAnimation=Tm,_.isSingleWordMode=ZM,_.isSpecialAnimation=hw,_.isSvgSource=gy,_.isTimeBasedMode=Yx,_.isValidAnimation=pw,_.isWhitespaceChar=h_,_.layerIdFor=Vn,_.layoutCaptionWords=Jb,_.layoutText=x_,_.lerpColor=mv,_.lerpNumber=hv,_.lerpVec2=pv,_.levelsHandler=Xf,_.linearToDb=ER,_.lintAepTransitions=nD,_.lintBodymovinJson=qT,_.listGlTransitionNames=wM,_.loadGoogleFonts=wL,_.loadMsdfAtlas=Bb,_.loadSpriteTexture=cO,_.loadSpriteTextureSync=ro,_.lottieColorToHex=Sn,_.mapV7DropShadow=v_,_.mapV7Stroke=T_,_.markVideoReady=Bo,_.materialOverrideKey=ku,_.mergeAssetMaps=ai,_.mergeTheme=Jf,_.metricsCacheKey=y_,_.model3DStateKey=J1,_.newCustomEventEmitter=ZE,_.normalizeAnimation=Ha,_.normalizeCaptionSegments=tL,_.normalizeFontWeight=Gu,_.normalizeLetterSpacing=S_,_.normalizeLoopAnimation=wm,_.normalizeTextRuns=hb,_.notoEmojiFileName=Ax,_.overlays=_a,_.parseAepComposition=Lo,_.parseAepCompositionSafe=xM,_.parseCaptionColor=zx,_.parseCaptionSegments=$M,_.parseHexColor=Wn,_.parseSRT=Fx,_.parseSubtitles=sL,_.parseTimestamp=ko,_.parseVTT=Bx,_.pathHash=AT,_.pathToThreeShape=wT,_.planPropSegments=R_,_.projectSegments=lL,_.rangeShapeValue=Qf,_.readExtrusionExtension=YT,_.readOriginalSize=dy,_.readPostFxExtension=HT,_.registerEffectHandler=BL,_.registerVideo=ev,_.releaseOffscreenRenderer=rT,_.releaseVideoAsset=iv,_.resetVideoReadiness=pL,_.resolveBlendModeString=Xa,_.resolveBlendStrategy=yw,_.resolveCaptionOffset=cL,_.resolveEmojiSrc=wf,_.resolveLightingConfig=Sd,_.resolvePostFxList=MT,_.resolveSequenceTransitions=e1,_.resolveSpaceWidth=Zb,_.resolveTextRuns=yf,_.resolveTextRunsWithWarnings=XM,_.resolveTextSource=ZL,_.resolveTextSplitFills=kv,_.resolveThemedColorValue=ff,_.resolveWordSpacing=_f,_.rewriteSvg=my,_.rgbaToHex=_i,_.rotateVec3Euler=TT,_.sampleAnimatable=Tr,_.sampleAnimatedBezier=Uf,_.sampleBezierPath=v1,_.sampleCaptionAt=If,_.sampleColor=xt,_.sampleModel3DState=Od,_.samplePath=yd,_.sampleScalar=ye,_.sampleVec2=sn,_.sanitizeCanvasText=CL,_.sanitizeImageSrc=Qa,_.selectorPerChar=ed,_.shouldSplitText=X1,_.splitGraphemes=d_,_.springPopMotion=_x,_.springPopSplit=Sx,_.staticParam=Fe,_.threeTextureFromPixi=bk,_.tintHandler=Wf,_.transformCaptionText=xr,_.transitionExists=Ob,_.transitionLayerIds=df,_.trimPolyline=T1,_.unregisterVideo=tv,_.useAepAssetResolver=G1,_.useAepBezierPathAnimator=zL,_.useAepColorAnimator=XL,_.useAepCompositionReady=W1,_.useAepCurrentFrame=N_,_.useAepEffectKeyframes=Rv,_.useAepEffects=Cv,_.useAepKeyframes=aI,_.useAepLayerContext=_t,_.useAepLayerContextOptional=Jt,_.useAepLayerTransform=Y1,_.useAepLayerTransform3D=Oi,_.useAepPrecompStore=Ld,_.useAepReadiness=z1,_.useAepRecursionDepth=P_,_.useAepTextLayout=jo,_.useAepTextOverride=bi,_.useAepTheme=zn,_.useAepTransitionClock=dT,_.useAepTransitionRegistry=wr,_.useAepValueAnimator=YL,_.useAepVec2Animator=VL,_.useAllVideosReady=yL,_.useAudioElementPlayer=n_,_.useAudioVisualizer=e_,_.useBlendFilter=Rm,_.useCaptionPlayhead=Dv,_.useCaptionStyles=Bv,_.useCustomEventListener=$e,_.useDebouncedValue=ei,_.useEffects=XA,_.useEmojiTextures=Uv,_.useFontEpoch=oi,_.useGLTransitionMesh=fd,_.useGsapEffect=xm,_.useHowlerAudioPlayer=RR,_.useMsdfAtlas=RT,_.usePixiAnimation=Am,_.usePixiRenderTexture=bT,_.usePrecompTexture=_T,_.useResolveAsset=Ei,_.useSpriteFilters=ut,_.useSvgTexture=by,_.useTypefaceMetrics=_v,_.useVideoLifecycle=Vv,_.useVideoTexture=qv,_.useVideoTimelineSync=Kv,_.usesClipLocalTime=jx,_.validatePrecompDepth=mT,_.withEffectsHook=za,_.withFiltersHook=Mm,_.wordVisualFor=Hx,_.wordboxPillSpec=$x,_.writeInstanceColor=KM,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
|
1523
|
+
`.trim())}`}class Yt extends B.Graphics{constructor(e,n,r={},i,o,s){super(),this.transformer=e;const a=Object.assign({},c1,r);this._handle=n,this._style=a,this.onHandleDelta=i,this.onHandleCommit=o,this._dirty=!0,this.eventMode="static",this.cursor=s||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new B.Point,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp,this.draw()}transformer;onHandleDelta;onHandleCommit;_handle;_style;_dirty;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_rotatorSprite=null;_rotatorKey=null;static _rotatorTextureCache=new Map;static async loadTextures(e=[{bgColor:"#6366f1",arrowColor:"#ffffff",size:28}]){await Promise.all(e.map(({bgColor:n="#6366f1",arrowColor:r="#ffffff",size:i=28})=>{const o=`${n}:${r}:${i}`;if(Yt._rotatorTextureCache.has(o)){const l=Yt._rotatorTextureCache.get(o);return l instanceof Promise?l:Promise.resolve(l)}const s=l1(n,r,i),a=B.Assets.load(s).then(l=>(Yt._rotatorTextureCache.set(o,l),l));return Yt._rotatorTextureCache.set(o,a),a}))}get handle(){return this._handle}set handle(e){this._handle=e,this._dirty=!0,this.draw()}get style(){return this._style}set style(e){this._style=Object.assign({},c1,e),this._dirty=!0,this.draw()}draw(){const e=this._handle,n=this._style;this.clear();const r=e==="middleLeft"||e==="middleRight",i=e==="topCenter"||e==="bottomCenter",o=e==="rotator";n.glowColor&&n.glowIntensity&&n.glowIntensity>0&&!o&&this.drawGlowEffect(n,r||i),o?this.drawRotatorHandle(n):r||i?this.drawPillHandle(e,n):this.drawCornerHandle(n),this._dirty=!1}drawGlowEffect(e,n){const i=e.radius||7,o=i/7;if(n){const s=10*o,a=20*o,l=5*o,c=2*o;for(let u=0;u<3;u++){const f=(e.glowIntensity||.15)*(1-u/3)*.3,d=u*c;this.roundRect(-s/2-d,-a/2-d,s+d*2,a+d*2,l+d).fill({color:e.glowColor||6514417,alpha:f})}}else{const s=i*1.5;for(let a=0;a<3;a++){const l=(e.glowIntensity||.15)*(1-a/3)*.3,c=i+(s-i)*(a/3);this.circle(0,0,c).fill({color:e.glowColor||6514417,alpha:l})}}}drawCornerHandle(e){const n=e.radius||7;this.circle(0,0,n).fill({color:16777215}).stroke({width:e.outlineThickness||2.5,color:e.outlineColor||6514417})}drawPillHandle(e,n){const i=(n.radius||7)/7,o=e==="topCenter"||e==="bottomCenter",s=(o?20:10)*i,a=(o?10:20)*i,l=5*i;this.roundRect(-s/2,-a/2,s,a,l).fill({color:n.color||16777215}).stroke({width:n.outlineThickness||2.5,color:n.outlineColor||6514417})}drawRotatorHandle(e){const n=e.outlineColor??6514417,r=e.rotatorIconColor??16777215,i="#"+n.toString(16).padStart(6,"0"),o="#"+r.toString(16).padStart(6,"0"),a=(e.radius||7)/7,l=Math.round(28*a),c=`${i}:${o}:${l}`,u=Yt._rotatorTextureCache.get(c);if(this._rotatorSprite&&this._rotatorKey!==c&&(this.removeChild(this._rotatorSprite),this._rotatorSprite.destroy(),this._rotatorSprite=null,this._rotatorKey=null),u instanceof B.Texture){if(!this._rotatorSprite){const b=new B.Sprite(u);b.anchor.set(.5,.5);const x=u.width||l,v=u.height||l;b.scale.set(l/x,l/v),this.addChild(b),this._rotatorSprite=b,this._rotatorKey=c}return}if(u)u.then(()=>{this._dirty=!0,this.draw()});else{const b=l1(i,o,l),x=B.Assets.load(b).then(v=>(Yt._rotatorTextureCache.set(c,v),this._dirty=!0,this.draw(),v));Yt._rotatorTextureCache.set(c,x)}const f=Math.round(10*a),d=f*.55,h=Math.max(1.5,1.8*a);this.circle(0,0,f).fill({color:n});const p=-Math.PI*.85,m=-Math.PI*.15;this.arc(0,0,d,p,m,!1).stroke({width:h,color:r});const g=Math.PI*.15,y=Math.PI*.85;this.arc(0,0,d,g,y,!1).stroke({width:h,color:r})}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(e){this._pointerDown&&(this._pointerDragging?this.onDrag(e):this.onDragStart(e),e.stopPropagation())}onPointerUp(e){this._pointerDragging&&this.onDragEnd(e),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(e){this._pointerPosition.copyFrom(e.global),this._pointerDragging=!0}onDrag(e){const n=e.global;this.onHandleDelta&&this.onHandleDelta(n),this._pointerPosition.copyFrom(n)}onDragEnd(e){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function qo(t,e,n,r){const{x:i,y:o}=n,{x:s,y:a}=r;if(Math.abs(s-i)<.01)return Math.abs(t-i);if(Math.abs(a-o)<.01)return Math.abs(e-o);const l=(a-o)/(s-i);return Math.abs((l*t-e+(a-l*s))/Math.sqrt(l*l+1))}const u1=a1.build(B.Point),FP=[new B.Point,new B.Point,new B.Point,new B.Point],BP=new B.Matrix,Er=new B.Point,UP=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],GP=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],jP=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],HP=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],md=new Array(12),YP=[UP,GP,jP,HP];class XP extends B.Graphics{transformer;boxScalingHandles;constructor(e){super(),this.transformer=e,this.boxScalingHandles=[this.addChild(new B.Graphics),this.addChild(new B.Graphics),this.addChild(new B.Graphics),this.addChild(new B.Graphics)],this.boxScalingHandles.forEach(n=>{n.eventMode="static"}),this.boxScalingHandles[0].cursor=vi.topCenter,this.boxScalingHandles[1].cursor=vi.middleRight,this.boxScalingHandles[2].cursor=vi.bottomCenter,this.boxScalingHandles[3].cursor=vi.middleLeft}hitHandleType(e,n,r){const{boxRotationEnabled:i,boxRotationTolerance:o,boxScalingEnabled:s,boxScalingTolerance:a}=this.transformer,[l,c,u,f]=e.hull,{x:d,y:h}=n.applyInverse(r,Er);if(s){const p=qo(d,h,l,c)*n.d,m=qo(d,h,l,f)*n.a,g=qo(d,h,c,u)*n.a,y=qo(d,h,f,u)*n.d,b=Math.min(p,m,g,y);if(b<a)switch(b){case p:return"topCenter";case m:return"middleLeft";case g:return"middleRight";case y:return"bottomCenter"}}if(i&&!e.contains(d,h)){const p=Math.sqrt((l.x-d)**2+(l.y-h)**2),m=Math.sqrt((c.x-d)**2+(c.y-h)**2),g=Math.sqrt((f.x-d)**2+(f.y-h)**2),y=Math.sqrt((u.x-d)**2+(u.y-h)**2),b=Math.min(p,m,g,y);if(b<o*1.45)switch(b){case p:return"boxRotateTopLeft";case m:return"boxRotateTopRight";case g:return"boxRotateBottomLeft";case y:return"boxRotateBottomRight"}}return null}drawBounds(e){const n=FP;for(let r=0;r<4;r++)this.transformer.projectToLocal(e.hull[r],n[r]);this.poly(n)}drawBoxScalingTolerance(e,n=this.transformer.boxScalingTolerance){e.innerBounds.pad(-n);const r=u1.allocateArray(4);r.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(2.5*n);const i=u1.allocateArray(4);i.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let o=0;o<4;o++){const s=r[o],a=r[(o+1)%4],l=i[o],c=i[(o+1)%4];this.boxScalingHandles[o].clear().poly([s,l,c,a]).fill({color:16777215,alpha:1e-4})}}drawBoxRotationTolerance(){const{boxRotateTopLeft:e,boxRotateTopRight:n,boxRotateBottomLeft:r,boxRotateBottomRight:i}=this.transformer.handleAnchors,o=this.transformer.boxRotationTolerance*2,s=BP.identity().scale(o,o).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=YP[a];let c;switch(a){case 0:c=e;break;case 1:c=n;break;case 2:c=r;break;case 3:c=i;break}for(let u=0;u<l.length;u+=2){const f=l[u],d=l[u+1];Er.set(f,d),s.apply(Er,Er),md[u]=Er.x+c.x,md[u+1]=Er.y+c.y}this.poly(md.slice())}}projectToLocal(e,n){return this.transformer.projectToLocal(e,n)}}const f1=new B.Matrix;function d1(t){const e=f1.identity();return e.c=Math.tan(t),e}function h1(t){const e=f1.identity();return e.b=Math.tan(t),e}function p1(t,e,n,r=t.pivot){const i=e.a,o=e.b,s=e.c,a=e.d,l=-Math.atan2(-s,a),c=Math.atan2(o,i);return n=n??c,t.pivot.set(r.x,r.y),t.rotation=n,t.skew.x=n+l,t.skew.y=-n+c,t.scale.x=Math.sqrt(i*i+o*o),t.scale.y=Math.sqrt(s*s+a*a),t.position.x=e.tx+(r.x*e.a+r.y*e.c),t.position.y=e.ty+(r.x*e.b+r.y*e.d),t}const Vo=new B.Matrix,WP=new B.Matrix,Xt=new B.Transform;function zP(t,e,n){t.updateLocalTransform();const r=t.worldTransform,i=t.parent?WP.copyFrom(t.parent.worldTransform):B.Matrix.IDENTITY;Vo.copyFrom(r),Vo.prepend(e),Vo.prepend(i.clone().invert()),p1(Xt,Vo),t.position.set(Xt.position.x,Xt.position.y),t.scale.set(Xt.scale.x,Xt.scale.y),t.pivot.set(Xt.pivot.x,Xt.pivot.y),t.rotation=Xt.rotation,t.skew.set(Xt.skew.x,Xt.skew.y)}const gd=new B.Transform,qP=[new B.Point,new B.Point,new B.Point,new B.Point],Sr=new B.Matrix,cn=new B.Point,Ko=new zo,m1=[new B.Point,new B.Point,new B.Point,new B.Point],g1=new B.Point,y1=new B.Matrix,Zo=a1.build(B.Point),vi={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},$o=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],_1={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},VP=[...$o,"rotator","skewHorizontal","skewVertical"],KP=4,ZP=16,$P=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],JP=Math.PI/90,QP=[Math.PI/4,-Math.PI/4],eN=Math.PI/90,Tn={color:6514417,thickness:2};let tN=class fn extends B.Container{_group;get group(){return this._group}set group(e){this._group=e?[...e]:[],this._focusedElementIndex=this._group.length>0?0:-1,this.updateElementIndexMap(),this.lazyDirty=!0}boundingBoxes;boxRotationEnabled;boxRotationTolerance;boxScalingEnabled;boxScalingTolerance;centeredScaling;cursors;individualBorderColor;individualBorderThickness;individualBorderAlpha;individualBorderStyle;individualBorderDashPattern;nestedSelectionEnabled;focusedElementBorderColor;focusedElementBorderThickness;focusedElementBorderStyle;focusedElementBorderDashPattern;showNonFocusedBorders;lazyMode=!1;lazyDirty=!1;lockAspectRatio;projectionTransform;rotationSnaps;rotationSnapTolerance;skewRadius;skewSnaps;skewSnapTolerance;stage;translateEnabled;transientGroupTilt;groupBounds;handles;handleAnchors;wireframe;_enabledHandles=void 0;_rotateEnabled;_scaleEnabled;_skewEnabled;_skewX;_skewY;_transformHandle=null;_transformType;_handleStyle;_wireframeStyle;_colorTheme;_rotatorAnchorConfig;_focusedElementIndex;_elementIndexMap;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_transformStarted;_clickThreshold;_clickStartPosition;_elementClickCandidate;constructor(e={}){super(),this.eventMode="static",this.cursors=Object.assign({default:"move"},e.cursors),this.cursor=this.cursors.default,this.boundingBoxes=e.boundingBoxes||"all",this._group=e.group||[],this.boxRotationTolerance=e.boxRotationTolerance||ZP,this.boxScalingTolerance=e.boxScalingTolerance||KP,this.centeredScaling=!!e.centeredScaling,this.projectionTransform=new B.Matrix,this.lockAspectRatio=e.lockAspectRatio===!0,this.rotationSnaps=e.rotationSnaps||$P,this.rotationSnapTolerance=e.rotationSnapTolerance!==void 0?e.rotationSnapTolerance:JP,this.skewRadius=e.skewRadius||64,this.skewSnaps=e.skewSnaps||QP,this.skewSnapTolerance=e.skewSnapTolerance!==void 0?e.skewSnapTolerance:eN,this.boxRotationEnabled=e.boxRotationEnabled===!0,this.boxScalingEnabled=e.boxScalingEnabled===!0,this._rotateEnabled=e.rotateEnabled!==!1,this._scaleEnabled=e.scaleEnabled!==!1,this._skewEnabled=e.skewEnabled===!0,this.translateEnabled=e.translateEnabled!==!1,this.transientGroupTilt=e.transientGroupTilt!==void 0?e.transientGroupTilt:!0,this.wireframe=this.addChild(new XP(this)),this.wireframe.cursor="none",this.stage=e.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e.colorTheme},this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e.rotatorAnchor},this.individualBorderColor=e.individualBorderColor!==void 0?e.individualBorderColor:54527,this.individualBorderThickness=e.individualBorderThickness,this.individualBorderAlpha=e.individualBorderAlpha!==void 0?e.individualBorderAlpha:1,this.individualBorderStyle=e.individualBorderStyle||"solid",this.individualBorderDashPattern=e.individualBorderDashPattern||[8,4],this.nestedSelectionEnabled=e.nestedSelectionEnabled!==void 0?e.nestedSelectionEnabled:!0,this.focusedElementBorderColor=e.focusedElementBorderColor!==void 0?e.focusedElementBorderColor:9133302,this.focusedElementBorderThickness=e.focusedElementBorderThickness,this.focusedElementBorderStyle=e.focusedElementBorderStyle||"dashed",this.focusedElementBorderDashPattern=e.focusedElementBorderDashPattern||[8,4],this.showNonFocusedBorders=e.showNonFocusedBorders!==void 0?e.showNonFocusedBorders:!1,this._focusedElementIndex=this._group.length>0?0:-1,this._elementIndexMap=new WeakMap,this.updateElementIndexMap(),this._wireframeStyle=Object.assign({},Tn,{color:this._colorTheme.primary},e.wireframeStyle||{});const n=e.handleConstructor||Yt,r={outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity,...e.handleStyle};this._handleStyle=r;const i="#"+(r.outlineColor??6514417).toString(16).padStart(6,"0"),o="#"+(r.rotatorIconColor??16777215).toString(16).padStart(6,"0"),s=Math.round(28*((r.radius??7)/7));Yt.loadTextures([{bgColor:i,arrowColor:o,size:s}]).catch(()=>{});const a={rotator:this.addChild(new n(this,"rotator",r,u=>{this.rotateGroup("rotator",u)},this.commitGroup))},l=$o.reduce((u,f)=>{const d=new n(this,f,r,()=>{},this.commitGroup,vi[f]);return d.onHandleDelta=h=>{this.scaleGroup(d.handle,h)},d.visible=this._scaleEnabled,u[f]=d,this.addChild(u[f]),u},{}),c={skewHorizontal:this.addChild(new n(this,"skewHorizontal",r,u=>{this.skewGroup("skewHorizontal",u)},this.commitGroup,"pointer")),skewVertical:this.addChild(new n(this,"skewVertical",r,u=>{this.skewGroup("skewVertical",u)},this.commitGroup,"pointer"))};this.handles=Object.assign({},l,a,c),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new B.Point,boxRotateTopLeft:new B.Point,boxRotateTopRight:new B.Point,boxRotateBottomLeft:new B.Point,boxRotateBottomRight:new B.Point,topLeft:new B.Point,topCenter:new B.Point,topRight:new B.Point,middleLeft:new B.Point,middleCenter:new B.Point,middleRight:new B.Point,bottomLeft:new B.Point,bottomCenter:new B.Point,bottomRight:new B.Point,skewHorizontal:new B.Point,skewVertical:new B.Point},this.groupBounds=new zo,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new B.Point,this._pointerMoveTarget=null,this._transformStarted=!1,this._clickThreshold=e.clickThreshold||5,this._clickStartPosition=new B.Point,this._elementClickCandidate=-1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.on("pointerdown",this.onPointerDown),this.on("pointerup",this.onPointerUp),this.on("pointerupoutside",this.onPointerUp),this.onRender=()=>{this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw()}}get enabledHandles(){return this._enabledHandles}get clickThreshold(){return this._clickThreshold}set clickThreshold(e){this._clickThreshold=e}set enabledHandles(e){const n=!!e&&e.length>0;!(this._enabledHandles&&this._enabledHandles.length>0)&&!n||(this._enabledHandles=n?e:void 0,VP.forEach(i=>{const o=this.handles[i];o&&(o.visible=!1)}),n?e.forEach(i=>{const o=this.handles[i];o&&(o.visible=!0)}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,$o.forEach(i=>{i!=="middleCenter"&&(this.handles[i].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(e){const n=this.handles;for(const r in n){const i=n[r];i&&(i.style=e)}this._handleStyle=e}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(e){if(this._rotateEnabled!==e){if(this._rotateEnabled=e,this._enabledHandles)return;this.handles.rotator.visible=e}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(e){if(this._scaleEnabled!==e){if(this._scaleEnabled=e,this._enabledHandles)return;$o.forEach(n=>{n!=="middleCenter"&&(this.handles[n].visible=e)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(e){if(this._skewEnabled!==e){if(this._skewEnabled=e,this._enabledHandles)return;this.handles.skewHorizontal.visible=e,this.handles.skewVertical.visible=e}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(e){this._wireframeStyle=Object.assign({},Tn,e)}get colorTheme(){return this._colorTheme}set colorTheme(e){this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e},this._handleStyle={...this._handleStyle,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity},this._wireframeStyle={...this._wireframeStyle,color:this._colorTheme.primary},this.redrawAllHandles()}get rotatorAnchor(){return this._rotatorAnchorConfig}set rotatorAnchor(e){this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e}}get focusedElement(){return this._focusedElementIndex>=0&&this._focusedElementIndex<this._group.length?this._group[this._focusedElementIndex]:null}set focusedElementIndex(e){if(e>=-1&&e<this._group.length){const n=this._focusedElementIndex;this._focusedElementIndex=e,this.lazyDirty=!0,n!==e&&(e>=0&&e<this._group.length?this.emit("elementfocused",this._group[e],e):this.emit("elementfocuscleared"))}}get focusedElementIndex(){return this._focusedElementIndex}focusElement(e){const n=this._elementIndexMap.get(e);n!==void 0&&(this._focusedElementIndex=n,this.lazyDirty=!0,this.emit("elementfocused",e,n))}clearElementFocus(){this._focusedElementIndex=-1,this.lazyDirty=!0,this.emit("elementfocuscleared")}focusNextElement(){this._group.length!==0&&(this._focusedElementIndex=(this._focusedElementIndex+1)%this._group.length,this.lazyDirty=!0,this.emit("elementfocused",this.focusedElement,this._focusedElementIndex))}updateElementIndexMap(){this._elementIndexMap=new WeakMap,this._group.forEach((e,n)=>{this._elementIndexMap.set(e,n),this.setupElementInteraction(e,n)})}setupElementInteraction(e,n){"eventMode"in e&&(e.eventMode="none"),"interactive"in e&&(e.interactive=!1),"interactiveChildren"in e&&(e.interactiveChildren=!0)}redrawAllHandles(){Object.values(this.handles).forEach(e=>{e&&(e.style={...e.style,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity})})}drawRotatorAnchorDot(e,n,r,i,o,s){const a=this._rotatorAnchorConfig;if(!a.enabled)return;const l=r-e,c=i-n,u=Math.sqrt(l*l+c*c),f=l/u,d=c/u,p=(this._handleStyle.radius||7)/7,m=a.startPosition||.45,g=Math.min(.8,m+(p-1)*.1),y=u*(a.segmentLength||.005),b=u*g,x=a.color||s,v=a.thickness||o,T=e+f*b,w=n+d*b,O=T+f*y,C=w+d*y;switch(a.style){case"dashed":this.drawDashedLine(T,w,O,C,v,x);break;case"dotted":this.drawDottedLine(T,w,O,C,v,x);break;default:this.wireframe.moveTo(T,w).lineTo(O,C).stroke({width:v,color:x});break}}drawDashedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dashPattern||[8,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),p=u/d,m=f/d;for(let g=0;g<h;g++){const y=e+p*g*(l+c),b=n+m*g*(l+c),x=y+p*l,v=b+m*l;this.wireframe.moveTo(y,b).lineTo(x,v).stroke({width:o,color:s})}}drawDottedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dotPattern||[2,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),p=u/d,m=f/d;for(let g=0;g<h;g++){const y=e+p*g*(l+c),b=n+m*g*(l+c);this.wireframe.circle(y,b,l).fill({color:s})}}drawDashedBounds(e,n,r,i,o,s=1){const{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=e;this.drawDashedLineSegment(a.x,a.y,l.x,l.y,n,r,i,o,s),this.drawDashedLineSegment(l.x,l.y,u.x,u.y,n,r,i,o,s),this.drawDashedLineSegment(u.x,u.y,c.x,c.y,n,r,i,o,s),this.drawDashedLineSegment(c.x,c.y,a.x,a.y,n,r,i,o,s)}drawDottedBounds(e,n,r,i,o=1){const{topLeft:s,topRight:a,bottomLeft:l,bottomRight:c}=e;this.drawDottedLineSegment(s.x,s.y,a.x,a.y,n,r,i,o),this.drawDottedLineSegment(a.x,a.y,c.x,c.y,n,r,i,o),this.drawDottedLineSegment(c.x,c.y,l.x,l.y,n,r,i,o),this.drawDottedLineSegment(l.x,l.y,s.x,s.y,n,r,i,o)}drawDashedLineSegment(e,n,r,i,o,s,a,l,c=1){const u=r-e,f=i-n,d=Math.sqrt(u*u+f*f);if(d===0)return;const h=u/d,p=f/d,m=Math.floor(d/(o+s));for(let y=0;y<m;y++){const b=e+h*y*(o+s),x=n+p*y*(o+s),v=Math.min(r,b+h*o),T=Math.min(i,x+p*o);this.wireframe.moveTo(b,x).lineTo(v,T).stroke({width:l,color:a,alpha:c})}const g=d-m*(o+s);if(g>0){const y=e+h*m*(o+s),b=n+p*m*(o+s),x=Math.min(o,g),v=y+h*x,T=b+p*x;this.wireframe.moveTo(y,b).lineTo(v,T).stroke({width:l,color:a,alpha:c})}}drawDottedLineSegment(e,n,r,i,o,s,a,l=1){const c=r-e,u=i-n,f=Math.sqrt(c*c+u*u);if(f===0)return;const d=c/f,h=u/f,p=o*2+s,m=Math.max(1,Math.floor(f/p)+1),g=m>1?f/(m-1):0;for(let y=0;y<m;y++){const b=g*y,x=e+d*b,v=n+h*b;this.wireframe.circle(x,v,o).fill({color:a,alpha:l})}}getGroupBounds(e=!1){return e&&this.updateGroupBounds(),this.groupBounds}translateGroup=e=>{this._transformHandle=null,this._transformType="translate";const n=Sr.identity().translate(e.x,e.y);this.emitTransformStart(),this.prependTransform(n)};rotateGroup=(e,n)=>{this._transformHandle=e,this._transformType="rotate";const r=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[e],cn);this.projectionTransform.applyInverse(i,i),n=this.projectionTransform.applyInverse(n,g1);const o=r.center,s=Math.atan2(i.y-o.y,i.x-o.x);let l=Math.atan2(n.y-o.y,n.x-o.x)-s,c=this.groupBounds.rotation+l;c=this.snapAngle(c,this.rotationSnapTolerance,this.rotationSnaps),l=c-this.groupBounds.rotation;const u=Sr.identity().translate(-o.x,-o.y).rotate(l).translate(o.x,o.y);this.emitTransformStart(),this.prependTransform(u,!0),this.updateGroupBounds(c),this._skewX+=l,this._skewY+=l};scaleGroup=(e,n)=>{this._transformHandle=e,this._transformType="scale";const r=_1[e].x,i=_1[e].y,o=this.handles,s=this.groupBounds,a=s.rotation,l=s.innerBounds,c=this.worldTransform.apply(this.handleAnchors[e],cn);this.projectionTransform.applyInverse(c,c),n=this.projectionTransform.applyInverse(n,g1);const u=n.x-c.x,f=n.y-c.y,d=(s.topRight.x-s.topLeft.x)/l.width,h=(s.topRight.y-s.topLeft.y)/l.width,p=(s.bottomLeft.x-s.topLeft.x)/l.height,m=(s.bottomLeft.y-s.topLeft.y)/l.height,g=u*d+f*h,y=u*p+f*m;let b=1,x=1;r!==0&&(b=1+g*r/l.width),i!==0&&(x=1+y*i/l.height);const v=this.lockAspectRatio&&(e==="topLeft"||e==="topRight"||e==="bottomLeft"||e==="bottomRight"),T=.01;if(b<T&&(b=T),x<T&&(x=T),v){const C=Math.abs(b),R=Math.abs(x),P=.001;if(C>R+P)x=b;else if(R>C+P)b=x;else{const A=(b+x)/2;b=A,x=A}}let w;this.centeredScaling?w=s.center:r===1&&i===1?w=s.topLeft:r===-1&&i===1?w=s.topRight:r===1&&i===-1?w=s.bottomLeft:r===-1&&i===-1?w=s.bottomRight:i===1?w=new B.Point((s.topLeft.x+s.topRight.x)/2,(s.topLeft.y+s.topRight.y)/2):i===-1?w=new B.Point((s.bottomLeft.x+s.bottomRight.x)/2,(s.bottomLeft.y+s.bottomRight.y)/2):r===1?w=new B.Point((s.topLeft.x+s.bottomLeft.x)/2,(s.topLeft.y+s.bottomLeft.y)/2):r===-1?w=new B.Point((s.topRight.x+s.bottomRight.x)/2,(s.topRight.y+s.bottomRight.y)/2):w=s.center;const O=Sr.identity().translate(-w.x,-w.y).rotate(-a).scale(b,x).rotate(a).translate(w.x,w.y);if(this.emitTransformStart(),(x<0||b<0)&&!(x<0&&b<0))switch(e){case"topLeft":case"bottomLeft":this.swapHandles(o.topLeft,o.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(o.topCenter,o.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(o.topRight,o.bottomRight);break}this.prependTransform(O)};skewGroup=(e,n)=>{this._transformHandle=e,this._transformType="skew";const r=this.groupBounds,i=cn.copyFrom(n);this.projectionTransform.applyInverse(i,i);const o=r.center,s=Sr.identity().translate(-o.x,-o.y);let a=this.groupBounds.rotation;if(e==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-o.y,i.x-o.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),s.prepend(h1(-l)),s.prepend(h1(this._skewX))}else{const l=this._skewY,c=Math.atan2(i.y-o.y,i.x-o.x)-Math.PI/2;this._skewY=c,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),s.prepend(d1(l)),s.prepend(d1(-this._skewY)),a-=this._skewY-l}s.translate(o.x,o.y),this.emitTransformStart(),this.prependTransform(s,!0),this.updateGroupBounds(a)};commitGroup=()=>{const e=this._transformHandle,n=this._transformType;this._transformHandle=null,this._transformType="none",this._transformStarted=!1,this.transientGroupTilt!==!1&&this._group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit",this.buildCommitPayload(e,n))};buildCommitPayload(e,n){const r=this.groupBounds,i=r.innerBounds;return{groupBounds:{x:i.x,y:i.y,width:i.width,height:i.height,rotation:r.rotation,centerX:r.center.x,centerY:r.center.y},elements:this._group.map(o=>({x:o.position.x,y:o.position.y,width:o.width??0,height:o.height??0,rotation:o.rotation,scaleX:o.scale.x,scaleY:o.scale.y,skewX:o.skew.x,skewY:o.skew.y,pivotX:o.pivot.x,pivotY:o.pivot.y})),handle:e,transformType:n}}draw(){const e=this._group,n=this._wireframeStyle.color??Tn.color,r=this._wireframeStyle.thickness??Tn.thickness;if(this.wireframe.clear(),e.length>1&&this.boundingBoxes==="all"){const a=this.individualBorderThickness||r,l=this.focusedElementBorderThickness||r;for(let c=0,u=e.length;c<u;c++){const f=this.nestedSelectionEnabled&&this._focusedElementIndex===c;if(!this.nestedSelectionEnabled||f||this.showNonFocusedBorders&&this._focusedElementIndex===-1){const h=fn.calculateOrientedBounds(e[c],Ko);if(f){const[p,m]=this.focusedElementBorderDashPattern;this.focusedElementBorderStyle==="dashed"?this.drawDashedBounds(h,p,m,this.focusedElementBorderColor,l,1):this.focusedElementBorderStyle==="dotted"?this.drawDottedBounds(h,p,m,this.focusedElementBorderColor,1):(this.wireframe.drawBounds(h),this.wireframe.stroke({width:l,color:this.focusedElementBorderColor,alpha:1}))}else{const[p,m]=this.individualBorderDashPattern;if(this.individualBorderStyle==="dashed")this.drawDashedBounds(h,p,m,this.individualBorderColor,a,this.individualBorderAlpha);else if(this.individualBorderStyle==="dotted")this.drawDottedBounds(h,p,m,this.individualBorderColor,this.individualBorderAlpha);else{const g=h.innerBounds;this.wireframe.rect(g.x,g.y,g.width,g.height).stroke({width:a,color:this.individualBorderColor,alpha:this.individualBorderAlpha})}}}}}const s=e.length!==1?fn.calculateGroupOrientedBounds(e,this.groupBounds.rotation,Ko,!0):fn.calculateOrientedBounds(e[0],Ko);this.wireframe.drawBounds(s),this.translateEnabled&&this.wireframe.fill({color:16777215,alpha:1e-4}),this.boundingBoxes!=="none"&&this.wireframe.stroke({width:r,color:n}),this.drawHandles(s),this.groupBounds.copyFrom(s),this.boxRotationEnabled&&(this.wireframe.drawBoxRotationTolerance(),this.wireframe.fill({color:16777215,alpha:1e-4})),this.boxScalingEnabled&&this.wireframe.drawBoxScalingTolerance(s),this.lazyDirty=!1}drawHandles(e){const n=this.handles,r=this.handleAnchors,{topLeft:i,topRight:o,bottomLeft:s,bottomRight:a,center:l}=e,[c,u,f,d]=m1,h=cn;if(this.projectToLocal(i,c),this.projectToLocal(o,u),this.projectToLocal(s,f),this.projectToLocal(a,d),this.projectToLocal(l,h),r.topLeft.copyFrom(c),r.topCenter.set((c.x+u.x)/2,(c.y+u.y)/2),r.topRight.copyFrom(u),r.middleLeft.set((c.x+f.x)/2,(c.y+f.y)/2),r.middleCenter.set((c.x+d.x)/2,(c.y+d.y)/2),r.middleRight.set((u.x+d.x)/2,(u.y+d.y)/2),r.bottomLeft.copyFrom(f),r.bottomCenter.set((f.x+d.x)/2,(f.y+d.y)/2),r.bottomRight.copyFrom(d),this.boxRotationEnabled&&(r.boxRotateTopLeft.copyFrom(r.topLeft),r.boxRotateTopRight.copyFrom(r.topRight),r.boxRotateBottomLeft.copyFrom(r.bottomLeft),r.boxRotateBottomRight.copyFrom(r.bottomRight)),this._rotateEnabled){const p=(c.x+u.x)/2,m=(c.y+u.y)/2;let g=-(c.y-u.y),y=c.x-u.x;const b=this._handleStyle.radius||7,x=32,v=b/7,T=x*v,w=Math.sqrt(g*g+y*y);g*=T/w,y*=T/w;const O=n.rotator;O.position.x=p+g,O.position.y=m+y;const C=this._wireframeStyle.color??Tn.color,R=this._wireframeStyle.thickness??Tn.thickness;this.drawRotatorAnchorDot(p,m,O.position.x,O.position.y,R,C),this.handleAnchors.rotator.copyFrom(O.position)}if(this._skewEnabled){const p=h.x,m=h.y;this.worldTransform.apply(h,h),r.skewHorizontal.set(h.x+Math.cos(this._skewX)*this.skewRadius,h.y+Math.sin(this._skewX)*this.skewRadius),r.skewVertical.set(h.x+-Math.sin(this._skewY)*this.skewRadius,h.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(r.skewHorizontal,r.skewHorizontal),this.worldTransform.applyInverse(r.skewVertical,r.skewVertical),h.set(p,m);const g=this._wireframeStyle.color??Tn.color,y=this._wireframeStyle.thickness??Tn.thickness,b=n.skewHorizontal,x=n.skewVertical;this.wireframe.circle(h.x,h.y,y*2).fill({color:g}),this.wireframe.moveTo(h.x,h.y).lineTo(b.x,b.y).moveTo(h.x,h.y).lineTo(x.x,x.y).stroke({width:y,color:g})}for(const p in n){let m=this.groupBounds.rotation;p==="skewHorizontal"?m=this._skewX:p==="skewVertical"&&(m=this._skewY);const g=n[p];g&&(g.rotation=m,g.position.copyFrom(r[p]),g.getBounds())}}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,this._clickStartPosition.copyFrom(e.global),this._pointerPosition.copyFrom(e.global),this._transformStarted=!1;const n=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,e.global);if(n)this._transformHandle=n,this._elementClickCandidate=-1;else if(this.nestedSelectionEnabled&&this._group.length>1){const r=e.global;this.projectionTransform.applyInverse(r,cn),this._elementClickCandidate=-1;const i=[];for(let o=0;o<this._group.length;o++)fn.calculateOrientedBounds(this._group[o],Ko).contains(cn.x,cn.y)&&i.push(o);if(i.length>0){let o=i[0];for(let s=1;s<i.length;s++){const a=this._group[o],l=this._group[i[s]];fn.isAboveInDisplayOrder(l,a)&&(o=i[s])}this._elementClickCandidate=o}}e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}static isAboveInDisplayOrder(e,n){if(e===n)return!1;const r=[],i=[];let o=e;for(;o;)r.push(o),o=o.parent;for(o=n;o;)i.push(o),o=o.parent;r.reverse(),i.reverse();const s=Math.min(r.length,i.length);for(let a=0;a<s;a++)if(r[a]!==i[a]){const l=r[a-1];if(!l||!l.children)return!1;const c=l.children.indexOf(r[a]),u=l.children.indexOf(i[a]);return c>u}return r.length>i.length}onPointerMove(e){const n=this._pointerPosition,r=Zo.allocate().copyFrom(e.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,r);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const o=Math.sqrt(Math.pow(r.x-this._clickStartPosition.x,2)+Math.pow(r.y-this._clickStartPosition.y,2));if(!this._pointerDragging&&o>this._clickThreshold&&(this._pointerDragging=!0,this._elementClickCandidate=-1),this._pointerDragging){switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,r);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,r);break;default:if(this.translateEnabled){const[s,a,l]=m1;s.set(0,0),a.set(r.x-n.x,r.y-n.y),this.projectionTransform.applyInverse(s,s),this.projectionTransform.applyInverse(a,a),l.set(a.x-s.x,a.y-s.y),this.translateGroup(l)}}this.emitTransformStart(),e.stopPropagation()}this._pointerPosition.x=r.x,this._pointerPosition.y=r.y}Zo.release(r)}emitTransformStart(){this._transformStarted||(this._transformStarted=!0,this.emit("transformstart",{handle:this._transformHandle,transformType:this._transformType}))}onPointerUp(e){if(!this._pointerDragging&&this.nestedSelectionEnabled&&this._group.length>1&&this._elementClickCandidate>=0){const r=this._elementClickCandidate;this._focusedElementIndex===r?this.lazyDirty=!0:(this._focusedElementIndex=r,this.lazyDirty=!0,this.emit("elementfocused",this._group[r],r))}this._pointerDragging=!1,this._pointerDown=!1,this._elementClickCandidate=-1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._transformStarted=!1,this.commitGroup(),e.stopPropagation()}prependTransform(e,n=!1){const r=this._group;for(let i=0,o=r.length;i<o;i++)zP(r[i],e);y1.copyFrom(e),n||this.updateGroupBounds(),this.emit("transformchange",y1)}updateGroupBounds(e=this.groupBounds.rotation){fn.calculateGroupOrientedBounds(this._group,e,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(e,n,r){if(e=e%(Math.PI*2),!r||r.length===1||!n)return e;for(let i=0,o=r.length;i<o;i++)if(Math.abs(e-r[i])<=n)return r[i];return e}swapHandles(e,n){const r=e.handle,i=n.handle,o=e.cursor,s=n.cursor,a=e.x,l=n.x,c=e.y,u=n.y;e.handle=i,n.handle=r,e.position.set(l,u),n.position.set(a,c),e.cursor=s,n.cursor=o,this.handles[r]=n,this.handles[i]=e,this._transformHandle===r?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=r)}setCursorFromHoveredHandle(e){if(e&&e.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(e)switch(e){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(e,n){return n||(n=new B.Point),this.projectionTransform.apply(e,n),this.worldTransform.applyInverse(n,n),n}static calculateTransformedCorners(e,n=e.worldTransform,r,i=0){const o=e.getLocalBounds();return e.getBounds(),r=r||[new B.Point,new B.Point,new B.Point,new B.Point],r[i].set(o.x,o.y),r[i+1].set(o.x+o.width,o.y),r[i+2].set(o.x+o.width,o.y+o.height),r[i+3].set(o.x,o.y+o.height),n.apply(r[i],r[i]),n.apply(r[i+1],r[i+1]),n.apply(r[i+2],r[i+2]),n.apply(r[i+3],r[i+3]),r}static calculateOrientedBounds(e,n){e.updateLocalTransform(),p1(gd,e.worldTransform);const r=gd.rotation,i=fn.calculateTransformedCorners(e,e.worldTransform,qP),o=(i[0].x+i[1].x+i[2].x+i[3].x)/4,s=(i[0].y+i[1].y+i[2].y+i[3].y)/4,a=Sr.identity().translate(-o,-s).rotate(-gd.rotation).translate(o,s);return a.apply(i[0],i[0]),a.apply(i[1],i[1]),a.apply(i[2],i[2]),a.apply(i[3],i[3]),n=n||new zo,n.rotation=r,n.innerBounds.x=Math.min(i[0].x,i[1].x,i[2].x,i[3].x),n.innerBounds.y=Math.min(i[0].y,i[1].y,i[2].y,i[3].y),n.innerBounds.width=Math.max(i[0].x,i[1].x,i[2].x,i[3].x)-n.innerBounds.x,n.innerBounds.height=Math.max(i[0].y,i[1].y,i[2].y,i[3].y)-n.innerBounds.y,n}static calculateGroupOrientedBounds(e,n,r,i=!1){const o=e.length,s=Zo.allocateArray(o*4);for(let d=0;d<o;d++){const h=e[d];i||h.updateLocalTransform(),fn.calculateTransformedCorners(h,h.worldTransform,s,d*4)}const a=Sr.identity().rotate(-n);let l=Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let d=0,h=s.length;d<h;d++){const p=s[d];a.apply(p,p);const m=p.x,g=p.y;l=m<l?m:l,c=g<c?g:c,u=m>u?m:u,f=g>f?g:f}return Zo.releaseArray(s),r=r||new zo,r.innerBounds.x=l,r.innerBounds.y=c,r.innerBounds.width=u-l,r.innerBounds.height=f-c,r.rotation=n,a.applyInverse(r.center,cn),r.center.copyFrom(cn),r}};function nN(t,e,n,r){for(const i in e){const o=n[i],s=r[i],a=e[i];o!==s&&(o&&t.off(a,o),s&&t.on(a,s))}}const En={},rN=B.Matrix.IDENTITY,iN={transformstart:"transformstart",transformchange:"transformchange",transformcommit:"transformcommit",elementfocused:"elementfocused",elementfocuscleared:"elementfocuscleared"};function b1(t,e,n){if(nN(t,iN,e,n),n.cursors&&Object.assign(t.cursors,n.cursors),t.group=n.group||[],t.boundingBoxes=n.boundingBoxes||"all",t.boxScalingEnabled=n.boxScalingEnabled===!0,t.boxScalingTolerance=n.boxScalingTolerance!==void 0?n.boxScalingTolerance:t.boxScalingTolerance,t.boxRotationEnabled=n.boxRotationEnabled===!0,t.boxRotationTolerance=n.boxRotationTolerance!==void 0?n.boxRotationTolerance:t.boxRotationTolerance,t.centeredScaling=n.centeredScaling??!1,t.enabledHandles=n.enabledHandles,t.lockAspectRatio=n.lockAspectRatio??!1,t.projectionTransform.copyFrom(n.projectionTransform||rN),t.skewRadius=n.skewRadius||t.skewRadius,t.rotateEnabled=n.rotateEnabled!==!1,t.scaleEnabled=n.scaleEnabled!==!1,t.skewEnabled=n.skewEnabled===!0,t.translateEnabled=n.translateEnabled!==!1,t.transientGroupTilt=n.transientGroupTilt??!0,e.clickThreshold!==n.clickThreshold&&n.clickThreshold!==void 0&&(t.clickThreshold=n.clickThreshold),e.handleConstructor!==n.handleConstructor&&e.handleConstructor!==void 0)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");e.rotationSnaps!==n.rotationSnaps&&(t.rotationSnaps=n.rotationSnaps??t.rotationSnaps),e.rotationSnapTolerance!==n.rotationSnapTolerance&&(t.rotationSnapTolerance=n.rotationSnapTolerance??t.rotationSnapTolerance),e.skewSnaps!==n.skewSnaps&&(t.skewSnaps=n.skewSnaps??t.skewSnaps),e.skewSnapTolerance!==n.skewSnapTolerance&&(t.skewSnapTolerance=n.skewSnapTolerance??t.skewSnapTolerance);const r=e.colorTheme||En,i=n.colorTheme||En;(r.primary!==i.primary||r.secondary!==i.secondary||r.background!==i.background||r.glow!==i.glow||r.glowIntensity!==i.glowIntensity)&&(t.colorTheme=i);const o=e.handleStyle||En,s=n.handleStyle||En;(o.color!==s.color||o.outlineColor!==s.outlineColor||o.outlineThickness!==s.outlineThickness||o.radius!==s.radius||o.shape!==s.shape||o.rotatorIconColor!==s.rotatorIconColor)&&(t.handleStyle=s);const a=e.wireframeStyle||En,l=n.wireframeStyle||En;(a.color!==l.color||a.thickness!==l.thickness)&&(t.wireframeStyle=l);const c=e.rotatorAnchor||En,u=n.rotatorAnchor||En;if((c.enabled!==u.enabled||c.startPosition!==u.startPosition||c.segmentLength!==u.segmentLength||c.thickness!==u.thickness||c.color!==u.color||c.style!==u.style||JSON.stringify(c.dashPattern)!==JSON.stringify(u.dashPattern)||JSON.stringify(c.dotPattern)!==JSON.stringify(u.dotPattern))&&(t.rotatorAnchor=u),e.nestedSelectionEnabled!==n.nestedSelectionEnabled&&(t.nestedSelectionEnabled=n.nestedSelectionEnabled!==void 0?n.nestedSelectionEnabled:!0),e.focusedElementBorderColor!==n.focusedElementBorderColor&&(t.focusedElementBorderColor=n.focusedElementBorderColor!==void 0?n.focusedElementBorderColor:9133302),e.focusedElementBorderThickness!==n.focusedElementBorderThickness&&(t.focusedElementBorderThickness=n.focusedElementBorderThickness),e.focusedElementBorderStyle!==n.focusedElementBorderStyle&&(t.focusedElementBorderStyle=n.focusedElementBorderStyle||"dashed"),e.focusedElementBorderDashPattern!==n.focusedElementBorderDashPattern&&(t.focusedElementBorderDashPattern=n.focusedElementBorderDashPattern||[8,4]),e.showNonFocusedBorders!==n.showNonFocusedBorders&&(t.showNonFocusedBorders=n.showNonFocusedBorders!==void 0?n.showNonFocusedBorders:!1),e.individualBorderColor!==n.individualBorderColor&&(t.individualBorderColor=n.individualBorderColor!==void 0?n.individualBorderColor:54527),e.individualBorderThickness!==n.individualBorderThickness&&(t.individualBorderThickness=n.individualBorderThickness),e.individualBorderAlpha!==n.individualBorderAlpha&&(t.individualBorderAlpha=n.individualBorderAlpha!==void 0?n.individualBorderAlpha:1),e.individualBorderStyle!==n.individualBorderStyle&&(t.individualBorderStyle=n.individualBorderStyle||"solid"),e.individualBorderDashPattern!==n.individualBorderDashPattern&&(t.individualBorderDashPattern=n.individualBorderDashPattern||[8,4]),n.focusedElementIndex!==void 0&&(t.focusedElementIndex=n.focusedElementIndex),e.onFocusChange!==n.onFocusChange){const f="__transformerFocusListeners",d=t[f];if(d&&(t.off("elementfocused",d.focused),t.off("elementfocuscleared",d.cleared)),n.onFocusChange){const h=(m,g)=>n.onFocusChange(g,m),p=()=>n.onFocusChange(-1,null);t.on("elementfocused",h),t.on("elementfocuscleared",p),t[f]={focused:h,cleared:p}}else t[f]=void 0}}const oN=S.forwardRef(function(e,n){const r=S.useRef(null),i=S.useRef(null),o=S.useRef({});return S.useEffect(()=>{const s=r.current;if(!s)return;const a=new tN({...e,stage:s});return s.addChild(a),i.current=a,b1(a,{},e),o.current=e,typeof n=="function"?n(a):n&&(n.current=a),()=>{s.removeChild(a),a.destroy({children:!0}),i.current=null,typeof n=="function"?n(null):n&&(n.current=null)}},[]),S.useEffect(()=>{const s=i.current;s&&(b1(s,o.current,e),o.current=e)}),I.createElement("pixiContainer",{ref:r})}),sN=300,aN=({selectedElementIds:t=[],containerRefsMap:e,mouseOverTransformerRef:n,isMultiSelect:r,rotateEnabled:i=!0,scaleEnabled:o=!0,translateEnabled:s=!0,skewEnabled:a=!1,boxScalingEnabled:l=!0,boxRotationEnabled:c=!0,showNonFocusedBorders:u,focusedElementIndex:f,individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:p,onDoubleClickElement:m,onTransformChange:g,onTransformCommit:y})=>{const b=S.useMemo(()=>{const P=[];for(const A of t){const L=e[A]?.current;L&&P.push(L)}return P},[t,e]),x=S.useRef(null),v=S.useRef(0),T=S.useRef(null),w=t[0],O=S.useCallback(P=>{n?.current&&(n.current.isDragging=!0,n.current.dragType=P.transformType)},[n]),C=S.useCallback(()=>{w&&g?.(w)},[w,g]),R=S.useCallback(P=>{if(n?.current&&(n.current.isDragging=!1,n.current.dragType=null),!w)return;const A=P.elements[0],L=A?{...A,groupBounds:P.groupBounds,handle:P.handle,transformType:P.transformType,elements:P.elements}:P;y?.(w,L)},[w,n,y]);return S.useEffect(()=>{const P=t.map(L=>({id:L,c:e[L]?.current})).filter(L=>!!L.c);if(!m||P.length===0)return;const A=[];for(const{id:L,c:N}of P){const D=N.eventMode;N.eventMode="static";const F=G=>{const z=performance.now();T.current===L&&z-v.current<sN?(m(L),v.current=0,T.current=null):(v.current=z,T.current=L)};N.on("pointerdown",F),A.push({c:N,fn:F}),N.__prevEventMode=D}return()=>{for(const{c:L,fn:N}of A){L.off("pointerdown",N);const D=L.__prevEventMode;D!==void 0&&(L.eventMode=D)}}},[t,e,m]),b.length===0?null:M.jsx(oN,{ref:x,group:b,rotateEnabled:i,scaleEnabled:o,translateEnabled:s,skewEnabled:a,boxScalingEnabled:l,boxRotationEnabled:c,boundingBoxes:r?"all":"groupOnly",nestedSelectionEnabled:!!r,showNonFocusedBorders:u??!!r,focusedElementIndex:f??(r?-1:void 0),individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:p,transformstart:O,transformchange:C,transformcommit:R})},x1=(t,e,n,r,i)=>{const o=1-i;return o*o*o*t+3*o*o*i*e+3*o*i*i*n+i*i*i*r};function v1(t,e=24){const{vertices:n,outTangents:r,inTangents:i,closed:o}=t;if(n.length===0)return[];const s=[],a=o?n.length:n.length-1;for(let l=0;l<a;l++){const c=n[l],u=n[(l+1)%n.length],f=r[l],d=i[(l+1)%n.length],h=[c[0]+f[0],c[1]+f[1]],p=[u[0]+d[0],u[1]+d[1]];for(let m=0;m<e;m++){const g=m/e;s.push([x1(c[0],h[0],p[0],u[0],g),x1(c[1],h[1],p[1],u[1],g)])}}return o||s.push(n[n.length-1]),s}function yd(t,e=96){switch(t.kind){case"rect":{const[n,r]=Ti(t.size),[i,o]=t.position?Ti(t.position):[0,0],s=i-n/2,a=o-r/2;return[[s,a],[s+n,a],[s+n,a+r],[s,a+r],[s,a]]}case"ellipse":{const[n,r]=Ti(t.size),[i,o]=t.position?Ti(t.position):[0,0],s=[],a=n/2,l=r/2;for(let c=0;c<=e;c++){const u=c/e*Math.PI*2;s.push([i+Math.cos(u)*a,o+Math.sin(u)*l])}return s}case"polystar":return cN(t,e);case"bezier":return v1(uN(t.path))}}function cN(t,e){const n=Math.max(3,Math.floor(Jo(t.points))),r=Jo(t.outerRadius),i=t.innerRadius!==void 0?Jo(t.innerRadius):r,o=t.rotation!==void 0?Jo(t.rotation):0,[s,a]=t.position?Ti(t.position):[0,0],l=t.starType==="star",c=l?n*2:n,u=o*Math.PI/180,f=[];for(let d=0;d<=c;d++){const p=!l||d%2===0?r:i,m=d/c*Math.PI*2-Math.PI/2+u;f.push([s+Math.cos(m)*p,a+Math.sin(m)*p])}return f.length>e?lN(f,e):f}function lN(t,e){if(t.length<=2||e<=2)return t.slice();const n=[];let r=0;for(let a=0;a<t.length-1;a++){const l=t[a+1][0]-t[a][0],c=t[a+1][1]-t[a][1],u=Math.hypot(l,c);n.push(u),r+=u}if(r===0)return[t[0],t[t.length-1]];const i=[];let o=0,s=0;for(let a=0;a<e;a++){const l=a/(e-1)*r;for(;o<n.length-1&&s+n[o]<l;)s+=n[o],o++;const c=n[o]||1,u=(l-s)/c;i.push([t[o][0]+(t[o+1][0]-t[o][0])*u,t[o][1]+(t[o+1][1]-t[o][1])*u])}return i}function T1(t,e,n,r=0){if(t.length<2)return t;const i=d=>{const h=d%1;return h<0?h+1:h},o=i(e+r),s=i(n+r);if(o===s)return[];const a=[];let l=0;for(let d=0;d<t.length-1;d++){const h=Math.hypot(t[d+1][0]-t[d][0],t[d+1][1]-t[d][1]);a.push(h),l+=h}if(l===0)return[];const c=d=>{let h=d*l;for(let p=0;p<a.length;p++){if(h<=a[p])return{idx:p,t:a[p]===0?0:h/a[p]};h-=a[p]}return{idx:a.length-1,t:1}},u=(d,h,p)=>[d[0]+(h[0]-d[0])*p,d[1]+(h[1]-d[1])*p],f=(d,h)=>{const p=c(d),m=c(h),g=[u(t[p.idx],t[p.idx+1],p.t)];for(let y=p.idx+1;y<=m.idx;y++)g.push(t[y]);return g.push(u(t[m.idx],t[m.idx+1],m.t)),g};return o<s?f(o,s):[...f(o,1),...f(0,s)]}function Ti(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function Jo(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function uN(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const E1=t=>new W.Color(t).toNumber(),S1=t=>t.length===9?parseInt(t.slice(7,9),16)/255:1;function w1(t,e){const{path:n,fill:r,stroke:i,trim:o}=e;if(o){hN(t,n,o,r,i);return}fN(t,n),O1(t,r,i)}function fN(t,e){switch(e.kind){case"rect":{const[n,r]=Qo(e.size),[i,o]=e.position?Qo(e.position):[0,0],s=e.roundness?pN(e.roundness):0,a=i-n/2,l=o-r/2;s>0?t.roundRect(a,l,n,r,s):t.rect(a,l,n,r);return}case"ellipse":{const[n,r]=Qo(e.size),[i,o]=e.position?Qo(e.position):[0,0];t.ellipse(i,o,n/2,r/2);return}case"polystar":{const n=yd(e);A1(t,n,!0);return}case"bezier":dN(t,mN(e.path));return}}function dN(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function A1(t,e,n){if(!(e.length<2)){t.moveTo(e[0][0],e[0][1]);for(let r=1;r<e.length;r++)t.lineTo(e[r][0],e[r][1]);n&&t.closePath()}}function hN(t,e,n,r,i){const o=yd(e),s=T1(o,C1(n.start),C1(n.end),n.offset??0);A1(t,s,n.start===0&&n.end===1),O1(t,r,i)}function O1(t,e,n){e&&t.fill({color:E1(e),alpha:S1(e)}),n&&t.stroke({color:E1(n.color),width:n.width,alpha:S1(n.color),cap:n.cap??"butt",join:n.join??"miter"})}const C1=t=>Math.max(0,Math.min(1,t));function Qo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function pN(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function mN(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const gN={vertices:[],inTangents:[],outTangents:[],closed:!1},yN=({ref:t,...e})=>{const n=I.useRef(null),r=I.useRef(null),{path:i,fill:o,stroke:s,trimPath:a,transformation:l,visible:c}=e,{x:u,y:f}=l,h=Jt()?.currentFrame??0,p=zn(),m=I.useMemo(()=>({fill:o!==void 0?xt(Yn(o,p),"#000000",h):void 0,stroke:s&&{color:xt(s.color,"#000000",h),width:ge(s.width,1,h),cap:s.cap,join:s.join},trim:a&&{start:ge(a.start,0,h),end:ge(a.end,1,h),offset:a.offset!==void 0?ge(a.offset,0,h):void 0}}),[o,s,a,h,p]),g=I.useMemo(()=>i.kind!=="bezier"?i:{kind:"bezier",path:Uf(i.path,gN,h)},[i,h]),y=I.useCallback(b=>{b.clear(),w1(b,{path:g,fill:m.fill,stroke:m.stroke,trim:m.trim})},[g,m]);return M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:r,x:u,y:f,children:M.jsx("pixiGraphics",{ref:n,draw:y,alpha:c?1:0})})})},R1=I.memo(yN,et),_N=({ref:t,...e})=>{const n=I.useRef(null),{transformation:r}=e;return M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:n,x:r.x,y:r.y})})},I1=I.memo(_N,et),M1=(t,e,n,r)=>n+(t-e)*r,L1=I.memo(({uniqueId:t,src:e,startAt:n,endAt:r,inPointFrames:i,level:o,pan:s,muted:a,visible:l=!0,trimStart:c=0,speed:u=1,transformation:f,onContainerRefReady:d})=>{const h=_t(),{tl:p,registerTimeUpdateListener:m,unregisterTimeUpdateListener:g}=I.useContext(Ye),y=h.framesToSeconds(i),b=h.fps,[x,v]=I.useState(null),T=I.useRef(null),w=I.useRef(s);w.current=s;const O=I.useCallback((P,A)=>{v(A)},[]),C=I.useCallback(P=>Math.max(0,Math.min(1,ge(o,1,M1(P,y,i,b)))),[o,y,i,b]),R=I.useCallback(P=>{const A=T.current;if(!A)return;const L=ge(w.current,0,M1(P,y,i,b));A.pan.value=Math.max(-1,Math.min(1,L))},[y,i,b]);return I.useEffect(()=>{if(s===void 0||!x)return;const P=hr.getContext(),A=hr.getOrCreateSourceNode(t);if(!P||!A||typeof P.createStereoPanner!="function")return;const L=P.createStereoPanner();try{A.disconnect(P.destination)}catch{}return A.connect(L).connect(P.destination),T.current=L,()=>{T.current=null;try{A.disconnect(L),L.disconnect(),A.connect(P.destination)}catch{}}},[x,s!==void 0,t]),I.useEffect(()=>{if(!(s===void 0||!m||!g))return m(R),()=>g(R)},[s!==void 0,R,m,g]),I.useEffect(()=>{s!==void 0&&R(p?.current?.time()??y)},[x,s,R,y,p]),M.jsx(t_,{uniqueId:t,src:e,startAt:n,endAt:r,audioStartAt:c,mute:!!a,speed:u,visible:l,getVolume:C,transformation:f,onAudioElementReady:O,onContainerRefReady:d})});L1.displayName="AepAudioLayer";function P1(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}function N1(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function k1(t,e){if(e.length!==0){for(const n of e)if(n.mode==="subtract"){const r=bN(P1(n.path));N1(t,r)}else N1(t,P1(n.path));t.fill({color:16777215,alpha:1})}}function bN(t){const e=t.vertices.length;return{vertices:t.vertices.slice().reverse(),outTangents:Array.from({length:e},(n,r)=>t.inTangents[e-1-r]),inTangents:Array.from({length:e},(n,r)=>t.outTangents[e-1-r]),closed:t.closed}}const xN={vertices:[],inTangents:[],outTangents:[],closed:!1},D1=({masks:t,children:e})=>{const n=I.useRef(null),r=I.useRef(null),o=Jt()?.currentFrame??0;I.useEffect(()=>{const l=n.current,c=r.current;if(!(!l||!c))return l.mask=c,()=>{l.mask=null}},[]);const s=I.useMemo(()=>t.map(l=>({...l,path:Uf(l.path,xN,o)})),[t,o]),a=I.useCallback(l=>{l.clear(),k1(l,s)},[s]);return M.jsxs("pixiContainer",{ref:n,children:[e,M.jsx("pixiGraphics",{ref:r,draw:a})]})},F1=({source:t,matted:e,mode:n,width:r,height:i})=>{const{app:o}=at.useApplication(),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(null);I.useEffect(()=>{if(o?.renderer)return c.current&&(c.current.width!==r||c.current.height!==i)&&(c.current.destroy(!0),c.current=null),c.current||(c.current=W.RenderTexture.create({width:Math.max(1,Math.round(r)),height:Math.max(1,Math.round(i))})),()=>{c.current?.destroy(!0),c.current=null}},[o,r,i]),I.useEffect(()=>{const h=o?.renderer;if(!h)return;const p=()=>{const m=c.current,g=s.current;!m||!g||(h.render({container:g,target:m}),l.current&&(l.current.texture=m))};return o.ticker.add(p),()=>{o.ticker.remove(p)}},[o]),I.useEffect(()=>{const h=a.current,p=l.current;if(!(!h||!p))return h.mask=p,()=>{h.mask=null}},[]);const u=n==="alpha-inverted"||n==="luma-inverted",f=n==="luma"||n==="luma-inverted",d=I.useMemo(()=>{if(!f)return;const h=new W.ColorMatrixFilter;return h.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,.2126,.7152,.0722,0,0],[h]},[f]);return M.jsxs("pixiContainer",{children:[M.jsx("pixiContainer",{ref:s,renderable:!0,alpha:0,children:t}),M.jsx("pixiContainer",{ref:a,children:e}),M.jsx("pixiSprite",{ref:l,width:r,height:i,alpha:1,filters:d,renderable:!1})]})};function _d(t,e){if(!e)throw new Error(`AEP: unknown assetId '${t}' (no entry in comp.assets)`);return{url:e.src,mime:vN(e.type)}}function vN(t){switch(t){case"image":return"image/*";case"video":return"video/*";case"audio":return"audio/*";case"lottie":return"application/json";case"svg":return"image/svg+xml";case"model":return"model/gltf-binary";default:return}}const B1=I.createContext(null),U1=({resolver:t,children:e})=>M.jsx(B1.Provider,{value:t,children:e});function G1(){return I.useContext(B1)??_d}const j1=new WeakMap;function TN(t){let e=j1.get(t);return e||(e=new Map,j1.set(t,e)),e}function Ei(t){const e=G1(),n=_t(),[r,i]=I.useState(()=>t?{url:"",state:"loading"}:{url:"",state:"idle"});return I.useEffect(()=>{if(!t){i({url:"",state:"idle"});return}const o=n.assets[t],s=TN(n.assets);let a=!1;const l=async()=>{const c=s.get(t);if(c)return c;const u=Promise.resolve(e(t,o));s.set(t,u);try{return await u}catch(f){throw s.delete(t),f}};return i({url:"",state:"loading"}),l().then(c=>{a||i({url:c.url,mime:c.mime,state:"ready"})}).catch(c=>{a||(console.error(`AEP asset resolver failed for '${t}':`,c),i({url:"",state:"error",error:c}))}),()=>{a=!0}},[t,e,n.assets]),r}function H1(t,e){const n=[],r=new Set;let i=t;for(;i;){if(r.has(i.id))throw new Error(`cyclic parent chain detected at layer '${t.id}' via '${i.id}'`);r.add(i.id),n.push(i),i=i.parent?e.get(i.parent):void 0}return n}function EN(t,e){const n=Math.cos(t.rotation*Math.PI/180),r=Math.sin(t.rotation*Math.PI/180),i=e.x*t.scaleX,o=e.y*t.scaleY;return{x:t.x+(n*i-r*o),y:t.y+(r*i+n*o),scaleX:t.scaleX*e.scaleX,scaleY:t.scaleY*e.scaleY,rotation:t.rotation+e.rotation,alpha:t.alpha*e.alpha}}function Y1(t,e){const{layersById:n,currentFrame:r}=_t();return I.useMemo(()=>{const i=H1(t,n);let o={x:0,y:0,scaleX:1,scaleY:1,rotation:0,alpha:1};for(let u=i.length-1;u>=0;u--){const f=i[u].transform,[d,h]=sn(f.position,[0,0],r),[p,m]=sn(f.scale,[1,1],r);o=EN(o,{x:d,y:h,scaleX:p,scaleY:m,rotation:ge(f.rotation,0,r),alpha:ge(f.opacity,1,r)})}const[s,a]=sn(t.transform.anchor,[0,0],r),l=e.width>0?s/e.width:.5,c=e.height>0?a/e.height:.5;return{x:o.x,y:o.y,width:e.width,height:e.height,scale:[o.scaleX,o.scaleY],rotation:o.rotation,alpha:o.alpha,anchor:{x:l,y:c}}},[t,n,e.width,e.height,r])}function X1(t){return!!(t.splitMode&&t.splitMode!=="single"||t.animators&&t.animators.length>0||(t.style.runs?.length??0)>0||typeof t.style.align=="string"&&t.style.align.startsWith("justify")||Array.isArray(t.style.fill))}const es=()=>{},bd=I.createContext({ready:!0,readyCount:0,total:0,register:()=>es,markReady:es,reset:es,reportError:es});function W1(){return I.useContext(bd).ready}function z1(){return I.useContext(bd)}const q1=({children:t,onLayerError:e})=>{const[n,r]=I.useState(()=>new Map),[i,o]=I.useState(!1);I.useEffect(()=>{o(!0)},[]);const s=I.useRef(e);s.current=e;const a=I.useCallback(m=>(r(g=>{if(g.has(m))return g;const y=new Map(g);return y.set(m,!1),y}),()=>{r(g=>{if(!g.has(m))return g;const y=new Map(g);return y.delete(m),y})}),[]),l=I.useCallback(m=>{r(g=>{if(g.get(m)===!0||!g.has(m))return g;const y=new Map(g);return y.set(m,!0),y})},[]),c=I.useCallback(m=>{r(g=>{if(g.get(m)===!1||!g.has(m))return g;const y=new Map(g);return y.set(m,!1),y})},[]),u=I.useCallback((m,g)=>{console.error(`[model3d] layer '${m}' failed:`,g),s.current?.(m,g)},[]),f=n.size;let d=0;for(const m of n.values())m&&(d+=1);const h=i&&d===f,p=I.useMemo(()=>({ready:h,readyCount:d,total:f,register:a,markReady:l,reset:c,reportError:u}),[h,d,f,a,l,c,u]);return M.jsx(bd.Provider,{value:p,children:t})},SN={can:[[0,0],[.5,0],[.5,.04],[.5,.9],[.48,.95],[.4,.99],[.4,1],[0,1]],bottle:[[0,0],[.3,0],[.4,.05],[.42,.2],[.4,.55],[.34,.68],[.18,.78],[.14,.86],[.14,.96],[.18,1],[0,1]],jar:[[0,0],[.46,0],[.5,.04],[.5,.82],[.46,.9],[.4,.94],[.4,1],[0,1]],tube:[[0,0],[.34,0],[.34,.08],[.34,.88],[.3,.94],[.3,1],[0,1]],pouch:[[0,0],[.22,0],[.38,.05],[.46,.2],[.44,.6],[.38,.82],[.24,.94],[.18,1],[0,1]]};function xd(t,e={}){const n=e.width??1,r=e.height??1;if(t==="box"){const l=e.depth??n;return new V.BoxGeometry(n,r,l)}const i=SN[t],o=i.map(([l,c])=>new V.Vector2(Math.max(0,l*n),(c-.5)*r)),s=new V.LatheGeometry(o,64),a=s.getAttribute("uv");for(let l=0;l<a.count;l++)a.setY(l,i[l%i.length][1]);return a.needsUpdate=!0,s}function vd(t,e,n=0){const r=t.map(b=>b[0]),i=t.map(b=>b[1]),o=Math.min(...r),s=Math.max(...r),a=Math.min(...i),l=Math.max(...i),c=(o+s)/2,u=(a+l)/2,f=Math.max(s-o,1e-6),d=Math.max(l-a,1e-6),h=new V.Shape;t.forEach(([b,x],v)=>{const T=b-c,w=u-x;v===0?h.moveTo(T,w):h.lineTo(T,w)}),h.closePath();const p=Math.max(e,1e-6),m=Math.max(0,n),g={generateTopUV(b,x,v,T,w){const O=C=>new V.Vector2((x[C*3]+f/2)/f,(x[C*3+1]+d/2)/d);return[O(v),O(T),O(w)]},generateSideWallUV(b,x,v,T,w,O){const C=R=>{const P=x[R*3],A=x[R*3+1],L=x[R*3+2];return new V.Vector2((P+f/2)/f,(A+d/2)/d+L/p)};return[C(v),C(T),C(w),C(O)]}},y=new V.ExtrudeGeometry(h,{depth:p,bevelEnabled:m>0,bevelThickness:m,bevelSize:m,bevelSegments:m>0?2:0,curveSegments:16,UVGenerator:g});return y.translate(0,0,-p/2),y.computeVertexNormals(),{geometry:y,width:f,height:d}}function wN(t,e){if(t.type==="primitive")return{geometry:xd(t.shape,t.proportions),materialGroups:t.shape==="box"?"box":"single"};if(t.type==="extrude")return{geometry:vd(t.contour,e,t.bevel).geometry,materialGroups:"extrude"};throw new Error("buildSourceGeometry does not handle gltf sources")}const Td={studio:{preset:"studio",keyAzimuth:-35,keyElevation:38,keyIntensity:3.2,keyColor:"#fff7ec",fillIntensity:1.1,rimIntensity:1.6,ambientIntensity:.22,environmentIntensity:.75,environment:"room"},window:{preset:"window",keyAzimuth:-70,keyElevation:55,keyIntensity:2.4,keyColor:"#eef4ff",fillIntensity:1.5,rimIntensity:.6,ambientIntensity:.35,environmentIntensity:.85,environment:"room"},golden:{preset:"golden",keyAzimuth:-58,keyElevation:14,keyIntensity:3.6,keyColor:"#ffd29a",fillIntensity:.8,rimIntensity:1.2,ambientIntensity:.18,environmentIntensity:.55,environment:"room"},night:{preset:"night",keyAzimuth:28,keyElevation:30,keyIntensity:.85,keyColor:"#9fb6ff",fillIntensity:.35,rimIntensity:2.8,ambientIntensity:.12,environmentIntensity:.45,environment:"room"}},Ed="studio";function Sd(t=Ed,e={},n){const r=Td[t];return{...r,keyAzimuth:e.keyAzimuth??r.keyAzimuth,keyElevation:e.keyElevation??r.keyElevation,keyIntensity:e.keyIntensity??r.keyIntensity,keyColor:e.keyColor??r.keyColor,fillIntensity:e.fillIntensity??r.fillIntensity,rimIntensity:e.rimIntensity??r.rimIntensity,environment:n??r.environment}}function V1(t,e){const n=t*Math.PI/180,r=e*Math.PI/180,i=Math.cos(r);return[Math.sin(n)*i,Math.sin(r),Math.cos(n)*i]}const wd=12;function AN(t){const e=new V.AmbientLight(16777215,t.ambientIntensity),n=new V.DirectionalLight(new V.Color(t.keyColor),t.keyIntensity);n.castShadow=!0,n.shadow.mapSize.set(1024,1024),n.shadow.bias=-5e-4;const r=new V.DirectionalLight(16777215,t.fillIntensity),i=new V.DirectionalLight(16777215,t.rimIntensity),o=new V.Group;o.add(e,n,n.target,r,i);const s={group:o,ambient:e,key:n,fill:r,rim:i};return K1(s,t),s}function K1(t,e){t.ambient.intensity=e.ambientIntensity,t.key.intensity=e.keyIntensity,t.key.color.set(e.keyColor),Ad(t.key,e.keyAzimuth,e.keyElevation),Ad(t.fill,e.keyAzimuth+140,Math.max(5,e.keyElevation-20)),Ad(t.rim,e.keyAzimuth+180,Math.max(10,e.keyElevation+5))}function Ad(t,e,n){const[r,i,o]=V1(e,n);t.position.set(r*wd,i*wd,o*wd),t.target.position.set(0,0,0),t.target.updateMatrixWorld()}function Z1(t){t.group.removeFromParent(),t.key.dispose(),t.fill.dispose(),t.rim.dispose(),t.ambient.dispose()}const $1=new WeakMap;function ON(t){const e=$1.get(t);if(e)return e;const n=new V.PMREMGenerator(t),r=new nE.RoomEnvironment,i=n.fromScene(r,.04);return r.traverse(o=>{const s=o;if(!s.isMesh)return;s.geometry?.dispose();const a=Array.isArray(s.material)?s.material:[s.material];for(const l of a)l?.dispose()}),n.dispose(),$1.set(t,i.texture),i.texture}function CN(t,e,n){t.environment=e.environment==="room"?ON(n):null,t.environmentIntensity=e.environmentIntensity}const vt={rotation:[0,0,0],position:[0,0,0],scale:1,roughness:.35,metalness:.05,clearcoat:0,shadowOpacity:.35,shadowSoftness:.6,shadowOffsetY:0,fov:35,fit:1.35};function Od(t,e){const n=t.lighting?.preset??Ed,r=Td[n],i=t.source.type==="extrude"?ge(t.source.depth,100,e):1,o=t.shadow;return{rotation:Go(t.view?.rotation,vt.rotation,e),position:Go(t.view?.position,vt.position,e),scale:ge(t.view?.scale,vt.scale,e),extrudeDepth:Math.max(i,1e-6),roughness:ge(t.material?.roughness,vt.roughness,e),metalness:ge(t.material?.metalness,vt.metalness,e),clearcoat:t.material?.clearcoat??vt.clearcoat,preset:n,keyAzimuth:ge(t.lighting?.key?.azimuth,r.keyAzimuth,e),keyElevation:ge(t.lighting?.key?.elevation,r.keyElevation,e),keyIntensity:ge(t.lighting?.key?.intensity,r.keyIntensity,e),keyColor:t.lighting?.key?.color??r.keyColor,fillIntensity:ge(t.lighting?.fill?.intensity,r.fillIntensity,e),rimIntensity:ge(t.lighting?.rim?.intensity,r.rimIntensity,e),environment:t.lighting?.environment??r.environment,shadowOpacity:o?ge(o.opacity,vt.shadowOpacity,e):0,shadowSoftness:o?.softness??vt.shadowSoftness,shadowOffsetY:o?.offsetY??vt.shadowOffsetY,fov:t.camera?.fov??vt.fov,fit:t.camera?.fit??vt.fit}}function J1(t){return JSON.stringify(t)}function RN(){const t=new V.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});return t.setPixelRatio(1),t.outputColorSpace=V.SRGBColorSpace,t.toneMapping=V.ACESFilmicToneMapping,t.toneMappingExposure=1,t.shadowMap.enabled=!0,t.shadowMap.type=V.PCFShadowMap,t.setClearColor(0,0),t}class Q1{renderer;gl;width=0;height=0;constructor(e){this.gl=e??RN(),this.renderer=this.gl}render({canvas:e,scene:n,camera:r,width:i,height:o}){const{gl:s}=this;(i!==this.width||o!==this.height)&&(s.setSize(i,o,!1),this.width=i,this.height=o),s.setViewport(0,0,i,o),s.render(n,r);const a=e.getContext("2d");if(!a)throw new Error("model3d: 2D canvas context unavailable");a.clearRect(0,0,i,o),a.drawImage(s.domElement,0,0,i,o)}dispose(){this.gl.dispose(),this.gl.forceContextLoss()}}function eT(t,e=2e3){const n=new Map;return{acquire(r){let i=n.get(r);return i||(i={value:t(),users:0,timer:null},n.set(r,i)),i.timer&&(clearTimeout(i.timer),i.timer=null),i.users+=1,i.value},release(r){const i=n.get(r);i&&(i.users=Math.max(0,i.users-1),!(i.users>0||i.timer)&&(i.timer=setTimeout(()=>{if(!(i.users>0)){n.delete(r);try{i.value.dispose()}catch{}}},e)))},size:()=>n.size}}const tT={},nT=eT(()=>new Q1);function Cd(t){return nT.acquire(t??tT)}function rT(t){nT.release(t??tT)}function IN(t){return Cd(t)}function iT(t,e,n,r){const i=Du(e,n,r);return{position:[t[0],t[1],t[2]+i],target:[t[0],t[1],t[2]]}}function oT(t,e,n){return n>0?Math.max(0,t-e)/n:0}function sT(t,e,n){return t>=e&&t<n}function MN(t,e){return e?{center:e.center?[e.center[0],e.center[1],e.center[2]]:t.center,maxDim:Math.max(e.size[0],e.size[1],e.size[2],1e-4)}:t}const LN=({ref:t,layer:e,...n})=>{const r=_t(),i=r.currentFrame,o=I.useRef(i);o.current=i;const{register:s,markReady:a,reset:l,reportError:c}=z1(),{app:u}=at.useApplication(),[f,d]=I.useState(null),[h,p]=I.useState(null),[m,g]=I.useState(null),[y,b]=I.useState(0),[x,v]=I.useState(!1),T=I.useRef(null),w=I.useRef(null),O=I.useRef("");I.useEffect(()=>{let J=!1;try{d(Cd(u)),J=!0}catch(ie){c(e.id,ie)}return()=>{J&&(d(null),rT(u))}},[u,e.id,c]),I.useEffect(()=>s(e.id),[s,e.id]);const C=e.viewport.width,R=e.viewport.height;I.useEffect(()=>{const J=document.createElement("canvas");J.width=C,J.height=R;const ie=W.Texture.from(J);return w.current=ie,p(J),g(ie),()=>{w.current=null,g(null),p(null),ie.destroy(!0)}},[C,R]);const P=e.source.type==="gltf"?e.source.assetId:void 0,A=e.textures?.label,L=e.textures?.front,N=Ei(P),D=Ei(A),F=Ei(L),G=(!P||N.state==="ready")&&(!A||D.state==="ready")&&(!L||F.state==="ready"),z=(P&&N.state==="error"?N.error:void 0)??(A&&D.state==="error"?D.error:void 0)??(L&&F.state==="error"?F.error:void 0),K=I.useMemo(()=>JSON.stringify(e.source),[e.source]),se=I.useMemo(()=>JSON.stringify(e.textures??{}),[e.textures]),pe=e.material?.clearcoat??0;I.useEffect(()=>{if(!h||!f||!G)return;if(z){const ve=String(z);O.current!==ve&&(O.current=ve,c(e.id,z));return}let J=!1;l(e.id),Z.current=!1,v(!1);const ie=Od(e,o.current),xe=Sd(ie.preset,{keyAzimuth:ie.keyAzimuth,keyElevation:ie.keyElevation,keyIntensity:ie.keyIntensity,keyColor:ie.keyColor,fillIntensity:ie.fillIntensity,rimIntensity:ie.rimIntensity},ie.environment),Y=new V.Scene,De=new V.PerspectiveCamera(ie.fov,C/R,.1,1e3),ye=new V.Group;Y.add(ye);const $=AN(xe);Y.add($.group),CN(Y,xe,f.renderer);const we=NN();Y.add(we);const me=[],Ue=()=>{T.current=null,Y.clear(),Z1($),we&&(we.geometry.dispose(),we.material.dispose());for(const ve of me)ve.dispose()},ze=ve=>{if(J)return;J=!0;const Ie=String(ve);O.current!==Ie&&(O.current=Ie,c(e.id,ve)),Ue()},ht=(ve,Ie,ct,ut)=>{if(J){Id(ve);return}ye.add(ve),kN(ve,$);const Me=new V.Box3().setFromObject(ve),Re=new V.Vector3,Se=new V.Vector3;Me.getSize(Re),Me.getCenter(Se);const Ge=MN({center:[Se.x,Se.y,Se.z],maxDim:Math.max(Re.x,Re.y,Re.z,1e-4)},e.bounds);Se.set(...Ge.center);const je=Ge.maxDim,qe={scene:Y,camera:De,root:ye,content:ve,materials:Ie,lighting:$,shadow:we,mixer:ct,clipDuration:ut,isExtrude:e.source.type==="extrude",baseExtrudeDepth:Math.max(ie.extrudeDepth,1e-6),maxDim:je,center:Se,boundsOverride:e.bounds??null};T.current=qe,v(ct!=null),b(it=>it+1)};return(async()=>{const ve=D.url?await aT(D.url):null;if(ve&&(me.push(ve),J))return;const Ie=F.url?await aT(F.url):null;if(Ie&&(me.push(Ie),J))return;if(e.source.type==="gltf"){const qe=await new Vd.GLTFLoader().loadAsync(N.url);if(J){Id(qe.scene);return}const it=PN(qe.scene),Le=e.material?.clearcoat??0;for(const Lt of it)"clearcoat"in Lt&&(Lt.clearcoat=Le,Le>0&&(Lt.needsUpdate=!0));let ot=null,Mt=0;if(qe.animations.length>0){const Lt=qe.animations[0];ot=new V.AnimationMixer(qe.scene),ot.clipAction(Lt).play(),Mt=Lt.duration}ht(qe.scene,it,ot,Mt);return}const ct=e.textures?.side??"#d8d8d8",ut=e.material?.clearcoat??0;if(e.source.type==="primitive"){const qe=xd(e.source.shape,e.source.proportions),it=e.source.shape==="box";let Le;if(it){const Mt=Si(ct,null,ut),Lt=Si(ct,Ie??ve,ut);Le=[Mt,Mt,Mt,Mt,Lt,Mt]}else Le=[Si(ct,ve??Ie,ut,!0)];const ot=new V.Mesh(qe,Le.length===1?Le[0]:Le);ht(ot,Le,null,0);return}const{geometry:Me}=vd(e.source.contour,ie.extrudeDepth,e.source.bevel),Re=Si(ct,Ie,ut),Se=Si(ct,null,ut),Ge=[Re,Se],je=new V.Mesh(Me,Ge);ht(je,Ge,null,0)})().catch(ze),()=>{J=!0;const ve=T.current;if(ve){ve.mixer?.stopAllAction(),Id(ve.content),ve.scene.clear(),Z1(ve.lighting),ve.shadow&&(ve.shadow.geometry.dispose(),ve.shadow.material.dispose());for(const Ie of me)Ie.dispose();T.current=null}else Ue();b(0)}},[h,f,G,z,K,se,pe,C,R,D.url,F.url,N.url,e.id,l,c]);const X=I.useMemo(()=>Od(e,i),[e,i]),he=J1(X),j=x?i:0,te=sT(i,e.inPoint,e.outPoint),H=I.useRef(X);H.current=X;const ae=I.useRef(i);ae.current=i;const Z=I.useRef(!1);I.useEffect(()=>{const J=T.current,ie=h,xe=w.current;if(!J||!ie||!xe||!f||!te&&Z.current)return;const Y=H.current,De=ae.current;DN(J,Y),FN(J,Y),BN(J,Y);const ye=Sd(Y.preset,{keyAzimuth:Y.keyAzimuth,keyElevation:Y.keyElevation,keyIntensity:Y.keyIntensity,keyColor:Y.keyColor,fillIntensity:Y.fillIntensity,rimIntensity:Y.rimIntensity},Y.environment);K1(J.lighting,ye),UN(J,Y,ye),J.mixer&&J.clipDuration>0&&J.mixer.setTime(oT(De,e.inPoint,r.fps));try{f.render({canvas:ie,scene:J.scene,camera:J.camera,width:C,height:R}),xe.source.update(),Z.current=!0,a(e.id)}catch($){const we=String($);O.current!==we&&(O.current=we,c(e.id,$))}},[he,j,te,y,f,h,r.fps,e.id,e.inPoint,C,R,a,c]);const{transformation:ce}=n;return M.jsx($e,{...n,ref:t,children:M.jsx("pixiContainer",{children:m&&M.jsx("pixiSprite",{texture:m,width:C,height:R,anchor:ce.anchor,x:ce.x,y:ce.y,alpha:n.visible?1:0})})})},Rd=I.memo(LN);Rd.displayName="Pixi3DModelLayer";function Si(t,e,n,r=!1){e&&e.wrapS!==V.RepeatWrapping&&(e.wrapS=V.RepeatWrapping,e.wrapT=V.ClampToEdgeWrapping,e.colorSpace=V.SRGBColorSpace,r&&(e.offset.x=.5),e.needsUpdate=!0);const i=new V.MeshPhysicalMaterial({color:new V.Color(e?"#ffffff":t),map:e,roughness:.35,metalness:.05,clearcoat:n,clearcoatRoughness:.2});return i.shadowSide=V.FrontSide,i}async function aT(t){const e=await new V.TextureLoader().loadAsync(t);return e.colorSpace=V.SRGBColorSpace,e.anisotropy=4,e}function PN(t){const e=new Set;return t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;s?.isMeshStandardMaterial&&e.add(s)}}),[...e]}function NN(){const t=new V.PlaneGeometry(1,1),e=new V.ShadowMaterial({opacity:0,transparent:!0}),n=new V.Mesh(t,e);return n.rotation.x=-Math.PI/2,n.position.y=-.5,n.receiveShadow=!0,n.castShadow=!1,n}function kN(t,e){t.traverse(i=>{const o=i;o.isMesh&&(o.castShadow=!0,o.receiveShadow=!0)});const n=6,r=e.key.shadow.camera;r.left=-n,r.right=n,r.top=n,r.bottom=-n,r.near=.1,r.far=60,r.updateProjectionMatrix()}function DN(t,e){const n=Math.PI/180;t.root.position.set(...e.position),t.root.rotation.set(e.rotation[0]*n,e.rotation[1]*n,e.rotation[2]*n),t.root.scale.setScalar(e.scale),t.isExtrude&&(t.content.scale.z=e.extrudeDepth/t.baseExtrudeDepth)}function FN(t,e){for(const n of t.materials)n.roughness=e.roughness,n.metalness=e.metalness}function BN(t,e){const{position:n,target:r}=iT([t.center.x,t.center.y,t.center.z],t.maxDim,e.fov,e.fit);t.camera.fov=e.fov,t.camera.position.set(...n),t.camera.lookAt(...r),t.camera.updateProjectionMatrix()}const cT=new V.Box3,lT=new V.Vector3,uT=new V.Vector3;function UN(t,e,n){const r=t.shadow;if(!r)return;const i=r.material;if(i.opacity=e.shadowOpacity,r.visible=e.shadowOpacity>0&&n.keyIntensity>0,!r.visible)return;t.root.updateMatrixWorld(!0);const o=t.boundsOverride,s=o?cT.setFromCenterAndSize(uT.set(...o.center??[t.center.x,t.center.y,t.center.z]),lT.set(...o.size)).applyMatrix4(t.root.matrixWorld):cT.setFromObject(t.content);if(s.isEmpty())return;const a=s.getSize(lT),l=s.getCenter(uT),c=Math.max(a.x,a.z,.001)*2.6;r.scale.set(c,c,1),r.position.set(l.x,s.min.y-e.shadowOffsetY,l.z),t.lighting.key.shadow.radius=2+e.shadowSoftness*10}function Id(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i)){const s=o;s&&s.isTexture&&s.dispose()}i.dispose()}})}const fT=I.createContext(null),ts=({children:t,overrides:e,prefix:n=""})=>{const[r]=I.useState(()=>new Map),[i,o]=I.useState(0),s=I.useCallback((l,c)=>{c?r.set(l,c):r.delete(l),o(u=>u+1)},[r]),a=I.useMemo(()=>({containers:r,revision:i,registerContainer:s,overrides:e,prefix:n}),[r,i,s,e,n]);return M.jsx(fT.Provider,{value:a,children:t})},wr=()=>I.useContext(fT);function wi(t){return Array.isArray(t)?t[0].v:t}const Ar=I.memo(({layer:t})=>t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0?null:M.jsx(GN,{layer:t}));Ar.displayName="AepLayerRouter";const GN=({layer:t})=>{const e=_t(),n=wr(),r=zn(),i=bi(t.id),o=e.framesToSeconds(t.inPoint),s=e.framesToSeconds(t.outPoint),a="assetId"in t?t.assetId:void 0,l=a?e.assets[a]:void 0,c=Ei(a),u=t.kind==="model3d"?{width:t.viewport.width,height:t.viewport.height}:{width:l?.width??e.width,height:l?.height??e.height},f=Y1(t,u),d={x:f.x,y:f.y,width:f.width,height:f.height,anchor:f.anchor,rotation:f.rotation,alpha:f.alpha,scale:f.scale},h=I.useCallback((T,w)=>{},[]),p=I.useCallback(T=>n?.registerContainer(`${n.prefix}${t.id}`,T),[n?.registerContainer,n?.prefix,t.id]),m=Cv(t),g=Rv(t,m),y={uniqueId:t.id,startAt:o,endAt:s,visible:t.hidden!==!0,onContainerRefReady:h};function b(){switch(t.kind){case"image":return M.jsx(hu,{...y,src:c.url,transformation:d});case"video":{const T="muted"in t?!!t.muted:!1;return M.jsx(ld,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,mute:T,locked:!1})}case"audio":return M.jsx(L1,{uniqueId:t.id,src:c.url,startAt:o,endAt:s,inPointFrames:t.inPoint,level:t.level,pan:t.pan,muted:!1,visible:t.hidden!==!0,transformation:d,onContainerRefReady:h});case"gif":return M.jsx(i_,{...y,src:c.url,transformation:d});case"lottie":return M.jsx(pd,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,locked:!1,loop:!0});case"svg":return M.jsx(_y,{...y,src:c.url,transformation:d});case"text":{const T=i??wi(t.source),w=wi(t.style.size),O=t.style.fill?wi(t.style.fill):void 0,C=O==null?"#ffffff":typeof O=="string"?O:r?.[O.themeKey]??O.default;return X1(t)?M.jsx("pixiContainer",{alpha:f.alpha,children:M.jsx(td,{layer:t,animators:t.animators??[],x:f.x,y:f.y})}):M.jsx(O_,{...y,text:T,transformation:{...d,fill:C,fontFamily:t.style.font,fontSize:w,fontColor:C,fontWeight:t.style.weight!=null?String(t.style.weight):void 0,fontStyle:t.style.italic?"italic":void 0,lineHeight:t.style.lineHeight?wi(t.style.lineHeight):void 0,letterSpacing:t.style.letterSpacing?wi(t.style.letterSpacing):void 0}})}case"shape":return M.jsx(R1,{...y,path:t.path,fill:t.fill,stroke:t.stroke,trimPath:t.trimPath,transformation:d,fps:e.fps,inPointFrames:t.inPoint});case"null":return M.jsx(I1,{...y,transformation:d});case"precomp":return M.jsx(pT,{...y,compId:t.compId,layerInPointFrames:t.inPoint,precompWidth:t.width,precompHeight:t.height,transformation:d});case"model3d":return M.jsx(Rd,{...y,layer:t,transformation:d});default:return null}}const x=b();if(x===null||a&&c.state==="error")return null;let v=x;if(m.length>0&&(v=M.jsxs("pixiContainer",{filters:m,children:[g,v]})),"masks"in t&&t.masks&&t.masks.length>0&&(v=M.jsx(D1,{masks:t.masks,fps:e.fps,inPointFrames:t.inPoint,children:v})),"trackMatte"in t&&t.trackMatte){const T=e.layersById.get(t.trackMatte.sourceId);T&&(v=M.jsx(F1,{mode:t.trackMatte.mode,width:e.width,height:e.height,source:M.jsx(Ar,{layer:T}),matted:v}))}return M.jsx($v,{uniqueId:`${n?.prefix??"aep:"}${t.id}`,startAt:o,endAt:s,onSequenceContainerReady:p,children:v})},dT=(t,e,n)=>{const{currentFrame:r}=_t(),i=I.useRef(r),o=I.useRef(new Set);i.current=r;const s=I.useCallback(a=>(o.current.add(a),a(i.current),()=>o.current.delete(a)),[]);return I.useLayoutEffect(()=>{for(const a of o.current)a(r)},[r]),I.useMemo(()=>({start:t,end:t+e,duration:e,ease:n,subscribe:s}),[t,e,n,s])},hT=t=>{const e=Array.isArray(t)?Bn(t):t??"none";return E.parseEase(e)??E.parseEase("none")},jN={},Md=I.memo(({transition:t,overrides:e})=>{const n=_t(),r=wr(),i=e?.[t.id],o=i?.name??t.name,s=i?.params??t.params??jN,a=i?.durationFrames??t.durationFrames,l=I.useMemo(()=>Array.isArray(t.from)?t.from:[t.from],[t.from]),c=I.useMemo(()=>Array.isArray(t.to)?t.to:[t.to],[t.to]),u=l[0]??"",f=c[0]??"",d=I.useMemo(()=>hT(t.ease),[t.ease]),h=dT(t.startFrame,a,d),p=r?.prefix??"",m=I.useCallback(()=>({from:r?.containers.get(`${p}${u}`)??null,to:r?.containers.get(`${p}${f}`)??null}),[r?.containers,r?.revision,p,u,f]),g=I.useMemo(()=>({pairId:`aep:${t.id}`,config:{type:o,name:o,duration:a,ease:"none",params:s},timing:{start:t.startFrame,end:t.startFrame+a,duration:a}}),[t.id,u,f,o,a,s,t.startFrame]),y=I.useCallback(O=>{const C=n.layersById,R=L=>[...new Set(L)].flatMap(N=>{const D=r?.containers.get(`${p}${N}`),F=[...C.keys()].indexOf(N);return D?[{container:D,zIndex:F}]:[]});let P=R(l),A=R(c);if(t.kind==="scene"&&t.includeShared){const L=new Set([...l,...c]),N=[...C.keys()].filter(D=>!L.has(D));P=[...P,...R(N)],A=[...A,...R(N)]}return{fromLayers:P,toLayers:A}},[n.layersById,r?.containers,r?.revision,p,l,c,t.kind,t.includeShared]),b=t.region,x=I.useCallback(()=>{if(b)return b;const O=r?.containers.get(`${p}${u}`),C=r?.containers.get(`${p}${f}`),R=P=>{if(!P)return null;const A=P.getLocalBounds();return{x:A.x,y:A.y,width:A.width,height:A.height}};return Pb([R(O),R(C)])},[b,r?.containers,p,u,f]),v=Math.max(1,Math.round(n.width)),T=Math.max(1,Math.round(n.height)),w=fd({transitionPair:g,width:v,height:T,clock:h,resolveEndpoints:m,getLayerSets:y,hideEndpointsInWindow:t.kind==="element",getRegion:x,fullCanvas:t.kind==="scene"});return M.jsx("pixiContainer",{ref:w,zIndex:Number.MAX_SAFE_INTEGER,sortableChildren:!0})});Md.displayName="AepTransitionMesh";const Ai=I.memo(({transition:t,overrides:e})=>{const n=wr(),r=e??n?.overrides;return r?.[t.id]?.disabled?null:M.jsx(Md,{transition:t,overrides:r})});Ai.displayName="AepTransitionLayer";const HN=({ref:t,...e})=>{const n=_t(),r=wr(),i=P_();if(i+1>yo)throw new Error(`AEP precomp recursion depth exceeded (max ${yo})`);const o=n.precomps[e.compId],s=n.framesToSeconds(e.layerInPointFrames),a=I.useMemo(()=>{if(!o)return null;const d=new Map(o.layers.map(m=>[m.id,m])),h=o.fps||n.fps,p=Math.max(0,(n.currentFrame/n.fps-s)*h);return{fps:h,durationInFrames:o.durationInFrames,width:o.width||e.precompWidth,height:o.height||e.precompHeight,assets:ai(n.assets,o.assets),layersById:d,precomps:{...n.precomps,...o.precomps??{}},framesToSeconds:m=>s+m/h,currentFrame:p}},[o,n,s,e.precompWidth,e.precompHeight]);if(!o||!a)return console.warn(`PixiPreComp: compId '${e.compId}' not found in precomps map`),null;const l=e.transformation.anchor,c=typeof l=="number"?l:l.x,u=typeof l=="number"?l:l.y,f={x:c*e.precompWidth,y:u*e.precompHeight};return M.jsx($e,{...e,pivotOffset:f,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{x:e.transformation.x,y:e.transformation.y,children:M.jsx(L_,{depth:i+1,children:M.jsx(ts,{overrides:r?.overrides,prefix:`${r?.prefix??""}${e.uniqueId??e.compId}/${e.compId}:`,children:M.jsxs(si,{value:a,children:[o.layers.map(d=>M.jsx(Ar,{layer:d},d.id)),o.transitions?.map(d=>M.jsx(Ai,{transition:d,overrides:r?.overrides},d.id))]})})})})})},pT=I.memo(HN,et);function mT(t,e=yo,n=0){if(n>e)throw new Error(`AEP precomp recursion depth exceeded (max ${e})`);const r=t.precomps??{};for(const i of Object.values(r))mT(i,e,n+1)}function YN(t){const e=new Set;for(const n of t)"trackMatte"in n&&n.trackMatte&&e.add(n.trackMatte.sourceId);return e}const gT=I.createContext(null),XN=({children:t})=>{const e=I.useMemo(()=>({entries:new Map,subscribers:new Set}),[]);return M.jsx(gT.Provider,{value:e,children:t})};function Ld(){return I.useContext(gT)}function yT(t){for(const e of t.subscribers)e()}function WN(t,e,n,r){if(!t)return null;let i=t.entries.get(e);return i?(i.width=n,i.height=r):(i={canvas:null,texture:null,width:n,height:r,rev:0},t.entries.set(e,i)),i}function zN(t,e){if(!t)return;const n=t.entries.get(e);n&&(n.texture&&n.texture.dispose(),t.entries.delete(e),yT(t))}function qN(t,e,n,r){if(!t)return;const i=t.entries.get(e);if(!i||!n?.renderer?.extract)return;const o=n.renderer.extract.canvas(r);i.canvas=o,i.texture?(i.texture.image=o,i.texture.needsUpdate=!0):(i.texture=new V.CanvasTexture(o),i.texture.flipY=!0,i.texture.minFilter=V.LinearFilter,i.texture.magFilter=V.LinearFilter),i.rev+=1,yT(t)}function _T(t){const e=Ld(),[,n]=I.useReducer(r=>r+1,0);return I.useEffect(()=>{if(e)return e.subscribers.add(n),()=>{e.subscribers.delete(n)}},[e]),e?.entries.get(t)??null}const Pd=new Map,VN=4;function KN(t,e){return`${Math.round(t)}x${Math.round(e)}`}let ZN=(t,e)=>W.RenderTexture.create({width:t,height:e});function $N(t,e){const n=KN(t,e),r=Pd.get(n)??[],i=r.find(s=>!s.inUse);if(i)return i.inUse=!0,i.texture;const o=ZN(t,e);if(r.push({texture:o,inUse:!0}),r.length>VN){const s=r.findIndex(a=>!a.inUse);if(s>=0){const[a]=r.splice(s,1);try{a.texture.destroy(!0)}catch{}}}return Pd.set(n,r),o}function JN(t){for(const e of Pd.values())for(const n of e)if(n.texture===t){n.inUse=!1;return}}function bT(t,e){const n=I.useMemo(()=>$N(t,e),[t,e]);return I.useEffect(()=>()=>JN(n),[n]),n}const Nd=({layer:t})=>{const e=_t(),n=wr(),{app:r}=at.useApplication(),i=Ld(),o=e.precomps[t.compId],s=I.useRef(null),a=bT(o?.width??t.width,o?.height??t.height),l=I.useMemo(()=>{if(!o)return null;const c=new Map(o.layers.map(h=>[h.id,h])),u=o.fps||e.fps,f=e.framesToSeconds(t.inPoint),d=Math.max(0,(e.currentFrame/e.fps-f)*u);return{fps:u,durationInFrames:o.durationInFrames,width:o.width||t.width,height:o.height||t.height,assets:ai(e.assets,o.assets),layersById:c,precomps:o.precomps??{},framesToSeconds:h=>f+h/u,currentFrame:d}},[o,e,t.inPoint,t.width,t.height]);return I.useEffect(()=>(WN(i,t.id,o?.width??t.width,o?.height??t.height),()=>{zN(i,t.id)}),[i,t.id,o?.width,o?.height,t.width,t.height]),at.useTick(()=>{!r||!s.current||!a||(r.renderer.render({container:s.current,target:a}),qN(i,t.id,r,a))}),!o||!l?null:M.jsx("pixiContainer",{ref:s,renderable:!1,children:M.jsx(ts,{overrides:n?.overrides,prefix:`${n?.prefix??""}${t.id}/${t.compId}:`,children:M.jsxs(si,{value:l,children:[o.layers.map(c=>M.jsx(Ar,{layer:c},c.id)),o.transitions?.map(c=>M.jsx(Ai,{transition:c,overrides:n?.overrides},c.id))]})})})};Nd.displayName="AepPrecompRenderer";function QN({onReady:t}){const e=W1(),n=I.useRef(!1);return I.useEffect(()=>{!e||n.current||(n.current=!0,t?.())},[e,t]),null}function ek(t,e){const[n,r]=I.useState(()=>{if(typeof t!="string")try{return Lo(t)}catch(i){return e?.(i),null}return null});return I.useEffect(()=>{if(typeof t!="string")return;let i=!1;return fetch(t).then(o=>o.json()).then(o=>{if(!i)try{r(Lo(o))}catch(s){e?.(s)}}).catch(o=>{i||e?.(o)}),()=>{i=!0}},[t,e]),n}const xT=I.memo(({src:t,assetMap:e,assetResolver:n,currentFrame:r,onReady:i,onError:o,theme:s,textOverrides:a,transitionOverrides:l,onRenderReady:c,onLayerError:u})=>{const f=ek(t,o),d=I.useMemo(()=>Jf(f?.theme,s),[f?.theme,s]);I.useEffect(()=>{f&&i?.(f)},[f,i]);const h=N_(f?.fps??30),p=r??h,m=I.useMemo(()=>{if(!f)return null;const R=new Map(f.layers.map(P=>[P.id,P]));return{fps:f.fps,durationInFrames:f.durationInFrames,width:f.width,height:f.height,assets:ai(f.assets,e),layersById:R,precomps:f.precomps??{},framesToSeconds:P=>P/f.fps,currentFrame:p}},[f,e,p]),{app:g}=at.useApplication();if(!f||!m)return null;const y=g?.screen?.width??f.width,b=g?.screen?.height??f.height,x=Math.min(y/f.width,b/f.height),v=(y-f.width*x)/2,T=(b-f.height*x)/2,w=n??_d,O=YN(f.layers),C=f.layers.filter(R=>R.kind==="precomp"&&"is3D"in R&&R.is3D===!0);return M.jsxs(q1,{onLayerError:u,children:[M.jsx(QN,{onReady:c}),M.jsx(U1,{resolver:w,children:M.jsx($f,{value:d,children:M.jsx(Nv,{value:a,children:M.jsx(si,{value:m,children:M.jsxs(ts,{overrides:l,prefix:"",children:[M.jsxs("pixiContainer",{x:v,y:T,scale:x,sortableChildren:!0,children:[f.layers.filter(R=>!O.has(R.id)).map(R=>M.jsx(Ar,{layer:R},R.id)),f.transitions?.map(R=>M.jsx(Ai,{transition:R,overrides:l},R.id))]}),C.map(R=>M.jsx(Nd,{layer:R},`rt-${R.id}`))]})})})})})]},f.id)});xT.displayName="AepComposition";const vT={x:0,y:0,z:0,rx:0,ry:0,rz:0,sx:1,sy:1,sz:1,alpha:1};function TT(t,e){const n=b=>b*Math.PI/180,r=Math.cos(n(e.rx)),i=Math.sin(n(e.rx)),o=Math.cos(n(e.ry)),s=Math.sin(n(e.ry)),a=Math.cos(n(e.rz)),l=Math.sin(n(e.rz));let c=t.x,u=t.y,f=t.z;const d=a*c-l*u,h=l*c+a*u;c=d,u=h;const p=o*c+s*f,m=-s*c+o*f;c=p,f=m;const g=r*u-i*f,y=i*u+r*f;return u=g,f=y,{x:c,y:u,z:f}}function ET(t,e){const n={x:e.x*t.sx,y:e.y*t.sy,z:e.z*t.sz},r=TT(n,t);return{x:t.x+r.x,y:t.y+r.y,z:t.z+r.z,rx:t.rx+e.rx,ry:t.ry+e.ry,rz:t.rz+e.rz,sx:t.sx*e.sx,sy:t.sy*e.sy,sz:t.sz*e.sz,alpha:t.alpha*e.alpha}}function Oi(t){const{layersById:e,currentFrame:n}=_t();return I.useMemo(()=>{const r=H1(t,e);let i={...vT};for(let o=r.length-1;o>=0;o--){const s=r[o],a=tk(s,n);i=ET(i,a)}return{position:[i.x,i.y,i.z],rotationEuler:[i.rx,i.ry,i.rz],scale:[i.sx,i.sy,i.sz],alpha:i.alpha}},[t,e,n])}function tk(t,e){return t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0&&t.transform3D?ST(t.transform3D,e):nk(t.transform,e)}function ST(t,e){const[n,r,i]=Go(t.position,[0,0,0],e),[o,s,a]=Go(t.rotation,[0,0,0],e),[l,c]=sn(t.scale,[1,1],e),u=ge(t.opacity,1,e);return{x:n,y:r,z:i,rx:o,ry:s,rz:a,sx:l,sy:c,sz:1,alpha:u}}function nk(t,e){const[n,r]=sn(t.position,[0,0],e),[i,o]=sn(t.scale,[1,1],e);return{x:n,y:r,z:0,rx:0,ry:0,rz:ge(t.rotation,0,e),sx:i,sy:o,sz:1,alpha:ge(t.opacity,1,e)}}const kd=({passes:t,currentFrame:e})=>{if(!t||t.length===0)return null;const n=t.filter(r=>r.enabled!==!1).map((r,i)=>ik(r,e,i)).filter(Boolean);return n.length===0?null:M.jsx($n.EffectComposer,{children:n})};kd.displayName="Aep3DPostFx";function ln(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:ge(i,n,r)}function rk(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:Array.isArray(i)&&i.length===2&&typeof i[0]=="number"?[i[0],i[1]]:sn(i,n,r)}function ik(t,e,n){const r=t.params;switch(t.name){case"bloom":return M.jsx($n.Bloom,{intensity:ln(r,"intensity",1,e),luminanceThreshold:ln(r,"luminanceThreshold",.9,e),radius:ln(r,"radius",.6,e)},n);case"chromaticAberration":{const[i,o]=rk(r,"offset",[.002,.002],e);return M.jsx($n.ChromaticAberration,{offset:new qd.Vector2(i,o),modulationOffset:0,radialModulation:!1},n)}case"vignette":return M.jsx($n.Vignette,{darkness:ln(r,"darkness",.5,e),offset:ln(r,"offset",.5,e)},n);case"noise":return M.jsx($n.Noise,{opacity:ln(r,"intensity",.15,e),premultiply:r.premultiply===!0},n);case"cameraLensBlur":return M.jsx($n.DepthOfField,{focusDistance:ln(r,"focusDistance",.02,e),focalLength:ln(r,"focalLength",.05,e),bokehScale:ln(r,"bokehScale",2,e)},n);default:return null}}function wT(t){const e=new V.Shape;switch(t.kind){case"rect":{const n=Or(t.size,[100,100]),[r,i]=n,o=r/2,s=i/2;return e.moveTo(-o,-s),e.lineTo(o,-s),e.lineTo(o,s),e.lineTo(-o,s),e.closePath(),e}case"ellipse":{const n=Or(t.size,[100,100]),[r,i]=n;return e.absellipse(0,0,r/2,i/2,0,Math.PI*2,!1,0),e}case"polystar":{const n=Or(t.points,5),r=Or(t.outerRadius??50,50),i=Or(t.innerRadius??20,20),o=t.starType==="star",s=o?n*2:n;for(let a=0;a<s;a++){const l=-Math.PI/2+a/s*Math.PI*2,c=o?a%2===0?r:i:r,u=c*Math.cos(l),f=c*Math.sin(l);a===0?e.moveTo(u,f):e.lineTo(u,f)}return e.closePath(),e}case"bezier":{const n=Or(t.path,ok());return sk(n,e),e}default:return e}}function ok(){return{vertices:[],inTangents:[],outTangents:[],closed:!1}}function sk(t,e){const n=t.vertices,r=t.inTangents,i=t.outTangents;if(n.length){e.moveTo(n[0][0],n[0][1]);for(let o=1;o<n.length;o++){const s=n[o-1],a=n[o],l=i[o-1]??[0,0],c=r[o]??[0,0];e.bezierCurveTo(s[0]+l[0],s[1]+l[1],a[0]+c[0],a[1]+c[1],a[0],a[1])}if(t.closed&&n.length>2){const o=n[n.length-1],s=n[0],a=i[n.length-1]??[0,0],l=r[0]??[0,0];e.bezierCurveTo(o[0]+a[0],o[1]+a[1],s[0]+l[0],s[1]+l[1],s[0],s[1]),e.closePath()}}}function Or(t,e){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]?t[0].v:t??e}function AT(t){return JSON.stringify(t)}const Dd=({path:t,fill:e="#88ccff",extrusion:n,currentFrame:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=Fd(ge(n.depth,1,r),.01),c=n.bevelThickness?Fd(ge(n.bevelThickness,0,r),.01):0,u=n.bevelSize?Fd(ge(n.bevelSize,0,r),.01):0,f=zn(),d=Yn(e,f),h=xt(d,"#88ccff",r),p=I.useMemo(()=>{const m=wT(t),g={depth:l,bevelEnabled:n.bevelEnabled!==!1&&(c>0||u>0),bevelThickness:c,bevelSize:u,bevelSegments:n.bevelSegments??2,curveSegments:n.curveSegments??12};return new V.ExtrudeGeometry(m,g)},[AT(t),l,c,u,n.bevelEnabled,n.bevelSegments,n.curveSegments]);return I.useEffect(()=>()=>{p.dispose()},[p]),M.jsxs("mesh",{position:i,rotation:o,scale:s,children:[M.jsx("primitive",{object:p,attach:"geometry"}),M.jsx("meshStandardMaterial",{color:h,transparent:a<1,opacity:a,metalness:n.sideMaterial?.metalness??.1,roughness:n.sideMaterial?.roughness??.6})]})};Dd.displayName="Aep3DShapeMesh";function Fd(t,e){return Math.round(t/e)*e}const ak={get:()=>{}},OT=I.createContext(ak),CT=({value:t,children:e})=>M.jsx(OT.Provider,{value:t,children:e});function RT(t){const e=I.useContext(OT);if(t)return e.get(t)}class IT{map=new Map;set(e,n){this.map.set(e,n)}get(e){return this.map.get(e)}has(e){return this.map.has(e)}}function ck(t){if(t<=64)return 64;let e=64;for(;e<t;)e<<=1;return e}const Cr=new V.Matrix4;function lk(t){return new V.ShaderMaterial({vertexShader:Ub,fragmentShader:Gb,uniforms:{uAtlas:{value:t.texture},uDistanceRange:{value:t.distanceRange}},transparent:!0,depthWrite:!1})}const uk=new V.PlaneGeometry(1,1),Bd=({layer:t,atlas:e,currentFrame:n,position:r,rotation:i,scale:o,opacity:s})=>{const a=zn(),l=bi(t.id),c=I.useMemo(()=>l===void 0?t:{...t,source:l},[t,l]),u=jo(c,n,{theme:a}),f=ge(t.style.size,24,n),d=t.style.fill?xt(Yn(t.style.fill,a),"#ffffff",n):"#ffffff",h=t.animators??[],p=I.useMemo(()=>h.map(w=>ge(w.amount,1,n)),[h,n]),m=I.useMemo(()=>Ho(h,u.glyphs,p),[h,u.glyphs.length,p]),g=I.useMemo(()=>u.glyphs.filter(w=>!w.isWhitespace),[u.glyphs]),y=ck(g.length),b=I.useMemo(()=>lk(e),[e]),x=I.useRef(null),v=I.useRef(null),T=I.useRef(null);return I.useEffect(()=>{const w=x.current;if(!w)return;const O=new Float32Array(y*4),C=new Float32Array(y*4),R=new V.InstancedBufferAttribute(O,4),P=new V.InstancedBufferAttribute(C,4);return R.setUsage(V.DynamicDrawUsage),P.setUsage(V.DynamicDrawUsage),w.geometry.setAttribute("aUvRect",R),w.geometry.setAttribute("aColor",P),v.current=R,T.current=P,()=>{w.geometry.deleteAttribute("aUvRect"),w.geometry.deleteAttribute("aColor"),v.current=null,T.current=null}},[y]),is.useFrame(()=>{const w=x.current,O=v.current,C=T.current;if(!w||!O||!C)return;let R=0;for(let L=0;L<m.length;L++){const N=m[L]?.opacity??0;N>R&&(R=N)}if(s+R<=.01)return;const P=u.bounds.width/2,A=u.bounds.height/2;for(let L=0;L<g.length;L++){const N=g[L],D=e.glyphs.get(N.char);if(!D){Cr.makeScale(0,0,0),w.setMatrixAt(L,Cr);continue}const F=m[N.charIndex]??{position:[0,0],scale:[0,0],rotation:0,opacity:0};Wb(Cr,D,{x:N.x,y:N.y,bounds:{width:P*2,height:A*2}},f,F),w.setMatrixAt(L,Cr);const G=L*4;O.array[G]=D.uv[0],O.array[G+1]=D.uv[1],O.array[G+2]=D.uv[2],O.array[G+3]=D.uv[3];const z=t.style.runs?.[N.runIndex]?.fill,K=(typeof z=="string"?z:void 0)??d,se=Math.max(0,Math.min(1,s+F.opacity)),pe=zb(K,se),X=L*4;C.array[X]=pe[0],C.array[X+1]=pe[1],C.array[X+2]=pe[2],C.array[X+3]=pe[3]}for(let L=g.length;L<y;L++)Cr.makeScale(0,0,0),w.setMatrixAt(L,Cr);w.instanceMatrix.needsUpdate=!0,O.needsUpdate=!0,C.needsUpdate=!0}),M.jsx("group",{position:r,rotation:i,scale:o,children:M.jsx("instancedMesh",{ref:x,args:[uk,b,y],frustumCulled:!1})})};Bd.displayName="AepMsdfTextMesh";const Ud=({layer:t,extrusion:e,currentFrame:n,fontUrl:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=zn(),c=bi(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=RT(t.style.font),d=e?.depth!=null&&ge(e.depth,0,n)>0,h=e?.depth?ge(e.depth,1,n):1,p=e?.bevelThickness?ge(e.bevelThickness,0,n):0,m=e?.bevelSize?ge(e.bevelSize,0,n):0,g=_v(r),y=jo(u,n,{boxWidth:t.style.boxWidth,metrics:g,theme:l});if(f&&!d)return M.jsx(Bd,{layer:u,atlas:f,currentFrame:n,position:i,rotation:o,scale:s,opacity:a});const b=ge(t.style.size,24,n),x=t.style.fill?xt(Yn(t.style.fill,l),"#ffffff",n):"#ffffff",v={font:r,size:b,height:h,bevelEnabled:p>0||m>0,bevelThickness:p,bevelSize:m,curveSegments:e?.curveSegments??12},T=t.animators??[],w=(t.style.runs?.length??0)>0;if(!(T.length>0||w||t.splitMode!=null&&t.splitMode!=="single"))return M.jsx("group",{position:i,rotation:o,scale:s,children:M.jsxs(Kd.Text3D,{...v,children:[y.glyphs.map(L=>L.char).join(""),M.jsx("meshStandardMaterial",{color:x,transparent:a<1,opacity:a})]})});const C=T.map(L=>ge(L.amount,1,n)),R=Ho(T,y.glyphs,C),P=y.bounds.width/2,A=y.bounds.height/2;return M.jsx("group",{position:i,rotation:o,scale:s,children:y.glyphs.map((L,N)=>{if(L.isWhitespace)return null;const D=R[N],F=t.style.runs?.[L.runIndex]?.fill,G=(typeof F=="string"?F:void 0)??x,z=L.x-P+D.position[0],K=-(L.y-A)+D.position[1],se=1+D.scale[0],pe=1+D.scale[1],X=-D.rotation*Math.PI/180,he=Math.max(0,Math.min(1,a+D.opacity)),j=t.style.runs?.[L.runIndex],te=j?.size!=null?typeof j.size=="number"?j.size:ge(j.size,b,n):b;return M.jsx("group",{position:[z,K,0],scale:[se,pe,1],rotation:[0,0,X],children:M.jsxs(Kd.Text3D,{...v,size:te,children:[L.char,M.jsx("meshStandardMaterial",{color:G,transparent:he<1,opacity:he})]})},L.charIndex)})})};Ud.displayName="Aep3DTextMesh";const fk=t=>[t[0],-t[1],-t[2]],dk=t=>{const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]},Gd=({layer:t,zOrder:e})=>{const n=Oi(t),r=_T(t.id),[i,o,s]=fk(n.position),a=s+e*.001,[l,c,u]=dk(n.rotationEuler),[f,d]=[n.scale[0],n.scale[1]],h=r?.width??t.width,p=r?.height??t.height;return M.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[M.jsx("planeGeometry",{args:[h,p]}),M.jsx("meshBasicMaterial",{map:r?.texture??null,color:r?.texture?"#ffffff":"#1a2030",transparent:!0,opacity:n.alpha})]})};Gd.displayName="Aep3DPrecompPlane";function hk(t){const e=I.useRef(null);e.current===null&&(e.current=new IT);const n=e.current,[r,i]=I.useState(0);return I.useEffect(()=>{if(!t?.fonts3D)return;let o=!1;for(const[s,a]of Object.entries(t.fonts3D))a.msdf&&(n.has(s)||Bb(a.msdf.json,{pngUrl:a.msdf.png}).then(l=>{o||(n.set(s,l),i(c=>c+1))}).catch(l=>{o||console.warn(`[useMsdfAtlasRegistry] failed to load atlas for "${s}":`,l)}));return()=>{o=!0}},[t,n]),{registry:n,ready:r}}function MT(t,e){const n=[...t??[]];if(!e||e.disableCameraDoF)return n;const r=n.some(o=>o.name==="cameraLensBlur"),i=e.focusDistance!==void 0||e.aperture!==void 0||e.blurLevel!==void 0;return!r&&i&&n.unshift({name:"cameraLensBlur",params:{focusDistance:e.focusDistance??.02,focalLength:e.aperture??.05,bokehScale:e.blurLevel??2}}),n}const LT=({comp:t,currentFrame:e,width:n,height:r,background:i="transparent",disabled:o,theme:s})=>{const a=I.useMemo(()=>Jf(t.theme,s),[t.theme,s]),{cameras:l,lights:c,threeDLayers:u,hasAny:f}=I.useMemo(()=>pk(t.layers),[t.layers]),d=l[0],h=I.useMemo(()=>MT(t.postFx,d),[t.postFx,d]),p=I.useMemo(()=>{const y=new Map(t.layers.map(b=>[b.id,b]));return{fps:t.fps,durationInFrames:t.durationInFrames,width:t.width,height:t.height,assets:ai(t.assets,void 0),layersById:y,precomps:t.precomps??{},framesToSeconds:b=>b/t.fps,currentFrame:e}},[t,e]),{registry:m,ready:g}=hk(t);return o||!f?null:M.jsx(o_,{width:n,height:r,background:i,defaultLights:c.length===0,children:M.jsx(CT,{value:m,children:M.jsx($f,{value:a,children:M.jsxs(si,{value:p,children:[d&&M.jsx(mk,{camera:d,currentFrame:e}),c.map(y=>M.jsx(gk,{light:y,currentFrame:e},y.id)),u.map((y,b)=>M.jsx(yk,{layer:y,currentFrame:e,zOrder:b},y.id)),M.jsx(kd,{passes:h,currentFrame:e})]})})},`msdf-${g}`)})};LT.displayName="Aep3DScene";function pk(t){const e=[],n=[],r=[];for(const i of t)i.kind==="camera"?e.push(i):i.kind==="light"?n.push(i):"is3D"in i&&i.is3D===!0&&r.push(i);return{cameras:e,lights:n,threeDLayers:r,hasAny:e.length+n.length+r.length>0}}function jd(t){return[t[0],-t[1],-t[2]]}function PT(t){const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]}const mk=({camera:t,currentFrame:e})=>{const{camera:n}=is.useThree(),r=Oi(t);return I.useEffect(()=>{if(!(n instanceof V.PerspectiveCamera))return;const[i,o,s]=jd(r.position);n.position.set(i,o,s);const[a,l,c]=PT(r.rotationEuler);n.rotation.set(a,l,c),n.fov=ge(t.fov,50,e),n.updateProjectionMatrix()}),null},gk=({light:t,currentFrame:e})=>{const n=Oi(t),[r,i,o]=jd(n.position),s=ge(t.intensity,1,e),a=xt(t.color,"#ffffff",e),l=new V.Color(a);switch(t.lightType){case"ambient":return M.jsx("ambientLight",{color:l,intensity:s});case"point":return M.jsx("pointLight",{color:l,intensity:s,position:[r,i,o]});case"spot":{const c=t.coneAngle?ge(t.coneAngle,90,e):90,u=t.coneFeather?ge(t.coneFeather,50,e):50;return M.jsx("spotLight",{color:l,intensity:s,position:[r,i,o],angle:c/2*(Math.PI/180),penumbra:u/100})}default:return M.jsx("directionalLight",{color:l,intensity:s,position:[r,i,o]})}},yk=({layer:t,currentFrame:e,zOrder:n})=>{const r=Oi(t),[i,o,s]=jd(r.position),a=s+n*.001,[l,c,u]=PT(r.rotationEuler),[f,d]=[r.scale[0],r.scale[1]],h=r.alpha;if(t.kind==="precomp")return M.jsx(Gd,{layer:t,zOrder:n});if(t.kind==="shape"&&"extrusion"in t&&t.extrusion)return M.jsx(Dd,{path:t.path,fill:t.fill??"#88ccff",extrusion:t.extrusion,currentFrame:e,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h});if(t.kind==="text"){const m=t.style.font,y=typeof m=="string"&&(m.endsWith(".json")||m.includes("/"))?m:"/fonts/helvetiker_regular.typeface.json",b="extrusion"in t&&t.extrusion?t.extrusion:void 0;return M.jsx(Ud,{layer:t,extrusion:b,currentFrame:e,fontUrl:y,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h})}const p=_k(t);return M.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[M.jsx("planeGeometry",{args:[1,1]}),M.jsx("meshStandardMaterial",{color:p,transparent:!0,opacity:h})]})};function _k(t){return t.kind==="shape"&&typeof t.fill=="string"?t.fill:"#88ccff"}function bk(){const t=document.createElement("canvas");t.width=1,t.height=1;const e=new V.CanvasTexture(t);return e.flipY=!1,e.minFilter=V.LinearFilter,e.magFilter=V.LinearFilter,{texture:e,refresh:(i,o)=>{if(!i?.renderer?.extract)return;const s=i.renderer.extract.canvas(o);e.image=s,e.needsUpdate=!0},dispose:()=>{e.dispose()}}}var NT=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(NT||{});const xk=[{label:"Freeform",ratio:null},{label:"1 : 1",ratio:1},{label:"16 : 9",ratio:16/9},{label:"9 : 16",ratio:9/16},{label:"4 : 3",ratio:4/3},{label:"3 : 2",ratio:3/2},{label:"2 : 3",ratio:2/3}],vk=20,ns=t=>Array.isArray(t)?t[0]:t;function kT(t,e){if(!(!t||!e))return[ns(t.x),ns(t.y),ns(e.x),ns(e.y)]}function Be(t,e){if(!t)return;if(t.a===0)return e(t.k);const n=t.k;if(n?.length)return n.map((r,i)=>{const o=n[i+1],s=o?kT(r.o,o.i):void 0;return{t:r.t,v:e(r.s),easeOut:s,hold:r.h===1?!0:void 0}})}const Wt=t=>Array.isArray(t)?t[0]:t,un=t=>{const e=Array.isArray(t)?t:[t,t];return[e[0],e[1]]},DT=t=>{const[e,n]=un(t);return[e/100,n/100]},FT=t=>(Array.isArray(t)?t[0]:t)/100;function BT(t){return{vertices:(t.v??[]).map(e=>[e[0],e[1]]),inTangents:(t.i??[]).map(e=>[e[0],e[1]]),outTangents:(t.o??[]).map(e=>[e[0],e[1]]),closed:t.c===!0}}function Tk(t){if(!t)return;if(t.a===0)return BT(t.k);const e=t.k;if(e?.length)return e.map((n,r)=>{const i=e[r+1],o=i?kT(n.o,i.i):void 0,s=Array.isArray(n.s)?n.s[0]:n.s;return{t:n.t,v:BT(s??{}),easeOut:o,hold:n.h===1?!0:void 0}})}const UT=[0,0],Ek=[1,1];function qn(t){const e=Be(t?.p,un)??UT,n=Be(t?.a,un)??UT,r=Be(t?.s,DT)??Ek,i=Be(t?.r,Wt)??0,o=Be(t?.o,FT)??1,s={position:e,anchor:n,scale:r,rotation:i,opacity:o},a=Be(t?.sk,Wt);a!==void 0&&(s.skew=a);const l=Be(t?.sa,Wt);return l!==void 0&&(s.skewAxis=l),s}function Sn(t){const e=o=>Math.max(0,Math.min(255,Math.round(o*255))).toString(16).padStart(2,"0"),n=e(t[0]??0),r=e(t[1]??0),i=e(t[2]??0);return t.length===4&&t[3]!==void 0&&t[3]<1?`#${n}${r}${i}${e(t[3])}`:`#${n}${r}${i}`}function Ci(t,e){return t?Be(t,Wt)??e:e}function Hd(t,e=[0,0,0]){return t?Be(t,r=>Array.isArray(r)?[r[0]??0,r[1]??0,r[2]??0]:e)??e:e}function Sk(t,e="#ffffff"){return t?Be(t,r=>{if(!Array.isArray(r))return e;const[i,o,s]=r;return Sn([i??1,o??1,s??1])})??e:e}function wk(t,e,n,r){if(!Array.isArray(t)&&typeof e=="number"&&typeof n=="number"&&typeof r=="number"){const[o,s,a]=t;return[o+e,s+n,a+r]}return t}function Ak(t){return t.ty===13}function Ok(t){return t.ty===14}function GT(){return{position:[0,0],anchor:[0,0],scale:[1,1],rotation:0,opacity:1}}function Yd(t){const e=Hd(t?.or),n=Ci(t?.rx,0),r=Ci(t?.ry,0),i=Ci(t?.rz??t?.r,0),o=Be(t?.s??{a:0,k:[100,100,100]},a=>{const l=Array.isArray(a)?a:[100,100,100];return[(l[0]??100)/100,(l[1]??100)/100]})??[1,1],s=Be(t?.o??{a:0,k:100},a=>(Array.isArray(a)?a[0]:a)/100)??1;return{position:Hd(t?.p),anchor:Hd(t?.a),scale:o,rotation:wk(e,n,r,i),opacity:s}}function jT(t,e){return{id:e,name:t.nm,inPoint:t.ip,outPoint:t.op,...typeof t.st=="number"&&{startTime:t.st},...typeof t.parent=="number"&&{parent:`layer_${t.parent}`},...t.hd===1&&{hidden:!0}}}function Ck(t,e){const n=t.pe?Be(t.pe,r=>{const i=Array.isArray(r)?r[0]:r;return typeof i=="number"?i:50})??50:50;return{kind:"camera",...jT(t,e),transform:GT(),transform3D:Yd(t.ks),fov:n}}function Rk(t){switch(t){case 1:return"parallel";case 2:return"spot";case 3:return"point";default:return"ambient"}}function Ik(t,e){const n=Rk(t.lt),r={kind:"light",...jT(t,e),transform:GT(),transform3D:Yd(t.ks),lightType:n,intensity:Be(t.in??{a:0,k:100},i=>{const o=Array.isArray(i)?i[0]:i;return typeof o=="number"?o/100:1})??1,color:Sk(t.cl)};return n==="spot"&&(t.ca&&(r.coneAngle=Ci(t.ca,90)),t.cf&&(r.coneFeather=Ci(t.cf,50))),r}function HT(t){if(!t||typeof t!="object")return;const e=t.__aepPostFx;if(!Array.isArray(e))return;const n=[];for(const r of e){const i=of.safeParse(r);i.success?n.push(i.data):console.warn("bodymovin: dropping invalid __aepPostFx entry",i.error.issues[0]?.message)}return n.length>0?n:void 0}function YT(t){if(!t||typeof t!="object")return;const e=t.__aepExtrusion;if(!(!e||typeof e!="object"))return e}function Mk(t){if(!t||typeof t!="object")return;const e=t.runs;if(!Array.isArray(e)||e.length===0)return;const n=[];for(const r of e){if(typeof r.from!="number"||typeof r.to!="number"||r.to<=r.from)continue;const i={from:r.from,to:r.to};typeof r.font=="string"&&(i.font=r.font),typeof r.size=="number"&&(i.size=r.size),Array.isArray(r.fc)&&r.fc.length===3&&(i.fill=Sn(r.fc)),(typeof r.weight=="number"||typeof r.weight=="string")&&(i.weight=r.weight),typeof r.italic=="boolean"&&(i.italic=r.italic),typeof r.tr=="number"&&typeof r.size=="number"?i.tracking=r.tr/1e3*r.size:typeof r.tr=="number"&&(i.tracking=r.tr/1e3),typeof r.bs=="number"&&(i.baselineShift=r.bs),n.push(i)}return n.length>0?n:void 0}function Vn(t){return typeof t.ind=="number"?`layer_${t.ind}`:(t.nm??"layer").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"layer"}function Rr(t){return{id:Vn(t),name:t.nm,inPoint:t.ip,outPoint:t.op,startTime:t.st,parent:typeof t.parent=="number"?`layer_${t.parent}`:void 0,hidden:t.hd===1?!0:void 0}}function XT(t){const e=[];for(const n of t)n.ty==="gr"&&n.it?e.push(...XT(n.it)):e.push(n);return e}function Lk(t){switch(t.ty){case"rc":{const e=Be(t.s,un)??[0,0],n=Be(t.p,un),r=Be(t.r,Wt);return{kind:"rect",size:e,...n!==void 0&&{position:n},...r!==void 0&&{roundness:r}}}case"el":{const e=Be(t.s,un)??[0,0],n=Be(t.p,un);return{kind:"ellipse",size:e,...n!==void 0&&{position:n}}}case"sr":{const e=Be(t.pt,Wt)??5,n=Be(t.or,Wt)??0,r=Be(t.ir,Wt),i=Be(t.r,Wt),o=Be(t.p,un);return{kind:"polystar",starType:t.sy===2?"polygon":"star",points:e,outerRadius:n,...r!==void 0&&{innerRadius:r},...i!==void 0&&{rotation:i},...o!==void 0&&{position:o}}}case"sh":{const e=Tk(t.ks);return e===void 0?null:{kind:"bezier",path:e}}default:return null}}function Pk(t){if(t?.c)return t.c.a===0?Sn(t.c.k):Sn(t.c.k[0].s)}function Nk(t,e,n){const r=Pk(t);if(r===void 0)return;const i=t?.c?.x;if(!i||!n)return r;const o=n(e,i);return o?{themeKey:o,default:r}:r}function kk(t,e){const n=XT(t.shapes),r=n.map(Lk).filter(l=>l!==null);if(r.length===0)return[];const i=Nk(n.find(l=>l.ty==="fl"),t.nm??"",e.resolveColorControl),o=Vn(t),s=Rr(t),a=qn(t.ks);return r.map((l,c)=>({kind:"shape",...s,id:c===0?s.id:`${o}_path_${c}`,...t.nm&&c>0&&{name:`${t.nm} / path ${c+1}`},transform:a,path:l,...i!==void 0&&{fill:i}}))}function Dk(t){return{kind:"shape",...Rr(t),transform:qn(t.ks),path:{kind:"rect",size:[t.sw,t.sh]},fill:t.sc}}function Fk(t){return{kind:"null",...Rr(t),transform:qn(t.ks)}}function Bk(t){return{kind:"image",...Rr(t),assetId:t.refId,transform:qn(t.ks)}}function Uk(t){return{kind:"precomp",...Rr(t),compId:t.refId,width:t.w,height:t.h,transform:qn(t.ks)}}function Gk(t){const e=t.t?.d?.k?.[0]?.s;if(!e)return null;const n=Mk(e),r={font:e.f,size:e.s,align:e.j===1?"right":e.j===2?"center":"left",...e.fc&&{fill:Sn(e.fc)},...e.lh!==void 0&&{lineHeight:e.lh},...e.tr!==void 0&&{letterSpacing:e.tr/1e3},...e.sc&&e.sw!==void 0&&{stroke:{color:Sn(e.sc),width:e.sw}},...n!==void 0&&{runs:n}};return{kind:"text",...Rr(t),transform:qn(t.ks),source:e.t,style:r}}function jk(t){switch(t.ty){case 0:return Uk(t);case 1:return Dk(t);case 2:return Bk(t);case 3:return Fk(t);case 5:return Gk(t);default:return null}}function WT(t,e={}){if(Ak(t))return[Ck(t,Vn(t))];if(Ok(t))return[Ik(t,Vn(t))];let n;if(t.ty===4)n=kk(t,e);else{const r=jk(t);n=r?[r]:[]}return n.length===0?[]:n.map(r=>{if(r.kind==="camera"||r.kind==="light")return r;let i=r;if(t.ddd===1&&(i=Yk(i,t)),e.matteSourceId&&t.tt!=null){const o=Hk(t.tt);o&&(i.trackMatte={sourceId:e.matteSourceId,mode:o})}if(i.kind==="shape"||i.kind==="text"){const o=YT(t);o&&(i.extrusion=o)}return i})}function Hk(t){switch(t){case 1:return"alpha";case 2:return"alpha-inverted";case 3:return"luma";case 4:return"luma-inverted";default:return null}}function Yk(t,e){if(t.kind==="camera"||t.kind==="light")return t;const n=e.ks;return n?{...t,is3D:!0,transform3D:Yd(n)}:t}const st={precomp:0,solid:1,image:2,null:3,shape:4,text:5,audio:6,video:9,camera:13,light:14},Xk=new Set([st.precomp,st.solid,st.image,st.null,st.shape,st.text,st.audio,st.video]),Wk=new Set([20,21,22,23,24,25,26,27,28,29,31,32,33,34]);function Tt(t){if(!t||typeof t!="object")return[];const e=t.layers;return Array.isArray(e)?e:[]}function dt(t){if(!t||typeof t!="object")return;const e=t.nm;return typeof e=="string"?e:void 0}function Xd(t,e,n=""){if(!t||typeof t!="object")return;if(Array.isArray(t)){t.forEach((i,o)=>Xd(i,e,`${n}[${o}]`));return}const r=t;("k"in r||"x"in r)&&e(r,n);for(const i of Object.keys(r))Xd(r[i],e,n?`${n}.${i}`:i)}const zk=[{id:"unsupported-layer-kind",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"unsupported-layer-kind"))return;const i=n.ty;if(typeof i!="number"){e.push({severity:"error",message:`Layer ${r} has no numeric \`ty\` — not a valid Bodymovin layer.`,layerIndex:r,layerName:dt(n)});return}i===st.camera||i===st.light||Xk.has(i)||e.push({severity:"error",message:`Layer ${r} uses unsupported Bodymovin \`ty: ${i}\`. Drop the layer or pre-render it as a video asset.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"expression",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{!n||typeof n!="object"||Et(n,"expression")||Xd(n,(i,o)=>{typeof i.x=="string"&&i.x.length>0&&e.push({severity:"error",message:`Layer ${r} property ${o} carries an expression. Run the expression baker (aep-17) before export.`,layerIndex:r,layerName:dt(n),path:o})})}),e}},{id:"3d-layer",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"3d-layer"))return;n.ddd===1&&e.push({severity:"info",message:`Layer ${r} is 3D-toggled (ddd: 1). Will render via the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)})}),e}},{id:"camera-or-light",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"camera-or-light"))return;const i=n.ty;i===st.camera?e.push({severity:"info",message:`Layer ${r} is a camera (ty: 13). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)}):i===st.light&&e.push({severity:"info",message:`Layer ${r} is a light (ty: 14). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)})}),e}},{id:"layer-style",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"layer-style"))return;const i=n.sy;Array.isArray(i)&&i.length>0&&e.push({severity:"warn",message:`Layer ${r} uses ${i.length} layer style(s). Layer styles are not parsed; re-author using shape strokes / effect filters.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"time-remap",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"time-remap"))return;const i=n.tm,o=n.sr;i!=null&&e.push({severity:"warn",message:`Layer ${r} uses time remap. Pre-bake to a flat keyframe timeline before export.`,layerIndex:r,layerName:dt(n),path:"tm"}),typeof o=="number"&&o!==1&&e.push({severity:"warn",message:`Layer ${r} has time stretch sr=${o}. Bake the stretch into keyframes or pre-render the source.`,layerIndex:r,layerName:dt(n),path:"sr"})}),e}},{id:"unsupported-effect",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"unsupported-effect"))return;const i=n.ef;Array.isArray(i)&&i.forEach((o,s)=>{if(!o||typeof o!="object")return;const a=o.ty;typeof a=="number"&&(Wk.has(a)||e.push({severity:"warn",message:`Layer ${r} effect[${s}] uses unsupported effect ty=${a}. Pre-render to footage or substitute with a supported effect.`,layerIndex:r,layerName:dt(n),path:`ef[${s}]`}))})}),e}},{id:"adjustment-layer",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"adjustment-layer"))return;const i=n.ao,o=n.ty;i===1&&o===st.solid&&e.push({severity:"warn",message:`Layer ${r} is an adjustment layer. The engine does not compose effects across sibling layers — apply effects per-layer instead.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"shape-operator",check:t=>{const e=[],n=new Set(["mm","rp","op","pb","tw","zz","rd"]);function r(i,o,s,a){if(!i)return;if(Array.isArray(i)){i.forEach((u,f)=>r(u,o,s,`${a}[${f}]`));return}if(typeof i!="object")return;const l=i,c=l.ty;typeof c=="string"&&n.has(c)&&e.push({severity:"warn",message:`Layer ${o} shape operator '${c}' (${a}) is not supported. Pre-bake the path to a single bezier before export.`,layerIndex:o,layerName:dt(s),path:a}),Array.isArray(l.it)&&r(l.it,o,s,`${a}.it`),Array.isArray(l.shapes)&&r(l.shapes,o,s,`${a}.shapes`)}return Tt(t).forEach((i,o)=>{if(!i||typeof i!="object"||Et(i,"shape-operator")||i.ty!==st.shape)return;const a=i.shapes;Array.isArray(a)&&r(a,o,i,"shapes")}),e}},{id:"text-runs-incomplete-coverage",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"text-runs-incomplete-coverage")||n.ty!==st.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=c.t;if(typeof f!="string")return;const d=f.length;if(d===0)return;const h=new Uint8Array(d);for(const m of u){if(!m||typeof m!="object")continue;const g=m.from,y=m.to;if(typeof g!="number"||typeof y!="number")continue;const b=Math.max(0,Math.floor(g)),x=Math.min(d,Math.floor(y));for(let v=b;v<x;v++)h[v]=1}let p=0;for(let m=0;m<d;m++)h[m]||p++;p>0&&e.push({severity:"warn",message:`Layer ${r} text \`runs\` cover ${d-p}/${d} chars; ${p} gap(s) filled with layer-level style at parse. Re-export with full per-letter coverage or remove \`runs\` to silence.`,layerIndex:r,layerName:dt(n),path:"t.d.k[0].s.runs"})}),e}},{id:"text-overlapping-runs",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"text-overlapping-runs")||n.ty!==st.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=u.filter(d=>!!d&&typeof d=="object"&&typeof d.from=="number"&&typeof d.to=="number").slice().sort((d,h)=>d.from-h.from);for(let d=1;d<f.length;d++){const h=f[d-1],p=f[d];p.from<h.to&&e.push({severity:"error",message:`Layer ${r} text \`runs\` overlap: [${h.from},${h.to}) ∩ [${p.from},${p.to}). Each character may be claimed by at most one run.`,layerIndex:r,layerName:dt(n),path:"t.d.k[0].s.runs"})}}),e}},{id:"extrusion-without-is3d",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"extrusion-without-is3d"))return;const i=n;(i.__aepExtrusion!==void 0||i.__aep_extrusion!==void 0)&&(i.ty!==st.shape&&i.ty!==st.text||i.ddd!==1&&e.push({severity:"warn",message:`Layer ${r} has \`extrusion\` set but is not 3D (\`ddd:0\`). Extrusion only renders in the Three sub-scene; toggle 3D in AE or remove the extrusion extension.`,layerIndex:r,layerName:dt(n),path:"__aepExtrusion"}))}),e}}];class zT extends Error{constructor(e){super(`Bodymovin lint found ${e.findings.filter(n=>n.severity==="error").length} error(s). First: ${e.findings.find(n=>n.severity==="error")?.message}`),this.report=e,this.name="LottieLintError"}report}function qT(t,e={}){const n=new Set(e.disabledRules??[]),r=zk.filter(s=>!n.has(s.id)),i=qk(t,r),o=Vk(i);return{findings:o,hasErrors:o.some(s=>s.severity==="error"),hasWarnings:o.some(s=>s.severity==="warn")}}function qk(t,e){const n=[];for(const r of e)try{const i=r.check(t);for(const o of i)n.push({...o,ruleId:r.id})}catch{}return n}function Vk(t){const e=new Set,n=[];for(const i of t){const o=`${i.ruleId}::${i.layerIndex??-1}::${i.path??""}`;e.has(o)||(e.add(o),n.push(i))}const r={error:0,warn:1,info:2};return n.sort((i,o)=>{const s=r[i.severity]-r[o.severity];return s!==0?s:(i.layerIndex??-1)-(o.layerIndex??-1)}),n}function Et(t,e){if(!t||typeof t!="object")return!1;const n=t.__aepLintSuppress;return Array.isArray(n)?n.includes(e):!1}const Kk="ADBE Color Control";function Zk(t,e){const n={},r=new Set,i=new Map;for(const o of t){if(!Array.isArray(o.ef))continue;const s=o.ef.filter(c=>c.mn===Kk);if(s.length===0)continue;r.add(e(o));const a=o.nm??"",l=new Map;for(const c of s){const u=c.nm;if(!u)continue;l.set(u,u);const d=c.ef?.find(h=>h.ty===2)?.v?.k;Array.isArray(d)&&d.length>=3&&(n[u]=Sn(d))}l.size>0&&i.set(a,l)}return{theme:n,sourceLayerIds:r,resolveToken(o,s){return i.get(o)?.get(s)}}}const $k=[/comp\([^)]+\)\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"](?:Color|"Color"|'Color')['"]\s*\)/,/thisComp\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/],Jk=/(?:^|[^.\w])effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/;function Qk(t){for(const n of $k){const r=n.exec(t);if(r)return{layerName:r[1],effectName:r[2]}}const e=Jk.exec(t);return e?{layerName:"",effectName:e[1]}:null}function eD(t,e={}){const n=t;if(!n||typeof n.fr!="number"||!Array.isArray(n.layers))throw new Error("bodymovinToAep: input does not look like a Bodymovin JSON document");const r=e.lint??"strict";if(r!=="off"){const h=qT(t,{disabledRules:e.disabledRules});if(r==="strict"&&h.hasErrors)throw new zT(h);if(r==="warn"||r==="strict"&&h.hasWarnings)for(const p of h.findings)console.warn(`[bodymovin lint:${p.severity}] ${p.ruleId} — ${p.message}`)}const i=Zk(n.layers,Vn),o=(h,p)=>{const m=Qk(p);if(!m)return;const g=m.layerName===""?h:m.layerName;return i.resolveToken(g,m.effectName)},{layers:s,assets:a,precomps:l}=VT(n.layers,o,i.sourceLayerIds),{mergedAssets:c,mergedPrecomps:u}=tD(a,l,n.assets??[]),f=HT(t),d=Object.keys(i.theme).length?i.theme:void 0;return Lo({version:"1.0.0",id:n.nm??"lottie-import",name:n.nm,width:n.w,height:n.h,fps:n.fr,durationInFrames:n.op,layers:s,assets:c,...Object.keys(u).length>0&&{precomps:u},...f&&{postFx:f},...d&&{theme:d}})}function VT(t,e,n){const r=t.map(o=>Vn(o)),i=[];for(let o=0;o<t.length;o++){const s=t[o];if(n?.has(r[o]))continue;const a=t[o-1],l=s.tt!=null&&s.tt>0&&a?.td===1?r[o-1]:void 0,c=WT(s,{matteSourceId:l,resolveColorControl:e});if(c.length===0){console.warn(`bodymovinToAep: dropping unsupported layer ty=${s.ty}`+(s.nm?` (${s.nm})`:""));continue}i.push(...c)}return{layers:i,assets:{},precomps:{}}}function tD(t,e,n){const r={...t},i={...e};for(const o of n)if("layers"in o&&Array.isArray(o.layers)){const s=VT(o.layers);r[o.id]={type:"composition",src:""},i[o.id]={version:"1.0.0",id:o.id,width:0,height:0,fps:0,durationInFrames:1,layers:s.layers,assets:s.assets}}else{const s=o,a=(s.u??"")+(s.p??"");r[o.id]={type:"image",src:a,...s.w!==void 0&&{width:s.w},...s.h!==void 0&&{height:s.h}}}return{mergedAssets:r,mergedPrecomps:i}}const KT=(t,e)=>t.flatMap((n,r)=>Ob(n.name)?[]:[{ruleId:"transition-unknown-name",severity:"warn",message:`Transition '${n.id}' uses unknown shader '${n.name}'; it will render as a crossfade.`,path:`${e}transitions.${r}.name`}]),nD=t=>{const e=[...KT(t.transitions??[],""),...Object.entries(t.precomps??{}).flatMap(([n,r])=>KT(r.transitions??[],`precomps.${n}.`))];return{findings:e,hasErrors:!1,hasWarnings:e.length>0}};_.AEP_MAX_PRECOMP_DEPTH=yo,_.AEP_SCHEMA_MAJOR=hf,_.AEP_SCHEMA_VERSION=gM,_.AEP_TEXT_ALIGN_VALUES=ub,_.ALL_GOOGLE_FONTS=_L,_.ANIMATION=Em,_.ANIMATIONS_WITHOUT_ALPHA=ja,_.ANIMATION_CONFIGS=Te,_.ANIMATION_TIMING=Dt,_.ASPECT_RATIOS=xk,_.AbstractContainer=$e,_.Aep3DPostFx=kd,_.Aep3DPrecompPlane=Gd,_.Aep3DScene=LT,_.Aep3DShapeMesh=Dd,_.Aep3DTextMesh=Ud,_.AepAssetResolverProvider=U1,_.AepComposition=xT,_.AepLayerProvider=si,_.AepLayerRouter=Ar,_.AepMaskContainer=D1,_.AepMsdfTextMesh=Bd,_.AepPrecompRenderProvider=XN,_.AepPrecompRenderer=Nd,_.AepReadinessProvider=q1,_.AepRecursionDepthProvider=L_,_.AepTextOverrideProvider=Nv,_.AepThemeProvider=$f,_.AepTransitionLayer=Ai,_.AepTransitionMesh=Md,_.AepTransitionProvider=ts,_.Animations=to,_.AudioPlaybackManager=Pu,_.BOXED_PADDING=pi,_.BlendModes=NT,_.BorderMaskContainer=Ot,_.CANVAS_DEFAULTS=Zr,_.CANVAS_TEXT_MAX_LENGTH=uv,_.CLIP_LOCAL_TOLERANCE_SEC=Cf,_.DEFAULT_BOXED_COLOR=qx,_.DEFAULT_DUCK_FADE_SEC=po,_.DEFAULT_DUCK_TO=Iu,_.DEFAULT_LIGHTING_PRESET=Ed,_.DEFAULT_MAX_REGION_PIXELS=mf,_.DEFAULT_SEGMENT_GAP_SEC=Mx,_.DEFAULT_WORD_SPACING_EM=Vb,_.DRIFT_TOLERANCE_SEC=Vy,_.EMOJI_CDN_BASE=wx,_.Events=ke,_.FALLBACK_SPACE_EM=qb,_.FONT_LOAD_TIMEOUT_MS=lv,_.GLOW_POP_BLOOM_ALPHA=sx,_.GLOW_POP_BLOOM_BLUR_EM=ox,_.GLOW_POP_BLOOM_PASSES=ax,_.GLOW_POP_BLUR_EM=ix,_.GLOW_POP_EMOJI_BLOOM_ALPHA=cx,_.GLOW_POP_EMOJI_MS=rx,_.GLOW_POP_EMOJI_OFFSET_EM=vf,_.GLOW_POP_EMOJI_SIZE_EM=xf,_.GLOW_POP_ENTER_MS=tx,_.GLOW_POP_EXIT_MS=nx,_.GLOW_POP_STREAK_ALPHA=bf,_.GOOGLE_FONTS=cv,_.GlTransitionRegistryProvider=bP,_.GsapPixieContext=Ye,_.GsapPixieContextProvider=$E,_.IDENTITY_TRANSFORM_3D=vT,_.LIGHTING_PRESETS=Td,_.LINE_PITCH=Kb,_.LOOP_ANIMATIONS=vm,_.LottieLintError=zT,_.MIN_CROP_SIZE=vk,_.MIN_VISIBLE_BLUR=Lf,_.MODEL3D_DEFAULTS=vt,_.MSDF_FRAGMENT_SHADER=Gb,_.MSDF_VERTEX_SHADER=Ub,_.MUSIC_BED_DEFAULT_VOLUME=vR,_.MaskTypes=Bt,_.MetricsCache=__,_.MsdfAtlasProvider=CT,_.MsdfAtlasRegistry=IT,_.OverlayTilingSpriteTypes=Np,_.OverlayTypes=Gr,_.PIXITEXT_HITAREA_PREFIX=w_,_.PIXITEXT_TEXT_LABEL=A_,_.PRELOAD_FONTS=bL,_.Pixi3DModelLayer=Rd,_.PixiAnimatedSprite=mP,_.PixiAudioSprite=t_,_.PixiCaptionsTrack=rP,_.PixiElementTransition=Xo,_.PixiGifSprite=i_,_.PixiGlTransition=n1,_.PixiImageSprite=hu,_.PixiLottieSprite=pd,_.PixiMorphSvgSprite=bR,_.PixiNullObject=I1,_.PixiOverlayTilingSprite=kp,_.PixiPreComp=pT,_.PixiRemotionGifSprite=NP,_.PixiRemotionImageSprite=IP,_.PixiRemotionSprite=CP,_.PixiRemotionVideoCanvaSprite=LP,_.PixiSceneTransition=hd,_.PixiSequence=$v,_.PixiSequenceWrapper=gP,_.PixiShapeLayer=R1,_.PixiSvgImageSprite=oR,_.PixiSvgPathSprite=_y,_.PixiSvgRawSprite=yy,_.PixiTextSplit=td,_.PixiTextSprite=O_,_.PixiThreeModelSprite=LR,_.PixiThreeSprite=o_,_.PixiTrackMatte=F1,_.PixiUnifiedTransformer=aN,_.PixiVideoCanvasSyncSprite=hP,_.PixiVideoSprite=ld,_.SPECIAL_ANIMATIONS=$r,_.SPRING_POP_AMPLITUDE_EM=hx,_.SPRING_POP_BLOOM_ALPHA=yx,_.SPRING_POP_BLOOM_BLUR_EM=gx,_.SPRING_POP_BLUR_ALPHA=Tf,_.SPRING_POP_BLUR_EM=mx,_.SPRING_POP_BLUR_MS=px,_.SPRING_POP_DAMPING=dx,_.SPRING_POP_FREQUENCY_HZ=fx,_.SPRING_POP_SPLIT_ALPHA=Ex,_.SPRING_POP_SPLIT_BOTTOM=Tx,_.SPRING_POP_SPLIT_EM=xx,_.SPRING_POP_SPLIT_MS=bx,_.SPRING_POP_SPLIT_SETTLED_EM=Ef,_.SPRING_POP_SPLIT_TOP=vx,_.SPRITE_REF_PROP_NAMES=ny,_.THREE_DEFAULTS=Gt,_.TRANSITIONS_MIN_VERSION=pf,_.TextRunsOverlapError=db,_.ThreeOffscreenRenderer=Q1,_.Transitions=TM,_.VOICE_TRACK_ROLES=Hy,_.WORDBOX_GROW_MS=Zx,_._listEffectHandlers=UL,_.acquireOffscreenRenderer=Cd,_.acquireVideoAsset=rv,_.activeScaleFor=No,_.activeWordIndexAt=ex,_.activeWordScaleFor=Sf,_.activeWordWindow=$b,_.aepAnimatableOf=q,_.aepAssetKindSchema=K_,_.aepAssetMapSchema=$_,_.aepAssetSchema=Z_,_.aepBezierPathSchema=fi,_.aepCameraLayerSchema=rb,_.aepCompositionSchema=Mo,_.aepEaseHandleSchema=tf,_.aepEffectNameSchema=J_,_.aepEffectSchema=Q_,_.aepKeyframeOf=nf,_.aepLayerSchema=Tb,_.aepLightLayerSchema=ib,_.aepMaskModeSchema=tb,_.aepMaskSchema=nb,_.aepPostFxNameSchema=eb,_.aepPostFxSchema=of,_.aepRangeBasedOnSchema=sb,_.aepRangeShapeSchema=ob,_.aepShapePathSchema=_b,_.aepTextAlignSchema=fb,_.aepTextAnimatorSchema=cb,_.aepTextRangeSelectorSchema=ab,_.aepTextStyleRunSchema=lb,_.aepTextStyleSchema=xb,_.aepThemableColorSchema=uf,_.aepThemableColorValueSchema=mb,_.aepThemeMapSchema=gb,_.aepThemeRefSchema=pb,_.aepTransform3DSchema=Io,_.aepTransformSchema=Ro,_.aepTransitionSchema=yb,_.animationAffectsAlpha=dw,_.applyAudioDecision=Lu,_.applyEntranceOverlaps=fL,_.applyMaterialOverrides=l_,_.areSpritePropsEqual=et,_.asNumber=Wt,_.asOpacity=FT,_.asScale=DT,_.asVec2=un,_.audioRegistry=hr,_.bodymovinToAep=eD,_.boxedBackgroundSpec=Kx,_.boxedRadiusFor=Vx,_.brightnessContrastHandler=zf,_.buildAudioLevelTimeline=KL,_.buildBezierPathTimeline=Iv,_.buildColorValueTimeline=fv,_.buildExtrudeGeometry=vd,_.buildGainSpec=SR,_.buildLayerTimeline=I_,_.buildPrimitiveGeometry=xd,_.buildRasterSvg=py,_.buildResourceUrlModifier=f_,_.buildScalarValueTimeline=Zf,_.buildSourceGeometry=wN,_.buildTextStyleOptions=Hu,_.buildV8FillGradient=E_,_.buildVec2ValueTimeline=Mv,_.camelToUpperSnake=lr,_.captionModeFor=Qb,_.captionSegmentSchema=Rx,_.captionSegmentsSchema=Ix,_.captionTimeAt=Mf,_.captionWordSchema=Cx,_.captionWordText=JM,_.clipFileTime=Ky,_.clipSegmentsToRange=uL,_.clipTimeAt=a_,_.clipTimeSeconds=oT,_.clipVolumeAt=Zy,_.clonePath=Xn,_.coerceLegacyTextAlign=cf,_.composeAnimators=Ho,_.composeTransform3D=ET,_.computeInstanceMatrix=Wb,_.computeModelPose=s_,_.convertLayer=WT,_.convertProperty=Be,_.convertTransform=qn,_.createAssetRefCounter=Ja,_.createAudioRegistry=jy,_.createCanvasMetricsProvider=b_,_.createGLTransitionShader=Ib,_.createPixiSelector=rO,_.createRendererPool=eT,_.cubicBezierEase=dv,_.dbToLinear=TR,_.decideAudioSync=Mu,_.defaultAssetResolver=_d,_.deriveDuckWindows=qy,_.detectOutlineIcon=hy,_.detectSubtitleFormat=Ux,_.directionFromAzimuthElevation=V1,_.displayedWordsFor=Xx,_.disposeObject=Fu,_.drawAepMaskComposite=k1,_.drawMaskShape=$a,_.drawShape=w1,_.dropShadowHandler=jf,_.duckGainAt=Xy,_.duckWindowsFromEnvelope=zy,_.easeCaptionProgress=xn,_.easeNameFor=Bn,_.easeOutBack=lx,_.emitCustomEvent=Ln,_.estimateWordTimings=Of,_.fadeGainAt=Yy,_.fastBoxBlurHandler=qf,_.findAllByPattern=Za,_.findByName=Ka,_.fitCameraToObject=u_,_.fitDistance=Du,_.flattenThemableColor=Yn,_.fontFamilyKey=kf,_.fontWeightsOf=yi,_.formatGoogleFamily=gi,_.frameCamera=iT,_.fromMultiplierColorCorrection=QA,_.gainAt=Wy,_.gaussianBlurHandler=Gf,_.getAepTransitionEase=hT,_.getAvailableTransitions=Cb,_.getEffectFilter=Pm,_.getEffectHandler=Kf,_.getElementName=Va,_.getLoadedFonts=xL,_.getOffscreenRenderer=IN,_.getPixiTextHitAreaName=nI,_.getTransitionInfo=SM,_.getTransitionShader=Po,_.getUniqueIdFromName=tO,_.gifFrameAt=r_,_.glowHandler=Hf,_.glowPopMotion=ux,_.googleFontsHref=av,_.groupWordsIntoSegments=nL,_.hasMaterialOverrides=c_,_.hexToRgba=zb,_.hueSaturationHandler=Yf,_.hydrateMsdfAtlas=VM,_.interpolateBezierPath=Ff,_.isClipLocal=Gx,_.isExternalUrl=vM,_.isFontSpecCovered=ov,_.isFrameInRange=sT,_.isLoopAnimation=Tm,_.isSingleWordMode=ZM,_.isSpecialAnimation=hw,_.isSvgSource=gy,_.isTimeBasedMode=Yx,_.isValidAnimation=pw,_.isWhitespaceChar=h_,_.layerIdFor=Vn,_.layoutCaptionWords=Jb,_.layoutText=x_,_.lerpColor=mv,_.lerpNumber=hv,_.lerpVec2=pv,_.levelsHandler=Xf,_.linearToDb=ER,_.lintAepTransitions=nD,_.lintBodymovinJson=qT,_.listGlTransitionNames=wM,_.loadGoogleFonts=wL,_.loadMsdfAtlas=Bb,_.loadSpriteTexture=cO,_.loadSpriteTextureSync=ro,_.lottieColorToHex=Sn,_.mapV7DropShadow=v_,_.mapV7Stroke=T_,_.markVideoReady=Bo,_.materialOverrideKey=ku,_.mergeAssetMaps=ai,_.mergeTheme=Jf,_.metricsCacheKey=y_,_.model3DStateKey=J1,_.newCustomEventEmitter=ZE,_.normalizeAnimation=Ha,_.normalizeCaptionSegments=tL,_.normalizeFontWeight=Gu,_.normalizeLetterSpacing=S_,_.normalizeLoopAnimation=wm,_.normalizeTextRuns=hb,_.notoEmojiFileName=Ax,_.overlays=_a,_.parseAepComposition=Lo,_.parseAepCompositionSafe=xM,_.parseCaptionColor=zx,_.parseCaptionSegments=$M,_.parseHexColor=Wn,_.parseSRT=Fx,_.parseSubtitles=sL,_.parseTimestamp=ko,_.parseVTT=Bx,_.pathHash=AT,_.pathToThreeShape=wT,_.planPropSegments=R_,_.projectSegments=lL,_.rangeShapeValue=Qf,_.readExtrusionExtension=YT,_.readOriginalSize=dy,_.readPostFxExtension=HT,_.registerEffectHandler=BL,_.registerVideo=ev,_.releaseOffscreenRenderer=rT,_.releaseVideoAsset=iv,_.resetVideoReadiness=pL,_.resolveBlendModeString=Xa,_.resolveBlendStrategy=yw,_.resolveCaptionOffset=cL,_.resolveEmojiSrc=wf,_.resolveLightingConfig=Sd,_.resolvePostFxList=MT,_.resolveSequenceTransitions=e1,_.resolveSpaceWidth=Zb,_.resolveTextRuns=yf,_.resolveTextRunsWithWarnings=XM,_.resolveTextSource=ZL,_.resolveTextSplitFills=kv,_.resolveThemedColorValue=ff,_.resolveWordSpacing=_f,_.rewriteSvg=my,_.rgbaToHex=_i,_.rotateVec3Euler=TT,_.sampleAnimatable=Tr,_.sampleAnimatedBezier=Uf,_.sampleBezierPath=v1,_.sampleCaptionAt=If,_.sampleColor=xt,_.sampleModel3DState=Od,_.samplePath=yd,_.sampleScalar=ge,_.sampleVec2=sn,_.sanitizeCanvasText=CL,_.sanitizeImageSrc=Qa,_.selectorPerChar=ed,_.shouldSplitText=X1,_.splitGraphemes=d_,_.springPopMotion=_x,_.springPopSplit=Sx,_.staticParam=Fe,_.threeTextureFromPixi=bk,_.tintHandler=Wf,_.transformCaptionText=xr,_.transitionExists=Ob,_.transitionLayerIds=df,_.trimPolyline=T1,_.unregisterVideo=tv,_.useAepAssetResolver=G1,_.useAepBezierPathAnimator=zL,_.useAepColorAnimator=XL,_.useAepCompositionReady=W1,_.useAepCurrentFrame=N_,_.useAepEffectKeyframes=Rv,_.useAepEffects=Cv,_.useAepKeyframes=aI,_.useAepLayerContext=_t,_.useAepLayerContextOptional=Jt,_.useAepLayerTransform=Y1,_.useAepLayerTransform3D=Oi,_.useAepPrecompStore=Ld,_.useAepReadiness=z1,_.useAepRecursionDepth=P_,_.useAepTextLayout=jo,_.useAepTextOverride=bi,_.useAepTheme=zn,_.useAepTransitionClock=dT,_.useAepTransitionRegistry=wr,_.useAepValueAnimator=YL,_.useAepVec2Animator=VL,_.useAllVideosReady=yL,_.useAudioElementPlayer=n_,_.useAudioVisualizer=e_,_.useBlendFilter=Rm,_.useCaptionPlayhead=Dv,_.useCaptionStyles=Bv,_.useCustomEventListener=Ze,_.useDebouncedValue=ei,_.useEffects=XA,_.useEmojiTextures=Uv,_.useFontEpoch=oi,_.useGLTransitionMesh=fd,_.useGsapEffect=xm,_.useHowlerAudioPlayer=RR,_.useMsdfAtlas=RT,_.usePixiAnimation=Am,_.usePixiRenderTexture=bT,_.usePrecompTexture=_T,_.useResolveAsset=Ei,_.useSpriteFilters=lt,_.useSvgTexture=by,_.useTypefaceMetrics=_v,_.useVideoLifecycle=Vv,_.useVideoTexture=qv,_.useVideoTimelineSync=Kv,_.usesClipLocalTime=jx,_.validatePrecompDepth=mT,_.withEffectsHook=za,_.withFiltersHook=Mm,_.wordVisualFor=Hx,_.wordboxPillSpec=$x,_.writeInstanceColor=KM,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|