UNPKG

@splinetool/loader

Version:

Spline is a collaborative design platform for creating production-ready interactive experiences in multiple dimensions. © 2024 Spline, Inc.

2 lines 864 kB
var aw=Object.create;var kl=Object.defineProperty;var sw=Object.getOwnPropertyDescriptor;var lw=Object.getOwnPropertyNames;var cw=Object.getPrototypeOf,uw=Object.prototype.hasOwnProperty;var dw=(i,t,e)=>t in i?kl(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var As=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),pw=(i,t)=>{for(var e in t)kl(i,e,{get:t[e],enumerable:!0})},fw=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lw(t))!uw.call(i,o)&&o!==e&&kl(i,o,{get:()=>t[o],enumerable:!(r=sw(t,o))||r.enumerable});return i};var Ms=(i,t,e)=>(e=i!=null?aw(cw(i)):{},fw(t||!i||!i.__esModule?kl(e,"default",{value:i,enumerable:!0}):e,i));var qi=(i,t,e)=>(dw(i,typeof t!="symbol"?t+"":t,e),e);var rx=As((Gp,tx)=>{(function(i,t){typeof Gp=="object"?tx.exports=t():typeof define=="function"&&define.amd?define(t):i.Alea=t()})(Gp,function(){"use strict";return i.importState=function(e){var r=new i;return r.importState(e),r},i;function i(){return function(e){var r=0,o=0,n=0,a=1;e.length==0&&(e=[+new Date]);var s=t();r=s(" "),o=s(" "),n=s(" ");for(var l=0;l<e.length;l++)r-=s(e[l]),r<0&&(r+=1),o-=s(e[l]),o<0&&(o+=1),n-=s(e[l]),n<0&&(n+=1);s=null;var c=function(){var u=2091639*r+a*23283064365386963e-26;return r=o,o=n,n=u-(a=u|0)};return c.next=c,c.uint32=function(){return c()*4294967296},c.fract53=function(){return c()+(c()*2097152|0)*11102230246251565e-32},c.version="Alea 0.9",c.args=e,c.exportState=function(){return[r,o,n,a]},c.importState=function(u){r=+u[0]||0,o=+u[1]||0,n=+u[2]||0,a=+u[3]||0},c}(Array.prototype.slice.call(arguments))}function t(){var e=4022871197,r=function(o){o=o.toString();for(var n=0;n<o.length;n++){e+=o.charCodeAt(n);var a=.02519603282416938*e;e=a>>>0,a-=e,a*=e,e=a>>>0,a-=e,e+=a*4294967296}return(e>>>0)*23283064365386963e-26};return r.version="Mash 0.9",r}})});var lx=As((lu,sx)=>{(function(i,t){typeof lu=="object"&&typeof sx<"u"?t(lu):typeof define=="function"&&define.amd?define(["exports"],t):t((i=typeof globalThis<"u"?globalThis:i||self).SVDJS={})})(lu,function(i){"use strict";i.SVD=function(t,e,r,o,n){if(e=e===void 0||e,r=r===void 0||r,n=1e-64/(o=o||Math.pow(2,-52)),!t)throw new TypeError("Matrix a is not defined");var a,s,l,c,u,p,d,f,h,m,y,b,v=t[0].length,w=t.length;if(w<v)throw new TypeError("Invalid matrix: m < n");for(var O=[],S=[],T=[],M=e==="f"?w:v,g=m=d=0;g<w;g++)S[g]=new Array(M).fill(0);for(g=0;g<v;g++)T[g]=new Array(v).fill(0);var D,E=new Array(v).fill(0);for(g=0;g<w;g++)for(a=0;a<v;a++)S[g][a]=t[g][a];for(g=0;g<v;g++){for(O[g]=d,h=0,l=g+1,a=g;a<w;a++)h+=Math.pow(S[a][g],2);if(h<n)d=0;else for(f=(p=S[g][g])*(d=p<0?Math.sqrt(h):-Math.sqrt(h))-h,S[g][g]=p-d,a=l;a<v;a++){for(h=0,s=g;s<w;s++)h+=S[s][g]*S[s][a];for(p=h/f,s=g;s<w;s++)S[s][a]=S[s][a]+p*S[s][g]}for(E[g]=d,h=0,a=l;a<v;a++)h+=Math.pow(S[g][a],2);if(h<n)d=0;else{for(f=(p=S[g][g+1])*(d=p<0?Math.sqrt(h):-Math.sqrt(h))-h,S[g][g+1]=p-d,a=l;a<v;a++)O[a]=S[g][a]/f;for(a=l;a<w;a++){for(h=0,s=l;s<v;s++)h+=S[a][s]*S[g][s];for(s=l;s<v;s++)S[a][s]=S[a][s]+h*O[s]}}m<(y=Math.abs(E[g])+Math.abs(O[g]))&&(m=y)}if(r)for(g=v-1;0<=g;g--){if(d!==0){for(f=S[g][g+1]*d,a=l;a<v;a++)T[a][g]=S[g][a]/f;for(a=l;a<v;a++){for(h=0,s=l;s<v;s++)h+=S[g][s]*T[s][a];for(s=l;s<v;s++)T[s][a]=T[s][a]+h*T[s][g]}}for(a=l;a<v;a++)T[g][a]=0,T[a][g]=0;T[g][g]=1,d=O[g],l=g}if(e){if(e==="f")for(g=v;g<w;g++){for(a=v;a<w;a++)S[g][a]=0;S[g][g]=1}for(g=v-1;0<=g;g--){for(l=g+1,d=E[g],a=l;a<M;a++)S[g][a]=0;if(d!==0){for(f=S[g][g]*d,a=l;a<M;a++){for(h=0,s=l;s<w;s++)h+=S[s][g]*S[s][a];for(p=h/f,s=g;s<w;s++)S[s][a]=S[s][a]+p*S[s][g]}for(a=g;a<w;a++)S[a][g]=S[a][g]/d}else for(a=g;a<w;a++)S[a][g]=0;S[g][g]=S[g][g]+1}}for(o*=m,s=v-1;0<=s;s--)for(var I=0;I<50;I++){for(D=!1,l=s;0<=l;l--){if(Math.abs(O[l])<=o){D=!0;break}if(Math.abs(E[l-1])<=o)break}if(!D){for(u=0,c=l-(h=1),g=l;g<s+1&&(p=h*O[g],O[g]=u*O[g],!(Math.abs(p)<=o));g++)if(d=E[g],E[g]=Math.sqrt(p*p+d*d),u=d/(f=E[g]),h=-p/f,e)for(a=0;a<w;a++)y=S[a][c],b=S[a][g],S[a][c]=y*u+b*h,S[a][g]=-y*h+b*u}if(b=E[s],l===s){if(b<0&&(E[s]=-b,r))for(a=0;a<v;a++)T[a][s]=-T[a][s];break}for(m=E[l],p=(((y=E[s-1])-b)*(y+b)+((d=O[s-1])-(f=O[s]))*(d+f))/(2*f*y),d=Math.sqrt(p*p+1),p=((m-b)*(m+b)+f*(y/(p<0?p-d:p+d)-f))/m,g=l+(h=u=1);g<s+1;g++){if(d=O[g],y=E[g],f=h*d,d*=u,b=Math.sqrt(p*p+f*f),p=m*(u=p/(O[g-1]=b))+d*(h=f/b),d=-m*h+d*u,f=y*h,y*=u,r)for(a=0;a<v;a++)m=T[a][g-1],b=T[a][g],T[a][g-1]=m*u+b*h,T[a][g]=-m*h+b*u;if(b=Math.sqrt(p*p+f*f),p=(u=p/(E[g-1]=b))*d+(h=f/b)*y,m=-h*d+u*y,e)for(a=0;a<w;a++)y=S[a][g-1],b=S[a][g],S[a][g-1]=y*u+b*h,S[a][g]=-y*h+b*u}O[l]=0,O[s]=p,E[s]=m}for(g=0;g<v;g++)E[g]<o&&(E[g]=0);return{u:S,q:E,v:T}},i.VERSION="1.1.1",Object.defineProperty(i,"__esModule",{value:!0})})});var O1=As((Yle,P1)=>{"use strict";function n_(i,t){function e(){this.constructor=i}e.prototype=t.prototype,i.prototype=new e}function Sn(i,t,e,r){this.message=i,this.expected=t,this.found=e,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Sn)}n_(Sn,Error);Sn.buildMessage=function(i,t){var e={literal:function(c){return'"'+o(c.text)+'"'},class:function(c){var u="",p;for(p=0;p<c.parts.length;p++)u+=c.parts[p]instanceof Array?n(c.parts[p][0])+"-"+n(c.parts[p][1]):n(c.parts[p]);return"["+(c.inverted?"^":"")+u+"]"},any:function(c){return"any character"},end:function(c){return"end of input"},other:function(c){return c.description}};function r(c){return c.charCodeAt(0).toString(16).toUpperCase()}function o(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function n(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function a(c){return e[c.type](c)}function s(c){var u=new Array(c.length),p,d;for(p=0;p<c.length;p++)u[p]=a(c[p]);if(u.sort(),u.length>0){for(p=1,d=1;p<u.length;p++)u[p-1]!==u[p]&&(u[d]=u[p],d++);u.length=d}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+o(c)+'"':"end of input"}return"Expected "+s(i)+" but "+l(t)+" found."};function a_(i,t){t=t!==void 0?t:{};var e={},r={svg_path:Cs},o=Cs,n=function(x){if(!x)return[];for(var P=[],L=0;L<x.length;L++)P=P.concat.apply(P,x[L]);var A=P[0];return A&&A.code=="m"&&(delete A.relative,A.code="M"),P},a=function(x,P){return nw(x,P)},s=/^[Mm]/,l=Ke(["M","m"],!1,!1),c=function(x,P,L){var A=An(x,[P]);return L&&(A=A.concat(An(x=="M"?"L":"l",L[1]))),A},u=/^[Zz]/,p=Ke(["Z","z"],!1,!1),d=function(){return An("Z")},f=/^[Ll]/,h=Ke(["L","l"],!1,!1),m=function(x,P){return An(x,P)},y=/^[Hh]/,b=Ke(["H","h"],!1,!1),v=function(x,P){return An(x,P.map(function(L){return{x:L}}))},w=/^[Vv]/,O=Ke(["V","v"],!1,!1),S=function(x,P){return An(x,P.map(function(L){return{y:L}}))},T=/^[Cc]/,M=Ke(["C","c"],!1,!1),g=function(x,P,L){return{x1:x.x,y1:x.y,x2:P.x,y2:P.y,x:L.x,y:L.y}},D=/^[Ss]/,E=Ke(["S","s"],!1,!1),I=function(x,P){return{x2:x.x,y2:x.y,x:P.x,y:P.y}},N=/^[Qq]/,_=Ke(["Q","q"],!1,!1),R=function(x,P){return{x1:x.x,y1:x.y,x:P.x,y:P.y}},V=/^[Tt]/,U=Ke(["T","t"],!1,!1),B=/^[Aa]/,q=Ke(["A","a"],!1,!1),j=function(x,P,L,A,z,oe){return{rx:x,ry:P,xAxisRotation:L,largeArc:A,sweep:z,x:oe.x,y:oe.y}},F=function(x,P){return{x,y:P}},H=function(x){return x*1},W=function(x){return x.join("")*1},ee=/^[01]/,te=Ke(["0","1"],!1,!1),Y=function(x){return x=="1"},re=function(){return""},K=",",Z=it(",",!1),Q=function(x){return x.join("")},$=".",de=it(".",!1),le=/^[eE]/,ie=Ke(["e","E"],!1,!1),ce=/^[+\-]/,ae=Ke(["+","-"],!1,!1),me=/^[0-9]/,fe=Ke([["0","9"]],!1,!1),he=function(x){return x.join("")},xe=/^[ \t\n\r]/,ye=Ke([" "," ",` `,"\r"],!1,!1),C=0,ne=0,Ne=[{line:1,column:1}],Ve=0,_e=[],Pe=0,St;if("startRule"in t){if(!(t.startRule in r))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');o=r[t.startRule]}function Me(){return i.substring(ne,C)}function bt(){return ki(ne,C)}function wt(x,P){throw P=P!==void 0?P:ki(ne,C),mr([Fd(x)],i.substring(ne,C),P)}function Ui(x,P){throw P=P!==void 0?P:ki(ne,C),jd(x,P)}function it(x,P){return{type:"literal",text:x,ignoreCase:P}}function Ke(x,P,L){return{type:"class",parts:x,inverted:P,ignoreCase:L}}function Er(){return{type:"any"}}function Gd(){return{type:"end"}}function Fd(x){return{type:"other",description:x}}function zl(x){var P=Ne[x],L;if(P)return P;for(L=x-1;!Ne[L];)L--;for(P=Ne[L],P={line:P.line,column:P.column};L<x;)i.charCodeAt(L)===10?(P.line++,P.column=1):P.column++,L++;return Ne[x]=P,P}function ki(x,P){var L=zl(x),A=zl(P);return{start:{offset:x,line:L.line,column:L.column},end:{offset:P,line:A.line,column:A.column}}}function ct(x){C<Ve||(C>Ve&&(Ve=C,_e=[]),_e.push(x))}function jd(x,P){return new Sn(x,null,null,P)}function mr(x,P,L){return new Sn(Sn.buildMessage(x,P),x,P,L)}function Cs(){var x,P,L,A,z;for(x=C,P=[],L=ze();L!==e;)P.push(L),L=ze();if(P!==e)if(L=Ht(),L===e&&(L=null),L!==e){for(A=[],z=ze();z!==e;)A.push(z),z=ze();A!==e?(ne=x,P=n(L),x=P):(C=x,x=e)}else C=x,x=e;else C=x,x=e;return x}function Ht(){var x,P,L,A,z,oe;if(x=C,P=Hi(),P!==e){for(L=[],A=C,z=[],oe=ze();oe!==e;)z.push(oe),oe=ze();for(z!==e?(oe=Hi(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;){for(L.push(A),A=C,z=[],oe=ze();oe!==e;)z.push(oe),oe=ze();z!==e?(oe=Hi(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e)}L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function Hi(){var x,P,L,A,z,oe;if(x=C,P=Tn(),P!==e){for(L=[],A=C,z=[],oe=ze();oe!==e;)z.push(oe),oe=ze();for(z!==e?(oe=Gl(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;){for(L.push(A),A=C,z=[],oe=ze();oe!==e;)z.push(oe),oe=ze();z!==e?(oe=Gl(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e)}L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function Gl(){var x;return x=HS(),x===e&&(x=WS(),x===e&&(x=qS(),x===e&&(x=$S(),x===e&&(x=XS(),x===e&&(x=KS(),x===e&&(x=ZS(),x===e&&(x=ew(),x===e&&(x=rw())))))))),x}function Tn(){var x,P,L,A,z,oe,Mn;if(x=C,s.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(l)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=qt(),A!==e?(z=C,oe=tt(),oe===e&&(oe=null),oe!==e?(Mn=lm(),Mn!==e?(oe=[oe,Mn],z=oe):(C=z,z=e)):(C=z,z=e),z===e&&(z=null),z!==e?(ne=x,P=c(P,A,z),x=P):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function HS(){var x,P;return x=C,u.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(p)),P!==e&&(ne=x,P=d()),x=P,x}function WS(){var x,P,L,A;if(x=C,f.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(h)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=lm(),A!==e?(ne=x,P=m(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function lm(){var x,P,L,A,z,oe;if(x=C,P=qt(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=qt(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=qt(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function qS(){var x,P,L,A;if(x=C,y.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(b)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=cm(),A!==e?(ne=x,P=v(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function cm(){var x,P,L,A,z,oe;if(x=C,P=Cn(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Cn(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Cn(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function $S(){var x,P,L,A;if(x=C,w.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(O)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=cm(),A!==e?(ne=x,P=S(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function XS(){var x,P,L,A;if(x=C,T.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(M)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=YS(),A!==e?(ne=x,P=m(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function YS(){var x,P,L,A,z,oe;if(x=C,P=Ud(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Ud(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Ud(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function Ud(){var x,P,L,A,z,oe;return x=C,P=qt(),P!==e?(L=tt(),L===e&&(L=null),L!==e?(A=qt(),A!==e?(z=tt(),z===e&&(z=null),z!==e?(oe=qt(),oe!==e?(ne=x,P=g(P,A,oe),x=P):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e),x}function KS(){var x,P,L,A;if(x=C,D.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(E)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=QS(),A!==e?(ne=x,P=m(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function QS(){var x,P,L,A,z,oe;if(x=C,P=kd(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=kd(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=kd(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function kd(){var x,P,L,A;return x=C,P=qt(),P!==e?(L=tt(),L===e&&(L=null),L!==e?(A=qt(),A!==e?(ne=x,P=I(P,A),x=P):(C=x,x=e)):(C=x,x=e)):(C=x,x=e),x}function ZS(){var x,P,L,A;if(x=C,N.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(_)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=JS(),A!==e?(ne=x,P=m(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function JS(){var x,P,L,A,z,oe;if(x=C,P=Hd(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Hd(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Hd(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function Hd(){var x,P,L,A;return x=C,P=qt(),P!==e?(L=tt(),L===e&&(L=null),L!==e?(A=qt(),A!==e?(ne=x,P=R(P,A),x=P):(C=x,x=e)):(C=x,x=e)):(C=x,x=e),x}function ew(){var x,P,L,A;if(x=C,V.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(U)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=tw(),A!==e?(ne=x,P=m(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function tw(){var x,P,L,A,z,oe;if(x=C,P=qt(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=qt(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=qt(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function rw(){var x,P,L,A;if(x=C,B.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(q)),P!==e){for(L=[],A=ze();A!==e;)L.push(A),A=ze();L!==e?(A=ow(),A!==e?(ne=x,P=m(P,A),x=P):(C=x,x=e)):(C=x,x=e)}else C=x,x=e;return x}function ow(){var x,P,L,A,z,oe;if(x=C,P=Wd(),P!==e){for(L=[],A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Wd(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);A!==e;)L.push(A),A=C,z=tt(),z===e&&(z=null),z!==e?(oe=Wd(),oe!==e?(z=[z,oe],A=z):(C=A,A=e)):(C=A,A=e);L!==e?(ne=x,P=a(P,L),x=P):(C=x,x=e)}else C=x,x=e;return x}function Wd(){var x,P,L,A,z,oe,Mn,$d,jl,Xd,Ul,Yd;return x=C,P=um(),P!==e?(L=tt(),L===e&&(L=null),L!==e?(A=um(),A!==e?(z=tt(),z===e&&(z=null),z!==e?(oe=Cn(),oe!==e?(Mn=tt(),Mn!==e?($d=dm(),$d!==e?(jl=tt(),jl===e&&(jl=null),jl!==e?(Xd=dm(),Xd!==e?(Ul=tt(),Ul===e&&(Ul=null),Ul!==e?(Yd=qt(),Yd!==e?(ne=x,P=j(P,A,oe,$d,Xd,Yd),x=P):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e)):(C=x,x=e),x}function qt(){var x,P,L,A;return x=C,P=Cn(),P!==e?(L=tt(),L===e&&(L=null),L!==e?(A=Cn(),A!==e?(ne=x,P=F(P,A),x=P):(C=x,x=e)):(C=x,x=e)):(C=x,x=e),x}function um(){var x,P;return x=C,P=fm(),P===e&&(P=Wi()),P!==e&&(ne=x,P=H(P)),x=P,x}function Cn(){var x,P,L,A;return x=C,P=C,L=qd(),L===e&&(L=null),L!==e?(A=fm(),A!==e?(L=[L,A],P=L):(C=P,P=e)):(C=P,P=e),P===e&&(P=C,L=qd(),L===e&&(L=null),L!==e?(A=Wi(),A!==e?(L=[L,A],P=L):(C=P,P=e)):(C=P,P=e)),P!==e&&(ne=x,P=W(P)),x=P,x}function dm(){var x,P;return x=C,ee.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(te)),P!==e&&(ne=x,P=Y(P)),x=P,x}function tt(){var x,P,L,A,z;if(x=C,P=[],L=ze(),L!==e)for(;L!==e;)P.push(L),L=ze();else P=e;if(P!==e)if(L=pm(),L===e&&(L=null),L!==e){for(A=[],z=ze();z!==e;)A.push(z),z=ze();A!==e?(P=[P,L,A],x=P):(C=x,x=e)}else C=x,x=e;else C=x,x=e;if(x===e){if(x=C,P=C,L=pm(),L!==e){for(A=[],z=ze();z!==e;)A.push(z),z=ze();A!==e?(L=[L,A],P=L):(C=P,P=e)}else C=P,P=e;P!==e&&(ne=x,P=re()),x=P}return x}function pm(){var x;return i.charCodeAt(C)===44?(x=K,C++):(x=e,Pe===0&&ct(Z)),x}function fm(){var x,P,L,A;return x=C,P=C,L=iw(),L!==e?(A=hm(),A===e&&(A=null),A!==e?(L=[L,A],P=L):(C=P,P=e)):(C=P,P=e),P===e&&(P=C,L=Wi(),L!==e?(A=hm(),A!==e?(L=[L,A],P=L):(C=P,P=e)):(C=P,P=e)),P!==e&&(ne=x,P=Q(P)),x=P,x}function iw(){var x,P,L,A,z;return x=C,P=C,L=Wi(),L===e&&(L=null),L!==e?(i.charCodeAt(C)===46?(A=$,C++):(A=e,Pe===0&&ct(de)),A!==e?(z=Wi(),z!==e?(L=[L,A,z],P=L):(C=P,P=e)):(C=P,P=e)):(C=P,P=e),P===e&&(P=C,L=Wi(),L!==e?(i.charCodeAt(C)===46?(A=$,C++):(A=e,Pe===0&&ct(de)),A!==e?(L=[L,A],P=L):(C=P,P=e)):(C=P,P=e)),P!==e&&(ne=x,P=Q(P)),x=P,x}function hm(){var x,P,L,A,z;return x=C,P=C,le.test(i.charAt(C))?(L=i.charAt(C),C++):(L=e,Pe===0&&ct(ie)),L!==e?(A=qd(),A===e&&(A=null),A!==e?(z=Wi(),z!==e?(L=[L,A,z],P=L):(C=P,P=e)):(C=P,P=e)):(C=P,P=e),P!==e&&(ne=x,P=Q(P)),x=P,x}function qd(){var x;return ce.test(i.charAt(C))?(x=i.charAt(C),C++):(x=e,Pe===0&&ct(ae)),x}function Wi(){var x,P,L;if(x=C,P=[],me.test(i.charAt(C))?(L=i.charAt(C),C++):(L=e,Pe===0&&ct(fe)),L!==e)for(;L!==e;)P.push(L),me.test(i.charAt(C))?(L=i.charAt(C),C++):(L=e,Pe===0&&ct(fe));else P=e;return P!==e&&(ne=x,P=he(P)),x=P,x}function ze(){var x,P;return x=C,xe.test(i.charAt(C))?(P=i.charAt(C),C++):(P=e,Pe===0&&ct(ye)),P!==e&&(ne=x,P=re()),x=P,x}function nw(x,P){if(!P)return[x];for(var L=[x],A=0,z=P.length;A<z;A++)L[A+1]=P[A][1];return L}var Fl={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var mm in Fl)Fl[mm.toUpperCase()]=Fl[mm];function An(x,P){P||(P=[{}]);for(var L=P.length;L--;){var A={code:x,command:Fl[x]};x==x.toLowerCase()&&(A.relative=!0);for(var z in P[L])A[z]=P[L][z];P[L]=A}return P}if(St=o(),St!==e&&C===i.length)return St;throw St!==e&&C<i.length&&ct(Gd()),mr(_e,Ve<i.length?i.charAt(Ve):null,Ve<i.length?ki(Ve,Ve+1):ki(Ve,Ve))}P1.exports={SyntaxError:Sn,parse:a_}});var Lh=As((Kle,T1)=>{var xd=O1().parse;xd.parseSVG=xd;xd.makeAbsolute=s_;T1.exports=xd;function s_(i){var t,e={x:0,y:0},r={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return i.forEach(function(o){o.command==="moveto"&&(t=o),o.x0=e.x,o.y0=e.y;for(var n in r)n in o&&(o[n]+=o.relative?o[r[n]]:0);"x"in o||(o.x=e.x),"y"in o||(o.y=e.y),o.relative=!1,o.code=o.code.toUpperCase(),o.command=="closepath"&&(o.x=t.x,o.y=t.y),e=o}),i}});var jS=As((gye,FS)=>{FS.exports=function(t,e){for(var r=t.split("."),o=e.split("."),n=0;n<3;n++){var a=Number(r[n]),s=Number(o[n]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}});import{FileLoader as cL,Loader as uL}from"three";function Hl(i){for(let t of Object.keys(i))i[t]===void 0&&delete i[t];return i}function Pt(i,t){return Object.setPrototypeOf(i,t),i}function Wl(i){return Array.isArray(i)?i:[i]}function ql(i,t){let e=0;for(;e<i.length&&e<t.length;){if(i[e]<t[e])return-1;if(i[e]>t[e])return 1;e+=1}return e!==t.length?-1:e!==i.length?1:0}var hw=typeof global=="object"&&global&&global.Object===Object&&global,$l=hw;var mw=typeof self=="object"&&self&&self.Object===Object&&self,yw=$l||mw||Function("return this")(),ut=yw;var gw=ut.Symbol,Et=gw;var ym=Object.prototype,xw=ym.hasOwnProperty,bw=ym.toString,Is=Et?Et.toStringTag:void 0;function vw(i){var t=xw.call(i,Is),e=i[Is];try{i[Is]=void 0;var r=!0}catch{}var o=bw.call(i);return r&&(t?i[Is]=e:delete i[Is]),o}var gm=vw;var Sw=Object.prototype,ww=Sw.toString;function Pw(i){return ww.call(i)}var xm=Pw;var Ow="[object Null]",Tw="[object Undefined]",bm=Et?Et.toStringTag:void 0;function Cw(i){return i==null?i===void 0?Tw:Ow:bm&&bm in Object(i)?gm(i):xm(i)}var lr=Cw;function Aw(i){return i!=null&&typeof i=="object"}var Vt=Aw;var Mw="[object Symbol]";function Iw(i){return typeof i=="symbol"||Vt(i)&&lr(i)==Mw}var ei=Iw;function Ew(i,t){for(var e=-1,r=i==null?0:i.length,o=Array(r);++e<r;)o[e]=t(i[e],e,i);return o}var Xl=Ew;var Nw=Array.isArray,dt=Nw;var Dw=1/0,vm=Et?Et.prototype:void 0,Sm=vm?vm.toString:void 0;function wm(i){if(typeof i=="string")return i;if(dt(i))return Xl(i,wm)+"";if(ei(i))return Sm?Sm.call(i):"";var t=i+"";return t=="0"&&1/i==-Dw?"-0":t}var Pm=wm;var _w=/\s/;function Rw(i){for(var t=i.length;t--&&_w.test(i.charAt(t)););return t}var Om=Rw;var Lw=/^\s+/;function Bw(i){return i&&i.slice(0,Om(i)+1).replace(Lw,"")}var Tm=Bw;function Vw(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}var pt=Vw;var Cm=0/0,zw=/^[-+]0x[0-9a-f]+$/i,Gw=/^0b[01]+$/i,Fw=/^0o[0-7]+$/i,jw=parseInt;function Uw(i){if(typeof i=="number")return i;if(ei(i))return Cm;if(pt(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=pt(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=Tm(i);var e=Gw.test(i);return e||Fw.test(i)?jw(i.slice(2),e?2:8):zw.test(i)?Cm:+i}var Kd=Uw;function kw(i){return i}var Am=kw;var Hw="[object AsyncFunction]",Ww="[object Function]",qw="[object GeneratorFunction]",$w="[object Proxy]";function Xw(i){if(!pt(i))return!1;var t=lr(i);return t==Ww||t==qw||t==Hw||t==$w}var Yl=Xw;var Yw=ut["__core-js_shared__"],Kl=Yw;var Mm=function(){var i=/[^.]+$/.exec(Kl&&Kl.keys&&Kl.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function Kw(i){return!!Mm&&Mm in i}var Im=Kw;var Qw=Function.prototype,Zw=Qw.toString;function Jw(i){if(i!=null){try{return Zw.call(i)}catch{}try{return i+""}catch{}}return""}var Oo=Jw;var e2=/[\\^$.*+?()[\]{}|]/g,t2=/^\[object .+?Constructor\]$/,r2=Function.prototype,o2=Object.prototype,i2=r2.toString,n2=o2.hasOwnProperty,a2=RegExp("^"+i2.call(n2).replace(e2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function s2(i){if(!pt(i)||Im(i))return!1;var t=Yl(i)?a2:t2;return t.test(Oo(i))}var Em=s2;function l2(i,t){return i?.[t]}var Nm=l2;function c2(i,t){var e=Nm(i,t);return Em(e)?e:void 0}var Zt=c2;var u2=Zt(ut,"WeakMap"),Ql=u2;var Dm=Object.create,d2=function(){function i(){}return function(t){if(!pt(t))return{};if(Dm)return Dm(t);i.prototype=t;var e=new i;return i.prototype=void 0,e}}(),_m=d2;function p2(i,t,e){switch(e.length){case 0:return i.call(t);case 1:return i.call(t,e[0]);case 2:return i.call(t,e[0],e[1]);case 3:return i.call(t,e[0],e[1],e[2])}return i.apply(t,e)}var Rm=p2;function f2(i,t){var e=-1,r=i.length;for(t||(t=Array(r));++e<r;)t[e]=i[e];return t}var Lm=f2;var h2=800,m2=16,y2=Date.now;function g2(i){var t=0,e=0;return function(){var r=y2(),o=m2-(r-e);if(e=r,o>0){if(++t>=h2)return arguments[0]}else t=0;return i.apply(void 0,arguments)}}var Bm=g2;function x2(i){return function(){return i}}var Vm=x2;var b2=function(){try{var i=Zt(Object,"defineProperty");return i({},"",{}),i}catch{}}(),In=b2;var v2=In?function(i,t){return In(i,"toString",{configurable:!0,enumerable:!1,value:Vm(t),writable:!0})}:Am,zm=v2;var S2=Bm(zm),Gm=S2;function w2(i,t){for(var e=-1,r=i==null?0:i.length;++e<r&&t(i[e],e,i)!==!1;);return i}var Fm=w2;var P2=9007199254740991,O2=/^(?:0|[1-9]\d*)$/;function T2(i,t){var e=typeof i;return t=t??P2,!!t&&(e=="number"||e!="symbol"&&O2.test(i))&&i>-1&&i%1==0&&i<t}var En=T2;function C2(i,t,e){t=="__proto__"&&In?In(i,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):i[t]=e}var Zl=C2;function A2(i,t){return i===t||i!==i&&t!==t}var Nn=A2;var M2=Object.prototype,I2=M2.hasOwnProperty;function E2(i,t,e){var r=i[t];(!(I2.call(i,t)&&Nn(r,e))||e===void 0&&!(t in i))&&Zl(i,t,e)}var Dn=E2;function N2(i,t,e,r){var o=!e;e||(e={});for(var n=-1,a=t.length;++n<a;){var s=t[n],l=r?r(e[s],i[s],s,e,i):void 0;l===void 0&&(l=i[s]),o?Zl(e,s,l):Dn(e,s,l)}return e}var Yr=N2;var jm=Math.max;function D2(i,t,e){return t=jm(t===void 0?i.length-1:t,0),function(){for(var r=arguments,o=-1,n=jm(r.length-t,0),a=Array(n);++o<n;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=e(a),Rm(i,this,s)}}var Um=D2;var _2=9007199254740991;function R2(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=_2}var _n=R2;function L2(i){return i!=null&&_n(i.length)&&!Yl(i)}var Jl=L2;var B2=Object.prototype;function V2(i){var t=i&&i.constructor,e=typeof t=="function"&&t.prototype||B2;return i===e}var Rn=V2;function z2(i,t){for(var e=-1,r=Array(i);++e<i;)r[e]=t(e);return r}var km=z2;var G2="[object Arguments]";function F2(i){return Vt(i)&&lr(i)==G2}var Qd=F2;var Hm=Object.prototype,j2=Hm.hasOwnProperty,U2=Hm.propertyIsEnumerable,k2=Qd(function(){return arguments}())?Qd:function(i){return Vt(i)&&j2.call(i,"callee")&&!U2.call(i,"callee")},Ln=k2;function H2(){return!1}var Wm=H2;var Xm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qm=Xm&&typeof module=="object"&&module&&!module.nodeType&&module,W2=qm&&qm.exports===Xm,$m=W2?ut.Buffer:void 0,q2=$m?$m.isBuffer:void 0,$2=q2||Wm,$i=$2;var X2="[object Arguments]",Y2="[object Array]",K2="[object Boolean]",Q2="[object Date]",Z2="[object Error]",J2="[object Function]",eP="[object Map]",tP="[object Number]",rP="[object Object]",oP="[object RegExp]",iP="[object Set]",nP="[object String]",aP="[object WeakMap]",sP="[object ArrayBuffer]",lP="[object DataView]",cP="[object Float32Array]",uP="[object Float64Array]",dP="[object Int8Array]",pP="[object Int16Array]",fP="[object Int32Array]",hP="[object Uint8Array]",mP="[object Uint8ClampedArray]",yP="[object Uint16Array]",gP="[object Uint32Array]",rt={};rt[cP]=rt[uP]=rt[dP]=rt[pP]=rt[fP]=rt[hP]=rt[mP]=rt[yP]=rt[gP]=!0;rt[X2]=rt[Y2]=rt[sP]=rt[K2]=rt[lP]=rt[Q2]=rt[Z2]=rt[J2]=rt[eP]=rt[tP]=rt[rP]=rt[oP]=rt[iP]=rt[nP]=rt[aP]=!1;function xP(i){return Vt(i)&&_n(i.length)&&!!rt[lr(i)]}var Ym=xP;function bP(i){return function(t){return i(t)}}var Bn=bP;var Km=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Es=Km&&typeof module=="object"&&module&&!module.nodeType&&module,vP=Es&&Es.exports===Km,Zd=vP&&$l.process,SP=function(){try{var i=Es&&Es.require&&Es.require("util").types;return i||Zd&&Zd.binding&&Zd.binding("util")}catch{}}(),To=SP;var Qm=To&&To.isTypedArray,wP=Qm?Bn(Qm):Ym,ec=wP;var PP=Object.prototype,OP=PP.hasOwnProperty;function TP(i,t){var e=dt(i),r=!e&&Ln(i),o=!e&&!r&&$i(i),n=!e&&!r&&!o&&ec(i),a=e||r||o||n,s=a?km(i.length,String):[],l=s.length;for(var c in i)(t||OP.call(i,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||n&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||En(c,l)))&&s.push(c);return s}var tc=TP;function CP(i,t){return function(e){return i(t(e))}}var rc=CP;var AP=rc(Object.keys,Object),Zm=AP;var MP=Object.prototype,IP=MP.hasOwnProperty;function EP(i){if(!Rn(i))return Zm(i);var t=[];for(var e in Object(i))IP.call(i,e)&&e!="constructor"&&t.push(e);return t}var Jm=EP;function NP(i){return Jl(i)?tc(i):Jm(i)}var Vn=NP;function DP(i){var t=[];if(i!=null)for(var e in Object(i))t.push(e);return t}var ey=DP;var _P=Object.prototype,RP=_P.hasOwnProperty;function LP(i){if(!pt(i))return ey(i);var t=Rn(i),e=[];for(var r in i)r=="constructor"&&(t||!RP.call(i,r))||e.push(r);return e}var ty=LP;function BP(i){return Jl(i)?tc(i,!0):ty(i)}var zn=BP;var VP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zP=/^\w*$/;function GP(i,t){if(dt(i))return!1;var e=typeof i;return e=="number"||e=="symbol"||e=="boolean"||i==null||ei(i)?!0:zP.test(i)||!VP.test(i)||t!=null&&i in Object(t)}var ry=GP;var FP=Zt(Object,"create"),Co=FP;function jP(){this.__data__=Co?Co(null):{},this.size=0}var oy=jP;function UP(i){var t=this.has(i)&&delete this.__data__[i];return this.size-=t?1:0,t}var iy=UP;var kP="__lodash_hash_undefined__",HP=Object.prototype,WP=HP.hasOwnProperty;function qP(i){var t=this.__data__;if(Co){var e=t[i];return e===kP?void 0:e}return WP.call(t,i)?t[i]:void 0}var ny=qP;var $P=Object.prototype,XP=$P.hasOwnProperty;function YP(i){var t=this.__data__;return Co?t[i]!==void 0:XP.call(t,i)}var ay=YP;var KP="__lodash_hash_undefined__";function QP(i,t){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=Co&&t===void 0?KP:t,this}var sy=QP;function Gn(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var r=i[t];this.set(r[0],r[1])}}Gn.prototype.clear=oy;Gn.prototype.delete=iy;Gn.prototype.get=ny;Gn.prototype.has=ay;Gn.prototype.set=sy;var Jd=Gn;function ZP(){this.__data__=[],this.size=0}var ly=ZP;function JP(i,t){for(var e=i.length;e--;)if(Nn(i[e][0],t))return e;return-1}var ti=JP;var eO=Array.prototype,tO=eO.splice;function rO(i){var t=this.__data__,e=ti(t,i);if(e<0)return!1;var r=t.length-1;return e==r?t.pop():tO.call(t,e,1),--this.size,!0}var cy=rO;function oO(i){var t=this.__data__,e=ti(t,i);return e<0?void 0:t[e][1]}var uy=oO;function iO(i){return ti(this.__data__,i)>-1}var dy=iO;function nO(i,t){var e=this.__data__,r=ti(e,i);return r<0?(++this.size,e.push([i,t])):e[r][1]=t,this}var py=nO;function Fn(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var r=i[t];this.set(r[0],r[1])}}Fn.prototype.clear=ly;Fn.prototype.delete=cy;Fn.prototype.get=uy;Fn.prototype.has=dy;Fn.prototype.set=py;var ri=Fn;var aO=Zt(ut,"Map"),oi=aO;function sO(){this.size=0,this.__data__={hash:new Jd,map:new(oi||ri),string:new Jd}}var fy=sO;function lO(i){var t=typeof i;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?i!=="__proto__":i===null}var hy=lO;function cO(i,t){var e=i.__data__;return hy(t)?e[typeof t=="string"?"string":"hash"]:e.map}var ii=cO;function uO(i){var t=ii(this,i).delete(i);return this.size-=t?1:0,t}var my=uO;function dO(i){return ii(this,i).get(i)}var yy=dO;function pO(i){return ii(this,i).has(i)}var gy=pO;function fO(i,t){var e=ii(this,i),r=e.size;return e.set(i,t),this.size+=e.size==r?0:1,this}var xy=fO;function jn(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var r=i[t];this.set(r[0],r[1])}}jn.prototype.clear=fy;jn.prototype.delete=my;jn.prototype.get=yy;jn.prototype.has=gy;jn.prototype.set=xy;var Xi=jn;var hO="Expected a function";function ep(i,t){if(typeof i!="function"||t!=null&&typeof t!="function")throw new TypeError(hO);var e=function(){var r=arguments,o=t?t.apply(this,r):r[0],n=e.cache;if(n.has(o))return n.get(o);var a=i.apply(this,r);return e.cache=n.set(o,a)||n,a};return e.cache=new(ep.Cache||Xi),e}ep.Cache=Xi;var by=ep;var mO=500;function yO(i){var t=by(i,function(r){return e.size===mO&&e.clear(),r}),e=t.cache;return t}var vy=yO;var gO=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xO=/\\(\\)?/g,bO=vy(function(i){var t=[];return i.charCodeAt(0)===46&&t.push(""),i.replace(gO,function(e,r,o,n){t.push(o?n.replace(xO,"$1"):r||e)}),t}),Sy=bO;function vO(i){return i==null?"":Pm(i)}var wy=vO;function SO(i,t){return dt(i)?i:ry(i,t)?[i]:Sy(wy(i))}var yr=SO;var wO=1/0;function PO(i){if(typeof i=="string"||ei(i))return i;var t=i+"";return t=="0"&&1/i==-wO?"-0":t}var ni=PO;function OO(i,t){t=yr(t,i);for(var e=0,r=t.length;i!=null&&e<r;)i=i[ni(t[e++])];return e&&e==r?i:void 0}var oc=OO;function TO(i,t){for(var e=-1,r=t.length,o=i.length;++e<r;)i[o+e]=t[e];return i}var Un=TO;var Py=Et?Et.isConcatSpreadable:void 0;function CO(i){return dt(i)||Ln(i)||!!(Py&&i&&i[Py])}var Oy=CO;function Ty(i,t,e,r,o){var n=-1,a=i.length;for(e||(e=Oy),o||(o=[]);++n<a;){var s=i[n];t>0&&e(s)?t>1?Ty(s,t-1,e,r,o):Un(o,s):r||(o[o.length]=s)}return o}var Cy=Ty;function AO(i){var t=i==null?0:i.length;return t?Cy(i,1):[]}var Ay=AO;function MO(i){return Gm(Um(i,void 0,Ay),i+"")}var ic=MO;var IO=rc(Object.getPrototypeOf,Object),kn=IO;var EO="[object Object]",NO=Function.prototype,DO=Object.prototype,My=NO.toString,_O=DO.hasOwnProperty,RO=My.call(Object);function LO(i){if(!Vt(i)||lr(i)!=EO)return!1;var t=kn(i);if(t===null)return!0;var e=_O.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&My.call(e)==RO}var Iy=LO;function BO(i,t,e){var r=-1,o=i.length;t<0&&(t=-t>o?0:o+t),e=e>o?o:e,e<0&&(e+=o),o=t>e?0:e-t>>>0,t>>>=0;for(var n=Array(o);++r<o;)n[r]=i[r+t];return n}var Ey=BO;function VO(){this.__data__=new ri,this.size=0}var Ny=VO;function zO(i){var t=this.__data__,e=t.delete(i);return this.size=t.size,e}var Dy=zO;function GO(i){return this.__data__.get(i)}var _y=GO;function FO(i){return this.__data__.has(i)}var Ry=FO;var jO=200;function UO(i,t){var e=this.__data__;if(e instanceof ri){var r=e.__data__;if(!oi||r.length<jO-1)return r.push([i,t]),this.size=++e.size,this;e=this.__data__=new Xi(r)}return e.set(i,t),this.size=e.size,this}var Ly=UO;function Hn(i){var t=this.__data__=new ri(i);this.size=t.size}Hn.prototype.clear=Ny;Hn.prototype.delete=Dy;Hn.prototype.get=_y;Hn.prototype.has=Ry;Hn.prototype.set=Ly;var Wn=Hn;function kO(i,t){return i&&Yr(t,Vn(t),i)}var By=kO;function HO(i,t){return i&&Yr(t,zn(t),i)}var Vy=HO;var jy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zy=jy&&typeof module=="object"&&module&&!module.nodeType&&module,WO=zy&&zy.exports===jy,Gy=WO?ut.Buffer:void 0,Fy=Gy?Gy.allocUnsafe:void 0;function qO(i,t){if(t)return i.slice();var e=i.length,r=Fy?Fy(e):new i.constructor(e);return i.copy(r),r}var Uy=qO;function $O(i,t){for(var e=-1,r=i==null?0:i.length,o=0,n=[];++e<r;){var a=i[e];t(a,e,i)&&(n[o++]=a)}return n}var ky=$O;function XO(){return[]}var nc=XO;var YO=Object.prototype,KO=YO.propertyIsEnumerable,Hy=Object.getOwnPropertySymbols,QO=Hy?function(i){return i==null?[]:(i=Object(i),ky(Hy(i),function(t){return KO.call(i,t)}))}:nc,qn=QO;function ZO(i,t){return Yr(i,qn(i),t)}var Wy=ZO;var JO=Object.getOwnPropertySymbols,eT=JO?function(i){for(var t=[];i;)Un(t,qn(i)),i=kn(i);return t}:nc,ac=eT;function tT(i,t){return Yr(i,ac(i),t)}var qy=tT;function rT(i,t,e){var r=t(i);return dt(i)?r:Un(r,e(i))}var sc=rT;function oT(i){return sc(i,Vn,qn)}var Ns=oT;function iT(i){return sc(i,zn,ac)}var lc=iT;var nT=Zt(ut,"DataView"),cc=nT;var aT=Zt(ut,"Promise"),uc=aT;var sT=Zt(ut,"Set"),dc=sT;var $y="[object Map]",lT="[object Object]",Xy="[object Promise]",Yy="[object Set]",Ky="[object WeakMap]",Qy="[object DataView]",cT=Oo(cc),uT=Oo(oi),dT=Oo(uc),pT=Oo(dc),fT=Oo(Ql),Yi=lr;(cc&&Yi(new cc(new ArrayBuffer(1)))!=Qy||oi&&Yi(new oi)!=$y||uc&&Yi(uc.resolve())!=Xy||dc&&Yi(new dc)!=Yy||Ql&&Yi(new Ql)!=Ky)&&(Yi=function(i){var t=lr(i),e=t==lT?i.constructor:void 0,r=e?Oo(e):"";if(r)switch(r){case cT:return Qy;case uT:return $y;case dT:return Xy;case pT:return Yy;case fT:return Ky}return t});var Ao=Yi;var hT=Object.prototype,mT=hT.hasOwnProperty;function yT(i){var t=i.length,e=new i.constructor(t);return t&&typeof i[0]=="string"&&mT.call(i,"index")&&(e.index=i.index,e.input=i.input),e}var Zy=yT;var gT=ut.Uint8Array,$n=gT;function xT(i){var t=new i.constructor(i.byteLength);return new $n(t).set(new $n(i)),t}var Xn=xT;function bT(i,t){var e=t?Xn(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.byteLength)}var Jy=bT;var vT=/\w*$/;function ST(i){var t=new i.constructor(i.source,vT.exec(i));return t.lastIndex=i.lastIndex,t}var eg=ST;var tg=Et?Et.prototype:void 0,rg=tg?tg.valueOf:void 0;function wT(i){return rg?Object(rg.call(i)):{}}var og=wT;function PT(i,t){var e=t?Xn(i.buffer):i.buffer;return new i.constructor(e,i.byteOffset,i.length)}var ig=PT;var OT="[object Boolean]",TT="[object Date]",CT="[object Map]",AT="[object Number]",MT="[object RegExp]",IT="[object Set]",ET="[object String]",NT="[object Symbol]",DT="[object ArrayBuffer]",_T="[object DataView]",RT="[object Float32Array]",LT="[object Float64Array]",BT="[object Int8Array]",VT="[object Int16Array]",zT="[object Int32Array]",GT="[object Uint8Array]",FT="[object Uint8ClampedArray]",jT="[object Uint16Array]",UT="[object Uint32Array]";function kT(i,t,e){var r=i.constructor;switch(t){case DT:return Xn(i);case OT:case TT:return new r(+i);case _T:return Jy(i,e);case RT:case LT:case BT:case VT:case zT:case GT:case FT:case jT:case UT:return ig(i,e);case CT:return new r;case AT:case ET:return new r(i);case MT:return eg(i);case IT:return new r;case NT:return og(i)}}var ng=kT;function HT(i){return typeof i.constructor=="function"&&!Rn(i)?_m(kn(i)):{}}var ag=HT;var WT="[object Map]";function qT(i){return Vt(i)&&Ao(i)==WT}var sg=qT;var lg=To&&To.isMap,$T=lg?Bn(lg):sg,cg=$T;var XT="[object Set]";function YT(i){return Vt(i)&&Ao(i)==XT}var ug=YT;var dg=To&&To.isSet,KT=dg?Bn(dg):ug,pg=KT;var QT=1,ZT=2,JT=4,fg="[object Arguments]",eC="[object Array]",tC="[object Boolean]",rC="[object Date]",oC="[object Error]",hg="[object Function]",iC="[object GeneratorFunction]",nC="[object Map]",aC="[object Number]",mg="[object Object]",sC="[object RegExp]",lC="[object Set]",cC="[object String]",uC="[object Symbol]",dC="[object WeakMap]",pC="[object ArrayBuffer]",fC="[object DataView]",hC="[object Float32Array]",mC="[object Float64Array]",yC="[object Int8Array]",gC="[object Int16Array]",xC="[object Int32Array]",bC="[object Uint8Array]",vC="[object Uint8ClampedArray]",SC="[object Uint16Array]",wC="[object Uint32Array]",Je={};Je[fg]=Je[eC]=Je[pC]=Je[fC]=Je[tC]=Je[rC]=Je[hC]=Je[mC]=Je[yC]=Je[gC]=Je[xC]=Je[nC]=Je[aC]=Je[mg]=Je[sC]=Je[lC]=Je[cC]=Je[uC]=Je[bC]=Je[vC]=Je[SC]=Je[wC]=!0;Je[oC]=Je[hg]=Je[dC]=!1;function pc(i,t,e,r,o,n){var a,s=t&QT,l=t&ZT,c=t&JT;if(e&&(a=o?e(i,r,o,n):e(i)),a!==void 0)return a;if(!pt(i))return i;var u=dt(i);if(u){if(a=Zy(i),!s)return Lm(i,a)}else{var p=Ao(i),d=p==hg||p==iC;if($i(i))return Uy(i,s);if(p==mg||p==fg||d&&!o){if(a=l||d?{}:ag(i),!s)return l?qy(i,Vy(a,i)):Wy(i,By(a,i))}else{if(!Je[p])return o?i:{};a=ng(i,p,s)}}n||(n=new Wn);var f=n.get(i);if(f)return f;n.set(i,a),pg(i)?i.forEach(function(y){a.add(pc(y,t,e,y,i,n))}):cg(i)&&i.forEach(function(y,b){a.set(b,pc(y,t,e,b,i,n))});var h=c?l?lc:Ns:l?zn:Vn,m=u?void 0:h(i);return Fm(m||i,function(y,b){m&&(b=y,y=i[b]),Dn(a,b,pc(y,t,e,b,i,n))}),a}var fc=pc;var PC=1,OC=4;function TC(i){return fc(i,PC|OC)}var Mo=TC;var CC="__lodash_hash_undefined__";function AC(i){return this.__data__.set(i,CC),this}var yg=AC;function MC(i){return this.__data__.has(i)}var gg=MC;function hc(i){var t=-1,e=i==null?0:i.length;for(this.__data__=new Xi;++t<e;)this.add(i[t])}hc.prototype.add=hc.prototype.push=yg;hc.prototype.has=gg;var xg=hc;function IC(i,t){for(var e=-1,r=i==null?0:i.length;++e<r;)if(t(i[e],e,i))return!0;return!1}var bg=IC;function EC(i,t){return i.has(t)}var vg=EC;var NC=1,DC=2;function _C(i,t,e,r,o,n){var a=e&NC,s=i.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=n.get(i),u=n.get(t);if(c&&u)return c==t&&u==i;var p=-1,d=!0,f=e&DC?new xg:void 0;for(n.set(i,t),n.set(t,i);++p<s;){var h=i[p],m=t[p];if(r)var y=a?r(m,h,p,t,i,n):r(h,m,p,i,t,n);if(y!==void 0){if(y)continue;d=!1;break}if(f){if(!bg(t,function(b,v){if(!vg(f,v)&&(h===b||o(h,b,e,r,n)))return f.push(v)})){d=!1;break}}else if(!(h===m||o(h,m,e,r,n))){d=!1;break}}return n.delete(i),n.delete(t),d}var mc=_C;function RC(i){var t=-1,e=Array(i.size);return i.forEach(function(r,o){e[++t]=[o,r]}),e}var Sg=RC;function LC(i){var t=-1,e=Array(i.size);return i.forEach(function(r){e[++t]=r}),e}var wg=LC;var BC=1,VC=2,zC="[object Boolean]",GC="[object Date]",FC="[object Error]",jC="[object Map]",UC="[object Number]",kC="[object RegExp]",HC="[object Set]",WC="[object String]",qC="[object Symbol]",$C="[object ArrayBuffer]",XC="[object DataView]",Pg=Et?Et.prototype:void 0,tp=Pg?Pg.valueOf:void 0;function YC(i,t,e,r,o,n,a){switch(e){case XC:if(i.byteLength!=t.byteLength||i.byteOffset!=t.byteOffset)return!1;i=i.buffer,t=t.buffer;case $C:return!(i.byteLength!=t.byteLength||!n(new $n(i),new $n(t)));case zC:case GC:case UC:return Nn(+i,+t);case FC:return i.name==t.name&&i.message==t.message;case kC:case WC:return i==t+"";case jC:var s=Sg;case HC:var l=r&BC;if(s||(s=wg),i.size!=t.size&&!l)return!1;var c=a.get(i);if(c)return c==t;r|=VC,a.set(i,t);var u=mc(s(i),s(t),r,o,n,a);return a.delete(i),u;case qC:if(tp)return tp.call(i)==tp.call(t)}return!1}var Og=YC;var KC=1,QC=Object.prototype,ZC=QC.hasOwnProperty;function JC(i,t,e,r,o,n){var a=e&KC,s=Ns(i),l=s.length,c=Ns(t),u=c.length;if(l!=u&&!a)return!1;for(var p=l;p--;){var d=s[p];if(!(a?d in t:ZC.call(t,d)))return!1}var f=n.get(i),h=n.get(t);if(f&&h)return f==t&&h==i;var m=!0;n.set(i,t),n.set(t,i);for(var y=a;++p<l;){d=s[p];var b=i[d],v=t[d];if(r)var w=a?r(v,b,d,t,i,n):r(b,v,d,i,t,n);if(!(w===void 0?b===v||o(b,v,e,r,n):w)){m=!1;break}y||(y=d=="constructor")}if(m&&!y){var O=i.constructor,S=t.constructor;O!=S&&"constructor"in i&&"constructor"in t&&!(typeof O=="function"&&O instanceof O&&typeof S=="function"&&S instanceof S)&&(m=!1)}return n.delete(i),n.delete(t),m}var Tg=JC;var eA=1,Cg="[object Arguments]",Ag="[object Array]",yc="[object Object]",tA=Object.prototype,Mg=tA.hasOwnProperty;function rA(i,t,e,r,o,n){var a=dt(i),s=dt(t),l=a?Ag:Ao(i),c=s?Ag:Ao(t);l=l==Cg?yc:l,c=c==Cg?yc:c;var u=l==yc,p=c==yc,d=l==c;if(d&&$i(i)){if(!$i(t))return!1;a=!0,u=!1}if(d&&!u)return n||(n=new Wn),a||ec(i)?mc(i,t,e,r,o,n):Og(i,t,l,e,r,o,n);if(!(e&eA)){var f=u&&Mg.call(i,"__wrapped__"),h=p&&Mg.call(t,"__wrapped__");if(f||h){var m=f?i.value():i,y=h?t.value():t;return n||(n=new Wn),o(m,y,e,r,n)}}return d?(n||(n=new Wn),Tg(i,t,e,r,o,n)):!1}var Ig=rA;function Eg(i,t,e,r,o){return i===t?!0:i==null||t==null||!Vt(i)&&!Vt(t)?i!==i&&t!==t:Ig(i,t,e,r,Eg,o)}var Ng=Eg;function oA(i,t){return i!=null&&t in Object(i)}var Dg=oA;function iA(i,t,e){t=yr(t,i);for(var r=-1,o=t.length,n=!1;++r<o;){var a=ni(t[r]);if(!(n=i!=null&&e(i,a)))break;i=i[a]}return n||++r!=o?n:(o=i==null?0:i.length,!!o&&_n(o)&&En(a,o)&&(dt(i)||Ln(i)))}var _g=iA;function nA(i,t){return i!=null&&_g(i,t,Dg)}var Rg=nA;var aA=function(){return ut.Date.now()},gc=aA;var sA="Expected a function",lA=Math.max,cA=Math.min;function uA(i,t,e){var r,o,n,a,s,l,c=0,u=!1,p=!1,d=!0;if(typeof i!="function")throw new TypeError(sA);t=Kd(t)||0,pt(e)&&(u=!!e.leading,p="maxWait"in e,n=p?lA(Kd(e.maxWait)||0,t):n,d="trailing"in e?!!e.trailing:d);function f(T){var M=r,g=o;return r=o=void 0,c=T,a=i.apply(g,M),a}function h(T){return c=T,s=setTimeout(b,t),u?f(T):a}function m(T){var M=T-l,g=T-c,D=t-M;return p?cA(D,n-g):D}function y(T){var M=T-l,g=T-c;return l===void 0||M>=t||M<0||p&&g>=n}function b(){var T=gc();if(y(T))return v(T);s=setTimeout(b,m(T))}function v(T){return s=void 0,d&&r?f(T):(r=o=void 0,a)}function w(){s!==void 0&&clearTimeout(s),c=0,r=l=o=s=void 0}function O(){return s===void 0?a:v(gc())}function S(){var T=gc(),M=y(T);if(r=arguments,o=this,l=T,M){if(s===void 0)return h(l);if(p)return clearTimeout(s),s=setTimeout(b,t),f(l)}return s===void 0&&(s=setTimeout(b,t)),a}return S.cancel=w,S.flush=O,S}var xc=uA;function dA(i){var t=i==null?0:i.length;return t?i[t-1]:void 0}var Lg=dA;function pA(i,t){return t.length<2?i:oc(i,Ey(t,0,-1))}var Bg=pA;function fA(i,t){return Ng(i,t)}var rp=fA;function hA(i,t){return t=yr(t,i),i=Bg(i,t),i==null||delete i[ni(Lg(t))]}var Vg=hA;function mA(i){return Iy(i)?void 0:i}var zg=mA;var yA=1,gA=2,xA=4,bA=ic(function(i,t){var e={};if(i==null)return e;var r=!1;t=Xl(t,function(n){return n=yr(n,i),r||(r=n.length>1),n}),Yr(i,lc(i),e),r&&(e=fc(e,yA|gA|xA,zg));for(var o=t.length;o--;)Vg(e,t[o]);return e}),Yn=bA;function vA(i,t,e,r){if(!pt(i))return i;t=yr(t,i);for(var o=-1,n=t.length,a=n-1,s=i;s!=null&&++o<n;){var l=ni(t[o]),c=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return i;if(o!=a){var u=s[l];c=r?r(u,l,s):void 0,c===void 0&&(c=pt(u)?u:En(t[o+1])?[]:{})}Dn(s,l,c),s=s[l]}return i}var Gg=vA;function SA(i,t,e){for(var r=-1,o=t.length,n={};++r<o;){var a=t[r],s=oc(i,a);e(s,a)&&Gg(n,yr(a,i),s)}return n}var Fg=SA;function wA(i,t){return Fg(i,t,function(e,r){return Rg(i,r)})}var jg=wA;var PA=ic(function(i,t){return i==null?{}:jg(i,t)}),Nr=PA;var ue=class{modifyById(t,e){let r=this;if(r[t]===void 0)throw new Error("not expected");{let n={...r,[t]:e};return Object.setPrototypeOf(n,ue.prototype),n}}add(t,e){return this.runOp({type:1,id:t,data:e})?.data??this}runOp(t){let e=this;if(t.type===1){let r=e[t.id],o;r===void 0?o={type:2,id:t.id}:o={type:1,id:t.id,data:r};let{id:n,data:a}=t,s={...e,[n]:a};return Object.setPrototypeOf(s,ue.prototype),{data:s,actual:t,reverse:o}}else if(t.type===2){let{id:r}=t,o=e[r];if(o===void 0)return null;{let n={...e};return Object.setPrototypeOf(n,ue.prototype),delete n[r],{data:n,actual:t,reverse:{type:1,id:r,data:o}}}}return null}};function Ds(i){if(i.deepFreeze!==void 0){i.deepFreeze(i);return}let t=Object.getOwnPropertyNames(i);for(let e of t){let r=i[e];r&&typeof r=="object"&&Ds(r)}return Object.freeze(i)}function Ug(i,t){let e=0;for(;e<i.length&&e<t.length;){if(i[e]<t[e])return-1;if(i[e]>t[e])return 1;e+=1}return e!==t.length?-1:e!==i.length?1:0}var Kn=class extends Error{};function bc(i){let t={...i};return Object.setPrototypeOf(t,Object.getPrototypeOf(i)),t}function Kr(i,t,e){if(i===void 0?t===void 0?(i=0,t=10):i=t-10:t===void 0&&(t=i+10),i>t){let n=i;i=t,t=n}let r=[],o=1/(e+1);for(let n=0;n<e;n++){let a=i+(t-i)*(n+.75+Math.random()*.5)*o;r.push(a)}return r}function Qn(i){return i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Uint32Array||i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array||i instanceof Float32Array||i instanceof Float64Array}function kg(){return typeof process<"u"}function Hg(i,t){for(let e of i)t(e.id,e.data)!==!0&&Hg(e.children,t)}function Wg(i,t){if(t(i.id,i.data)!==!0)for(let e of i.children)Wg(e,t)}var Qe=class extends Array{constructor(...e){super(...e);Object.setPrototypeOf(this,Qe.prototype)}deepFreeze(){let e=0;for(;e<this.length;)Ds(this[e]),e++}fillCaches0(e,r){this.objCaches.set(e.id,e),this.parentCaches.set(e.id,r);for(let o of e.children)this.fillCaches0(o,e.id)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,this.parentCaches=new Map;for(let e of this)this.fillCaches0(e,null)}}randomId(){this.fillCaches();let e=Array.from(this.objCaches.keys());if(e.length!==0)return e[Math.max(0,Math.floor(Math.random()*e.length)-1)]}nonExistOrDescendantOf(e,r){if(!this.has(e))return!0;for(;e;){let o=this.parent(e);if(o===r)return!0;e=o}return!1}rootAcestor(e){for(;e;){let r=this.parent(e);if(r)e=r;else return e}return e}isDescendantOf(e,r){for(;e;){let o=this.parent(e);if(o===r)return!0;e=o}return!1}data(e){return this.get(e)?.data}has(e){return this.childrenOf(e)!==void 0}get(e){return this.fillCaches(),this.objCaches.get(e)}childrenOf(e){return e===null?this:this.get(e)?.children}traverseFrom(e,r){if(e===null)this.traverse(r);else{let o=this.get(e);o&&Wg(o,r)}}traverse(e){Hg(this,e)}totalSize(){return this.fillCaches(),this.objCaches.size}parent(e){return this.fillCaches(),this.parentCaches.get(e)}childrenArray(e){return e===null?this:this.get(e).children}modifyById(e,r){if(this.get(e)===void 0)throw new Error("not expected");{let n=this.parent(e),a=this.childrenArray(n),s=a.findIndex(u=>u.id===e);if(s<0)throw new Error("not expected");let l=a[s];return a=[...a],a[s]={...l,data:r},this.modifyArrayBy(n,a)}}modifyArrayBy(e,r){let o=e,n=r;for(;o!==null;){let s=n,l=o;if(o=this.parent(o),o===void 0)throw new Error;n=this.childrenArray(o);let c=n.findIndex(u=>u.id===l);if(c<0)throw new Error;n=[...n],n[c]={...n[c],children:s}}Object.setPrototypeOf(n,Qe.prototype);let a=n;return a.fillCaches(),a}runOp(e){switch(e.type){case 7:return this.addOp(e);case 8:return this.deleteOp(e);case 9:return this.moveOp(e)}return null}checkDuplicatedIdRec({id:e,children:r}){if(this.get(e)!==void 0)return!0;for(let o of r)if(this.checkDuplicatedIdRec(o))return!0;return!1}addOp(e){let{parent:r,fi:o,id:n,data:a,children:s}=e;if(r!==null&&this.get(r)===void 0)return null;if(this.checkDuplicatedIdRec(e))return null;{let l=r,c=this.childrenArray(l),u={fi:o,id:n,data:a,children:s};return c=[...c,u],c.sort((d,f)=>d.fi-f.fi),e.localIndex=c.indexOf(u),{data:this.modifyArrayBy(l,c),actual:e,reverse:{type:8,id:n}}}}deleteOp(e){let{id:r}=e;if(this.get(r)===null)return null;{let o=this.parent(r);if(o===void 0)return null;let n=this.childrenArray(o),a=n.findIndex(c=>c.id===r);e.localIndex=a,n=[...n];let s=n.splice(a,1)[0];return{data:this.modifyArrayBy(o,n),actual:e,reverse:{type:7,...s,parent:o}}}}moveOp(e){let{parent:r,fi:o,id:n}=e;if(r!==null&&this.get(r)===void 0)return this.deleteOp({type:8,id:n});if(r!==null){let f=r;for(;f!==null;){if(f===void 0)throw new Error;if(f===n)throw new Kn("cyclic tree");f=this.parent(f)}}let a=this.parent(n);if(a===void 0)return null;let s=a,l=this.childrenArray(a),c=l.findIndex(f=>f.id===n);l=[...l];let u=l.splice(c,1)[0],p=this.modifyArrayBy(a,l);a=r,l=p.childrenArray(a);let d=u.fi;return u={...u,fi:o},l=[...l,u],l.sort((f,h)=>f.fi-h.fi),e.localIndex=l.indexOf(u),p=p.modifyArrayBy(a,l),{data:p,actual:e,reverse:{type:9,parent:s,fi:d,id:n}}}previous(e,r){if(r===null){let n=this.childrenArray(e);return n.length===0?null:n[n.length-1].id}let o=null;for(let n of this.childrenArray(e)){if(n.id===r)return o;o=n.id}return null}traverseSortNext(e){let r=this.parent(e);if(r!==void 0){let o=this.childrenArray(r),n=o.findIndex(a=>a.id===e)+1;if(n<o.length)return o[n].id;if(r)return this.traverseSortNext(r)}}sortNext(e){let r=this.childrenArray(e);return r.length>0?r[0].id:this.traverseSortNext(e)}traverseSortPrevious(e){let r=this.childrenArray(e);return r.length>0?this.traverseSortPrevious(r[r.length-1].id):e}sortPrevious(e){let r=this.parent(e);if(r!==void 0){let o=this.childrenArray(r),n=o.findIndex(a=>a.id===e)-1;return n>=0?this.traverseSortPrevious(o[n].id):r}}getAllSorted(e){let r=[];for(let o of e){let n=this.getWithSortKey(o.id);n!==void 0&&r.push({...o,...n})}r.sort((o,n)=>Ug(o.sortKey,n.sortKey));for(let o of r)delete o.sortKey;return r}getWithSortKey(e){var r=e;let o=[],n=this.get(r),a=n;if(n!==void 0){for(;r;)o.splice(0,0,n.fi),r=this.parent(r),r!==null&&(n=this.get(r));return{...a,sortKey:o}}}insertBeforeHelper(e,r,o){return this.insertAfterHelper(e,this.previous(e,r),o)}insertAfterHelper(e,r,o){let n=this.childrenArray(e);if(r===null){if(n.length===0)return Kr(0,o,o);{let a=n[0].fi;return