@zyzgroup/core-web 0.1.45 → 0.1.46

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.
@@ -3,7 +3,7 @@ var ZYZGroupCoreWeb=function(d,v){"use strict";function Xn(i){return i&&i.__esMo
3
3
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[or]=this[or]={accessors:{}}).accessors,n=this.prototype;function r(a){const o=Ye(a);s[o]||(zh(n,a),s[o]=!0)}return A.isArray(t)?t.forEach(r):r(t),this}}ms.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(ms.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(s){this[e]=s}}}),A.freezeMethods(ms);const Rt=ms;function yi(i,t){const e=this||gi,s=t||e,n=Rt.from(s.headers);let r=s.data;return A.forEach(i,function(o){r=o.call(e,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function hr(i){return!!(i&&i.__CANCEL__)}function Ie(i,t,e){F.call(this,i??"canceled",F.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(Ie,F,{__CANCEL__:!0});function cr(i,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?i(e):t(new F("Request failed with status code "+e.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Oh(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function Bh(i,t){i=i||10;const e=new Array(i),s=new Array(i);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[n]=h,s[n]=c;let u=r,f=0;for(;u!==n;)f+=e[u++],u=u%i;if(n=(n+1)%i,n===r&&(r=(r+1)%i),c-a<t)return;const m=l&&c-l;return m?Math.round(f*1e3/m):void 0}}function Nh(i,t){let e=0,s=1e3/t,n,r;const a=(c,l=Date.now())=>{e=l,n=null,r&&(clearTimeout(r),r=null),i.apply(null,c)};return[(...c)=>{const l=Date.now(),u=l-e;u>=s?a(c,l):(n=c,r||(r=setTimeout(()=>{r=null,a(n)},s-u)))},()=>n&&a(n)]}const gs=(i,t,e=3)=>{let s=0;const n=Bh(50,250);return Nh(r=>{const a=r.loaded,o=r.lengthComputable?r.total:void 0,h=a-s,c=n(h),l=a<=o;s=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:h,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:r,lengthComputable:o!=null,[t?"download":"upload"]:!0};i(u)},e)},lr=(i,t)=>{const e=i!=null;return[s=>t[0]({lengthComputable:e,total:i,loaded:s}),t[1]]},ur=i=>(...t)=>A.asap(()=>i(...t)),Fh=lt.hasStandardBrowserEnv?((i,t)=>e=>(e=new URL(e,lt.origin),i.protocol===e.protocol&&i.host===e.host&&(t||i.port===e.port)))(new URL(lt.origin),lt.navigator&&/(msie|trident)/i.test(lt.navigator.userAgent)):()=>!0,Yh=lt.hasStandardBrowserEnv?{write(i,t,e,s,n,r){const a=[i+"="+encodeURIComponent(t)];A.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),A.isString(s)&&a.push("path="+s),A.isString(n)&&a.push("domain="+n),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(i){const t=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Xh(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function Uh(i,t){return t?i.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):i}function fr(i,t,e){let s=!Xh(t);return i&&(s||e==!1)?Uh(i,t):t}const dr=i=>i instanceof Rt?{...i}:i;function ge(i,t){t=t||{};const e={};function s(c,l,u,f){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge.call({caseless:f},c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function n(c,l,u,f){if(A.isUndefined(l)){if(!A.isUndefined(c))return s(void 0,c,u,f)}else return s(c,l,u,f)}function r(c,l){if(!A.isUndefined(l))return s(void 0,l)}function a(c,l){if(A.isUndefined(l)){if(!A.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,u){if(u in t)return s(c,l);if(u in i)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l,u)=>n(dr(c),dr(l),u,!0)};return A.forEach(Object.keys(Object.assign({},i,t)),function(l){const u=h[l]||n,f=u(i[l],t[l],l);A.isUndefined(f)&&u!==o||(e[l]=f)}),e}const mr=i=>{const t=ge({},i);let{data:e,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:r,headers:a,auth:o}=t;t.headers=a=Rt.from(a),t.url=ir(fr(t.baseURL,t.url,t.allowAbsoluteUrls),i.params,i.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let h;if(A.isFormData(e)){if(lt.hasStandardBrowserEnv||lt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((h=a.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...l].join("; "))}}if(lt.hasStandardBrowserEnv&&(s&&A.isFunction(s)&&(s=s(t)),s||s!==!1&&Fh(t.url))){const c=n&&r&&Yh.read(r);c&&a.set(n,c)}return t},Vh=typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(e,s){const n=mr(i);let r=n.data;const a=Rt.from(n.headers).normalize();let{responseType:o,onUploadProgress:h,onDownloadProgress:c}=n,l,u,f,m,g;function _(){m&&m(),g&&g(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let E=new XMLHttpRequest;E.open(n.method.toUpperCase(),n.url,!0),E.timeout=n.timeout;function b(){if(!E)return;const y=Rt.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),P={data:!o||o==="text"||o==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:y,config:i,request:E};cr(function(L){e(L),_()},function(L){s(L),_()},P),E=null}"onloadend"in E?E.onloadend=b:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(b)},E.onabort=function(){E&&(s(new F("Request aborted",F.ECONNABORTED,i,E)),E=null)},E.onerror=function(){s(new F("Network Error",F.ERR_NETWORK,i,E)),E=null},E.ontimeout=function(){let w=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const P=n.transitional||rr;n.timeoutErrorMessage&&(w=n.timeoutErrorMessage),s(new F(w,P.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,i,E)),E=null},r===void 0&&a.setContentType(null),"setRequestHeader"in E&&A.forEach(a.toJSON(),function(w,P){E.setRequestHeader(P,w)}),A.isUndefined(n.withCredentials)||(E.withCredentials=!!n.withCredentials),o&&o!=="json"&&(E.responseType=n.responseType),c&&([f,g]=gs(c,!0),E.addEventListener("progress",f)),h&&E.upload&&([u,m]=gs(h),E.upload.addEventListener("progress",u),E.upload.addEventListener("loadend",m)),(n.cancelToken||n.signal)&&(l=y=>{E&&(s(!y||y.type?new Ie(null,i,E):y),E.abort(),E=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const S=Oh(n.url);if(S&&lt.protocols.indexOf(S)===-1){s(new F("Unsupported protocol "+S+":",F.ERR_BAD_REQUEST,i));return}E.send(r||null)})},Gh=(i,t)=>{const{length:e}=i=i?i.filter(Boolean):[];if(t||e){let s=new AbortController,n;const r=function(c){if(!n){n=!0,o();const l=c instanceof Error?c:this.reason;s.abort(l instanceof F?l:new Ie(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,r(new F(`timeout ${t} of ms exceeded`,F.ETIMEDOUT))},t);const o=()=>{i&&(a&&clearTimeout(a),a=null,i.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),i=null)};i.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>A.asap(o),h}},qh=function*(i,t){let e=i.byteLength;if(!t||e<t){yield i;return}let s=0,n;for(;s<e;)n=s+t,yield i.slice(s,n),s=n},Hh=async function*(i,t){for await(const e of jh(i))yield*qh(e,t)},jh=async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}const t=i.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},gr=(i,t,e,s)=>{const n=Hh(i,t);let r=0,a,o=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await n.next();if(c){o(),h.close();return}let u=l.byteLength;if(e){let f=r+=u;e(f)}h.enqueue(new Uint8Array(l))}catch(c){throw o(c),c}},cancel(h){return o(h),n.return()}},{highWaterMark:2})},ps=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",pr=ps&&typeof ReadableStream=="function",Wh=ps&&(typeof TextEncoder=="function"?(i=>t=>i.encode(t))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),yr=(i,...t)=>{try{return!!i(...t)}catch{return!1}},$h=pr&&yr(()=>{let i=!1;const t=new Request(lt.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!t}),wr=64*1024,wi=pr&&yr(()=>A.isReadableStream(new Response("").body)),ys={stream:wi&&(i=>i.body)};ps&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ys[t]&&(ys[t]=A.isFunction(i[t])?e=>e[t]():(e,s)=>{throw new F(`Response type '${t}' is not supported`,F.ERR_NOT_SUPPORT,s)})})})(new Response);const Jh=async i=>{if(i==null)return 0;if(A.isBlob(i))return i.size;if(A.isSpecCompliantForm(i))return(await new Request(lt.origin,{method:"POST",body:i}).arrayBuffer()).byteLength;if(A.isArrayBufferView(i)||A.isArrayBuffer(i))return i.byteLength;if(A.isURLSearchParams(i)&&(i=i+""),A.isString(i))return(await Wh(i)).byteLength},Zh=async(i,t)=>{const e=A.toFiniteNumber(i.getContentLength());return e??Jh(t)},xi={http:yh,xhr:Vh,fetch:ps&&(async i=>{let{url:t,method:e,data:s,signal:n,cancelToken:r,timeout:a,onDownloadProgress:o,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:f}=mr(i);c=c?(c+"").toLowerCase():"text";let m=Gh([n,r&&r.toAbortSignal()],a),g;const _=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let E;try{if(h&&$h&&e!=="get"&&e!=="head"&&(E=await Zh(l,s))!==0){let P=new Request(t,{method:"POST",body:s,duplex:"half"}),M;if(A.isFormData(s)&&(M=P.headers.get("content-type"))&&l.setContentType(M),P.body){const[L,U]=lr(E,gs(ur(h)));s=gr(P.body,wr,L,U)}}A.isString(u)||(u=u?"include":"omit");const b="credentials"in Request.prototype;g=new Request(t,{...f,signal:m,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:b?u:void 0});let S=await fetch(g);const y=wi&&(c==="stream"||c==="response");if(wi&&(o||y&&_)){const P={};["status","statusText","headers"].forEach(G=>{P[G]=S[G]});const M=A.toFiniteNumber(S.headers.get("content-length")),[L,U]=o&&lr(M,gs(ur(o),!0))||[];S=new Response(gr(S.body,wr,L,()=>{U&&U(),_&&_()}),P)}c=c||"text";let w=await ys[A.findKey(ys,c)||"text"](S,i);return!y&&_&&_(),await new Promise((P,M)=>{cr(P,M,{data:w,headers:Rt.from(S.headers),status:S.status,statusText:S.statusText,config:i,request:g})})}catch(b){throw _&&_(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,i,g),{cause:b.cause||b}):F.from(b,b&&b.code,i,g)}})};A.forEach(xi,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const xr=i=>`- ${i}`,Kh=i=>A.isFunction(i)||i===null||i===!1,br={getAdapter:i=>{i=A.isArray(i)?i:[i];const{length:t}=i;let e,s;const n={};for(let r=0;r<t;r++){e=i[r];let a;if(s=e,!Kh(e)&&(s=xi[(a=String(e)).toLowerCase()],s===void 0))throw new F(`Unknown adapter '${a}'`);if(s)break;n[a||"#"+r]=s}if(!s){const r=Object.entries(n).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
4
4
  `+r.map(xr).join(`
5
5
  `):" "+xr(r[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:xi};function bi(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Ie(null,i)}function Sr(i){return bi(i),i.headers=Rt.from(i.headers),i.data=yi.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),br.getAdapter(i.adapter||gi.adapter)(i).then(function(s){return bi(i),s.data=yi.call(i,i.transformResponse,s),s.headers=Rt.from(s.headers),s},function(s){return hr(s)||(bi(i),s&&s.response&&(s.response.data=yi.call(i,i.transformResponse,s.response),s.response.headers=Rt.from(s.response.headers))),Promise.reject(s)})}const vr="1.8.4",ws={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{ws[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const Tr={};ws.transitional=function(t,e,s){function n(r,a){return"[Axios v"+vr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new F(n(a," has been removed"+(e?" in "+e:"")),F.ERR_DEPRECATED);return e&&!Tr[a]&&(Tr[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}},ws.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Qh(i,t,e){if(typeof i!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new F("option "+r+" must be "+h,F.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new F("Unknown option "+r,F.ERR_BAD_OPTION)}}const xs={assertOptions:Qh,validators:ws},Xt=xs.validators;class bs{constructor(t){this.defaults=t,this.interceptors={request:new nr,response:new nr}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const r=n.stack?n.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ge(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&xs.assertOptions(s,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),n!=null&&(A.isFunction(n)?e.paramsSerializer={serialize:n}:xs.assertOptions(n,{encode:Xt.function,serialize:Xt.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),xs.assertOptions(e,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],g=>{delete r[g]}),e.headers=Rt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(e)===!1||(h=h&&_.synchronous,o.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let l,u=0,f;if(!h){const g=[Sr.bind(this),void 0];for(g.unshift.apply(g,o),g.push.apply(g,c),f=g.length,l=Promise.resolve(e);u<f;)l=l.then(g[u++],g[u++]);return l}f=o.length;let m=e;for(u=0;u<f;){const g=o[u++],_=o[u++];try{m=g(m)}catch(E){_.call(this,E);break}}try{l=Sr.call(this,m)}catch(g){return Promise.reject(g)}for(u=0,f=c.length;u<f;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=ge(this.defaults,t);const e=fr(t.baseURL,t.url,t.allowAbsoluteUrls);return ir(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){bs.prototype[t]=function(e,s){return this.request(ge(s||{},{method:t,url:e,data:(s||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ge(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}bs.prototype[t]=e(),bs.prototype[t+"Form"]=e(!0)});const Ss=bs;class Si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ie(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Si(function(n){t=n}),cancel:t}}}const tc=Si;function ec(i){return function(e){return i.apply(null,e)}}function sc(i){return A.isObject(i)&&i.isAxiosError===!0}const vi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vi).forEach(([i,t])=>{vi[t]=i});const ic=vi;function _r(i){const t=new Ss(i),e=Vn(Ss.prototype.request,t);return A.extend(e,Ss.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return _r(ge(i,n))},e}const tt=_r(gi);tt.Axios=Ss,tt.CanceledError=Ie,tt.CancelToken=tc,tt.isCancel=hr,tt.VERSION=vr,tt.toFormData=fs,tt.AxiosError=F,tt.Cancel=tt.CanceledError,tt.all=function(t){return Promise.all(t)},tt.spread=ec,tt.isAxiosError=sc,tt.mergeConfig=ge,tt.AxiosHeaders=Rt,tt.formToJSON=i=>ar(A.isHTMLForm(i)?new FormData(i):i),tt.getAdapter=br.getAdapter,tt.HttpStatusCode=ic,tt.default=tt;const nc=tt,Er=window.crypto.subtle;Er||console.warn("Crypto API not supported");async function Mr(i,t="SHA-256"){const e=await Er.digest(t,v.getUint8ArrayFromString(i));return v.getStringFromArrayBuffer(e)}async function Pr(i,t="SHA-256"){const e=JSON.stringify(v.getSortedObjectString(i));return Mr(e,t)}var rc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,oc=(i,t,e,s)=>{for(var n=s>1?void 0:s?ac(t,e):t,r=i.length-1,a;r>=0;r--)(a=i[r])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&rc(t,e,n),n};class Ti{instance;constructor(t){this.instance=nc.create(t);const e=new Cr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>s?s.status==200?(await e.confirmRequest(s.config),s):Promise.reject(s):Promise.reject("axios response is undefined! maybe config.interceptor is NOT set return value!"),async s=>Promise.reject(s))}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}oc([v.Cache(6e4),v.Retry(3)],Ti.prototype,"request",1);class Cr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await Pr({url:e,method:s,params:n,data:r})}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const _i=i=>new XMLSerializer().serializeToString(i),hc=(i,t="text/html")=>new DOMParser().parseFromString(i,t),Ir=(i,t=v.MIMEEnum.SVG,e=v.EncodeEnum.utf8)=>v.toBlob(_i(i),t,e);async function Ei(i=["*"],t){if(!document||!(document instanceof Document))throw new Error("This is not a browser environment");let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",i.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",n=>{s.value=""},!1),new Promise((n,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):n(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(n=>(s.remove(),n)).catch(n=>{throw s.remove(),n})}function Xe(i,t=v.ReadInBrowserEnum.text,e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case v.ReadInBrowserEnum.dataURL:r.readAsDataURL(i);break;case v.ReadInBrowserEnum.binaryString:r.readAsBinaryString(i);break;case v.ReadInBrowserEnum.arraybuffer:r.readAsArrayBuffer(i);break;case v.ReadInBrowserEnum.text:default:r.readAsText(i)}})}async function cc(i){const t=await Xe(i,v.ReadInBrowserEnum.arraybuffer);return v.getFileTypeFromArrayBuffer(t)}const lc=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function uc(i){switch(i.toLowerCase()){case"jpg":case"jpeg":return v.MIMEEnum.JPEG;case"gif":return v.MIMEEnum.GIF;case"svg":return v.MIMEEnum.SVG;case"pdf":return v.MIMEEnum.PDF;case"png":default:return v.MIMEEnum.PNG}}function Ar(i,t,e,s,n,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Ar(i,t,e,s,n,a,Math.min(a+n,s.size));else return i(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function kr(i,t=1048576){return await new Promise((e,s)=>Ar(e,s,new Do.ArrayBuffer,i,t,0,Math.min(t,i.size)))}class fc{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Ti({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await kr(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{v.increaseTime(this.time,1),this.onTime?.(v.formatTimeOverflow(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}function Mi(){return new Date().getTime()}function Pi(i,t){t=Math.max(t||0,0);function e(n){return v.hasSymbol(n,v.SYMBOL_TIMESTAMP)?{...n,[v.SYMBOL_TIMESTAMP]:Mi()}:{v:n,[v.SYMBOL_TIMESTAMP]:Mi()}}let s=e(i);return{get:()=>{let n;return(!t||s[v.SYMBOL_TIMESTAMP]+t*1e3>=Mi())&&(n=s.v),{value:n?s:void 0,rawValue:n}},set:n=>s=e(n)}}function dc(i,t){const e=v.ref(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${i}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return v.watchEffect(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),n=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=i+"="+encodeURIComponent(e.value)+s+n+r+a}}),{get:()=>e.value,set:s=>e.value=s}}function mc(){const i=document.cookie.split("; ");for(let t=0;t<i.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(i[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",n=location.pathname.split("/");for(document.cookie=s+"/";n.length>0;)document.cookie=s+n.join("/"),n.pop();e.shift()}}}function Dr(i,t){const e=typeof i=="string"?i:i.toString();let s=t?.initValue;if(!s)try{s=v.parse(window.localStorage.getItem(e)||"")}catch{s=""}const{get:n,set:r}=Pi(s,t?.aliveInSeconds),a=v.ref(n().value);return v.watchEffect(()=>{if(a.value)try{window.localStorage.setItem(e,v.stringify(a.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const o=n();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function gc(){window.localStorage.clear()}function pc(i,t){const e=typeof i=="string"?i:i.toString();let s=t?.initValue;if(!s)try{s=v.parse(window.sessionStorage.getItem(e)||"")}catch{s=""}const{get:n,set:r}=Pi(s,t?.aliveInSeconds),a=v.ref(n().value);return v.watchEffect(()=>{if(a.value)try{window.sessionStorage.setItem(e,v.stringify(a.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const o=n();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function yc(){window.sessionStorage.clear()}function wc(i,t){let e;return i.objectStoreNames.contains(t)||(e=i.createObjectStore(t,{keyPath:"id"})),e}function xc(i,t=1,e){return new Promise((s,n)=>{let r;const a=window.indexedDB.open(i,t);a.onerror=()=>{n("无法使用IndexDB!")},a.onsuccess=o=>{r=o.target.result,wc(r,e),s(r)}})}function bc(i,t,e={id:1,name:"xxx"}){return new Promise((s,n)=>{const r=i.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=o=>{s(o)},r.onerror=o=>{n(o)}})}function N(i,t,e,s=!1){const n=async r=>{await e(r)};try{i.addEventListener(t,n,s)}catch{i.attachEvent("on"+t,n)}return()=>{try{i.removeEventListener(t,n,s)}catch{i.detachEvent("on"+t,n)}}}const Sc=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],vc=["keydown","keyup","keypress"],Tc=["touchstart","touchend","touchcancel","touchmove"],_c=["pointerdown","pointerup","pointercancel","pointermove"],Ec=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Mc=["change"];function Pc(i,t,e={bubbles:!0,detail:{}}){if(!i)return;let s;try{Sc.includes(t)?s=new MouseEvent(t,e):vc.includes(t)?s=new KeyboardEvent(t,e):Tc.includes(t)?s=new TouchEvent(t,e):_c.includes(t)?s=new PointerEvent(t,e):Ec.includes(t)?s=new DragEvent(t,e):Mc.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(i.dispatchEvent)i.dispatchEvent(s);else if(i.fireEvent&&document.createEventObject)i.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function Cc(i,t){const e=i.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function ie(i){i.preventDefault&&i.preventDefault();try{i.returnValue=!1}catch{}}function Rr(i){i.stopPropagation&&i.stopPropagation();try{i.cancelBubble=!0}catch{}}function Ic(i,t){let e=document.createElement(i);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}function Ac(i){if(document.implementation.hasFeature("MouseEvents","2.0"))return i.button;switch(i.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const vs=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(i)?t="iOS":/android/i.test(i)?t="Android":/BlackBerry/i.test(i)?t="BlackBerry":/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()};function kc(i=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(i)){const e=i.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(i)){const e=i.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Dc(i,t){const e=i.split("."),s=t.split(".");for(let n=0,r=e.length;n<r;n++){if(s.length==n)return 1;if(e[n]!=s[n])return e[n]>s[n]?1:-1}return e.length!=s.length?-1:0}function Ci(){const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()}const Rc=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function Lc(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function zc(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Ii(){return vs()==="ios"}function Ai(){return vs()==="macos"}function Oc(){return Ii()|Ai()}function Lr(){return vs()==="android"}function Bc(){return Ii()||Lr()}function zr(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const Nc=zr()!==-1,Fc=document.documentMode?document.documentMode===9:!1,Yc=document.documentMode?document.documentMode===10:!1,Xc=document.documentMode?document.documentMode===11:!1;function Or(){return Ci()==="wechat"}function Br(){return Ci()==="ali"}function Uc(){return Or()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Vc(){return Br()&&navigator.userAgent.match(/miniprogram/i)}const Gc=typeof document<"u",Nr=typeof window<"u",qc=typeof history<"u",Hc=Nr&&window.File&&window.FileReader&&window.FileList&&window.Blob,Fr=(()=>!!(v.root.Worker&&v.root.Blob&&v.root.Promise&&v.root.OffscreenCanvas&&v.root.OffscreenCanvasRenderingContext2D&&v.root.HTMLCanvasElement&&v.root.HTMLCanvasElement.prototype.transferControlToOffscreen&&v.root.URL&&v.root.URL.createObjectURL))(),jc=typeof Path2D=="function"&&typeof DOMMatrix=="function",Yr=function(){if(!v.root.OffscreenCanvas)return!1;const i=new OffscreenCanvas(1,1),t=i.getContext("2d");t.fillRect(0,0,1,1);const e=i.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),Wc=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},$c="webkit moz ms o".split(" ");function Ts(i){return typeof i=="function"&&/native code/.test(i.toString())}function Jc(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}(function(){if(!window.requestAnimationFrame){let i=v.now();window.requestAnimationFrame=function(t){const e=v.now(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();function ki(i){let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function Di(i,t=0){if(t==0)return i(v.now()),()=>{};{const e=v.now();return ki(s=>s-e>=t?(i(s),!1):!0)}}function Zc(i,t=0){let e=!1,s=0;const n=v.now(),r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t<=o),Di(r,Math.max(0,t-o))};return Di(r,t),()=>{e=!0}}function Kc(i,t=20){const e=1e3/t;let s=0,n;return()=>(v.now()-s>=e&&(s=v.now(),n=i()),n)}window.requestIdleCallback=window.requestIdleCallback||function(i,t){const e=v.now();return setTimeout(function(){i({didTimeout:v.now()-e>50,timeRemaining:()=>Math.max(0,50-(v.now()-e))})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(i){clearTimeout(i)};function Xr(i,t){requestIdleCallback(e=>{e.timeRemaining()>0||t?i():Xr(i,t)},{timeout:t})}const Ri=new v.CacheMap;let Li=!1;function zi(i,t,e){i&&t&&Ri.set(i,{cb:t,startTime:v.now(),timeout:e}),!Li&&(Li=!0,tl(s=>{Li=!1;let n=s.timeRemaining();Ri.filter((r,a)=>{let o=!1;const h=v.now();(n>0||a.timeout&&v.now()-a.startTime>=a.timeout)&&(a.cb(),o=!0);const c=v.now();return n-=c-h,!o}),Ri.length>0&&zi()}))}let _s=0,pe=33,ne=33,Oi;const Ur=new MessageChannel,Qc=Ur.port2;Ur.port1.onmessage=i=>{Oi!==null&&Oi({didTimeout:_s<=v.now(),timeRemaining:()=>Math.max(0,_s-v.now())})};function tl(i){return Oi=i,requestAnimationFrame(t=>{let e=t-_s+ne;e<ne&&pe<ne?(e<8&&(e=8),ne=e<pe?pe:e):e>ne&&pe>ne?ne=e<pe?pe:e:pe=e,_s=t+ne,Qc.postMessage(null)})}function el(i){if(typeof setImmediate<"u"&&Ts(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(Ts(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&Ts(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function sl(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class Ue{static _nextId=0;static nextId(){return Ue._nextId++}}const O={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-O.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?O.Bounce.In(i*2)*.5:O.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function Vr(i){switch(i){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return i}}const il=4,nl=.001,rl=1e-7,al=10,Ve=11,Es=1/(Ve-1),ol=typeof Float32Array=="function";function Gr(i,t){return 1-3*t+3*i}function qr(i,t){return 3*t-6*i}function Hr(i){return 3*i}function Ms(i,t,e){return((Gr(t,e)*i+qr(t,e))*i+Hr(t))*i}function jr(i,t,e){return 3*Gr(t,e)*i*i+2*qr(t,e)*i+Hr(t)}function hl(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=Ms(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>rl&&++o<al);return a}function cl(i,t,e,s){for(let n=0;n<il;++n){const r=jr(t,e,s);if(r===0)return t;const a=Ms(t,e,s)-i;t-=a/r}return t}function ll(i){return i}function Bi(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return ll;const n=ol?new Float32Array(Ve):new Array(Ve);for(let a=0;a<Ve;++a)n[a]=Ms(a*Es,i,e);function r(a){let o=0,h=1;const c=Ve-1;for(;h!==c&&n[h]<=a;++h)o+=Es;--h;const l=(a-n[h])/(n[h+1]-n[h]),u=o+l*Es,f=jr(u,i,e);return f>=nl?cl(a,u,i,e):f===0?u:hl(a,o,o+Es,i,e)}return a=>a===0||a===1?a:Ms(r(a),t,s)}function Ni(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Wr(i){const[t,e,s,n]=Ni(i);return[1-s,1-n,1-t,1-e]}function ul(i){return Bi(...Ni(i))}function fl(i){return Bi(...Wr(i))}const Ht={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Ht.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Ht.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Ht.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Ht.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};class $r{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=v.now(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const Mt=new $r;class Fi{constructor(t,e=Mt){this._object=t,this._group=e}_id=Ue.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=O.Linear.None;_interpolationFunction=Ht.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=v.now()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=v.now()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=v.now()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=Mt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=O.Linear.None){return this._easingFunction=t,this}interpolation(t=Ht.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=v.now(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const dl=Ue.nextId,ml=Mt.getAll.bind(Mt),gl=Mt.removeAll.bind(Mt),pl=Mt.add.bind(Mt),yl=Mt.remove.bind(Mt),wl=Mt.update.bind(Mt),xl={now:v.now,Sequence:Ue,Easing:O,Interpolation:Ht,Group:$r,Tween:Fi,nextId:dl,getAll:ml,removeAll:gl,add:pl,remove:yl,update:wl};class Yi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=v.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=v.now();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Ps{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){v.ShellSort(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.fromValues={...n.fromValues},n.toValues={...n.toValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||O.Linear.None,interpolationFunction:s?.interpolationFunction||Ht.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Yi,s=this.frameDuration;return new Promise(n=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ki(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new Fi({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),v.deleteArrayItem(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),n()),a})})}isPaused=!1;pausedClock=new Yi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Vr(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Cs=new v.CacheMap,Jr=(i=!0)=>{Cs.filter((t,e)=>(e.alternate&&(Ws(e,e.alternate),i&&Cs.set(t,e.alternate),e.alternate=void 0),i))};function Xi(i){let t=Cs.get(i);return t||(t=js(i),Cs.set(i,t)),t}function Zr(i){const t=Xi(i);return t.alternate||(t.alternate=js(i)),t.alternate}function bl(i,t,e=!0){t(Zr(i)),Jr(e)}function Ui(i,t,e=!0){t(Zr(i)),zi("FLUSH_DOM_ACTION",()=>Jr(e),50)}function Y(i){return i*Math.PI/180}function ut(i){return i*180/Math.PI}function Is(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function As(i,t,e,s){return Is(e-i,s-t)}function ks(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function re(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function Pt(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function Sl(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function vl(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=ut(re(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Kr=Tl("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Tl(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function dt(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function Ds(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function _l(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function El(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Ge={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class Rs{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",dt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class Vi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class qe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Ge);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Ge[n].canvas}}__getStyleState(){const t={},e=Object.keys(Ge);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Ge);for(let r=0;r<n.length;r++){const a=Ge[n[r]],o=this[n[r]];if(a.apply){if(o instanceof Vi){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,dt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Rs)e.setAttribute(a.apply,dt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,dt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Kr);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Kr[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(dt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(dt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(dt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(dt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(dt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(dt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(dt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(dt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(dt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),f=this.normalize([h[0]+c[0],h[1]+c[1]]),m=r/Math.sin(u/2),g=t+m*f[0],_=e+m*f[1],E=[-h[1],h[0]],b=[c[1],-c[0]],S=function(P){const M=P[0];return P[1]>=0?Math.acos(M):-Math.acos(M)},y=S(E),w=S(b);this.lineTo(g+E[0]*r,_+E[1]*r),this.arc(g,_,r,y,w)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:Ds(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Rs(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:Ds(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Rs(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":_l(this.textAlign),"dominant-baseline":El(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),u=a?0:1;let f=0,m=r-n;m<0&&(m+=2*Math.PI),a?f=m>Math.PI?0:1:f=m>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(dt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:f,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=Ds(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",dt("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,u,f,m,g,_,E;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const b=this.__closestGroupOrSvg();this.__currentElement;const S="translate("+s+", "+n+")";if(e instanceof qe){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(f=u.childNodes[0];f.childNodes.length;)E=f.childNodes[0].getAttribute("id"),this.__ids[E]=E,this.__SVGdefs.appendChild(f.childNodes[0]);if(m=u.childNodes[1],m){const y=m.getAttribute("transform");let w;y?w=y+" "+S:w=S,m.setAttribute("transform",w),b.appendChild(m)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(g=this.__createElement("image"),g.setAttribute("width",r),g.setAttribute("height",a),g.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(_=this.__document.createElement("canvas"),_.width=r,_.height=a,_.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=_),g.setAttribute("transform",S),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),b.appendChild(g))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=Ds(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof qe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Vi(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Ls{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new qe({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}let zs=class{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=re(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const Qr=zs;class Gi extends zs{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,u=(t-s)/2,f=(e-n)/2,m=Math.cos(l)*u+Math.sin(l)*f,g=-Math.sin(l)*u+Math.cos(l)*f,_=m*m/(r*r)+g*g/(a*a);if(_>1){const $=Math.sqrt(_);throw r=$*r,a=$*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const E=Math.sqrt((r*r*a*a-r*r*g*g-a*a*m*m)/(r*r*g*g+a*a*m*m)),b=h!=c?1:-1,S=b*E*r*g/a,y=b*E*-a*m/r,w=(t+s)/2,P=(e+n)/2,M=Math.cos(l)*S-Math.sin(l)*y+w,L=Math.sin(l)*S+Math.cos(l)*y+P,U=($,K,ht,it)=>($*it>=K*ht?1:-1)*Math.acos(($*ht+K*it)/(Math.sqrt($*$+K*K)*Math.sqrt(ht*ht+it*it))),G=U(1,0,t-M,e-L)-l,W=U(t-M,e-L,s-M,n-L);return[M,L,r,a,l,G,G+W]}}class Ml extends zs{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Pl=Ml;class pt extends zs{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));const l=[],u=c.length;for(let g=0;g<u;g++){for(let _=g+1;_<u;_++)c[g].X===c[_].X&&c[g].Y===c[_].Y&&(_=++g);l.push({X:c[g].X,Y:c[g].Y})}const f={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},m={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:f.x,y:f.y,width:m.x-f.x,height:m.y-f.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let m=0;for(let g=0;g<12;g++){const _=l*u[g]+l,E=this.base3(_,t,s,r,o),b=this.base3(_,e,n,a,h);m+=f[g]*Math.sqrt(E*E+b*b)}return l*m}length(t=1){return pt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||pt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;const l=1;let u=l/2,f=l-u,m=pt.bezlen(e,s,n,r,a,o,h,c,f);for(;Math.abs(m-t)>.01;)u/=2,f+=(m<t?1:-1)*u,m=pt.bezlen(e,s,n,r,a,o,h,c,f);return f}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),f=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),m=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),g=s*this.x+e*this.c1x,_=s*this.y+e*this.c1y,E=s*this.c2x+e*this.toX,b=s*this.c2y+e*this.toY,S=90-Math.atan2(l-f,u-m)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:f,y:m},start:{x:g,y:_},end:{x:E,y:b},alpha:S}}}const He=Math.PI*2;function ta(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function Cl(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,u=-h*(i-e)/2+c*(t-s)/2,f=a*a,m=o*o,g=l*l,_=u*u;let E=f*m-f*_-m*g;E<0&&(E=0),E/=f*_+m*g,E=Math.sqrt(E)*(n===r?-1:1);const b=E*a/o*u,S=E*-o/a*l,y=c*b-h*S+(i+e)/2,w=h*b+c*S+(t+s)/2,P=(l-b)/a,M=(u-S)/o,L=(-l-b)/a,U=(-u-S)/o,G=ta(1,0,P,M);let W=ta(P,M,L,U);return r===0&&W>0&&(W-=He),r===1&&W<0&&(W+=He),[y,w,G,W]}function Il(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function ea(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*He/360),l=Math.cos(h*He/360),u=l*(i-e)/2+c*(t-s)/2,f=-c*(i-e)/2+l*(t-s)/2;if(u===0&&f===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const m=u*u/(a*a)+f*f/(o*o);m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m));const g=Cl(i,t,e,s,n,r,a,o,c,l),_=[];let E=g[2],b=g[3];const S=Math.max(Math.ceil(Math.abs(b)/(He/4)),1);b/=S;for(let y=0;y<S;y++)_.push(Il(E,b)),E+=b;return _.map(y=>{for(let w=0;w<y.length;w+=2){let P=y[w+0],M=y[w+1];P*=a,M*=o;const L=l*P-c*M,U=c*P+l*M;y[w+0]=L+g[0],y[w+1]=U+g[1]}return y})}function qi(i,t,e,s,n,r){return[i/3+.6666666666666666*e,t/3+.6666666666666666*s,n/3+.6666666666666666*e,r/3+.6666666666666666*s,n,r]}function je(i,t,e,s){return[i,t,e,s,e,s]}const We={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ye{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&oe(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||v.generateUUID()})}static downloadFromSVGElement(t,e="shape"){return _n(Ir(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return _n(v.toBlob(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return _i(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return ye.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=v.extractAllNumbers(r);for(a=="m"&&o.length>We[a]&&(e.push([n,...o.splice(0,We[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<We[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,We[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,u;for(let f=0,m=t.length;f<m;f++){let g=t[f];const _=g[0];switch(_){case"M":s=g[1],n=g[2];break;case"A":const E=ea(r,a,g[6],g[7],g[4],g[5],g[1],g[2],g[3]);if(!E.length)continue;E.forEach((y,w)=>{const[P,M,L,U,G,W,$,K]=y;g=["C",L,U,G,W,$,K],w<E.length-1&&e.push(g)});break;case"S":let b=r,S=a;(u=="C"||u=="S")&&(b+=b-c,S+=S-l),g=["C",b,S,g[1],g[2],g[3],g[4]];break;case"T":u=="Q"||u=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),g=["C",...qi(r,a,o,h,g[1],g[2])];break;case"Q":o=g[1],h=g[2],g=["C",...qi(r,a,g[1],g[2],g[3],g[4])];break;case"L":g=["C",...je(r,a,g[1],g[2])];break;case"H":g=["C",...je(r,a,g[1],a)];break;case"V":g=["C",...je(r,a,r,g[1])];break;case"Z":g=["C",...je(r,a,s,n)];break}u=_,r=g[g.length-2],a=g[g.length-1],g.length>4?(c=g[g.length-4],l=g[g.length-3]):(c=r,l=a),e.push(g)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const bt=ye;class St{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(bt.parseSVGPath(t),e):t instanceof St?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=bt.normalizeSVGPath(bt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new pt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new St;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new pt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new St;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof Gi){ea(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,f,m,g,_,E,b]=c;this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:f,c1y:m,c2x:g,c2y:_,toX:E,toY:b})),this.prevPathX=E,this.prevPathY=b});return}let e,s,n,r,a,o;t instanceof pt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Pl?[e,s,n,r,a,o]=qi(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=je(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return bt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new wt;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,u=r.c2y,f=r.toX,m=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:u}=t.transformPoint({x:l,y:u}),{x:f,y:m}=t.transformPoint({x:f,y:m}),n.push(new pt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:u,toX:f,toY:m}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new St;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,u=a.length;l<u;l++){const f=a[l],m=f.length();if(h+m>e&&!o){const g=f.getPointAtSegmentLength(e-h);if(c.appendLine(new pt({c1x:g.start.x,c1y:g.start.y,c2x:g.m.x,c2y:g.m.y,toX:g.x,toY:g.y})),s)return c;o=c,c.appendLine(new pt({c1x:g.n.x,c1y:g.n.y,c2x:g.end.x,c2y:g.end.y,toX:f.x,toY:f.y})),h+=m;continue}h+=m,c.appendLine(f)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){const l=this.getPointAtLength(c),u=ks(l.x,l.y,t,e);u<a&&(n=l,r=c,a=u)}for(o/=2;o>.5;){const c=r-o,l=this.getPointAtLength(c),u=ks(l.x,l.y,t,e),f=r+o,m=this.getPointAtLength(f),g=ks(m.x,m.y,t,e);c>=0&&u<a?(n=l,r=c,a=u):f<=s&&g<a?(n=m,r=f,a=g):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?re(h.x,h.y,n.x,n.y):re(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=As(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],u=e[o++],f=e[o++],m=e[o++];a.push(["C",h,c,l,u,f,m]);let g=0;for(;g<r&&n>0;)a.push(["C",f,m,f,m,f,m]),n-=6,g++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=v.maxDotNumber(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:St.fromPolymorphPoints(St.mixPoints(new St({d:t}).polymorphPoints,new St({d:e}).polymorphPoints,s)).toSVGPathData()}}const Al=St;class H extends v.EventBus{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=v.generateUUID(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=v.extractAllNumbers(s).reduce((n,r)=>n+r,0)}return v.reactive(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new St,v.watchEffect(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new wt;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new wt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Ls)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof Ls)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return v.newConstructor(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[v.toKebab(s),n]))):e&&(this.attrs[v.toKebab(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[v.toKebab(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[v.toKebab(t)]}distance(t){return As(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=ut(re(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=Pt(Y(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=Pt(Y(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=v.parseNumber(t?.gravity,0);this.vy+=e;const s=v.parseNumber(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=v.parseNumber(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=v.parseNumber(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=v.parseNumber(e?.springLength,100),n=v.parseNumber(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=v.maxDotNumber(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new Ps({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+v.maxDotNumber(o.offset,2)),r?.(o,h)}})),a.play()}}class $e extends H{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=zt(Y(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=zt(Y(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=zt(Y(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return Is(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}class Hi{_x;_y;_z;_w;constructor(t=0,e=0,s=0,n=1){this._x=t,this._y=e,this._z=s,this._w=n}static slerpFlat(t,e,s,n,r,a,o){let h=s[n+0],c=s[n+1],l=s[n+2],u=s[n+3];const f=r[a+0],m=r[a+1],g=r[a+2],_=r[a+3];if(o===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(o===1){t[e+0]=f,t[e+1]=m,t[e+2]=g,t[e+3]=_;return}if(u!==_||h!==f||c!==m||l!==g){let E=1-o;const b=h*f+c*m+l*g+u*_,S=b>=0?1:-1,y=1-b*b;if(y>Number.EPSILON){const P=Math.sqrt(y),M=Math.atan2(P,b*S);E=Math.sin(E*M)/P,o=Math.sin(o*M)/P}const w=o*S;if(h=h*E+f*w,c=c*E+m*w,l=l*E+g*w,u=u*E+_*w,E===1-o){const P=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=P,c*=P,l*=P,u*=P}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,s,n,r,a){const o=s[n],h=s[n+1],c=s[n+2],l=s[n+3],u=r[a],f=r[a+1],m=r[a+2],g=r[a+3];return t[e]=o*g+l*u+h*m-c*f,t[e+1]=h*g+l*f+c*u-o*m,t[e+2]=c*g+l*m+o*f-h*u,t[e+3]=l*g-o*u-h*f-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,s=this._z,n=this._w){return this._x=t,this._y=e,this._z=s,this._w=n,this._onChangeCallback(),this}clone(){return new Hi(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t.x,n=t.y,r=t.z,a=t.order,o=Math.cos,h=Math.sin,c=o(s/2),l=o(n/2),u=o(r/2),f=h(s/2),m=h(n/2),g=h(r/2);switch(a){case"XYZ":this._x=f*l*u+c*m*g,this._y=c*m*u-f*l*g,this._z=c*l*g+f*m*u,this._w=c*l*u-f*m*g;break;case"YXZ":this._x=f*l*u+c*m*g,this._y=c*m*u-f*l*g,this._z=c*l*g-f*m*u,this._w=c*l*u+f*m*g;break;case"ZXY":this._x=f*l*u-c*m*g,this._y=c*m*u+f*l*g,this._z=c*l*g+f*m*u,this._w=c*l*u-f*m*g;break;case"ZYX":this._x=f*l*u-c*m*g,this._y=c*m*u+f*l*g,this._z=c*l*g-f*m*u,this._w=c*l*u+f*m*g;break;case"YZX":this._x=f*l*u+c*m*g,this._y=c*m*u+f*l*g,this._z=c*l*g-f*m*u,this._w=c*l*u-f*m*g;break;case"XZY":this._x=f*l*u-c*m*g,this._y=c*m*u-f*l*g,this._z=c*l*g+f*m*u,this._w=c*l*u+f*m*g;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,n=Math.sin(s);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,s=e[0],n=e[4],r=e[8],a=e[1],o=e[5],h=e[9],c=e[2],l=e[6],u=e[10],f=s+o+u;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(l-h)*m,this._y=(r-c)*m,this._z=(a-n)*m}else if(s>o&&s>u){const m=2*Math.sqrt(1+s-o-u);this._w=(l-h)/m,this._x=.25*m,this._y=(n+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-s-u);this._w=(r-c)/m,this._x=(n+a)/m,this._y=.25*m,this._z=(h+l)/m}else{const m=2*Math.sqrt(1+u-s-o);this._w=(a-n)/m,this._x=(r+c)/m,this._y=(h+l)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(v.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const n=Math.min(1,e/s);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,n=t._y,r=t._z,a=t._w,o=e._x,h=e._y,c=e._z,l=e._w;return this._x=s*l+a*o+n*c-r*h,this._y=n*l+a*h+r*o-s*c,this._z=r*l+a*c+s*h-n*o,this._w=a*l-s*o-n*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,n=this._y,r=this._z,a=this._w;let o=a*t._w+s*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=s,this._y=n,this._z=r,this;const h=1-o*o;if(h<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*s+e*this._x,this._y=m*n+e*this._y,this._z=m*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),l=Math.atan2(c,o),u=Math.sin((1-e)*l)/c,f=Math.sin(e*l)/c;return this._w=a*u+this._w*f,this._x=s*u+this._x*f,this._y=n*u+this._y*f,this._z=r*u+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),n=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(n*Math.sin(t),n*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Je{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Je(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y;return this.x=t.m11*e+t.m21*s+t.m31,this.y=t.m12*e+t.m22*s+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=v.clamp(this.x,t.x,e.x),this.y=v.clamp(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=v.clamp(this.x,t,e),this.y=v.clamp(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(v.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return sa.copy(this).projectOnVector(t),this.sub(sa)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(v.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),n=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*s-a*n+t.x,this.y=r*n+a*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class vt{x=0;y=0;z=0;constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.z=s}set(t=0,e=0,s=0){return this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new vt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ia.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ia.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,n=this.z,r=t.value;return this.x=r[0]*e+r[3]*s+r[6]*n,this.y=r[1]*e+r[4]*s+r[7]*n,this.z=r[2]*e+r[5]*s+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,n=this.z,r=t.value,a=1/(r[3]*e+r[7]*s+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*n+r[12])*a,this.y=(r[1]*e+r[5]*s+r[9]*n+r[13])*a,this.z=(r[2]*e+r[6]*s+r[10]*n+r[14])*a,this}applyQuaternion(t){const e=this.x,s=this.y,n=this.z,r=t.x,a=t.y,o=t.z,h=t.w,c=2*(a*n-o*s),l=2*(o*e-r*n),u=2*(r*s-a*e);return this.x=e+h*c+a*u-o*l,this.y=s+h*l+o*c-r*u,this.z=n+h*u+r*l-a*c,this}transformDirection(t){const e=this.x,s=this.y,n=this.z,r=t.value;return this.x=r[0]*e+r[4]*s+r[8]*n,this.y=r[1]*e+r[5]*s+r[9]*n,this.z=r[2]*e+r[6]*s+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=v.clamp(this.x,t.x,e.x),this.y=v.clamp(this.y,t.y,e.y),this.z=v.clamp(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=v.clamp(this.x,t,e),this.y=v.clamp(this.y,t,e),this.z=v.clamp(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(v.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,n=t.y,r=t.z,a=e.x,o=e.y,h=e.z;return this.x=n*h-r*o,this.y=r*a-s*h,this.z=s*o-n*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Wi.copy(this).projectOnVector(t),this.sub(Wi)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Wi.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(v.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,n=this.z-t.z;return e*e+s*s+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),s=this.setFromMatrix4Column(t,1).length(),n=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=s,this.z=n,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class ji{x=0;y=0;z=0;w=1;constructor(t=0,e=0,s=0,n=1){this.x=t,this.y=e,this.z=s,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,s=0,n=1){return this.x=t,this.y=e,this.z=s,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new ji(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,n=this.z,r=this.w,a=t.value;return this.x=a[0]*e+a[4]*s+a[8]*n+a[12]*r,this.y=a[1]*e+a[5]*s+a[9]*n+a[13]*r,this.z=a[2]*e+a[6]*s+a[10]*n+a[14]*r,this.w=a[3]*e+a[7]*s+a[11]*n+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,s,n,r;const h=t.value,c=h[0],l=h[4],u=h[8],f=h[1],m=h[5],g=h[9],_=h[2],E=h[6],b=h[10];if(Math.abs(l-f)<.01&&Math.abs(u-_)<.01&&Math.abs(g-E)<.01){if(Math.abs(l+f)<.1&&Math.abs(u+_)<.1&&Math.abs(g+E)<.1&&Math.abs(c+m+b-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const y=(c+1)/2,w=(m+1)/2,P=(b+1)/2,M=(l+f)/4,L=(u+_)/4,U=(g+E)/4;return y>w&&y>P?y<.01?(s=0,n=.707106781,r=.707106781):(s=Math.sqrt(y),n=M/s,r=L/s):w>P?w<.01?(s=.707106781,n=0,r=.707106781):(n=Math.sqrt(w),s=M/n,r=U/n):P<.01?(s=.707106781,n=.707106781,r=0):(r=Math.sqrt(P),s=L/r,n=U/r),this.set(s,n,r,e),this}let S=Math.sqrt((E-g)*(E-g)+(u-_)*(u-_)+(f-l)*(f-l));return Math.abs(S)<.001&&(S=1),this.x=(E-g)/S,this.y=(u-_)/S,this.z=(f-l)/S,this.w=Math.acos((c+m+b-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=v.clamp(this.x,t.x,e.x),this.y=v.clamp(this.y,t.y,e.y),this.z=v.clamp(this.z,t.z,e.z),this.w=v.clamp(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=v.clamp(this.x,t,e),this.y=v.clamp(this.y,t,e),this.z=v.clamp(this.z,t,e),this.w=v.clamp(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(v.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const sa=new Je,Wi=new vt,ia=new Hi,Ze=2e3,$i=2001,na=[1,0,0,1],ra=[1,0,0,1,0,0],aa=[1,0,0,0,1,0,0,0,1],oa=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Ji{value;constructor(t=na){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,s=0,n=1){return this.m11=t,this.m21=e,this.m12=s,this.m22=n,this}identity(){return this.value=Array.from(na),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Ji(this.value)}fromArray(t,e=0){for(let s=0;s<4;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const s=t.value,n=e.value,r=this.value,a=s[0],o=s[2],h=s[1],c=s[3],l=n[0],u=n[2],f=n[1],m=n[3];return r[0]=a*l+o*f,r[2]=a*u+o*m,r[1]=h*l+c*f,r[3]=h*u+c*m,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class Ae{value;constructor(t=aa){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,s=0,n=0,r=1,a=0,o=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=n,l[2]=o,l[3]=e,l[4]=r,l[5]=h,l[6]=s,l[7]=a,l[8]=c,this}identity(){return this.value=Array.from(aa),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new Ae(this.value)}fromArray(t,e=0){for(let s=0;s<9;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const s=t.value,n=e.value,r=this.value,a=s[0],o=s[3],h=s[6],c=s[1],l=s[4],u=s[7],f=s[2],m=s[5],g=s[8],_=n[0],E=n[3],b=n[6],S=n[1],y=n[4],w=n[7],P=n[2],M=n[5],L=n[8];return r[0]=a*_+o*S+h*P,r[3]=a*E+o*y+h*M,r[6]=a*b+o*w+h*L,r[1]=c*_+l*S+u*P,r[4]=c*E+l*y+u*M,r[7]=c*b+l*w+u*L,r[2]=f*_+m*S+g*P,r[5]=f*E+m*y+g*M,r[8]=f*b+m*w+g*L,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}determinant(){const t=this.value,e=t[0],s=t[1],n=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-s*r*l+s*o*h+n*r*c-n*a*h}invert(){const t=this.value,e=t[0],s=t[1],n=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=l*a-o*c,f=o*h-l*r,m=c*r-a*h,g=e*u+s*f+n*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(n*c-l*s)*_,t[2]=(o*s-n*a)*_,t[3]=f*_,t[4]=(l*e-n*h)*_,t[5]=(n*r-o*e)*_,t[6]=m*_,t[7]=(s*h-c*e)*_,t[8]=(a*e-s*r)*_,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,n,r,a,o){const h=Math.cos(r),c=Math.sin(r);return this.set(s*h,s*c,-s*(h*a+c*o)+a+t,-n*c,n*h,-n*(-c*a+h*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Zi.makeScale(t,e)),this}rotate(t){return this.premultiply(Zi.makeRotation(-t)),this}translate(t,e){return this.premultiply(Zi.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class yt{value;is3dSpecial=!1;constructor(t=oa){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}set(t=1,e=0,s=0,n=0,r=0,a=1,o=0,h=0,c=0,l=0,u=1,f=0,m=0,g=0,_=0,E=1){const b=this.value;return b[0]=t,b[4]=e,b[8]=s,b[12]=n,b[1]=r,b[5]=a,b[9]=o,b[13]=h,b[2]=c,b[6]=l,b[10]=u,b[14]=f,b[3]=m,b[7]=g,b[11]=_,b[15]=E,this}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(oa),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new yt(this.value)}static fromString(t){const e=new yt,s=v.regMatchAll("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}fromArray(t,e=0){for(let s=0;s<16;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.value;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}copyPosition(t){const e=this.value,s=t.value;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),s.setFromMatrix4Column(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new wt(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>v.maxDotNumber(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=ut(v.clamp(Math.asin(-this.m13),-1,1));let r=ut(Math.atan2(this.m23,this.m33));Math.cos(Y(n))===0&&(r=ut(Math.atan2(-this.m31,this.m22)));let a=ut(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:ut(this.m14),skewY:ut(this.m24),skewZ:ut(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,s=t.value,n=1/ke.setFromMatrix4Column(t,0).length(),r=1/ke.setFromMatrix4Column(t,1).length(),a=1/ke.setFromMatrix4Column(t,2).length();return e[0]=s[0]*n,e[1]=s[1]*n,e[2]=s[2]*n,e[3]=0,e[4]=s[4]*r,e[5]=s[5]*r,e[6]=s[6]*r,e[7]=0,e[8]=s[8]*a,e[9]=s[9]*a,e[10]=s[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,s=t.x,n=t.y,r=t.z,a=Math.cos(s),o=Math.sin(s),h=Math.cos(n),c=Math.sin(n),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const f=a*l,m=a*u,g=o*l,_=o*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=m+g*c,e[5]=f-_*c,e[9]=-o*h,e[2]=_-f*c,e[6]=g+m*c,e[10]=a*h}else if(t.order==="YXZ"){const f=h*l,m=h*u,g=c*l,_=c*u;e[0]=f+_*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*l,e[9]=-o,e[2]=m*o-g,e[6]=_+f*o,e[10]=a*h}else if(t.order==="ZXY"){const f=h*l,m=h*u,g=c*l,_=c*u;e[0]=f-_*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*l,e[9]=_-f*o,e[2]=-a*c,e[6]=o,e[10]=a*h}else if(t.order==="ZYX"){const f=a*l,m=a*u,g=o*l,_=o*u;e[0]=h*l,e[4]=g*c-m,e[8]=f*c+_,e[1]=h*u,e[5]=_*c+f,e[9]=m*c-g,e[2]=-c,e[6]=o*h,e[10]=a*h}else if(t.order==="YZX"){const f=a*h,m=a*c,g=o*h,_=o*c;e[0]=h*l,e[4]=_-f*u,e[8]=g*u+m,e[1]=u,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=m*u+g,e[10]=f-_*u}else if(t.order==="XZY"){const f=a*h,m=a*c,g=o*h,_=o*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=f*u+_,e[5]=a*l,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*l,e[10]=_*u+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(kl,t,Dl)}lookAt(t,e,s){const n=this.value;return Tt.subVectors(t,e),Tt.lengthSq()===0&&(Tt.z=1),Tt.normalize(),ae.crossVectors(s,Tt),ae.lengthSq()===0&&(Math.abs(s.z)===1?Tt.x+=1e-4:Tt.z+=1e-4,Tt.normalize(),ae.crossVectors(s,Tt)),ae.normalize(),Os.crossVectors(Tt,ae),n[0]=ae.x,n[4]=Os.x,n[8]=Tt.x,n[1]=ae.y,n[5]=Os.y,n[9]=Tt.y,n[2]=ae.z,n[6]=Os.z,n[10]=Tt.z,this}multiplyMatrices(t,e){const s=t.value,n=e.value,r=this.value,a=s[0],o=s[4],h=s[8],c=s[12],l=s[1],u=s[5],f=s[9],m=s[13],g=s[2],_=s[6],E=s[10],b=s[14],S=s[3],y=s[7],w=s[11],P=s[15],M=n[0],L=n[4],U=n[8],G=n[12],W=n[1],$=n[5],K=n[9],ht=n[13],it=n[2],Bt=n[6],Et=n[10],It=n[14],Nt=n[3],z=n[7],R=n[11],X=n[15];return r[0]=a*M+o*W+h*it+c*Nt,r[4]=a*L+o*$+h*Bt+c*z,r[8]=a*U+o*K+h*Et+c*R,r[12]=a*G+o*ht+h*It+c*X,r[1]=l*M+u*W+f*it+m*Nt,r[5]=l*L+u*$+f*Bt+m*z,r[9]=l*U+u*K+f*Et+m*R,r[13]=l*G+u*ht+f*It+m*X,r[2]=g*M+_*W+E*it+b*Nt,r[6]=g*L+_*$+E*Bt+b*z,r[10]=g*U+_*K+E*Et+b*R,r[14]=g*G+_*ht+E*It+b*X,r[3]=S*M+y*W+w*it+P*Nt,r[7]=S*L+y*$+w*Bt+P*z,r[11]=S*U+y*K+w*Et+P*R,r[15]=S*G+y*ht+w*It+P*X,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this}determinant(){const t=this.value,e=t[0],s=t[4],n=t[8],r=t[12],a=t[1],o=t[5],h=t[9],c=t[13],l=t[2],u=t[6],f=t[10],m=t[14],g=t[3],_=t[7],E=t[11],b=t[15];return g*(+r*h*u-n*c*u-r*o*f+s*c*f+n*o*m-s*h*m)+_*(+e*h*m-e*c*f+r*a*f-n*a*m+n*c*l-r*h*l)+E*(+e*c*u-e*o*m-r*a*u+s*a*m+r*o*l-s*c*l)+b*(-n*o*l-e*h*u+e*o*f+n*a*u-s*a*f+s*h*l)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const n=this.value;return t instanceof vt?(n[12]=t.x,n[13]=t.y,n[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&(n[12]=t,n[13]=e,n[14]=s),this}invert(){const t=this.value,e=t[0],s=t[1],n=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=t[9],f=t[10],m=t[11],g=t[12],_=t[13],E=t[14],b=t[15],S=u*E*c-_*f*c+_*h*m-o*E*m-u*h*b+o*f*b,y=g*f*c-l*E*c-g*h*m+a*E*m+l*h*b-a*f*b,w=l*_*c-g*u*c+g*o*m-a*_*m-l*o*b+a*u*b,P=g*u*h-l*_*h-g*o*f+a*_*f+l*o*E-a*u*E,M=e*S+s*y+n*w+r*P;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/M;return t[0]=S*L,t[1]=(_*f*r-u*E*r-_*n*m+s*E*m+u*n*b-s*f*b)*L,t[2]=(o*E*r-_*h*r+_*n*c-s*E*c-o*n*b+s*h*b)*L,t[3]=(u*h*r-o*f*r-u*n*c+s*f*c+o*n*m-s*h*m)*L,t[4]=y*L,t[5]=(l*E*r-g*f*r+g*n*m-e*E*m-l*n*b+e*f*b)*L,t[6]=(g*h*r-a*E*r-g*n*c+e*E*c+a*n*b-e*h*b)*L,t[7]=(a*f*r-l*h*r+l*n*c-e*f*c-a*n*m+e*h*m)*L,t[8]=w*L,t[9]=(g*u*r-l*_*r-g*s*m+e*_*m+l*s*b-e*u*b)*L,t[10]=(a*_*r-g*o*r+g*s*c-e*_*c-a*s*b+e*o*b)*L,t[11]=(l*o*r-a*u*r-l*s*c+e*u*c+a*s*m-e*o*m)*L,t[12]=P*L,t[13]=(l*_*n-g*u*n+g*s*f-e*_*f-l*s*E+e*u*E)*L,t[14]=(g*o*n-a*_*n-g*s*h+e*_*h+a*s*E-e*o*E)*L,t[15]=(a*u*n-l*o*n+l*s*h-e*u*h-a*s*f+e*o*f)*L,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,n))}makeTranslation(t,e,s){return t instanceof vt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),n=Math.sin(e),r=1-s,a=t.x,o=t.y,h=t.z,c=r*a,l=r*o;return this.set(c*a+s,c*o-n*h,c*h+n*o,0,c*o+n*h,l*o+s,l*h-n*a,0,c*h-n*o,l*h+n*a,r*h*h+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,n,r,a){return this.set(1,s,r,0,t,1,a,0,e,n,1,0,0,0,0,1),this}makePerspective(t,e,s,n,r,a,o=Ze){const h=this.value,c=2*r/(e-t),l=2*r/(s-n),u=(e+t)/(e-t),f=(s+n)/(s-n);let m,g;if(o===Ze)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===$i)m=-a/(a-r),g=-a*r/(a-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=c,h[4]=0,h[8]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=f,h[13]=0,h[2]=0,h[6]=0,h[10]=m,h[14]=g,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,s,n,r,a,o=Ze){const h=this.value,c=1/(e-t),l=1/(s-n),u=1/(a-r),f=(e+t)*c,m=(s+n)*l;let g,_;if(o===Ze)g=(a+r)*u,_=-2*u;else if(o===$i)g=r*u,_=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-f,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-m,h[2]=0,h[6]=0,h[10]=_,h[14]=-g,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,s){const n=this.value,r=e.x,a=e.y,o=e.z,h=e.w,c=r+r,l=a+a,u=o+o,f=r*c,m=r*l,g=r*u,_=a*l,E=a*u,b=o*u,S=h*c,y=h*l,w=h*u,P=s.x,M=s.y,L=s.z;return n[0]=(1-(_+b))*P,n[1]=(m+w)*P,n[2]=(g-y)*P,n[3]=0,n[4]=(m-w)*M,n[5]=(1-(f+b))*M,n[6]=(E+S)*M,n[7]=0,n[8]=(g+y)*L,n[9]=(E-S)*L,n[10]=(1-(f+_))*L,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,s){const n=this.value;let r=ke.set(n[0],n[1],n[2]).length();const a=ke.set(n[4],n[5],n[6]).length(),o=ke.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],Lt.copy(this);const c=1/r,l=1/a,u=1/o;return Lt.value[0]*=c,Lt.value[1]*=c,Lt.value[2]*=c,Lt.value[4]*=l,Lt.value[5]*=l,Lt.value[6]*=l,Lt.value[8]*=u,Lt.value[9]*=u,Lt.value[10]*=u,e.setFromRotationMatrix4(Lt),s.x=r,s.y=a,s.z=o,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,s=0){return this.multiply(new yt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new yt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}scaleVector3(t){const e=this.value,s=t.x,n=t.y,r=t.z;return e[0]*=s,e[4]*=n,e[8]*=r,e[1]*=s,e[5]*=n,e[9]*=r,e[2]*=s,e[6]*=n,e[10]*=r,e[3]*=s,e[7]*=n,e[11]*=r,this}rotateX(t){const e=Y(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new yt([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=Y(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new yt([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=Y(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new yt([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new yt([1,0,0,Y(t),0,1,0,Y(e),0,0,1,Y(s),0,0,0,1]))}perspective(t){return this.multiply(new yt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const u=-n/l;return e+=u*(a-e),s+=u*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new $e({x:t,y:e}),a=new $e({x:t+s,y:e}),o=new $e({x:t+s,y:e+n}),h=new $e({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),u=Math.max(r.x,a.x,o.x,h.x)-c,f=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:u,height:f}}}class wt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=ra){this.value=Array.from(t),this.matrix4=this.toMatrix4()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}static fromString(t){const e=new wt,s=v.regMatchAll("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}toMatrix4(t=this.matrix4){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new yt(e)}identity(){return this.value=Array.from(ra),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.multiplyScalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new wt(this.value)}multiply(t){const e=this.clone(),s=t instanceof wt?t:new wt(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}invert(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,u=-c*n+a*o,f=h*n-r*o;let m=t*l+e*u+s*f;return m?(m=1/m,this.m11=l*m,this.m12=(-c*e+s*h)*m,this.m13=(a*e-s*r)*m,this.m21=u*m,this.m22=(c*t-s*o)*m,this.m23=(-a*t+s*n)*m,this.m31=f*m,this.m32=(-h*t+e*o)*m,this.m33=(r*t-e*n)*m,this):null}adjugate(){const t=new wt;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=ut(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:ut(Math.atan2(-this.m21,this.m22)),skewY:ut(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],u=t.value[3],f=t.value[4],m=t.value[5],g=h*u,_=c*l,E=(l*s-e*u)/(_-g),b=(h*s-e*c)/(g-_),S=(l*r-n*u)/(_-g),y=(h*r-n*c)/(g-_),w=(l*(o-m)+u*(f-a))/(_-g),P=(h*(o-m)+c*(f-a))/(g-_),M=[E,b,S,y,w,P];return new wt(M)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>v.maxDotNumber(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,s){return this.matrix4.translate(t,e,s),this.matrix4.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,s-this.matrix4.m43),this}rotate(t,e=0,s=0){const n=Y(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix4(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix4.rotateX(t).rotateY(e).rotateZ(s),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix4.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix4(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix4.scale(t,e,s),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix4.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(Y(e)),Math.sin(Y(e)),-Math.sin(Y(t)),Math.cos(Y(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const kl=new vt(0,0,0),Dl=new vt(1,1,1),ae=new vt,Os=new vt,Tt=new vt,ke=new vt,Zi=new Ae,Lt=new yt;function Ki(i){const t=new wt;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new yt(r)),t.matrix4.toMatrix(t);break}return""}),t}function zt(i,t,e){const s=new wt;return s.rotate(ut(i)),s.transformPoint({x:t,y:e})}function Qi(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=Y(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function Rl(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,Qi(t)),s}function we(i,t,e){const s=Xi(i);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[v.toCamel(t)]||s.props.style[v.toKebab(t)]||"":s.props.style}function tn(i,t,e){Ui(i,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(n=>{s.props.style[n]=t[n]})},!0)}function en(i){const t={};if(getComputedStyle){const e=getComputedStyle(i);for(let s=0,n=e.length;s<n;s++)t[e[s]]=e.getPropertyValue(t[s])}else{const e=i.currentStyle;for(const s in e)t[s]=e[s]}return i.style.cssText&&i.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[s,n]=e.split(":");s&&n&&(t[s.trim()]=n.trim())}),t}function Ll(i,t,e){let s=i.style[t]||"";if(!s&&getComputedStyle){t=v.toKebab(t);const n=getComputedStyle(i,e),r=n.getPropertyPriority(t);s=n.getPropertyValue(t).trim()+(r?"!"+r:"")}return s||(s=i.currentStyle[t]||""),s}function Bs(i,t,e){typeof t=="string"&&e?i.style.setProperty(v.toKebab(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Bs(i,s,t[s])})}function sn(i,t){typeof t=="string"?i.style.removeProperty(v.toKebab(t)):Object.keys(t).forEach(e=>{sn(i,e)})}function ha(i,t){let e;if(typeof t=="string"){const s=document.querySelector(t)?.shadowRoot;s?e=s:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const s=document.createElement("style");return s.innerHTML=i,e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)}}else{const s=document.styleSheets[0].insertRule(i);return()=>{document.styleSheets[0].deleteRule(s)}}}function zl(i,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:we(i,"transform")||""});const s=Ki(e.transform),n={};for(const r in t){const a=t[r];switch(r){case"transform":break;case"translate":s.translate(a[0]||0,a[1]||0);break;case"translateTo":s.translateTo(a[0]||0,a[1]||0);break;case"translateX":s.translateX(a||0);break;case"translateXTo":s.translateXTo(a||0);break;case"translateY":s.translateY(a||0);break;case"translateYTo":s.translateYTo(a||0);break;case"translateZ":s.translateZ(a||0);break;case"translateZTo":s.translateZTo(a||0);break;case"translate3d":s.translate3d(a[0]||0,a[1]||0,a[2]||0);break;case"translate3dTo":s.translate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotate":typeof a=="number"?s.rotate(a||0):s.rotate(a[0]||0,a[1]||0,a[2]||0);break;case"rotateTo":typeof a=="number"?s.rotateTo(a||0):s.rotateTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotateX":s.rotateX(a||0);break;case"rotateXTo":s.rotateXTo(a||0);break;case"rotateY":s.rotateY(a||0);break;case"rotateYTo":s.rotateYTo(a||0);break;case"rotateZ":s.rotateZ(a||0);break;case"rotateZTo":s.rotateZTo(a||0);break;case"rotate3d":s.rotate3d(a[0]||0,a[1]||0,a[2]||0);break;case"rotate3dTo":s.rotate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"scale":typeof a=="number"?s.scale(a||1):s.scale(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleTo":typeof a=="number"?s.scaleTo(a||1):s.scaleTo(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleX":s.scaleX(a||1);break;case"scaleXTo":s.scaleXTo(a||1);break;case"scaleY":s.scaleY(a||1);break;case"scaleYTo":s.scaleYTo(a||1);break;case"scaleZ":s.scaleZ(a||1);break;case"scaleZTo":s.scaleZTo(a||1);break;case"scale3d":typeof a=="number"?s.scale3d(a||1):s.scale3d(a[0]||1,a[1]||1,a[2]||1);break;case"scale3dTo":typeof a=="number"?s.scale3dTo(a||1):s.scale3dTo(a[0]||1,a[1]||1,a[2]||1);break;case"skew":typeof a=="number"?s.skew(a||0):s.skew(a[0]||0,a[1]||0);break;case"skewTo":typeof a=="number"?s.skewTo(a||0):s.skewTo(a[0]||0,a[1]||0);break;case"skewX":s.skewX(a||0);break;case"skewXTo":s.skewXTo(a||0);break;case"skewY":s.skewY(a||0);break;case"skewYTo":s.skewYTo(a||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(a||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=we(i,r)),Object.assign(n,{[r]:`${a}`});break}}return Object.assign(n,{transform:s.toString()}),n}function oe(i,t,e){if(t===void 0&&e===void 0)return nn(i);if(typeof t=="string"&&e===void 0)return ca(i,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=""+e),Ui(i,n=>{Object.entries(s).forEach(([r,a])=>{n.props[r]=""+a})})}const Ol=["-o-","-ms-","-moz-","-webkit-",""];function nn(i){const t={};for(let e=0,s=i.attributes,n=s.length;e<n;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=en(i):t[r.nodeName]=r.nodeValue)}return t}function ca(i,t){return t==="style"?en(i):i.getAttribute(v.toKebab(t))}function De(i,t,e){return i.setAttribute(v.toKebab(t),""+e)}function Bl(i,t){t.split(/[,\s]+/i).forEach(e=>{const s=v.toKebab(e.trim());s!=""&&i.removeAttribute(s)})}function Nl(i,t){De(i,"draggable","true");const e=[];return e.push(N(i,"dragstart",s=>{ie(s),Rr(s);const n=s.dataTransfer;n&&(n.effectAllowed="move",n.setData("text/plain","some-data")),t?.onStart?.(s)},!0)),e.push(N(i,"drag",s=>{ie(s),t?.onDrag?.(s)})),e.push(N(i,"dragend",s=>{ie(s),t?.onEnd?.(s)})),()=>{e.forEach(s=>s())}}function Fl(i,t){const e=[];return e.push(N(i,"dragenter",s=>{ie(s),t?.onEnter?.(s)})),e.push(N(i,"dragover",s=>{ie(s);const n=s.dataTransfer;n&&(n.dropEffect="move"),t?.onOver?.(s)})),e.push(N(i,"dragleave",s=>{ie(s),t?.onLeave?.(s)})),e.push(N(i,"drop",s=>{ie(s);const n=s.dataTransfer;if(!n){t?.onDrop?.(s,[]);return}t?.onDrop?.(s,[...n.files])})),()=>{e.forEach(s=>s())}}function Yl(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function Ke(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function Xl(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function la(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function Ul(){const{scrollWidth:i,scrollHeight:t}=Ke();return{width:i,height:t}}function rn(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ke();return{x:e+r,y:t+a,width:s,height:n}}function Vl(i){let t=i,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:i.offsetWidth,height:i.offsetHeight}}function ua(i){return i.getBoundingClientRect()}function Gl(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ql(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Ke(),s=e-i;return s<=0?0:t/s*100}function fa(){const i={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,s){i.x=e.x,i.y=e.y,typeof s=="boolean"&&(i.isDown=s),this.setCurrentMousePoint(e,s)},setCurrentMousePoint:(e,s)=>{const n=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-n,t.dy=t.y-r,t.dStartX=t.x-i.x,t.dStartY=t.y-i.y,typeof s=="boolean"&&(t.isDown=s)}}}function Hl(i){if("center"in i){const t=i.center,e=ua(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function an(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Ke();return{x:i.clientX+t,y:i.clientY+e}}function Re(i,t){const e={x:0,y:0};if(t){const s=an(i),n=rn(t);e.x=v.clamp(s.x-n.x,0,n.width),e.y=v.clamp(s.y-n.y,0,n.height)}else{let s=0,n=0;if("currentTarget"in i&&i.currentTarget&&i.target&&i.currentTarget!=i.target){const r=i.currentTarget.getBoundingClientRect(),a=i.target.getBoundingClientRect();s=a.left-r.left,n=a.top-r.top}if("offsetX"in i)e.x=i.offsetX+s,e.y=i.offsetY+n;else{const r=an(i),a=rn(i.target);e.x=v.clamp(r.x-a.x+s,0,a.width),e.y=v.clamp(r.y-a.y+n,0,a.height)}}return e}var da={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
6
+ `+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ge(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&xs.assertOptions(s,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),n!=null&&(A.isFunction(n)?e.paramsSerializer={serialize:n}:xs.assertOptions(n,{encode:Xt.function,serialize:Xt.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),xs.assertOptions(e,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],g=>{delete r[g]}),e.headers=Rt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(e)===!1||(h=h&&_.synchronous,o.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let l,u=0,f;if(!h){const g=[Sr.bind(this),void 0];for(g.unshift.apply(g,o),g.push.apply(g,c),f=g.length,l=Promise.resolve(e);u<f;)l=l.then(g[u++],g[u++]);return l}f=o.length;let m=e;for(u=0;u<f;){const g=o[u++],_=o[u++];try{m=g(m)}catch(E){_.call(this,E);break}}try{l=Sr.call(this,m)}catch(g){return Promise.reject(g)}for(u=0,f=c.length;u<f;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=ge(this.defaults,t);const e=fr(t.baseURL,t.url,t.allowAbsoluteUrls);return ir(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){bs.prototype[t]=function(e,s){return this.request(ge(s||{},{method:t,url:e,data:(s||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ge(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}bs.prototype[t]=e(),bs.prototype[t+"Form"]=e(!0)});const Ss=bs;class Si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ie(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Si(function(n){t=n}),cancel:t}}}const tc=Si;function ec(i){return function(e){return i.apply(null,e)}}function sc(i){return A.isObject(i)&&i.isAxiosError===!0}const vi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vi).forEach(([i,t])=>{vi[t]=i});const ic=vi;function _r(i){const t=new Ss(i),e=Vn(Ss.prototype.request,t);return A.extend(e,Ss.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return _r(ge(i,n))},e}const tt=_r(gi);tt.Axios=Ss,tt.CanceledError=Ie,tt.CancelToken=tc,tt.isCancel=hr,tt.VERSION=vr,tt.toFormData=fs,tt.AxiosError=F,tt.Cancel=tt.CanceledError,tt.all=function(t){return Promise.all(t)},tt.spread=ec,tt.isAxiosError=sc,tt.mergeConfig=ge,tt.AxiosHeaders=Rt,tt.formToJSON=i=>ar(A.isHTMLForm(i)?new FormData(i):i),tt.getAdapter=br.getAdapter,tt.HttpStatusCode=ic,tt.default=tt;const nc=tt,Er=window.crypto.subtle;Er||console.warn("Crypto API not supported");async function Mr(i,t="SHA-256"){const e=await Er.digest(t,v.getUint8ArrayFromString(i));return v.getStringFromArrayBuffer(e)}async function Pr(i,t="SHA-256"){const e=JSON.stringify(v.getSortedObjectString(i));return Mr(e,t)}var rc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,oc=(i,t,e,s)=>{for(var n=s>1?void 0:s?ac(t,e):t,r=i.length-1,a;r>=0;r--)(a=i[r])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&rc(t,e,n),n};class Ti{instance;constructor(t){this.instance=nc.create(t);const e=new Cr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>s?s.status==200?(await e.confirmRequest(s.config),s):Promise.reject(s):Promise.reject("axios response is undefined! maybe config.interceptor is NOT set return value!"),async s=>Promise.reject(s))}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}oc([v.Cache(6e4),v.Retry(3)],Ti.prototype,"request",1);class Cr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await Pr({url:e,method:s,params:n,data:r})}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const _i=i=>new XMLSerializer().serializeToString(i),hc=(i,t="text/html")=>new DOMParser().parseFromString(i,t),Ir=(i,t=v.MIMEEnum.SVG,e=v.EncodeEnum.utf8)=>v.toBlob(_i(i),t,e);async function Ei(i=["*"],t){if(!document||!(document instanceof Document))throw new Error("This is not a browser environment");let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",i.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",n=>{s.value=""},!1),new Promise((n,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):n(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(n=>(s.remove(),n)).catch(n=>{throw s.remove(),n})}function Xe(i,t=v.ReadInBrowserEnum.text,e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case v.ReadInBrowserEnum.dataURL:r.readAsDataURL(i);break;case v.ReadInBrowserEnum.binaryString:r.readAsBinaryString(i);break;case v.ReadInBrowserEnum.arraybuffer:r.readAsArrayBuffer(i);break;case v.ReadInBrowserEnum.text:default:r.readAsText(i)}})}async function cc(i){const t=await Xe(i,v.ReadInBrowserEnum.arraybuffer);return v.getFileTypeFromArrayBuffer(t)}const lc=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function uc(i){switch(i.toLowerCase()){case"jpg":case"jpeg":return v.MIMEEnum.JPEG;case"gif":return v.MIMEEnum.GIF;case"svg":return v.MIMEEnum.SVG;case"pdf":return v.MIMEEnum.PDF;case"png":default:return v.MIMEEnum.PNG}}function Ar(i,t,e,s,n,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Ar(i,t,e,s,n,a,Math.min(a+n,s.size));else return i(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function kr(i,t=1048576){return await new Promise((e,s)=>Ar(e,s,new Do.ArrayBuffer,i,t,0,Math.min(t,i.size)))}class fc{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Ti({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await kr(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{v.increaseTime(this.time,1),this.onTime?.(v.formatTimeOverflow(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}function Mi(){return new Date().getTime()}function Pi(i,t){t=Math.max(t||0,0);function e(n){return v.hasYZSymbol(n,v.SYMBOL_TIMESTAMP)?{...n,[v.SYMBOL_TIMESTAMP]:Mi()}:{v:n,[v.SYMBOL_TIMESTAMP]:Mi()}}let s=e(i);return{get:()=>{let n;return(!t||s[v.SYMBOL_TIMESTAMP]+t*1e3>=Mi())&&(n=s.v),{value:n?s:void 0,rawValue:n}},set:n=>s=e(n)}}function dc(i,t){const e=v.ref(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${i}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return v.watchEffect(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),n=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=i+"="+encodeURIComponent(e.value)+s+n+r+a}}),{get:()=>e.value,set:s=>e.value=s}}function mc(){const i=document.cookie.split("; ");for(let t=0;t<i.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(i[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",n=location.pathname.split("/");for(document.cookie=s+"/";n.length>0;)document.cookie=s+n.join("/"),n.pop();e.shift()}}}function Dr(i,t){const e=typeof i=="string"?i:i.toString();let s=t?.initValue;if(!s)try{s=v.parse(window.localStorage.getItem(e)||"")}catch{s=""}const{get:n,set:r}=Pi(s,t?.aliveInSeconds),a=v.ref(n().value);return v.watchEffect(()=>{if(a.value)try{window.localStorage.setItem(e,v.stringify(a.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const o=n();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function gc(){window.localStorage.clear()}function pc(i,t){const e=typeof i=="string"?i:i.toString();let s=t?.initValue;if(!s)try{s=v.parse(window.sessionStorage.getItem(e)||"")}catch{s=""}const{get:n,set:r}=Pi(s,t?.aliveInSeconds),a=v.ref(n().value);return v.watchEffect(()=>{if(a.value)try{window.sessionStorage.setItem(e,v.stringify(a.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const o=n();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function yc(){window.sessionStorage.clear()}function wc(i,t){let e;return i.objectStoreNames.contains(t)||(e=i.createObjectStore(t,{keyPath:"id"})),e}function xc(i,t=1,e){return new Promise((s,n)=>{let r;const a=window.indexedDB.open(i,t);a.onerror=()=>{n("无法使用IndexDB!")},a.onsuccess=o=>{r=o.target.result,wc(r,e),s(r)}})}function bc(i,t,e={id:1,name:"xxx"}){return new Promise((s,n)=>{const r=i.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=o=>{s(o)},r.onerror=o=>{n(o)}})}function N(i,t,e,s=!1){const n=async r=>{await e(r)};try{i.addEventListener(t,n,s)}catch{i.attachEvent("on"+t,n)}return()=>{try{i.removeEventListener(t,n,s)}catch{i.detachEvent("on"+t,n)}}}const Sc=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],vc=["keydown","keyup","keypress"],Tc=["touchstart","touchend","touchcancel","touchmove"],_c=["pointerdown","pointerup","pointercancel","pointermove"],Ec=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Mc=["change"];function Pc(i,t,e={bubbles:!0,detail:{}}){if(!i)return;let s;try{Sc.includes(t)?s=new MouseEvent(t,e):vc.includes(t)?s=new KeyboardEvent(t,e):Tc.includes(t)?s=new TouchEvent(t,e):_c.includes(t)?s=new PointerEvent(t,e):Ec.includes(t)?s=new DragEvent(t,e):Mc.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(i.dispatchEvent)i.dispatchEvent(s);else if(i.fireEvent&&document.createEventObject)i.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function Cc(i,t){const e=i.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function ie(i){i.preventDefault&&i.preventDefault();try{i.returnValue=!1}catch{}}function Rr(i){i.stopPropagation&&i.stopPropagation();try{i.cancelBubble=!0}catch{}}function Ic(i,t){let e=document.createElement(i);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}function Ac(i){if(document.implementation.hasFeature("MouseEvents","2.0"))return i.button;switch(i.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const vs=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(i)?t="iOS":/android/i.test(i)?t="Android":/BlackBerry/i.test(i)?t="BlackBerry":/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()};function kc(i=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(i)){const e=i.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(i)){const e=i.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Dc(i,t){const e=i.split("."),s=t.split(".");for(let n=0,r=e.length;n<r;n++){if(s.length==n)return 1;if(e[n]!=s[n])return e[n]>s[n]?1:-1}return e.length!=s.length?-1:0}function Ci(){const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()}const Rc=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function Lc(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function zc(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Ii(){return vs()==="ios"}function Ai(){return vs()==="macos"}function Oc(){return Ii()|Ai()}function Lr(){return vs()==="android"}function Bc(){return Ii()||Lr()}function zr(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const Nc=zr()!==-1,Fc=document.documentMode?document.documentMode===9:!1,Yc=document.documentMode?document.documentMode===10:!1,Xc=document.documentMode?document.documentMode===11:!1;function Or(){return Ci()==="wechat"}function Br(){return Ci()==="ali"}function Uc(){return Or()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Vc(){return Br()&&navigator.userAgent.match(/miniprogram/i)}const Gc=typeof document<"u",Nr=typeof window<"u",qc=typeof history<"u",Hc=Nr&&window.File&&window.FileReader&&window.FileList&&window.Blob,Fr=(()=>!!(v.root.Worker&&v.root.Blob&&v.root.Promise&&v.root.OffscreenCanvas&&v.root.OffscreenCanvasRenderingContext2D&&v.root.HTMLCanvasElement&&v.root.HTMLCanvasElement.prototype.transferControlToOffscreen&&v.root.URL&&v.root.URL.createObjectURL))(),jc=typeof Path2D=="function"&&typeof DOMMatrix=="function",Yr=function(){if(!v.root.OffscreenCanvas)return!1;const i=new OffscreenCanvas(1,1),t=i.getContext("2d");t.fillRect(0,0,1,1);const e=i.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),Wc=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},$c="webkit moz ms o".split(" ");function Ts(i){return typeof i=="function"&&/native code/.test(i.toString())}function Jc(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}(function(){if(!window.requestAnimationFrame){let i=v.now();window.requestAnimationFrame=function(t){const e=v.now(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();function ki(i){let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function Di(i,t=0){if(t==0)return i(v.now()),()=>{};{const e=v.now();return ki(s=>s-e>=t?(i(s),!1):!0)}}function Zc(i,t=0){let e=!1,s=0;const n=v.now(),r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t<=o),Di(r,Math.max(0,t-o))};return Di(r,t),()=>{e=!0}}function Kc(i,t=20){const e=1e3/t;let s=0,n;return()=>(v.now()-s>=e&&(s=v.now(),n=i()),n)}window.requestIdleCallback=window.requestIdleCallback||function(i,t){const e=v.now();return setTimeout(function(){i({didTimeout:v.now()-e>50,timeRemaining:()=>Math.max(0,50-(v.now()-e))})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(i){clearTimeout(i)};function Xr(i,t){requestIdleCallback(e=>{e.timeRemaining()>0||t?i():Xr(i,t)},{timeout:t})}const Ri=new v.CacheMap;let Li=!1;function zi(i,t,e){i&&t&&Ri.set(i,{cb:t,startTime:v.now(),timeout:e}),!Li&&(Li=!0,tl(s=>{Li=!1;let n=s.timeRemaining();Ri.filter((r,a)=>{let o=!1;const h=v.now();(n>0||a.timeout&&v.now()-a.startTime>=a.timeout)&&(a.cb(),o=!0);const c=v.now();return n-=c-h,!o}),Ri.length>0&&zi()}))}let _s=0,pe=33,ne=33,Oi;const Ur=new MessageChannel,Qc=Ur.port2;Ur.port1.onmessage=i=>{Oi!==null&&Oi({didTimeout:_s<=v.now(),timeRemaining:()=>Math.max(0,_s-v.now())})};function tl(i){return Oi=i,requestAnimationFrame(t=>{let e=t-_s+ne;e<ne&&pe<ne?(e<8&&(e=8),ne=e<pe?pe:e):e>ne&&pe>ne?ne=e<pe?pe:e:pe=e,_s=t+ne,Qc.postMessage(null)})}function el(i){if(typeof setImmediate<"u"&&Ts(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(Ts(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&Ts(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function sl(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class Ue{static _nextId=0;static nextId(){return Ue._nextId++}}const O={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-O.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?O.Bounce.In(i*2)*.5:O.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function Vr(i){switch(i){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return i}}const il=4,nl=.001,rl=1e-7,al=10,Ve=11,Es=1/(Ve-1),ol=typeof Float32Array=="function";function Gr(i,t){return 1-3*t+3*i}function qr(i,t){return 3*t-6*i}function Hr(i){return 3*i}function Ms(i,t,e){return((Gr(t,e)*i+qr(t,e))*i+Hr(t))*i}function jr(i,t,e){return 3*Gr(t,e)*i*i+2*qr(t,e)*i+Hr(t)}function hl(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=Ms(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>rl&&++o<al);return a}function cl(i,t,e,s){for(let n=0;n<il;++n){const r=jr(t,e,s);if(r===0)return t;const a=Ms(t,e,s)-i;t-=a/r}return t}function ll(i){return i}function Bi(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return ll;const n=ol?new Float32Array(Ve):new Array(Ve);for(let a=0;a<Ve;++a)n[a]=Ms(a*Es,i,e);function r(a){let o=0,h=1;const c=Ve-1;for(;h!==c&&n[h]<=a;++h)o+=Es;--h;const l=(a-n[h])/(n[h+1]-n[h]),u=o+l*Es,f=jr(u,i,e);return f>=nl?cl(a,u,i,e):f===0?u:hl(a,o,o+Es,i,e)}return a=>a===0||a===1?a:Ms(r(a),t,s)}function Ni(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Wr(i){const[t,e,s,n]=Ni(i);return[1-s,1-n,1-t,1-e]}function ul(i){return Bi(...Ni(i))}function fl(i){return Bi(...Wr(i))}const Ht={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Ht.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Ht.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Ht.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Ht.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};class $r{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=v.now(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const Mt=new $r;class Fi{constructor(t,e=Mt){this._object=t,this._group=e}_id=Ue.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=O.Linear.None;_interpolationFunction=Ht.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=v.now()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=v.now()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=v.now()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=Mt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=O.Linear.None){return this._easingFunction=t,this}interpolation(t=Ht.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=v.now(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const dl=Ue.nextId,ml=Mt.getAll.bind(Mt),gl=Mt.removeAll.bind(Mt),pl=Mt.add.bind(Mt),yl=Mt.remove.bind(Mt),wl=Mt.update.bind(Mt),xl={now:v.now,Sequence:Ue,Easing:O,Interpolation:Ht,Group:$r,Tween:Fi,nextId:dl,getAll:ml,removeAll:gl,add:pl,remove:yl,update:wl};class Yi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=v.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=v.now();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Ps{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){v.ShellSort(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.fromValues={...n.fromValues},n.toValues={...n.toValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||O.Linear.None,interpolationFunction:s?.interpolationFunction||Ht.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Yi,s=this.frameDuration;return new Promise(n=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ki(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new Fi({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),v.deleteArrayItem(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),n()),a})})}isPaused=!1;pausedClock=new Yi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Vr(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Cs=new v.CacheMap,Jr=(i=!0)=>{Cs.filter((t,e)=>(e.alternate&&(Ws(e,e.alternate),i&&Cs.set(t,e.alternate),e.alternate=void 0),i))};function Xi(i){let t=Cs.get(i);return t||(t=js(i),Cs.set(i,t)),t}function Zr(i){const t=Xi(i);return t.alternate||(t.alternate=js(i)),t.alternate}function bl(i,t,e=!0){t(Zr(i)),Jr(e)}function Ui(i,t,e=!0){t(Zr(i)),zi("FLUSH_DOM_ACTION",()=>Jr(e),50)}function Y(i){return i*Math.PI/180}function ut(i){return i*180/Math.PI}function Is(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function As(i,t,e,s){return Is(e-i,s-t)}function ks(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function re(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function Pt(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function Sl(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function vl(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=ut(re(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Kr=Tl("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Tl(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function dt(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function Ds(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function _l(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function El(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Ge={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class Rs{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",dt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class Vi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class qe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Ge);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Ge[n].canvas}}__getStyleState(){const t={},e=Object.keys(Ge);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Ge);for(let r=0;r<n.length;r++){const a=Ge[n[r]],o=this[n[r]];if(a.apply){if(o instanceof Vi){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,dt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Rs)e.setAttribute(a.apply,dt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,dt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Kr);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Kr[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(dt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(dt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(dt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(dt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(dt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(dt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(dt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(dt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(dt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),f=this.normalize([h[0]+c[0],h[1]+c[1]]),m=r/Math.sin(u/2),g=t+m*f[0],_=e+m*f[1],E=[-h[1],h[0]],b=[c[1],-c[0]],S=function(P){const M=P[0];return P[1]>=0?Math.acos(M):-Math.acos(M)},y=S(E),w=S(b);this.lineTo(g+E[0]*r,_+E[1]*r),this.arc(g,_,r,y,w)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:Ds(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Rs(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:Ds(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Rs(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":_l(this.textAlign),"dominant-baseline":El(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),u=a?0:1;let f=0,m=r-n;m<0&&(m+=2*Math.PI),a?f=m>Math.PI?0:1:f=m>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(dt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:f,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=Ds(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",dt("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,u,f,m,g,_,E;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const b=this.__closestGroupOrSvg();this.__currentElement;const S="translate("+s+", "+n+")";if(e instanceof qe){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(f=u.childNodes[0];f.childNodes.length;)E=f.childNodes[0].getAttribute("id"),this.__ids[E]=E,this.__SVGdefs.appendChild(f.childNodes[0]);if(m=u.childNodes[1],m){const y=m.getAttribute("transform");let w;y?w=y+" "+S:w=S,m.setAttribute("transform",w),b.appendChild(m)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(g=this.__createElement("image"),g.setAttribute("width",r),g.setAttribute("height",a),g.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(_=this.__document.createElement("canvas"),_.width=r,_.height=a,_.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=_),g.setAttribute("transform",S),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),b.appendChild(g))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=Ds(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof qe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Vi(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Ls{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new qe({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}let zs=class{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=re(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const Qr=zs;class Gi extends zs{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,u=(t-s)/2,f=(e-n)/2,m=Math.cos(l)*u+Math.sin(l)*f,g=-Math.sin(l)*u+Math.cos(l)*f,_=m*m/(r*r)+g*g/(a*a);if(_>1){const $=Math.sqrt(_);throw r=$*r,a=$*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const E=Math.sqrt((r*r*a*a-r*r*g*g-a*a*m*m)/(r*r*g*g+a*a*m*m)),b=h!=c?1:-1,S=b*E*r*g/a,y=b*E*-a*m/r,w=(t+s)/2,P=(e+n)/2,M=Math.cos(l)*S-Math.sin(l)*y+w,L=Math.sin(l)*S+Math.cos(l)*y+P,U=($,K,ht,it)=>($*it>=K*ht?1:-1)*Math.acos(($*ht+K*it)/(Math.sqrt($*$+K*K)*Math.sqrt(ht*ht+it*it))),G=U(1,0,t-M,e-L)-l,W=U(t-M,e-L,s-M,n-L);return[M,L,r,a,l,G,G+W]}}class Ml extends zs{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Pl=Ml;class pt extends zs{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));const l=[],u=c.length;for(let g=0;g<u;g++){for(let _=g+1;_<u;_++)c[g].X===c[_].X&&c[g].Y===c[_].Y&&(_=++g);l.push({X:c[g].X,Y:c[g].Y})}const f={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},m={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:f.x,y:f.y,width:m.x-f.x,height:m.y-f.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let m=0;for(let g=0;g<12;g++){const _=l*u[g]+l,E=this.base3(_,t,s,r,o),b=this.base3(_,e,n,a,h);m+=f[g]*Math.sqrt(E*E+b*b)}return l*m}length(t=1){return pt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||pt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;const l=1;let u=l/2,f=l-u,m=pt.bezlen(e,s,n,r,a,o,h,c,f);for(;Math.abs(m-t)>.01;)u/=2,f+=(m<t?1:-1)*u,m=pt.bezlen(e,s,n,r,a,o,h,c,f);return f}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),f=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),m=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),g=s*this.x+e*this.c1x,_=s*this.y+e*this.c1y,E=s*this.c2x+e*this.toX,b=s*this.c2y+e*this.toY,S=90-Math.atan2(l-f,u-m)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:f,y:m},start:{x:g,y:_},end:{x:E,y:b},alpha:S}}}const He=Math.PI*2;function ta(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function Cl(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,u=-h*(i-e)/2+c*(t-s)/2,f=a*a,m=o*o,g=l*l,_=u*u;let E=f*m-f*_-m*g;E<0&&(E=0),E/=f*_+m*g,E=Math.sqrt(E)*(n===r?-1:1);const b=E*a/o*u,S=E*-o/a*l,y=c*b-h*S+(i+e)/2,w=h*b+c*S+(t+s)/2,P=(l-b)/a,M=(u-S)/o,L=(-l-b)/a,U=(-u-S)/o,G=ta(1,0,P,M);let W=ta(P,M,L,U);return r===0&&W>0&&(W-=He),r===1&&W<0&&(W+=He),[y,w,G,W]}function Il(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function ea(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*He/360),l=Math.cos(h*He/360),u=l*(i-e)/2+c*(t-s)/2,f=-c*(i-e)/2+l*(t-s)/2;if(u===0&&f===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const m=u*u/(a*a)+f*f/(o*o);m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m));const g=Cl(i,t,e,s,n,r,a,o,c,l),_=[];let E=g[2],b=g[3];const S=Math.max(Math.ceil(Math.abs(b)/(He/4)),1);b/=S;for(let y=0;y<S;y++)_.push(Il(E,b)),E+=b;return _.map(y=>{for(let w=0;w<y.length;w+=2){let P=y[w+0],M=y[w+1];P*=a,M*=o;const L=l*P-c*M,U=c*P+l*M;y[w+0]=L+g[0],y[w+1]=U+g[1]}return y})}function qi(i,t,e,s,n,r){return[i/3+.6666666666666666*e,t/3+.6666666666666666*s,n/3+.6666666666666666*e,r/3+.6666666666666666*s,n,r]}function je(i,t,e,s){return[i,t,e,s,e,s]}const We={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ye{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&oe(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||v.generateUUID()})}static downloadFromSVGElement(t,e="shape"){return _n(Ir(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return _n(v.toBlob(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return _i(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return ye.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=v.extractAllNumbers(r);for(a=="m"&&o.length>We[a]&&(e.push([n,...o.splice(0,We[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<We[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,We[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,u;for(let f=0,m=t.length;f<m;f++){let g=t[f];const _=g[0];switch(_){case"M":s=g[1],n=g[2];break;case"A":const E=ea(r,a,g[6],g[7],g[4],g[5],g[1],g[2],g[3]);if(!E.length)continue;E.forEach((y,w)=>{const[P,M,L,U,G,W,$,K]=y;g=["C",L,U,G,W,$,K],w<E.length-1&&e.push(g)});break;case"S":let b=r,S=a;(u=="C"||u=="S")&&(b+=b-c,S+=S-l),g=["C",b,S,g[1],g[2],g[3],g[4]];break;case"T":u=="Q"||u=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),g=["C",...qi(r,a,o,h,g[1],g[2])];break;case"Q":o=g[1],h=g[2],g=["C",...qi(r,a,g[1],g[2],g[3],g[4])];break;case"L":g=["C",...je(r,a,g[1],g[2])];break;case"H":g=["C",...je(r,a,g[1],a)];break;case"V":g=["C",...je(r,a,r,g[1])];break;case"Z":g=["C",...je(r,a,s,n)];break}u=_,r=g[g.length-2],a=g[g.length-1],g.length>4?(c=g[g.length-4],l=g[g.length-3]):(c=r,l=a),e.push(g)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const bt=ye;class St{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(bt.parseSVGPath(t),e):t instanceof St?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=bt.normalizeSVGPath(bt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new pt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new St;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new pt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new St;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof Gi){ea(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,f,m,g,_,E,b]=c;this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:f,c1y:m,c2x:g,c2y:_,toX:E,toY:b})),this.prevPathX=E,this.prevPathY=b});return}let e,s,n,r,a,o;t instanceof pt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Pl?[e,s,n,r,a,o]=qi(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=je(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return bt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new wt;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,u=r.c2y,f=r.toX,m=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:u}=t.transformPoint({x:l,y:u}),{x:f,y:m}=t.transformPoint({x:f,y:m}),n.push(new pt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:u,toX:f,toY:m}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new St;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,u=a.length;l<u;l++){const f=a[l],m=f.length();if(h+m>e&&!o){const g=f.getPointAtSegmentLength(e-h);if(c.appendLine(new pt({c1x:g.start.x,c1y:g.start.y,c2x:g.m.x,c2y:g.m.y,toX:g.x,toY:g.y})),s)return c;o=c,c.appendLine(new pt({c1x:g.n.x,c1y:g.n.y,c2x:g.end.x,c2y:g.end.y,toX:f.x,toY:f.y})),h+=m;continue}h+=m,c.appendLine(f)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){const l=this.getPointAtLength(c),u=ks(l.x,l.y,t,e);u<a&&(n=l,r=c,a=u)}for(o/=2;o>.5;){const c=r-o,l=this.getPointAtLength(c),u=ks(l.x,l.y,t,e),f=r+o,m=this.getPointAtLength(f),g=ks(m.x,m.y,t,e);c>=0&&u<a?(n=l,r=c,a=u):f<=s&&g<a?(n=m,r=f,a=g):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?re(h.x,h.y,n.x,n.y):re(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=As(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],u=e[o++],f=e[o++],m=e[o++];a.push(["C",h,c,l,u,f,m]);let g=0;for(;g<r&&n>0;)a.push(["C",f,m,f,m,f,m]),n-=6,g++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=v.maxDotNumber(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:St.fromPolymorphPoints(St.mixPoints(new St({d:t}).polymorphPoints,new St({d:e}).polymorphPoints,s)).toSVGPathData()}}const Al=St;class H extends v.EventBus{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=v.generateUUID(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=v.extractAllNumbers(s).reduce((n,r)=>n+r,0)}return v.reactive(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new St,v.watchEffect(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new wt;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new wt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Ls)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof Ls)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return v.newConstructor(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[v.toKebab(s),n]))):e&&(this.attrs[v.toKebab(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[v.toKebab(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[v.toKebab(t)]}distance(t){return As(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=ut(re(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=Pt(Y(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=Pt(Y(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=v.parseNumber(t?.gravity,0);this.vy+=e;const s=v.parseNumber(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=v.parseNumber(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=v.parseNumber(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=v.parseNumber(e?.springLength,100),n=v.parseNumber(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=v.maxDotNumber(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new Ps({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+v.maxDotNumber(o.offset,2)),r?.(o,h)}})),a.play()}}class $e extends H{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=zt(Y(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=zt(Y(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=zt(Y(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return Is(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}class Hi{_x;_y;_z;_w;constructor(t=0,e=0,s=0,n=1){this._x=t,this._y=e,this._z=s,this._w=n}static slerpFlat(t,e,s,n,r,a,o){let h=s[n+0],c=s[n+1],l=s[n+2],u=s[n+3];const f=r[a+0],m=r[a+1],g=r[a+2],_=r[a+3];if(o===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(o===1){t[e+0]=f,t[e+1]=m,t[e+2]=g,t[e+3]=_;return}if(u!==_||h!==f||c!==m||l!==g){let E=1-o;const b=h*f+c*m+l*g+u*_,S=b>=0?1:-1,y=1-b*b;if(y>Number.EPSILON){const P=Math.sqrt(y),M=Math.atan2(P,b*S);E=Math.sin(E*M)/P,o=Math.sin(o*M)/P}const w=o*S;if(h=h*E+f*w,c=c*E+m*w,l=l*E+g*w,u=u*E+_*w,E===1-o){const P=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=P,c*=P,l*=P,u*=P}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,s,n,r,a){const o=s[n],h=s[n+1],c=s[n+2],l=s[n+3],u=r[a],f=r[a+1],m=r[a+2],g=r[a+3];return t[e]=o*g+l*u+h*m-c*f,t[e+1]=h*g+l*f+c*u-o*m,t[e+2]=c*g+l*m+o*f-h*u,t[e+3]=l*g-o*u-h*f-c*m,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,s=this._z,n=this._w){return this._x=t,this._y=e,this._z=s,this._w=n,this._onChangeCallback(),this}clone(){return new Hi(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t.x,n=t.y,r=t.z,a=t.order,o=Math.cos,h=Math.sin,c=o(s/2),l=o(n/2),u=o(r/2),f=h(s/2),m=h(n/2),g=h(r/2);switch(a){case"XYZ":this._x=f*l*u+c*m*g,this._y=c*m*u-f*l*g,this._z=c*l*g+f*m*u,this._w=c*l*u-f*m*g;break;case"YXZ":this._x=f*l*u+c*m*g,this._y=c*m*u-f*l*g,this._z=c*l*g-f*m*u,this._w=c*l*u+f*m*g;break;case"ZXY":this._x=f*l*u-c*m*g,this._y=c*m*u+f*l*g,this._z=c*l*g+f*m*u,this._w=c*l*u-f*m*g;break;case"ZYX":this._x=f*l*u-c*m*g,this._y=c*m*u+f*l*g,this._z=c*l*g-f*m*u,this._w=c*l*u+f*m*g;break;case"YZX":this._x=f*l*u+c*m*g,this._y=c*m*u+f*l*g,this._z=c*l*g-f*m*u,this._w=c*l*u-f*m*g;break;case"XZY":this._x=f*l*u-c*m*g,this._y=c*m*u-f*l*g,this._z=c*l*g+f*m*u,this._w=c*l*u+f*m*g;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,n=Math.sin(s);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,s=e[0],n=e[4],r=e[8],a=e[1],o=e[5],h=e[9],c=e[2],l=e[6],u=e[10],f=s+o+u;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(l-h)*m,this._y=(r-c)*m,this._z=(a-n)*m}else if(s>o&&s>u){const m=2*Math.sqrt(1+s-o-u);this._w=(l-h)/m,this._x=.25*m,this._y=(n+a)/m,this._z=(r+c)/m}else if(o>u){const m=2*Math.sqrt(1+o-s-u);this._w=(r-c)/m,this._x=(n+a)/m,this._y=.25*m,this._z=(h+l)/m}else{const m=2*Math.sqrt(1+u-s-o);this._w=(a-n)/m,this._x=(r+c)/m,this._y=(h+l)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(v.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const n=Math.min(1,e/s);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,n=t._y,r=t._z,a=t._w,o=e._x,h=e._y,c=e._z,l=e._w;return this._x=s*l+a*o+n*c-r*h,this._y=n*l+a*h+r*o-s*c,this._z=r*l+a*c+s*h-n*o,this._w=a*l-s*o-n*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,n=this._y,r=this._z,a=this._w;let o=a*t._w+s*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=s,this._y=n,this._z=r,this;const h=1-o*o;if(h<=Number.EPSILON){const m=1-e;return this._w=m*a+e*this._w,this._x=m*s+e*this._x,this._y=m*n+e*this._y,this._z=m*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),l=Math.atan2(c,o),u=Math.sin((1-e)*l)/c,f=Math.sin(e*l)/c;return this._w=a*u+this._w*f,this._x=s*u+this._x*f,this._y=n*u+this._y*f,this._z=r*u+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),n=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(n*Math.sin(t),n*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Je{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Je(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y;return this.x=t.m11*e+t.m21*s+t.m31,this.y=t.m12*e+t.m22*s+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=v.clamp(this.x,t.x,e.x),this.y=v.clamp(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=v.clamp(this.x,t,e),this.y=v.clamp(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(v.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return sa.copy(this).projectOnVector(t),this.sub(sa)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(v.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),n=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*s-a*n+t.x,this.y=r*n+a*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class vt{x=0;y=0;z=0;constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.z=s}set(t=0,e=0,s=0){return this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new vt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ia.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ia.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,n=this.z,r=t.value;return this.x=r[0]*e+r[3]*s+r[6]*n,this.y=r[1]*e+r[4]*s+r[7]*n,this.z=r[2]*e+r[5]*s+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,n=this.z,r=t.value,a=1/(r[3]*e+r[7]*s+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*n+r[12])*a,this.y=(r[1]*e+r[5]*s+r[9]*n+r[13])*a,this.z=(r[2]*e+r[6]*s+r[10]*n+r[14])*a,this}applyQuaternion(t){const e=this.x,s=this.y,n=this.z,r=t.x,a=t.y,o=t.z,h=t.w,c=2*(a*n-o*s),l=2*(o*e-r*n),u=2*(r*s-a*e);return this.x=e+h*c+a*u-o*l,this.y=s+h*l+o*c-r*u,this.z=n+h*u+r*l-a*c,this}transformDirection(t){const e=this.x,s=this.y,n=this.z,r=t.value;return this.x=r[0]*e+r[4]*s+r[8]*n,this.y=r[1]*e+r[5]*s+r[9]*n,this.z=r[2]*e+r[6]*s+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=v.clamp(this.x,t.x,e.x),this.y=v.clamp(this.y,t.y,e.y),this.z=v.clamp(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=v.clamp(this.x,t,e),this.y=v.clamp(this.y,t,e),this.z=v.clamp(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(v.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,n=t.y,r=t.z,a=e.x,o=e.y,h=e.z;return this.x=n*h-r*o,this.y=r*a-s*h,this.z=s*o-n*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Wi.copy(this).projectOnVector(t),this.sub(Wi)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Wi.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(v.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,n=this.z-t.z;return e*e+s*s+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),s=this.setFromMatrix4Column(t,1).length(),n=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=s,this.z=n,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class ji{x=0;y=0;z=0;w=1;constructor(t=0,e=0,s=0,n=1){this.x=t,this.y=e,this.z=s,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,s=0,n=1){return this.x=t,this.y=e,this.z=s,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new ji(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,n=this.z,r=this.w,a=t.value;return this.x=a[0]*e+a[4]*s+a[8]*n+a[12]*r,this.y=a[1]*e+a[5]*s+a[9]*n+a[13]*r,this.z=a[2]*e+a[6]*s+a[10]*n+a[14]*r,this.w=a[3]*e+a[7]*s+a[11]*n+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,s,n,r;const h=t.value,c=h[0],l=h[4],u=h[8],f=h[1],m=h[5],g=h[9],_=h[2],E=h[6],b=h[10];if(Math.abs(l-f)<.01&&Math.abs(u-_)<.01&&Math.abs(g-E)<.01){if(Math.abs(l+f)<.1&&Math.abs(u+_)<.1&&Math.abs(g+E)<.1&&Math.abs(c+m+b-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const y=(c+1)/2,w=(m+1)/2,P=(b+1)/2,M=(l+f)/4,L=(u+_)/4,U=(g+E)/4;return y>w&&y>P?y<.01?(s=0,n=.707106781,r=.707106781):(s=Math.sqrt(y),n=M/s,r=L/s):w>P?w<.01?(s=.707106781,n=0,r=.707106781):(n=Math.sqrt(w),s=M/n,r=U/n):P<.01?(s=.707106781,n=.707106781,r=0):(r=Math.sqrt(P),s=L/r,n=U/r),this.set(s,n,r,e),this}let S=Math.sqrt((E-g)*(E-g)+(u-_)*(u-_)+(f-l)*(f-l));return Math.abs(S)<.001&&(S=1),this.x=(E-g)/S,this.y=(u-_)/S,this.z=(f-l)/S,this.w=Math.acos((c+m+b-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=v.clamp(this.x,t.x,e.x),this.y=v.clamp(this.y,t.y,e.y),this.z=v.clamp(this.z,t.z,e.z),this.w=v.clamp(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=v.clamp(this.x,t,e),this.y=v.clamp(this.y,t,e),this.z=v.clamp(this.z,t,e),this.w=v.clamp(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(v.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const sa=new Je,Wi=new vt,ia=new Hi,Ze=2e3,$i=2001,na=[1,0,0,1],ra=[1,0,0,1,0,0],aa=[1,0,0,0,1,0,0,0,1],oa=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Ji{value;constructor(t=na){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,s=0,n=1){return this.m11=t,this.m21=e,this.m12=s,this.m22=n,this}identity(){return this.value=Array.from(na),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Ji(this.value)}fromArray(t,e=0){for(let s=0;s<4;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const s=t.value,n=e.value,r=this.value,a=s[0],o=s[2],h=s[1],c=s[3],l=n[0],u=n[2],f=n[1],m=n[3];return r[0]=a*l+o*f,r[2]=a*u+o*m,r[1]=h*l+c*f,r[3]=h*u+c*m,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class Ae{value;constructor(t=aa){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,s=0,n=0,r=1,a=0,o=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=n,l[2]=o,l[3]=e,l[4]=r,l[5]=h,l[6]=s,l[7]=a,l[8]=c,this}identity(){return this.value=Array.from(aa),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new Ae(this.value)}fromArray(t,e=0){for(let s=0;s<9;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const s=t.value,n=e.value,r=this.value,a=s[0],o=s[3],h=s[6],c=s[1],l=s[4],u=s[7],f=s[2],m=s[5],g=s[8],_=n[0],E=n[3],b=n[6],S=n[1],y=n[4],w=n[7],P=n[2],M=n[5],L=n[8];return r[0]=a*_+o*S+h*P,r[3]=a*E+o*y+h*M,r[6]=a*b+o*w+h*L,r[1]=c*_+l*S+u*P,r[4]=c*E+l*y+u*M,r[7]=c*b+l*w+u*L,r[2]=f*_+m*S+g*P,r[5]=f*E+m*y+g*M,r[8]=f*b+m*w+g*L,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}determinant(){const t=this.value,e=t[0],s=t[1],n=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-s*r*l+s*o*h+n*r*c-n*a*h}invert(){const t=this.value,e=t[0],s=t[1],n=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=l*a-o*c,f=o*h-l*r,m=c*r-a*h,g=e*u+s*f+n*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=u*_,t[1]=(n*c-l*s)*_,t[2]=(o*s-n*a)*_,t[3]=f*_,t[4]=(l*e-n*h)*_,t[5]=(n*r-o*e)*_,t[6]=m*_,t[7]=(s*h-c*e)*_,t[8]=(a*e-s*r)*_,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,n,r,a,o){const h=Math.cos(r),c=Math.sin(r);return this.set(s*h,s*c,-s*(h*a+c*o)+a+t,-n*c,n*h,-n*(-c*a+h*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Zi.makeScale(t,e)),this}rotate(t){return this.premultiply(Zi.makeRotation(-t)),this}translate(t,e){return this.premultiply(Zi.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class yt{value;is3dSpecial=!1;constructor(t=oa){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}set(t=1,e=0,s=0,n=0,r=0,a=1,o=0,h=0,c=0,l=0,u=1,f=0,m=0,g=0,_=0,E=1){const b=this.value;return b[0]=t,b[4]=e,b[8]=s,b[12]=n,b[1]=r,b[5]=a,b[9]=o,b[13]=h,b[2]=c,b[6]=l,b[10]=u,b[14]=f,b[3]=m,b[7]=g,b[11]=_,b[15]=E,this}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(oa),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new yt(this.value)}static fromString(t){const e=new yt,s=v.regMatchAll("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}fromArray(t,e=0){for(let s=0;s<16;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.value;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}copyPosition(t){const e=this.value,s=t.value;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),s.setFromMatrix4Column(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new wt(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>v.maxDotNumber(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=ut(v.clamp(Math.asin(-this.m13),-1,1));let r=ut(Math.atan2(this.m23,this.m33));Math.cos(Y(n))===0&&(r=ut(Math.atan2(-this.m31,this.m22)));let a=ut(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:ut(this.m14),skewY:ut(this.m24),skewZ:ut(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,s=t.value,n=1/ke.setFromMatrix4Column(t,0).length(),r=1/ke.setFromMatrix4Column(t,1).length(),a=1/ke.setFromMatrix4Column(t,2).length();return e[0]=s[0]*n,e[1]=s[1]*n,e[2]=s[2]*n,e[3]=0,e[4]=s[4]*r,e[5]=s[5]*r,e[6]=s[6]*r,e[7]=0,e[8]=s[8]*a,e[9]=s[9]*a,e[10]=s[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,s=t.x,n=t.y,r=t.z,a=Math.cos(s),o=Math.sin(s),h=Math.cos(n),c=Math.sin(n),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const f=a*l,m=a*u,g=o*l,_=o*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=m+g*c,e[5]=f-_*c,e[9]=-o*h,e[2]=_-f*c,e[6]=g+m*c,e[10]=a*h}else if(t.order==="YXZ"){const f=h*l,m=h*u,g=c*l,_=c*u;e[0]=f+_*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*u,e[5]=a*l,e[9]=-o,e[2]=m*o-g,e[6]=_+f*o,e[10]=a*h}else if(t.order==="ZXY"){const f=h*l,m=h*u,g=c*l,_=c*u;e[0]=f-_*o,e[4]=-a*u,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*l,e[9]=_-f*o,e[2]=-a*c,e[6]=o,e[10]=a*h}else if(t.order==="ZYX"){const f=a*l,m=a*u,g=o*l,_=o*u;e[0]=h*l,e[4]=g*c-m,e[8]=f*c+_,e[1]=h*u,e[5]=_*c+f,e[9]=m*c-g,e[2]=-c,e[6]=o*h,e[10]=a*h}else if(t.order==="YZX"){const f=a*h,m=a*c,g=o*h,_=o*c;e[0]=h*l,e[4]=_-f*u,e[8]=g*u+m,e[1]=u,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=m*u+g,e[10]=f-_*u}else if(t.order==="XZY"){const f=a*h,m=a*c,g=o*h,_=o*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=f*u+_,e[5]=a*l,e[9]=m*u-g,e[2]=g*u-m,e[6]=o*l,e[10]=_*u+f}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(kl,t,Dl)}lookAt(t,e,s){const n=this.value;return Tt.subVectors(t,e),Tt.lengthSq()===0&&(Tt.z=1),Tt.normalize(),ae.crossVectors(s,Tt),ae.lengthSq()===0&&(Math.abs(s.z)===1?Tt.x+=1e-4:Tt.z+=1e-4,Tt.normalize(),ae.crossVectors(s,Tt)),ae.normalize(),Os.crossVectors(Tt,ae),n[0]=ae.x,n[4]=Os.x,n[8]=Tt.x,n[1]=ae.y,n[5]=Os.y,n[9]=Tt.y,n[2]=ae.z,n[6]=Os.z,n[10]=Tt.z,this}multiplyMatrices(t,e){const s=t.value,n=e.value,r=this.value,a=s[0],o=s[4],h=s[8],c=s[12],l=s[1],u=s[5],f=s[9],m=s[13],g=s[2],_=s[6],E=s[10],b=s[14],S=s[3],y=s[7],w=s[11],P=s[15],M=n[0],L=n[4],U=n[8],G=n[12],W=n[1],$=n[5],K=n[9],ht=n[13],it=n[2],Bt=n[6],Et=n[10],It=n[14],Nt=n[3],z=n[7],R=n[11],X=n[15];return r[0]=a*M+o*W+h*it+c*Nt,r[4]=a*L+o*$+h*Bt+c*z,r[8]=a*U+o*K+h*Et+c*R,r[12]=a*G+o*ht+h*It+c*X,r[1]=l*M+u*W+f*it+m*Nt,r[5]=l*L+u*$+f*Bt+m*z,r[9]=l*U+u*K+f*Et+m*R,r[13]=l*G+u*ht+f*It+m*X,r[2]=g*M+_*W+E*it+b*Nt,r[6]=g*L+_*$+E*Bt+b*z,r[10]=g*U+_*K+E*Et+b*R,r[14]=g*G+_*ht+E*It+b*X,r[3]=S*M+y*W+w*it+P*Nt,r[7]=S*L+y*$+w*Bt+P*z,r[11]=S*U+y*K+w*Et+P*R,r[15]=S*G+y*ht+w*It+P*X,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this}determinant(){const t=this.value,e=t[0],s=t[4],n=t[8],r=t[12],a=t[1],o=t[5],h=t[9],c=t[13],l=t[2],u=t[6],f=t[10],m=t[14],g=t[3],_=t[7],E=t[11],b=t[15];return g*(+r*h*u-n*c*u-r*o*f+s*c*f+n*o*m-s*h*m)+_*(+e*h*m-e*c*f+r*a*f-n*a*m+n*c*l-r*h*l)+E*(+e*c*u-e*o*m-r*a*u+s*a*m+r*o*l-s*c*l)+b*(-n*o*l-e*h*u+e*o*f+n*a*u-s*a*f+s*h*l)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const n=this.value;return t instanceof vt?(n[12]=t.x,n[13]=t.y,n[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&(n[12]=t,n[13]=e,n[14]=s),this}invert(){const t=this.value,e=t[0],s=t[1],n=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=t[9],f=t[10],m=t[11],g=t[12],_=t[13],E=t[14],b=t[15],S=u*E*c-_*f*c+_*h*m-o*E*m-u*h*b+o*f*b,y=g*f*c-l*E*c-g*h*m+a*E*m+l*h*b-a*f*b,w=l*_*c-g*u*c+g*o*m-a*_*m-l*o*b+a*u*b,P=g*u*h-l*_*h-g*o*f+a*_*f+l*o*E-a*u*E,M=e*S+s*y+n*w+r*P;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/M;return t[0]=S*L,t[1]=(_*f*r-u*E*r-_*n*m+s*E*m+u*n*b-s*f*b)*L,t[2]=(o*E*r-_*h*r+_*n*c-s*E*c-o*n*b+s*h*b)*L,t[3]=(u*h*r-o*f*r-u*n*c+s*f*c+o*n*m-s*h*m)*L,t[4]=y*L,t[5]=(l*E*r-g*f*r+g*n*m-e*E*m-l*n*b+e*f*b)*L,t[6]=(g*h*r-a*E*r-g*n*c+e*E*c+a*n*b-e*h*b)*L,t[7]=(a*f*r-l*h*r+l*n*c-e*f*c-a*n*m+e*h*m)*L,t[8]=w*L,t[9]=(g*u*r-l*_*r-g*s*m+e*_*m+l*s*b-e*u*b)*L,t[10]=(a*_*r-g*o*r+g*s*c-e*_*c-a*s*b+e*o*b)*L,t[11]=(l*o*r-a*u*r-l*s*c+e*u*c+a*s*m-e*o*m)*L,t[12]=P*L,t[13]=(l*_*n-g*u*n+g*s*f-e*_*f-l*s*E+e*u*E)*L,t[14]=(g*o*n-a*_*n-g*s*h+e*_*h+a*s*E-e*o*E)*L,t[15]=(a*u*n-l*o*n+l*s*h-e*u*h-a*s*f+e*o*f)*L,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,n))}makeTranslation(t,e,s){return t instanceof vt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),n=Math.sin(e),r=1-s,a=t.x,o=t.y,h=t.z,c=r*a,l=r*o;return this.set(c*a+s,c*o-n*h,c*h+n*o,0,c*o+n*h,l*o+s,l*h-n*a,0,c*h-n*o,l*h+n*a,r*h*h+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,n,r,a){return this.set(1,s,r,0,t,1,a,0,e,n,1,0,0,0,0,1),this}makePerspective(t,e,s,n,r,a,o=Ze){const h=this.value,c=2*r/(e-t),l=2*r/(s-n),u=(e+t)/(e-t),f=(s+n)/(s-n);let m,g;if(o===Ze)m=-(a+r)/(a-r),g=-2*a*r/(a-r);else if(o===$i)m=-a/(a-r),g=-a*r/(a-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=c,h[4]=0,h[8]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=f,h[13]=0,h[2]=0,h[6]=0,h[10]=m,h[14]=g,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,s,n,r,a,o=Ze){const h=this.value,c=1/(e-t),l=1/(s-n),u=1/(a-r),f=(e+t)*c,m=(s+n)*l;let g,_;if(o===Ze)g=(a+r)*u,_=-2*u;else if(o===$i)g=r*u,_=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-f,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-m,h[2]=0,h[6]=0,h[10]=_,h[14]=-g,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,s){const n=this.value,r=e.x,a=e.y,o=e.z,h=e.w,c=r+r,l=a+a,u=o+o,f=r*c,m=r*l,g=r*u,_=a*l,E=a*u,b=o*u,S=h*c,y=h*l,w=h*u,P=s.x,M=s.y,L=s.z;return n[0]=(1-(_+b))*P,n[1]=(m+w)*P,n[2]=(g-y)*P,n[3]=0,n[4]=(m-w)*M,n[5]=(1-(f+b))*M,n[6]=(E+S)*M,n[7]=0,n[8]=(g+y)*L,n[9]=(E-S)*L,n[10]=(1-(f+_))*L,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,s){const n=this.value;let r=ke.set(n[0],n[1],n[2]).length();const a=ke.set(n[4],n[5],n[6]).length(),o=ke.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],Lt.copy(this);const c=1/r,l=1/a,u=1/o;return Lt.value[0]*=c,Lt.value[1]*=c,Lt.value[2]*=c,Lt.value[4]*=l,Lt.value[5]*=l,Lt.value[6]*=l,Lt.value[8]*=u,Lt.value[9]*=u,Lt.value[10]*=u,e.setFromRotationMatrix4(Lt),s.x=r,s.y=a,s.z=o,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,s=0){return this.multiply(new yt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new yt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}scaleVector3(t){const e=this.value,s=t.x,n=t.y,r=t.z;return e[0]*=s,e[4]*=n,e[8]*=r,e[1]*=s,e[5]*=n,e[9]*=r,e[2]*=s,e[6]*=n,e[10]*=r,e[3]*=s,e[7]*=n,e[11]*=r,this}rotateX(t){const e=Y(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new yt([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=Y(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new yt([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=Y(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new yt([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new yt([1,0,0,Y(t),0,1,0,Y(e),0,0,1,Y(s),0,0,0,1]))}perspective(t){return this.multiply(new yt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const u=-n/l;return e+=u*(a-e),s+=u*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new $e({x:t,y:e}),a=new $e({x:t+s,y:e}),o=new $e({x:t+s,y:e+n}),h=new $e({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),u=Math.max(r.x,a.x,o.x,h.x)-c,f=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:u,height:f}}}class wt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=ra){this.value=Array.from(t),this.matrix4=this.toMatrix4()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}static fromString(t){const e=new wt,s=v.regMatchAll("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}toMatrix4(t=this.matrix4){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new yt(e)}identity(){return this.value=Array.from(ra),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.multiplyScalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new wt(this.value)}multiply(t){const e=this.clone(),s=t instanceof wt?t:new wt(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}invert(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,u=-c*n+a*o,f=h*n-r*o;let m=t*l+e*u+s*f;return m?(m=1/m,this.m11=l*m,this.m12=(-c*e+s*h)*m,this.m13=(a*e-s*r)*m,this.m21=u*m,this.m22=(c*t-s*o)*m,this.m23=(-a*t+s*n)*m,this.m31=f*m,this.m32=(-h*t+e*o)*m,this.m33=(r*t-e*n)*m,this):null}adjugate(){const t=new wt;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=ut(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:ut(Math.atan2(-this.m21,this.m22)),skewY:ut(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],u=t.value[3],f=t.value[4],m=t.value[5],g=h*u,_=c*l,E=(l*s-e*u)/(_-g),b=(h*s-e*c)/(g-_),S=(l*r-n*u)/(_-g),y=(h*r-n*c)/(g-_),w=(l*(o-m)+u*(f-a))/(_-g),P=(h*(o-m)+c*(f-a))/(g-_),M=[E,b,S,y,w,P];return new wt(M)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>v.maxDotNumber(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,s){return this.matrix4.translate(t,e,s),this.matrix4.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,s-this.matrix4.m43),this}rotate(t,e=0,s=0){const n=Y(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix4(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix4.rotateX(t).rotateY(e).rotateZ(s),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix4.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix4(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix4.scale(t,e,s),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix4.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(Y(e)),Math.sin(Y(e)),-Math.sin(Y(t)),Math.cos(Y(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const kl=new vt(0,0,0),Dl=new vt(1,1,1),ae=new vt,Os=new vt,Tt=new vt,ke=new vt,Zi=new Ae,Lt=new yt;function Ki(i){const t=new wt;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new yt(r)),t.matrix4.toMatrix(t);break}return""}),t}function zt(i,t,e){const s=new wt;return s.rotate(ut(i)),s.transformPoint({x:t,y:e})}function Qi(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=Y(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function Rl(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,Qi(t)),s}function we(i,t,e){const s=Xi(i);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[v.toCamel(t)]||s.props.style[v.toKebab(t)]||"":s.props.style}function tn(i,t,e){Ui(i,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(n=>{s.props.style[n]=t[n]})},!0)}function en(i){const t={};if(getComputedStyle){const e=getComputedStyle(i);for(let s=0,n=e.length;s<n;s++)t[e[s]]=e.getPropertyValue(t[s])}else{const e=i.currentStyle;for(const s in e)t[s]=e[s]}return i.style.cssText&&i.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[s,n]=e.split(":");s&&n&&(t[s.trim()]=n.trim())}),t}function Ll(i,t,e){let s=i.style[t]||"";if(!s&&getComputedStyle){t=v.toKebab(t);const n=getComputedStyle(i,e),r=n.getPropertyPriority(t);s=n.getPropertyValue(t).trim()+(r?"!"+r:"")}return s||(s=i.currentStyle[t]||""),s}function Bs(i,t,e){typeof t=="string"&&e?i.style.setProperty(v.toKebab(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Bs(i,s,t[s])})}function sn(i,t){typeof t=="string"?i.style.removeProperty(v.toKebab(t)):Object.keys(t).forEach(e=>{sn(i,e)})}function ha(i,t){let e;if(typeof t=="string"){const s=document.querySelector(t)?.shadowRoot;s?e=s:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const s=document.createElement("style");return s.innerHTML=i,e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)}}else{const s=document.styleSheets[0].insertRule(i);return()=>{document.styleSheets[0].deleteRule(s)}}}function zl(i,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:we(i,"transform")||""});const s=Ki(e.transform),n={};for(const r in t){const a=t[r];switch(r){case"transform":break;case"translate":s.translate(a[0]||0,a[1]||0);break;case"translateTo":s.translateTo(a[0]||0,a[1]||0);break;case"translateX":s.translateX(a||0);break;case"translateXTo":s.translateXTo(a||0);break;case"translateY":s.translateY(a||0);break;case"translateYTo":s.translateYTo(a||0);break;case"translateZ":s.translateZ(a||0);break;case"translateZTo":s.translateZTo(a||0);break;case"translate3d":s.translate3d(a[0]||0,a[1]||0,a[2]||0);break;case"translate3dTo":s.translate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotate":typeof a=="number"?s.rotate(a||0):s.rotate(a[0]||0,a[1]||0,a[2]||0);break;case"rotateTo":typeof a=="number"?s.rotateTo(a||0):s.rotateTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotateX":s.rotateX(a||0);break;case"rotateXTo":s.rotateXTo(a||0);break;case"rotateY":s.rotateY(a||0);break;case"rotateYTo":s.rotateYTo(a||0);break;case"rotateZ":s.rotateZ(a||0);break;case"rotateZTo":s.rotateZTo(a||0);break;case"rotate3d":s.rotate3d(a[0]||0,a[1]||0,a[2]||0);break;case"rotate3dTo":s.rotate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"scale":typeof a=="number"?s.scale(a||1):s.scale(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleTo":typeof a=="number"?s.scaleTo(a||1):s.scaleTo(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleX":s.scaleX(a||1);break;case"scaleXTo":s.scaleXTo(a||1);break;case"scaleY":s.scaleY(a||1);break;case"scaleYTo":s.scaleYTo(a||1);break;case"scaleZ":s.scaleZ(a||1);break;case"scaleZTo":s.scaleZTo(a||1);break;case"scale3d":typeof a=="number"?s.scale3d(a||1):s.scale3d(a[0]||1,a[1]||1,a[2]||1);break;case"scale3dTo":typeof a=="number"?s.scale3dTo(a||1):s.scale3dTo(a[0]||1,a[1]||1,a[2]||1);break;case"skew":typeof a=="number"?s.skew(a||0):s.skew(a[0]||0,a[1]||0);break;case"skewTo":typeof a=="number"?s.skewTo(a||0):s.skewTo(a[0]||0,a[1]||0);break;case"skewX":s.skewX(a||0);break;case"skewXTo":s.skewXTo(a||0);break;case"skewY":s.skewY(a||0);break;case"skewYTo":s.skewYTo(a||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(a||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=we(i,r)),Object.assign(n,{[r]:`${a}`});break}}return Object.assign(n,{transform:s.toString()}),n}function oe(i,t,e){if(t===void 0&&e===void 0)return nn(i);if(typeof t=="string"&&e===void 0)return ca(i,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=""+e),Ui(i,n=>{Object.entries(s).forEach(([r,a])=>{n.props[r]=""+a})})}const Ol=["-o-","-ms-","-moz-","-webkit-",""];function nn(i){const t={};for(let e=0,s=i.attributes,n=s.length;e<n;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=en(i):t[r.nodeName]=r.nodeValue)}return t}function ca(i,t){return t==="style"?en(i):i.getAttribute(v.toKebab(t))}function De(i,t,e){return i.setAttribute(v.toKebab(t),""+e)}function Bl(i,t){t.split(/[,\s]+/i).forEach(e=>{const s=v.toKebab(e.trim());s!=""&&i.removeAttribute(s)})}function Nl(i,t){De(i,"draggable","true");const e=[];return e.push(N(i,"dragstart",s=>{ie(s),Rr(s);const n=s.dataTransfer;n&&(n.effectAllowed="move",n.setData("text/plain","some-data")),t?.onStart?.(s)},!0)),e.push(N(i,"drag",s=>{ie(s),t?.onDrag?.(s)})),e.push(N(i,"dragend",s=>{ie(s),t?.onEnd?.(s)})),()=>{e.forEach(s=>s())}}function Fl(i,t){const e=[];return e.push(N(i,"dragenter",s=>{ie(s),t?.onEnter?.(s)})),e.push(N(i,"dragover",s=>{ie(s);const n=s.dataTransfer;n&&(n.dropEffect="move"),t?.onOver?.(s)})),e.push(N(i,"dragleave",s=>{ie(s),t?.onLeave?.(s)})),e.push(N(i,"drop",s=>{ie(s);const n=s.dataTransfer;if(!n){t?.onDrop?.(s,[]);return}t?.onDrop?.(s,[...n.files])})),()=>{e.forEach(s=>s())}}function Yl(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function Ke(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function Xl(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function la(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function Ul(){const{scrollWidth:i,scrollHeight:t}=Ke();return{width:i,height:t}}function rn(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ke();return{x:e+r,y:t+a,width:s,height:n}}function Vl(i){let t=i,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:i.offsetWidth,height:i.offsetHeight}}function ua(i){return i.getBoundingClientRect()}function Gl(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ql(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Ke(),s=e-i;return s<=0?0:t/s*100}function fa(){const i={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,s){i.x=e.x,i.y=e.y,typeof s=="boolean"&&(i.isDown=s),this.setCurrentMousePoint(e,s)},setCurrentMousePoint:(e,s)=>{const n=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-n,t.dy=t.y-r,t.dStartX=t.x-i.x,t.dStartY=t.y-i.y,typeof s=="boolean"&&(t.isDown=s)}}}function Hl(i){if("center"in i){const t=i.center,e=ua(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function an(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Ke();return{x:i.clientX+t,y:i.clientY+e}}function Re(i,t){const e={x:0,y:0};if(t){const s=an(i),n=rn(t);e.x=v.clamp(s.x-n.x,0,n.width),e.y=v.clamp(s.y-n.y,0,n.height)}else{let s=0,n=0;if("currentTarget"in i&&i.currentTarget&&i.target&&i.currentTarget!=i.target){const r=i.currentTarget.getBoundingClientRect(),a=i.target.getBoundingClientRect();s=a.left-r.left,n=a.top-r.top}if("offsetX"in i)e.x=i.offsetX+s,e.y=i.offsetY+n;else{const r=an(i),a=rn(i.target);e.x=v.clamp(r.x-a.x+s,0,a.width),e.y=v.clamp(r.y-a.y+n,0,a.height)}}return e}var da={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
7
7
  * http://hammerjs.github.io/
8
8
  *
9
9
  * Copyright (c) 2016 Jorik Tangelder;